Skip to content

eth/gasestimator: return used gas for plain transfer estimates - #35592

Merged
rjl493456442 merged 1 commit into
ethereum:masterfrom
MysticRyuujin:estimategas-amsterdam-intrinsic
Aug 28, 2026
Merged

rjl493456442 merged 1 commit into
ethereum:masterfrom
MysticRyuujin:estimategas-amsterdam-intrinsic

Conversation

@MysticRyuujin

Copy link
Copy Markdown
Contributor

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.

@rjl493456442 rjl493456442 added this to the 1.17.6 milestone Aug 28, 2026
@rjl493456442
rjl493456442 merged commit 492912a into ethereum:master Aug 28, 2026
10 checks passed
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.
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.

2 participants