Skip to content

Conversation

@holiman
Copy link
Contributor

@holiman holiman commented Apr 20, 2021

Supersedes #22680

Original description below:


Possible way to close #22649.
Previously, the makeCallVariantGasCallEIP2929 charged the cold account access cost directly, leading to an incorrect gas cost passed to the tracer from the main execution loop.
This change still temporarily charges the cost (to allow for an accurate calculation of the available gas for the call), but then afterwards refunds it and instead returns the correct total gas cost to be then properly charged in the main loop.

This is the best fix I could come up with that keeps the general wrapper structure intact. Alternatives would be deeper changes to the way EIP-2929 gas cost calculation is conducted.

@holiman holiman changed the title Fix 22649 core/vm: make gas cost reporting to tracers correct Apr 20, 2021
Copy link
Member

@rjl493456442 rjl493456442 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nitpick, otherwise lgtm.

@holiman holiman merged commit 65a1c2d into ethereum:master Apr 27, 2021
@holiman holiman added this to the 1.10.3 milestone Apr 27, 2021
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
Previously, the makeCallVariantGasCallEIP2929 charged the cold account access cost directly, leading to an incorrect gas cost passed to the tracer from the main execution loop.
This change still temporarily charges the cost (to allow for an accurate calculation of the available gas for the call), but then afterwards refunds it and instead returns the correct total gas cost to be then properly charged in the main loop.
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Nov 1, 2024
Previously, the makeCallVariantGasCallEIP2929 charged the cold account access cost directly, leading to an incorrect gas cost passed to the tracer from the main execution loop.
This change still temporarily charges the cost (to allow for an accurate calculation of the available gas for the call), but then afterwards refunds it and instead returns the correct total gas cost to be then properly charged in the main loop.
gzliudan pushed a commit to XinFinOrg/XDPoSChain that referenced this pull request Oct 9, 2025
Previously, the makeCallVariantGasCallEIP2929 charged the cold account access cost directly, leading to an incorrect gas cost passed to the tracer from the main execution loop.
This change still temporarily charges the cost (to allow for an accurate calculation of the available gas for the call), but then afterwards refunds it and instead returns the correct total gas cost to be then properly charged in the main loop.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect gas cost passed to tracer for EIP-2929 calls with cold account accesses

3 participants