-
Notifications
You must be signed in to change notification settings - Fork 771
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Difference between gasUsed and execResult.gasUsed #1446
Comments
Hm, when did this change for you? I am looking around the code in I also noticed that the debug output is outputting the same variable twice ( ethereumjs-monorepo/packages/vm/src/runTx.ts Lines 361 to 362 in 587ee70
and also here ethereumjs-monorepo/packages/vm/src/runTx.ts Lines 361 to 362 in 587ee70
|
|
I thought it might have, but the line I was considering (here) was actually It could still be introduced by that PR, but it's not immediately obvious to me yet. For the OP issue, one common cause is that It could be a mutated BN we need to clone that's getting accidentally modified. I am wondering between which versions this behavior changed for @yann300. |
Additional note: this should be easily be verifiable by looking at some execution with |
@yann300 any further thoughts or follow-up here? do you remember what you ended up doing? "gasUsed" is a little confusing because we have two different meanings:
I would like to at least resolve my comment above about the second log output not outputting |
that's a good idea, will do, let me dig into it a bit more and I'll report my findings here and add next steps to that issue |
👍 🙂 Ok, have already added the link to the comment here as a placeholder so that we don't forget. |
Ok I've investigated further, and based on ethereumjs-monorepo/packages/vm/src/evm/evm.ts Lines 456 to 460 in aa7d323
Which I think is fine, it was probably a decision to surface that important number in ethereumjs-monorepo/packages/vm/src/evm/evm.ts Lines 26 to 33 in aa7d323
ethereumjs-monorepo/packages/vm/src/evm/evm.ts Lines 44 to 60 in aa7d323
(edit: I've looked into this further and the reason we have a |
@jochem-brouwer can you please write a qualified comment on the state of this and eventually close here? 😋 |
@holgerd77 Yup! This can be closed, as in V6 we have now renamed the vars:
The difference in the name now explains what the semantical difference is. In Will close. |
Thanks a lot, that's a really great explanation! 🙏🙂👍 |
the
afterTx
event (link below) used to contain 2 different values for the gas consumption (tx cost and exec cost):{ gasUsed }
and{ execResult: { gasUsed } }
. The latter seems now to also return the tx cost.ethereumjs-monorepo/packages/vm/src/runTx.ts
Line 473 in 587ee70
The text was updated successfully, but these errors were encountered: