Skip to content

feat(spec-specs,test-tests): add EIP-2780 and EIP-8038 - #3052

Merged
marioevz merged 14 commits into
forks/amsterdamfrom
eips/amsterdam/eip-2780-8038
Jul 2, 2026
Merged

feat(spec-specs,test-tests): add EIP-2780 and EIP-8038#3052
marioevz merged 14 commits into
forks/amsterdamfrom
eips/amsterdam/eip-2780-8038

Conversation

@danceratopz

@danceratopz danceratopz commented Jun 25, 2026

Copy link
Copy Markdown
Member

🗒️ Description

This is not ready to merge, as it stands, this PR mainly exists as a tracker for the remaining issues to get this into forks/amsterdam

#3088 is required before review

Possible to defer...

🔗 Related Issues or PRs

✅ 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: Set appropriate labels for the changes (only maintainers can apply labels).

Cute Animal Picture

image

@danceratopz danceratopz added C-feat Category: an improvement or new feature A-test-specs Area: execution_testing.specs A-spec-tests Area: tests for specifications e.g. json_infra labels Jun 25, 2026
@danceratopz
danceratopz force-pushed the eips/amsterdam/eip-2780-8038 branch from 9765653 to 35a757b Compare July 2, 2026 11:00
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.05660% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.24%. Comparing base (c074f38) to head (60a2c7c).

Files with missing lines Patch % Lines
src/ethereum/forks/amsterdam/vm/eoa_delegation.py 96.15% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #3052   +/-   ##
================================================
  Coverage            93.23%   93.24%           
================================================
  Files                  624      624           
  Lines                36936    36986   +50     
  Branches              3375     3383    +8     
================================================
+ Hits                 34439    34489   +50     
  Misses                1704     1704           
  Partials               793      793           
Flag Coverage Δ
unittests 93.24% <99.05%> (+<0.01%) ⬆️

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.

@danceratopz

danceratopz commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@danceratopz
danceratopz force-pushed the eips/amsterdam/eip-2780-8038 branch from 35a757b to b270a21 Compare July 2, 2026 12:26
@danceratopz
danceratopz marked this pull request as ready for review July 2, 2026 15:56
danceratopz and others added 9 commits July 2, 2026 21:08
…2972)

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: danceratopz <danceratopz@gmail.com>
Co-authored-by: marioevz <marioevz@gmail.com>
…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.
…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>
Co-authored-by: danceratopz <danceratopz@gmail.com>
Co-authored-by: Louis Tsai <72684086+LouisTsai-Csie@users.noreply.github.com>
Co-authored-by: spencer-tb <spencer.tb@ethereum.org>

@marioevz marioevz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! It's a lot of comments but in reality they are only stylistic comments, and most of them don't affect functionality.

Comment thread src/ethereum/forks/amsterdam/vm/gas.py Outdated
Comment thread src/ethereum/forks/amsterdam/vm/gas.py Outdated
Comment thread src/ethereum/forks/amsterdam/vm/gas.py Outdated
Comment thread src/ethereum/forks/amsterdam/vm/gas.py Outdated
Comment thread packages/testing/src/execution_testing/forks/gas_costs.py Outdated
Comment thread src/ethereum/forks/amsterdam/fork.py Outdated
Comment thread src/ethereum/forks/amsterdam/state_tracker.py Outdated
Comment thread src/ethereum/forks/amsterdam/state_tracker.py
Comment thread src/ethereum/forks/amsterdam/state_tracker.py
Comment thread tests/amsterdam/eip2780_reduce_intrinsic_tx_gas/helpers.py Outdated
marioevz added 5 commits July 2, 2026 16:00
Co-authored-by: Mario Vega <marioevz@gmail.com>
Co-authored-by: Mario Vega <marioevz@gmail.com>
Co-authored-by: Mario Vega <marioevz@gmail.com>
@marioevz
marioevz merged commit 2dfaa3e into forks/amsterdam Jul 2, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-spec-tests Area: tests for specifications e.g. json_infra A-test-specs Area: execution_testing.specs C-feat Category: an improvement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants