Skip to content

feat(tests): expand create collision matrix and add balance-only cases - #3425

Merged
spencer-tb merged 5 commits into
ethereum:forks/amsterdamfrom
danceratopz:expand-create-collision-matrix
Aug 26, 2026
Merged

feat(tests): expand create collision matrix and add balance-only cases#3425
spencer-tb merged 5 commits into
ethereum:forks/amsterdamfrom
danceratopz:expand-create-collision-matrix

Conversation

@danceratopz

@danceratopz danceratopz commented Aug 24, 2026

Copy link
Copy Markdown
Member

Description

Expand the create collision tests to the full parameter matrix of nonce, code, storage and balance for all cases where EIP-684 defines an abort. The new no-storage cells catch a client that incorrectly aborts on storage instead of code or nonce. Cells with zero nonce and empty code are excluded at param generation: with non-empty storage the behavior is undefined in protocol (EIP-7610 was declined for Glamsterdam), with empty storage the account is deployable.

Also add balance-only success tests for the deployable case, for creation transactions and for the CREATE and CREATE2 opcodes: an account with only a balance is not a collision, creation must succeed and the balance is kept.

Filled locally at Frontier, Paris, Cancun and Amsterdam, all pass, re-verified after rebasing onto forks/amsterdam once #3417 merged.

Related Issues or PRs

Implements the coverage expansion requested in the review of #3417 (comment 1, comment 2).

Checklist

  • Ran fast static checks to avoid CI fails, see Code Standards & Verifying Changes: just static
  • PR title has the form <type>(<area>): <title>, where <type> and <area> come from an appropriate C-<type>, respectively A-<area>, label. The title should match the target squash commit message.

Cute Animal Picture

   /\_/\
  ( o.o )    no collisions,
   > ^ <     only deployments
  /|   |\
 (_|___|_)

@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.77%. Comparing base (2ce2191) to head (fc54472).
⚠️ Report is 1 commits behind head on forks/amsterdam.

Additional details and impacted files
@@               Coverage Diff                @@
##           forks/amsterdam    #3425   +/-   ##
================================================
  Coverage            93.77%   93.77%           
================================================
  Files                  624      624           
  Lines                36905    36905           
  Branches              3326     3326           
================================================
  Hits                 34606    34606           
  Misses                1597     1597           
  Partials               702      702           
Flag Coverage Δ
unittests 93.77% <ø> (ø)

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.

Address review feedback from jochem-brouwer on
ethereum#3417. Parametrize the collision account over
the full product of nonce, code, storage and balance where EIP-684
defines an abort, so a client that incorrectly aborts on storage is
caught. Cells with zero nonce and empty code are excluded: with
storage the behavior is undefined in protocol since EIP-7610 was
declined, without storage the account is deployable. Add balance-only
success tests for the deployable case, for creation transactions and
for the CREATE and CREATE2 opcodes.
@danceratopz
danceratopz force-pushed the expand-create-collision-matrix branch from ff2a572 to 617e037 Compare August 25, 2026 06:32
@danceratopz danceratopz added C-feat Category: an improvement or new feature A-tests Area: Consensus tests. labels Aug 25, 2026
@danceratopz
danceratopz marked this pull request as ready for review August 25, 2026 06:37

@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 from my end! Would like an approve and merge from @jochem-brouwer

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

Hi @danceratopz I checked the tests and it looks correct. However, the docs are not correct.

Could you edit the docs? Let me know if I should address this, then I will change and push a commit 😄 👍

"""
Test that a contract creation opcode succeeds when the target
address has only a balance: an account with zero nonce, no code and
no storage is not a collision (EIP-684).

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.

This is not correct, EIP-684 only verifies: no code and nonce is zero. The storage check is added in EIP-7610, however, since this is DFId this is still undefined behavior (we shouldo also not test such behavior, which we are not doing here, so that's fine! 😄 )

If a contract creation is attempted due to a creation transaction, the CREATE opcode, the CREATE2 opcode, or any other reason, and the destination address already has either a nonzero nonce, or a nonzero code length, then the creation MUST throw

@jochem-brouwer

Copy link
Copy Markdown
Member

Wait, it's a double negation. We could also add "no balance" but that would be correct also. Ok I will approve it, merge if you are fine, or edit the comment if you think it should change.

@spencer-tb
spencer-tb merged commit bd443d9 into ethereum:forks/amsterdam Aug 26, 2026
17 checks passed
@danceratopz
danceratopz deleted the expand-create-collision-matrix branch August 27, 2026 10:46
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.

3 participants