Skip to content

feat(tests): cover SYSTEM_ADDRESS accessed via delegation and withdrawal (EIP-7928) - #3681

Merged
fselmo merged 2 commits into
ethereum:forks/amsterdamfrom
Sahil-4555:test/bal-system-address-access
Sep 30, 2026
Merged

fselmo merged 2 commits into
ethereum:forks/amsterdamfrom
Sahil-4555:test/bal-system-address-access

Conversation

@Sahil-4555

@Sahil-4555 Sahil-4555 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds EIP-7928 block-access-list tests for SYSTEM_ADDRESS (0xff…fe) when it is genuinely accessed:

  • test_block_access_lists_eip7702.py::test_bal_7702_delegation_to_system_address
  • test_block_access_lists_eip4895.py::test_bal_withdrawal_to_system_address (zero and non-zero amount)

Why / flow

SYSTEM_ADDRESS is excluded from the BAL only as the synthetic caller of the block's system calls; once it is actually accessed it must be recorded like any other address. Two access paths were untested:

  • 7702 delegation: a call to an EOA delegated to SYSTEM_ADDRESS loads the delegation target, so SYSTEM_ADDRESS must appear in the BAL.
  • Withdrawal recipient: a withdrawal to SYSTEM_ADDRESS records the recipient regardless of amount, so SYSTEM_ADDRESS must appear in the BAL.

The existing eip7702 and eip4895 BAL tests never route an access through SYSTEM_ADDRESS, so neither path was covered. These were surfaced by cross-client differential testing - Erigon currently omits SYSTEM_ADDRESS from the BAL on both paths, so its BAL hash diverges from the other clients (reported to Erigon; Sepolia glamsterdam / 3.7.x, not mainnet). Adding the coverage here so the spec suite catches it.

Filling

Both fill and pass against the reference (EELS), which includes SYSTEM_ADDRESS in all cases:

tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_eip4895.py .
tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists_eip7702.py .
6 passed

ruff check and ruff format clean.

@Sahil-4555 Sahil-4555 changed the title tests(eip7928): cover SYSTEM_ADDRESS accessed via delegation and withdrawal feat(tests): cover SYSTEM_ADDRESS accessed via delegation and withdrawal (EIP-7928) Sep 30, 2026
@fselmo
fselmo self-requested a review September 30, 2026 21:45
@fselmo fselmo self-assigned this Sep 30, 2026
@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.62%. Comparing base (faf6637) to head (b383366).
⚠️ Report is 18 commits behind head on forks/amsterdam.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           forks/amsterdam    #3681      +/-   ##
===================================================
+ Coverage            94.53%   94.62%   +0.08%     
===================================================
  Files                  624      624              
  Lines                37021    36976      -45     
  Branches              3349     3349              
===================================================
- Hits                 34999    34988      -11     
+ Misses                1429     1397      -32     
+ Partials               593      591       -2     
Flag Coverage Δ
unittests 94.62% <ø> (+0.08%) ⬆️

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.

Import SYSTEM_ADDRESS like the sibling modules, drop the inline conditional in the withdrawal post-state, pin the delegation target's absence from post-state, shorten the docstrings, and add both tests to test_cases.md.

@fselmo fselmo 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.

Thanks! This adds some good cases. Just cleaned it up a bit 👍🏼

@fselmo
fselmo merged commit 3650d3d into ethereum:forks/amsterdam Sep 30, 2026
20 checks passed
@Sahil-4555
Sahil-4555 deleted the test/bal-system-address-access branch October 1, 2026 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants