Skip to content

tests(amsterdam): add BAL missing withdrawal account tests#2652

Merged
fselmo merged 1 commit intoethereum:forks/amsterdamfrom
edg-l:tests/bal-missing-withdrawal-account
Apr 10, 2026
Merged

tests(amsterdam): add BAL missing withdrawal account tests#2652
fselmo merged 1 commit intoethereum:forks/amsterdamfrom
edg-l:tests/bal-missing-withdrawal-account

Conversation

@edg-l
Copy link
Copy Markdown
Contributor

@edg-l edg-l commented Apr 10, 2026

Summary

Add tests verifying that clients reject blocks where the BAL (EIP-7928) omits an account that was modified by a withdrawal (EIP-4895).

The existing test_bal_invalid_missing_account only covers accounts modified by transactions. These new tests cover the withdrawal case: the BAL must include every account whose state changed during the withdrawal/request phase, not just the accounts it claims to cover.

New tests:

  • test_bal_invalid_missing_withdrawal_account - block with 1 tx + 1 withdrawal, BAL missing the withdrawal recipient
  • test_bal_invalid_missing_withdrawal_account_empty_block - empty block with 1 withdrawal, BAL missing the recipient

Test plan

  • All new tests fill successfully
  • All 86 tests in test_block_access_lists_invalid.py pass (no regressions)
  • ruff check and ruff format --check pass

@edg-l edg-l force-pushed the tests/bal-missing-withdrawal-account branch from b169e5c to ac4722c Compare April 10, 2026 14:46
Add tests verifying that clients reject blocks where the BAL omits an
account modified by a withdrawal (EIP-4895 x EIP-7928 interaction).

The existing test_bal_invalid_missing_account only covers accounts
modified by transactions. These new tests cover the withdrawal case:

- test_bal_invalid_missing_withdrawal_account: block with tx + withdrawal,
  BAL missing the withdrawal recipient
- test_bal_invalid_missing_withdrawal_account_empty_block: empty block
  with only a withdrawal, BAL missing the recipient
- test_bal_invalid_missing_withdrawal_account_consistent_state_root:
  same as above but with rlp_modifier overriding state_root to simulate
  a malicious builder crafting a self-consistent invalid block
@edg-l edg-l force-pushed the tests/bal-missing-withdrawal-account branch from ac4722c to 96099da Compare April 10, 2026 14:50
@edg-l edg-l marked this pull request as ready for review April 10, 2026 14:50
Copy link
Copy Markdown
Contributor

@fselmo fselmo left a comment

Choose a reason for hiding this comment

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

Thanks for this! This is great coverage to have. I will iterate on some more related test cases 👍🏼

@fselmo fselmo merged commit 249184e into ethereum:forks/amsterdam Apr 10, 2026
1 check passed
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