1

Here's a Kovan transaction I'm trying to optimize:

I've noticed that the "Internal Txns" view displays internal steps for the function I called, along with a "Gas Limit" column that appears to present the evolution of gas usage within the transaction.

Is this column indeed a detailing of gas consumption for the transaction? How should I interpret these values?

Thanks in advance.

Shane Fontaine
  • 18,036
  • 20
  • 54
  • 82

1 Answers1

1

You are correct.

That "Gas Limit" column is the gas sent with each of those calls. You can imagine that an Ethereum transaction is made up of many smaller "transactions" (calls). In this sense, the page you linked is each of the smaller "transactions" and the "Gas Limit" can be thought of in the same light as the "Gas limit" of the overall transaction.

There are some slightly exotic rules around these smaller "transactions", such as the 1/64th rule. You can read more about it in EIP-150.

You can see even more detailed information by clicking the ellipsis on the top right of that page and choosing "Parity Trace"

Shane Fontaine
  • 18,036
  • 20
  • 54
  • 82
  • 1
    Hi Shane, do you know why summing the "gasUsed" for each action from the "Parity Trace" results in much more gas than the actual amount used by the transaction? – Thomas C. G. de Vilhena Apr 03 '21 at 23:20
  • I would not expect that to be the case. If you have verified that that is the case, then I'm not sure! – Shane Fontaine Apr 03 '21 at 23:45
  • 1
    I dug up a bit on the parity trace json data and It seems that when an action has child actions its "gasUsed" is the sum of all inner actions plus the gas used within it, so that's why it adds up to much more. After some parsing it's possible to obtain the actual gas for each individual action, making it easier to spot possible optimization targets ;) – Thomas C. G. de Vilhena Apr 04 '21 at 00:07
  • I see. That makes sense! – Shane Fontaine Apr 04 '21 at 00:07
  • Hello @ThomasC.G.deVilhena, how where you able to obtain the actual gas from the individual action – Gabriel Ezenwankwo Oct 17 '22 at 08:48