-
Notifications
You must be signed in to change notification settings - Fork 20.4k
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
Incorrect gas cost passed to tracer for EIP-2929 calls with cold account accesses #22649
Comments
I will see if I can create a PR later today with a proposed fix that keeps the existing |
Thanks for the great detailed issue! We would very much like to see the PR you make later today. |
Turns out that was indeed optimistic. I created #22680 now though, which is the best minimal fix I could come up with. |
I wanted to push some changes to this PR, but you seem to have disabled maintainer-push on your fork. I might open a new PR and cherry-pick your commit, if that's ok? |
Ah, wasn't aware we had disabled maintainer-push. New PR is fine with me, will close the other one then. |
System information
Commit hash : anything past 6487c00 that introduced EIP-2929 support
Expected behaviour
With EIP-2929 enabled, the dynamic cost of all call types includes an optional
COLD_ACCOUNT_ACCESS_COST
. This cost, if charged, should also be part of the total opcode gas cost passed to the tracer and exposed e.g. viadebug_traceTransaction
.Actual behaviour
While properly charged, the
COLD_ACCOUNT_ACCESS_COST
is never part of the gas cost reported to the tracer.Explanation
6487c00 added the new
core/vm/operations_acl.go
file for EIP-2929 gas logic. Dynamic gas cost calculation for all call types is wrapped in operations_acl.go#L176:The issue is that the
ColdAccountAccessCostEIP2929
is charged directly, instead of being passed to the outside together with the rest of the dynamic gas, to be charged there and passed to the tracer. While this is necessary to properly calculate the available call gas in the innergasFunc
, it causes the incorrect gas reporting to the tracer at interpreter.go#L278.The text was updated successfully, but these errors were encountered: