Repository navigation
feat(tests): complete EIP-7981 coverage and testing checklist - #3537
Merged
danceratopz merged 21 commits intoSep 21, 2026
Merged
Conversation
2 tasks done
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## forks/amsterdam #3537 +/- ##
===================================================
+ Coverage 94.44% 94.47% +0.03%
===================================================
Files 624 624
Lines 36928 36969 +41
Branches 3326 3334 +8
===================================================
+ Hits 34875 34925 +50
+ Misses 1450 1443 -7
+ Partials 603 601 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
danceratopz
force-pushed
the
7981-improve-tests
branch
from
September 15, 2026 06:10
fb73a23 to
906c947
Compare
2 tasks done
danceratopz
force-pushed
the
7981-improve-tests
branch
2 times, most recently
from
September 15, 2026 11:57
b9126b3 to
4b26471
Compare
danceratopz
marked this pull request as ready for review
September 15, 2026 12:31
danceratopz
marked this pull request as draft
September 15, 2026 12:55
danceratopz
force-pushed
the
7981-improve-tests
branch
from
September 15, 2026 12:57
a214f03 to
5cb8faa
Compare
Expand test_access_list_data_cost_with_execution with calldata-floor and execution-cost dominance for zero and nonzero calldata, retaining transaction types 1 and 2. These cases catch a surcharge omitted from either side of the gas-used maximum. Derive the surcharge independently of the access-list calculator and provide surplus gas so an out-of-gas transaction cannot satisfy the receipt assertion simply by consuming the entire gas limit. Validation: all 24 focused EELS fill cases and just static pass against the unrefactored specification on forks/amsterdam.
Add test_execution_gas_after_access_list_surcharge. The existing OOG checklist markers only cover transactions rejected before execution for insufficient intrinsic or floor gas. They do not prove that EIP-7981's surcharge is deducted before the EVM runs. Add an exact execution-gas boundary around a warm SSTORE for transaction types 1 and 2. Assert receipt status, gas used and storage rollback with one gas too little, exact gas and one extra gas. This supplies actual execution-OOG evidence for the gas-cost checklist item. Validation: focused EELS fill and just static pass before this commit.
Build the transaction gas limit from the gas the transaction is expected to use, including the top-frame authorization gas of type 4 transactions, and attach an expected receipt with success status and that exact gas to every valid fixture-built transaction. Until now the fixture limit stopped at the intrinsic cost, so type 4 transactions ran out of gas while processing their authorization, and the gas-measurement tests only checked acceptance. Add a gas surplus fixture, on by default, so a receipt that equals the gas limit cannot pass by consuming everything. The exact gas limit test sets it to zero. Annotate the authorization fixtures with whether they create an account so the top-frame gas is modeled. Remove the manual receipt in the calldata floor test, which the fixture now supersedes.
The shared error fixture returned the intrinsic gas exception for every negative gas delta. When the calldata floor exceeds the intrinsic cost, the gas limit sits between the two and the specification rejects on the floor check, so record that exception. This changes the floor validation test; the intrinsic gas cases keep their exception. Nimbus reports the intrinsic exception for these blocks because it rejects a block with transactions and zero gas used before validating any transaction. That needs invalid-transaction blocks to carry a nonzero header gas used, which is a separate change.
Add test_access_list_floor_with_exact_balance. The existing exact-balance scenario only rejected a gas limit midway through the surcharge gap. The data-floor checklist requires both valid and invalid transactions when the floor exceeds intrinsic gas. Use floor minus one, exact floor and floor plus one limits. Assert receipt status, gas used and the sender's final balance for valid cases, with full upfront funding for both transaction types 1 and 2. Correct the marker from execution OOG to data-floor intrinsic validity. Validation: focused EELS fill and just static pass before this commit.
Map gas-limit and data-floor rejection to intrinsic validity rather than execution OOG. Credit exact valid limits and contract creation with their specific checklist items; preserve actual gas measurements. Validation: module EELS fill and just static pass before this commit.
Both gas-transition tests already assert fork-specific billed gas through receipts or sender balances. Add the gas-measurement mapping alongside their existing before/after activation decorators. The validity-transition test already covers all four required outcomes. Validation: module EELS fill and just static pass before this commit.
Strengthen test_duplicate_access_list_entries. The existing duplicate-address-entry case does not detect a client that deduplicates storage keys within each entry. Add that distinct shape to the measured duplicate test without multiplying unrelated parameters. This is an optional improvement beyond checklist closure. Validation: focused EELS fill and just static pass before this commit.
Add test_access_list_data_cost_at_crossover. The existing surcharge regression tests well-separated floor and execution dominance. Add the exact crossover and adjacent execution gas values for zero and nonzero calldata, retaining the existing cases. Use surplus gas and exact receipts to detect a misplaced max operation. This is an independent improvement beyond checklist closure. Validation: focused EELS fill and just static pass before this commit.
Add test_access_list_surcharge_with_refund. EIP-7981 preserves refund rules, so the new-refund checklist section is not applicable. Add independent interaction coverage: clear a warm slot, optionally revert, and assert storage, receipt status and gas after refunds with and without calldata-floor dominance. This checks that the surcharged floor still binds and revert discards the refund. Validation: focused EELS fill and just static pass before this commit.
Add test_access_list_surcharge_with_recipient_costs. The surcharge must survive Amsterdam's different intrinsic bases for self-transfers and value-bearing transfers. The previous cases only used non-self recipients with zero value. Add focused combinations of self/other recipients and zero/nonzero value with and without floor dominance. Derive the expected surcharge separately from calculators without an access list, and assert success and billed gas with surplus gas. Use an existing funded recipient so account creation cannot obscure the repricing being measured. This is an optional interaction regression beyond checklist closure. Validation: focused EELS fill and just static pass before this commit.
Replace the blanket transaction-type exclusion with exclusions for the rules EIP-7981 leaves unchanged, keeping the exact and insufficient gas limit, floor validity and contract creation items for the repriced transaction types. Record the coverage evidence as self-contained statements and mark the optional second-client instrumentation as not collected rather than as validation.
Since ethereum#3223 the pin has been the hash of the EIPs commit that moved the EIP to Review, so the version check never matched a blob. Use the blob hash of eip-7981.md in that same commit. The pinned content is unchanged. Relative to the blob pinned before ethereum#3223 (954963f), the only difference is the status change from Draft to Review.
danceratopz
force-pushed
the
7981-improve-tests
branch
from
September 16, 2026 08:42
5cb8faa to
e0e8200
Compare
danceratopz
marked this pull request as ready for review
September 16, 2026 11:14
This was referenced Sep 16, 2026
LouisTsai-Csie
requested changes
Sep 17, 2026
LouisTsai-Csie
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the checklist PR. A few ideas:
- Two-dimensional gas: execution cost with access list dominates header cost.
- Combine
test_access_list_data_cost_with_executionandtest_access_list_data_cost_at_crossoveras they have similar structure.
This was referenced Sep 17, 2026
Contributor
|
Follow up review PR: danceratopz#61 Fire away! :) |
LouisTsai-Csie
approved these changes
Sep 21, 2026
LouisTsai-Csie
left a comment
Contributor
There was a problem hiding this comment.
LGTM from my side
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
Strengthen EIP-7981 tests to check successful execution and exact gas charges.
Nimbus rejects a block that has transactions and a header gasUsed of zero before it validates any transaction, so it reports the intrinsic gas exception for the below-floor cases of the floor validation and exact-balance tests. Those cases pass on Nimbus once invalid-transaction blocks carry a nonzero header gasUsed, which is the subject of the follow-up #3599. This is kinda low prio. Currently exception mapping is disabled for nimbus (in the hive sim Dockerfiles), see #3603.
Validation at the current head:
just staticpasses, and all 731 EIP-7981 fill cases pass with--until Amsterdam --generate-all-formats, including 184 EngineX fixtures and the activation transitions. The regenerated checklist covers all 15 applicable items with 254 items marked N/A and no unmarked tests.consume enginexagainst go-ethereum, Nethermind, ethrex, Erigon, Besu and Reth passes all 186 cases each; Nimbus passes 174 and fails the 12 below-floor cases named above until the follow-up lands. Devnet execution andconsume engineremain open.Related Issues or PRs
tests@v21.0.0(Glamsterdam Testnet) #3217Checklist
just static<type>(<area>): <title>, where<type>and<area>come from an appropriateC-<type>, respectivelyA-<area>, label. The title should match the target squash commit message.Cute Animal Picture