Skip to content

feat(test): Increase BAL coverage with tests and BAL expectations for some existing#2834

Merged
spencer-tb merged 4 commits into
ethereum:forks/amsterdamfrom
fselmo:feat/bal-coverage
May 13, 2026
Merged

feat(test): Increase BAL coverage with tests and BAL expectations for some existing#2834
spencer-tb merged 4 commits into
ethereum:forks/amsterdamfrom
fselmo:feat/bal-coverage

Conversation

@fselmo

@fselmo fselmo commented May 11, 2026

Copy link
Copy Markdown
Contributor

🗒️ Description

  • Increase BAL coverage. Some expectations and tests in first commit here were based on the claims from this repository: https://github.com/catwith1hat/evm-breaker, though investigation led to most of the reported cases already being covered in the tests here and clients seem to be passing these. Either way, BAL expectations were added to some tests that cover similar scenarios as guardrails, and some novel test scenarios came out of this as well and were added here. Test cases that seem genuinely novel from evm-breaker audit that were added in this PR (5/18):
    • #167: test_bal_7702_invalid_authority_has_code_authorization — auth fails because authority has pre-existing non-delegation code; authority loaded then rejected, must appear in BAL with empty change
      set.
    • #180: test_bal_7702_multi_hop_delegation_chain — A→B→C delegation chain; CALL(A) resolves one hop only, third address must not appear in BAL.
    • #165: test_bal_create_storage_op_then_selfdestruct_same_tx — same-tx CREATE/CREATE2 + SLOAD/SSTORE on slot B + SELFDESTRUCT; slot B must appear in storage_reads, never storage_changes, and
      destroyed contract has no nonce/code changes.
    • #165: test_bal_create2_selfdestruct_then_recreate_same_block — Tx1 CREATE2+SELFDESTRUCT then Tx2 CREATE2 at same address; Tx1 entry has no nonce/code changes, Tx2 entry has fresh nonce+code at the
      same address.
    • #165: test_selfdestruct_send_to_sender — pre-existing contract SELFDESTRUCTs to tx.sender; sender's BAL entry coalesces nonce_changes (as sender) and balance_changes (as beneficiary).
  • Since I was already here I did a quick scan for some related tests of interest against what exists and added a few more cases here in a second commit to increase the coverage even more.
  • The third commit here closes out missing test cases reported in EIP-7928 BAL: missing test coverage for direct DELEGATECALL/CALLCODE to a precompile (bal-devnet-7) #2830 from Nethermind precompile-specific paths.

Bonus: I changed all the fork.header_bal_hash_required() checks in tests that append a BAL expectation to fork.is_eip_enabled(7928), now that this API is available, as I think it is more readable / desirable this way.


✅ 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.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).
  • Tests: Ran mkdocs serve locally and verified the auto-generated docs for new tests in the Test Case Reference are correctly formatted.
  • Tests: For PRs implementing a missed test case, update the post-mortem document to add an entry the list.
  • Ported Tests: All converted JSON/YML tests from ethereum/tests or tests/static have been assigned @ported_from marker.

Cute Animal Picture

Screenshot 2026-05-11 at 11 43 29

@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.01%. Comparing base (2eb175e) to head (00e6e43).
⚠️ Report is 4 commits behind head on forks/amsterdam.

Additional details and impacted files
@@                 Coverage Diff                 @@
##           forks/amsterdam    #2834      +/-   ##
===================================================
+ Coverage            88.62%   90.01%   +1.38%     
===================================================
  Files                  577      539      -38     
  Lines                35659    32618    -3041     
  Branches              3490     3030     -460     
===================================================
- Hits                 31604    29361    -2243     
+ Misses                3492     2699     -793     
+ Partials               563      558       -5     
Flag Coverage Δ
unittests 90.01% <ø> (+1.38%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@fselmo fselmo marked this pull request as ready for review May 11, 2026 17:41
@fselmo fselmo requested a review from raxhvl May 11, 2026 17:41
@fselmo fselmo added the C-test Category: test label May 11, 2026
@fselmo fselmo force-pushed the feat/bal-coverage branch from 5204b1e to 70d5178 Compare May 11, 2026 17:53
@marioevz marioevz self-requested a review May 11, 2026 21:36

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

LGTM, just a couple of comments, thanks!

fselmo added a commit to fselmo/execution-specs that referenced this pull request May 11, 2026
@fselmo

fselmo commented May 11, 2026

Copy link
Copy Markdown
Contributor Author

LGTM, just a couple of comments, thanks!

Thanks! Both great suggestions. Applied here just now 👀

Comment thread tests/amsterdam/eip7928_block_level_access_lists/test_block_access_lists.py Outdated
Comment thread tests/amsterdam/eip7928_block_level_access_lists/test_cases.md Outdated
fselmo added a commit to fselmo/execution-specs that referenced this pull request May 12, 2026
@fselmo fselmo force-pushed the feat/bal-coverage branch from 9b8b1de to 8ada189 Compare May 12, 2026 14:29
Comment thread tests/prague/eip7702_set_code_tx/test_set_code_txs.py
Comment thread tests/prague/eip7702_set_code_tx/test_set_code_txs.py
fselmo added a commit to fselmo/execution-specs that referenced this pull request May 12, 2026
@fselmo fselmo force-pushed the feat/bal-coverage branch from 8ada189 to b4708b7 Compare May 12, 2026 15:27
Comment thread tests/prague/eip7702_set_code_tx/test_set_code_txs.py

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

Great work on increasing BAL coverage :)

@fselmo fselmo force-pushed the feat/bal-coverage branch from b4708b7 to 00e6e43 Compare May 12, 2026 16:24
@fselmo

fselmo commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @raxhvl. I've addressed everything here. I think some of these can come in another PR. We should really do a review back through the Planned cases in test_cases.md and add them here.

Can you do a final review here?

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

Everything except this is resolved.Its a non-blocking nice to have.

Agree on closing tests from test_cases.md. I (and claude) have found great value in test_cases.md for BAL. Could we consider this for other EIPs.

@fselmo

fselmo commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

Agree on closing tests from test_cases.md. I (and claude) have found great value in test_cases.md for BAL. Could we consider this for other EIPs.

I found it useful for BALs for sure. If you can suggest this in a testing meeting, we can see how the team feels 👀

@fselmo

fselmo commented May 12, 2026

Copy link
Copy Markdown
Contributor Author

Ah I still need an approve from someone with write privileges. @marioevz when you get a chance can you re-review so we can merge this.

@fselmo fselmo requested a review from marioevz May 12, 2026 19:04

@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 e45c0ed into ethereum:forks/amsterdam May 13, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-test Category: test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants