Skip to content

fix(tests): align Amsterdam (gas) tests with EIP-2780/8037/8038 - #3088

Merged
spencer-tb merged 6 commits into
ethereum:eips/amsterdam/eip-2780-8038from
danceratopz:eips/amsterdam/eip-2780-8038-test-fixes
Jul 2, 2026
Merged

fix(tests): align Amsterdam (gas) tests with EIP-2780/8037/8038#3088
spencer-tb merged 6 commits into
ethereum:eips/amsterdam/eip-2780-8038from
danceratopz:eips/amsterdam/eip-2780-8038-test-fixes

Conversation

@danceratopz

Copy link
Copy Markdown
Member

🗒️ Description

Fix-up 5 tests (filled at Amsterdam) that surfaced following the rebase of eips/amsterdam/2780-8038 on forks/amsterdam:

Test Failure Rebased-in trigger Meets (already on branch)
test_base_fee_per_gas_follows_dominant_dimension num_txs = 15 gives 15 * intrinsic = 225000 < 300000 target 7c634a428c6 (#3039) added this test with num_txs = 15, calibrated for the upstream 21000 intrinsic (15 * 21000 = 315000 > 300000) EIP-2780's reduced intrinsic (~15000)
test_create2check_fields_in_initcode ported 1_000_000 gas limit too small for the CREATE2 children 8dca7a70340 (#2996) un-skipped it on Amsterdam (d0,d1,d2,d4,d5,d6) EIP-8037 state-creation gas (+ its #3027 spill refactor)
test_coinbase_warm_account_call_gas expects 100, measures 200 on EXTCODESIZE/EXTCODECOPY 8dca7a70340 (#2996) un-skipped it on Amsterdam (d0..d7) EIP-8038 second WARM_ACCESS code read
test_selfdestruct_state_gas_refilled_on_ancestor_revert derived header short by ACCOUNT_WRITE (8000) 9920b6e67cb (#3027) reworked state-gas reservoir/spill, so the regular ACCOUNT_WRITE now surfaces in the header EIP-8038 ACCOUNT_WRITE on empty-account SELFDESTRUCT
test_mixed_validity_multi_auth_receipt_gas receipt too high; skipped invalid auths also refund b270a21e8ea (#3021, cherry-picked) reworked set_delegation() refunds for skipped auths EIP-8038 set-code intrinsic/refund model

🔗 Related Issues or PRs

Targets:

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Verifying Changes:
    just static
  • All: PR title have the form <type>(<area>):, where <type> and <area> come from an approrpriate C-<type>, respectively A-<area>, label. The title should match the a target squash commit message.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).

Cute Animal Picture

image

The ancestor revert refills the state-gas charge, but Amsterdam still bills the EIP-8038 ACCOUNT_WRITE regular gas for the attempted value transfer to an empty account. Update the derived blockchain header expectation to match that accounting.
Invalid set-code authorizations are skipped, but the Amsterdam implementation refills their auth state gas and refunds ACCOUNT_WRITE. Update the receipt calculation and comments to match that accounting.
Amsterdam intrinsic gas changes made the regular-dominant block fall
below the base-fee target. Derive the STOP transaction count from the
target and intrinsic cost so the test keeps covering the intended
dominant-dimension branch regardless of future intrinsic-gas changes.
The ported CREATE2 filler pinned a 1,000,000 block gas limit, too little
for the EIP-8037 state gas that spills into the regular budget on
Amsterdam. The test pins post-state, not a gas boundary, so omit the env
`gas_limit` and let the framework supply its default block gas limit
(ample regular budget plus state reservoir) on every fork.
EXTCODESIZE and EXTCODECOPY now include the EIP-8038 warm code-read
charge. Derive the measured warm-access gas from `WARM_ACCESS` and gate
the extra code-read on `fork.is_eip_enabled(8038)`, keeping the legacy
expectation for earlier forks.
@danceratopz danceratopz added C-bug Category: this is a bug, deviation, or other problem A-tests Area: Consensus tests. labels Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.24%. Comparing base (b270a21) to head (aba3906).

Additional details and impacted files
@@                       Coverage Diff                        @@
##           eips/amsterdam/eip-2780-8038    #3088      +/-   ##
================================================================
+ Coverage                         92.89%   93.24%   +0.34%     
================================================================
  Files                               624      624              
  Lines                             36979    36979              
  Branches                           3381     3381              
================================================================
+ Hits                              34353    34482     +129     
+ Misses                             1788     1704      -84     
+ Partials                            838      793      -45     
Flag Coverage Δ
unittests 93.24% <ø> (+0.34%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@spencer-tb spencer-tb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@spencer-tb
spencer-tb merged commit bd52730 into ethereum:eips/amsterdam/eip-2780-8038 Jul 2, 2026
18 checks passed
spencer-tb pushed a commit that referenced this pull request Jul 2, 2026
marioevz added a commit that referenced this pull request Jul 2, 2026
* feat(spec-specs, tests): add EIP-8038 state-access gas cost update (#2972)

Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Mario Vega <11726710+marioevz@users.noreply.github.com>

* feat(spec-specs, tests): Implement EIP-2780 (#3017)

* chore(tests): fix failing ported static slow tests for EIP-8038 (#3019)

Co-authored-by: marioevz <marioevz@gmail.com>

* test(amsterdam): add EIP-8038 state-access gas cost tests (#3033)

Co-authored-by: danceratopz <danceratopz@gmail.com>
Co-authored-by: marioevz <marioevz@gmail.com>

* fix(tests): account for EIP-8246 in EIP-8038 selfdestruct gas test (#3044)

EIP-8246 removes the `SELFDESTRUCT` balance burn, which changes the
same-transaction self-destruct-to-self outcome. Gate the affected
expectations in `test_selfdestruct_gas.py` on `fork.is_eip_enabled(8246)`
so the test holds on forks with and without EIP-8246:

- Pre-EIP-8246: The originator balance is burnt (a `Burn` log) and the
  same-transaction-created account is deleted.
- EIP-8246 onwards: The burn is removed, so the self-send is a no-op; the
  balance stays in the (emptied) originator and no log is emitted.

`burn_log` is imported lazily in the pre-EIP-8246 branch because EIP-8246
deletes the helper from the EIP-7708 spec. The charged gas is unchanged,
so `cumulative_gas_used` is asserted identically on both sides.

* fix(spec-specs): EIP-2780 charge `NEW_ACCOUNT` for value transfer to zero balance precompile (#3048)

* fix(amsterdam): charge NEW_ACCOUNT for value transfer to empty precompile

EIP-2780 charges the NEW_ACCOUNT state cost when a transaction
transfers value to a recipient that is empty per EIP-161. The
top-frame charge previously carved out precompile recipients, but
neither EIP-2780 nor EIP-161 authorizes that exemption:

- EIP-2780 does not mention precompiles; its rule keys solely on
  "empty per EIP-161 and tx.value > 0".
- EIP-161 defines empty structurally (no code, zero nonce, zero
  balance) with no precompile exception, so an unfunded precompile
  is empty and is created by the value transfer like any other
  account.

Remove the `recipient_is_precompile` carve-out from the top-frame
charge so an empty precompile receiving value pays NEW_ACCOUNT,
drop the matching special-case from the testing framework's
`transaction_top_frame_state_gas`, and rewrite
`test_value_move_to_precompiles` to assert the charge fires for the
not-funded precompile while a pre-funded (alive) precompile remains
exempt by virtue of being non-empty.

Co-authored-by: danceratopz <danceratopz@gmail.com>

* feat(tests): add more EIP-2780 tests (#3055)

Co-authored-by: danceratopz <danceratopz@gmail.com>
Co-authored-by: Louis Tsai <72684086+LouisTsai-Csie@users.noreply.github.com>

* feat(specs): update EIP-8037 impl for ethereum/EIPs#11715 (#3021)

Co-authored-by: spencer-tb <spencer.tb@ethereum.org>

* fix(tests): align Amsterdam (gas) tests with EIP-2780/8037/8038 (#3088)

Co-authored-by: marioevz <marioevz@gmail.com>

* Apply suggestions from code review (packates/testing)

Co-authored-by: Mario Vega <marioevz@gmail.com>

* Apply suggestions from code review (specs)

Co-authored-by: Mario Vega <marioevz@gmail.com>

* Apply suggestions from code review (tests)

Co-authored-by: Mario Vega <marioevz@gmail.com>

* fix(specs): Lint

* fix(test-tools): Lint

---------

Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Mario Vega <11726710+marioevz@users.noreply.github.com>
Co-authored-by: Guruprasad Kamath <guru241987@gmail.com>
Co-authored-by: spencer <spencer.taylor-brown@ethereum.org>
Co-authored-by: marioevz <marioevz@gmail.com>
Co-authored-by: CPerezz <37264926+CPerezz@users.noreply.github.com>
Co-authored-by: Guruprasad Kamath <48196632+gurukamath@users.noreply.github.com>
Co-authored-by: Louis Tsai <72684086+LouisTsai-Csie@users.noreply.github.com>
Co-authored-by: spencer-tb <spencer.tb@ethereum.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tests Area: Consensus tests. C-bug Category: this is a bug, deviation, or other problem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants