Skip to content

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

Open
gurukamath wants to merge 5 commits into
ethereum:eips/amsterdam/eip-2780-8038from
gurukamath:eips/amsterdam/eip-2780-test-coverage
Open

feat(tests): add more EIP-2780 tests#3055
gurukamath wants to merge 5 commits into
ethereum:eips/amsterdam/eip-2780-8038from
gurukamath:eips/amsterdam/eip-2780-test-coverage

Conversation

@gurukamath

Copy link
Copy Markdown
Contributor

🗒️ Description

Expands the EIP-2780 (Reduce Transaction Intrinsic Cost) test suite on top of the eip-2780-8038 base, pinning the decomposed-intrinsic, top-frame state-gas, and calldata-floor interactions not covered by the existing tests:

  • Fork transition — identical transactions straddling the Amsterdam boundary assert the per-tx gas changes by the EIP-2780 amount only once the fork activates (flat 21,000 → decomposed intrinsic); self-transfers collapse to TX_BASE.
  • Top-frame NEW_ACCOUNT as state gas — a block-header gas_used assertion pins that the empty-recipient value-transfer charge is attributed to the state dimension (max(block_regular, block_state)), which balance-only state tests cannot distinguish.
  • EIP-7708 transfer log — fires exactly when TRANSFER_LOG_COST is charged (non-self value transfers), and never for self-transfers or zero-value transactions.
  • Intrinsic & floor boundariesgas_limit = intrinsic − 1 rejection for both plain calls and contract creation; the EIP-7623/7976 calldata floor binding (masking the decomposed value charges) plus below-floor rejection; and a nonce-only-alive recipient confirming the NEW_ACCOUNT gate keys on is_account_alive, not balance == 0.

Test-only; no spec changes. All fixtures fill green against Amsterdam.

🔗 Related Issues or PRs

#3017

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.

Cute Animal Picture

Cute Animals - 6 of 7

- test_calldata_floor.py: a data-heavy value transfer whose
  EIP-7623/7976 calldata floor (built on the lowered TX_BASE) dominates
  the decomposed intrinsic, masking the recipient/value charges so the
  gas paid is identical at value 0 and 1; plus a one-below-floor
  rejection (INTRINSIC_GAS_BELOW_FLOOR_GAS_COST). The floor-dominating
  calldata size is derived from the shared EIP-7623
  find_floor_cost_threshold search rather than hardcoded.
- test_intrinsic_gas_boundary.py: contract-creation intrinsic boundary
  (gas_limit = intrinsic - 1 -> INTRINSIC_GAS_TOO_LOW), pinning the
  combined regular + NEW_ACCOUNT state intrinsic for creates.
- test_top_frame_charges.py: a nonce-only-alive recipient (nonce=1,
  zero balance, no code) is not empty per EIP-161, so a value transfer
  does not incur the top-frame NEW_ACCOUNT charge; the gate keys on
  is_account_alive, not balance == 0.
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (eips/amsterdam/eip-2780-8038@d9819bb). Learn more about missing BASE report.

Additional details and impacted files
@@                       Coverage Diff                       @@
##             eips/amsterdam/eip-2780-8038    #3055   +/-   ##
===============================================================
  Coverage                                ?   93.21%           
===============================================================
  Files                                   ?      620           
  Lines                                   ?    38830           
  Branches                                ?     3348           
===============================================================
  Hits                                    ?    36197           
  Misses                                  ?     1773           
  Partials                                ?      860           
Flag Coverage Δ
unittests 93.21% <ø> (?)

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.

@gurukamath gurukamath requested a review from danceratopz June 26, 2026 10:07
@danceratopz danceratopz self-assigned this Jun 29, 2026
@danceratopz danceratopz changed the title tests(amsterdam): add more EIP-2780 tests feat(tests): add more EIP-2780 tests Jun 29, 2026
@danceratopz danceratopz added C-feat Category: an improvement or new feature A-tests Area: Consensus tests. labels Jun 29, 2026
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-feat Category: an improvement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants