Skip to content

execution/tests, genesiswrite: pin the EIP-7610 storage-only CREATE2 collision - #23600

Merged
AskAlexSharov merged 3 commits into
mainfrom
awskii/eip7610-storage-collision-test
Aug 28, 2026
Merged

execution/tests, genesiswrite: pin the EIP-7610 storage-only CREATE2 collision#23600
AskAlexSharov merged 3 commits into
mainfrom
awskii/eip7610-storage-collision-test

Conversation

@awskii

@awskii awskii commented Aug 26, 2026

Copy link
Copy Markdown
Member

hasCreateCollision rejects a CREATE whose destination holds storage, which is EIP-7610's clause on top of EIP-684. Nothing covered it. The shape is reachable only through a genesis alloc — post-EIP-161 no execution path produces an account with zero nonce, empty code and non-empty storage — so it never appeared in a generated chain, and dropping the storage term from the check broke no test in the package.

Found while working the PBT devnet, where geth and besu both apply a different rule: geth replaces the runtime probe with a mainnet-only address list (ethereum/go-ethereum#34718), besu drops the check under BINARY_TRIE in anticipation of EIP-8253's nonce bump, which no client implements. Erigon keeps the probe — HasPrefix(kv.StorageDomain, addr) over flat state, so the storage root BAL removes was never involved. This pins the behaviour so a later move is deliberate rather than silent.

Removing the storage term is also not a one-line change. With targetHasStorage dropped, the chain generator and the executor compute different roots for the same block — wrong trie root: block 1, BadBlock: invalid state root hash — because the creation then proceeds onto an account that already holds storage, which is the account-reset case EIP-7610 exists to remove.

Changes

  • execution/tests: three arms over one CREATE2 — destination carrying a storage slot at zero balance, the same at nil balance, and a control with the destination absent that deploys 2 bytes. The control is what makes the first two mean anything; without it they pass on a deployment that never worked.
  • execution/state/genesiswrite: uint256.FromBig(account.Balance) had no nil guard, so a GenesisAlloc entry without a balance panicked in ComputeGenesisCommitment. Not reachable from a genesis file, where balance is gencodec:"required", but reachable from any Go caller building an alloc — which is how the nil arm hit it. go-ethereum guards the same call at core/genesis.go:155.

@awskii
awskii requested review from mh0lt and yperbasis as code owners August 26, 2026 11:58
@yperbasis
yperbasis requested review from taratorio and a balanced review from Copilot August 26, 2026 14:01

Copilot AI 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.

Pull request overview

Pins EIP-7610 CREATE2 collision behavior for storage-only genesis accounts.

Changes:

  • Adds collision and successful-deployment test cases.
  • Treats nil genesis balances as zero during commitment calculation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
execution/tests/eip7610_storage_collision_test.go Tests storage-only CREATE2 collisions and control deployment.
execution/state/genesiswrite/genesis_write.go Safely handles nil genesis balances.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@AskAlexSharov
AskAlexSharov added this pull request to the merge queue Aug 27, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 27, 2026
@AskAlexSharov
AskAlexSharov added this pull request to the merge queue Aug 28, 2026
Merged via the queue into main with commit 7992c6a Aug 28, 2026
137 checks passed
@AskAlexSharov
AskAlexSharov deleted the awskii/eip7610-storage-collision-test branch August 28, 2026 03:58
@taratorio

Copy link
Copy Markdown
Member

fyi, EIP-7610 got dropped in favour of EIP-8253 - I will remove all code associated with it next week (need to merge some other things first and update some test fixtures before that).

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.

4 participants