Repository navigation
eth/gasestimator: return used gas for plain transfer estimates - #35592
Merged
rjl493456442 merged 1 commit intoAug 28, 2026
Merged
Conversation
MysticRyuujin
requested review from
fjl,
lightclient and
rjl493456442
as code owners
August 26, 2026 19:02
MysticRyuujin
force-pushed
the
estimategas-amsterdam-intrinsic
branch
from
August 26, 2026 19:08
0b9efae to
fe82011
Compare
6 of 10 tasks
rjl493456442
approved these changes
Aug 28, 2026
This was referenced Aug 28, 2026
jimmyc256
pushed a commit
to Lambda256/go-ethereum-ralim
that referenced
this pull request
Sep 23, 2026
…eum#35592) The plain-transfer shortcut in the gas estimator executes the call with a 21,000 gas limit and returns 21,000 on success. After Amsterdam, EIP-2780 prices these calls below 21,000: a zero-value call to an existing account costs 15,000 and a self transfer costs 12,000. The shortcut hides that and `eth_estimateGas` over-reports by up to 75%. This change returns the used gas from the trial execution instead of the constant. A plain transfer runs no code and gets no refunds, so its used gas is the minimum gas limit that succeeds. Before Amsterdam the used gas is exactly 21,000, so behavior there does not change. Cross-client context, measured with hive rpc-compat on the Amsterdam fixtures from ethereum/execution-apis#867: nethermind and erigon return the exact EIP-2780 minimum (15,000), besu returns 15,159, geth and reth return the 21,000 floor. Includes a regression test at the RPC layer: 21,000 / 15,000 / 12,000 for the three transfer shapes under an Amsterdam config. The test fails without the estimator change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The plain-transfer shortcut in the gas estimator executes the call with a 21,000 gas limit and returns 21,000 on success. After Amsterdam, EIP-2780 prices these calls below 21,000: a zero-value call to an existing account costs 15,000 and a self transfer costs 12,000. The shortcut hides that and
eth_estimateGasover-reports by up to 75%.This change returns the used gas from the trial execution instead of the constant. A plain transfer runs no code and gets no refunds, so its used gas is the minimum gas limit that succeeds. Before Amsterdam the used gas is exactly 21,000, so behavior there does not change.
Cross-client context, measured with hive rpc-compat on the Amsterdam fixtures from ethereum/execution-apis#867: nethermind and erigon return the exact EIP-2780 minimum (15,000), besu returns 15,159, geth and reth return the 21,000 floor.
Includes a regression test at the RPC layer: 21,000 / 15,000 / 12,000 for the three transfer shapes under an Amsterdam config. The test fails without the estimator change.