Repository navigation
fix(revm): correct Amsterdam gas accounting for sponsored reservoir and batch access lists - #427
Merged
Merged
Conversation
The sponsored reimburse_caller override returned only remaining + refunded gas, omitting the EIP-8037 reservoir, which is charged upfront and must be returned like any unused gas. Under Amsterdam (non-zero reservoir) this under-reimbursed the sponsor and broke supply conservation, since the base-fee redirect already accounts for the reservoir. Include it, matching revm's reimburse_caller. Adds a regression test asserting the reservoir is reimbursed.
validate_batch_initial_tx_gas priced access-list entries with fixed ACCESS_LIST_ADDRESS / ACCESS_LIST_STORAGE_KEY constants and left them out of the EIP-7623/7981 floor entirely. Use cfg.gas_params() for the execution cost and add the access-list floor contribution, matching revm's initial_tx_gas. Both are no-ops before Amsterdam, where the gas params and the access-list floor multiplier differ from zero/constants. Adds a regression test comparing a batch with and without an access list under Amsterdam.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
damiannolan
marked this pull request as ready for review
October 27, 2026 11:21
tac0turtle
approved these changes
Oct 27, 2026
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.
Description
Two independent gas-accounting corrections in the evnode batch/sponsor paths,
both scoped to behavior that only differs once the Amsterdam (EIP-8037 / EIP-7981)
rules are active. They are no-ops on the current chain and leave every existing
test unchanged.
1. Reimburse the sponsor for unused reservoir gas
The sponsored
reimburse_calleroverride returned onlyremaining + refundedgas, omitting the EIP-8037 reservoir. The reservoir is charged upfront like the
rest of the gas, so unused reservoir must be returned too — this is what revm's
own
reimburse_callerdoes. With a non-zero reservoir the sponsor wasunder-reimbursed while the base-fee redirect already accounted for the reservoir,
so value was not conserved. Includes
gas.reservoir()in the reimbursement.2. Price batch access lists from gas params and the floor
validate_batch_initial_tx_gaspriced access-list entries with fixedACCESS_LIST_ADDRESS/ACCESS_LIST_STORAGE_KEYconstants and left them out ofthe EIP-7623/7981 gas floor entirely. It now prices the execution cost from
cfg.gas_params()and adds the access-list floor contribution, matching revm'sinitial_tx_gas. Before Amsterdam the gas-params values equal the old constantsand the access-list floor multiplier is zero, so this changes nothing there.
Testing
cargo test -p ev-revm(55 tests) — all pass.reservoir is returned; 0 without the fix).
Amsterdam (isolates the access-list execution cost and floor contribution;
the floor delta is 0 without the fix).
cargo clippyandcargo +nightly fmt --checkclean.Type of Change
Related Issues
Fixes #(issue)
Checklist
Testing
Additional Notes