Summary
This is an RPC-only release: it fixes eth_estimateGas correctness on 0G and removes a
CPU-amplification vector in the estimator. No consensus, state-transition or payload-building
changes — validators are not required to upgrade for consensus safety.
1. eth_estimateGas no longer tracks the request gas cap (critical)
The 0G revm fork raises gas_used to 80% of the gas limit and clears the refund at the end of
execution. The estimator seeded its optimistic candidate from gas_used + gas_refund, so the
candidate landed at ~80% of the cap and the returned estimate tracked the cap, not the actual
usage. Observable symptom: with a 36M cap, balanceOf on Bridged USDC
(0x1f3AA82227281cA364bFb3d253B0f1af1Da6473E) returned 29,029,739, while 0g-geth returned
34,013 for the identical request — a ~850× overestimate.
Estimates are now seeded from the top-level frame's pre-settlement gas, recorded by a
read-only inspector and raised to the EIP-7623 calldata floor, matching 0g-geth's MaxUsedGas
behaviour. The lower bound and the binary search are unchanged; the inspector only runs for the
first full execution.
Impact: wallets, dApps, bridges and gas oracles that call eth_estimateGas on 0G were receiving
gas limits roughly an order of magnitude too large.
Verification: re-run the request above against a 36M cap — expect ~34,013, not the cap.
2. eth_estimateGas is no longer a CPU amplification vector (hardening)
The EIP-7623 calldata floor was recomputed on every frame end — N × O(M) wasted work for N nested
frames and M bytes of calldata — and both N and M are caller-controlled through state overrides.
The floor is now computed once per transaction.
- 200k nested CALL frames + 128 KiB calldata: 9,566 ms → 73.7 ms (plain execution: 72.3 ms)
- 200k nested CALL frames + 4 KiB calldata: 371 ms → 74.0 ms
Testing
- Real-EVM
eth_estimateGasregressions added (four of them fail on the previous estimator). - 76-row case/cap request matrix (
crates/rpc/rpc/testdata/gas_alignment.json) shared with a
0g-geth reference test. cargo test -p reth-rpc --lib: 39/39 passed, including 8estimate_gas_*regressions.
Update Priority
| User Class | Priority | Why |
|---|---|---|
| RPC / Public Node Ops | High | Every eth_estimateGas caller got cap-sized gas limits; also DoS hardening
|
| Payload Builders | Low–Medium | No consensus change; upgrade to keep RPC-submitted tx gas limits sane |
| Non-Payload Builders | Low | RPC-only change, no state-transition impact |
See Update Priorities for more information about this table.
All Changes
- perf(rpc): avoid redundant EIP-7623 floor recomputation per frame
- fix(rpc): seed estimate_gas candidate from pre-settlement gas