execution/stagedsync: AuRa genesis bypass for parallel-exec emptyRemoval#21930
Merged
Conversation
Mirror serial's txtask.Execute rules-clobber (rules = &chain.Rules{} at
block 0) at the parallel normalizeWriteSet callsite. Without this, the
AuRa CreateAccount(ZeroAddress) placeholder is treated as EIP-161-empty
in parallel, emitted as SelfDestructPath=true, and turned into a
DeleteUpdate by calc_state — diverging from serial's full-account
UPDATE and producing the wrong trie root reported in #21712.
Fixes #21712
This was referenced Jun 21, 2026
AskAlexSharov
approved these changes
Jun 22, 2026
AskAlexSharov
approved these changes
Jun 22, 2026
yperbasis
added a commit
that referenced
this pull request
Jun 22, 2026
…empty-accounts Resolve EIP-161 family conflicts against #21937 (AuRa SystemAddress carve-out) and #21930 (genesis bypass): every empty-removal gate now flows through Rules.IsEIP161Enabled() while preserving the EIP161EmptyRemoval(spuriousDragon, isAura, addr) helper and the be.blockNum!=0 genesis bypass.
pull Bot
pushed a commit
to Dustin4444/erigon
that referenced
this pull request
Jun 22, 2026
…ll EIP-161 empty-removal paths (extend erigontech#21930 family) (erigontech#21937) Cherry-pick of erigontech#21916 (yperbasis/aura-retain-system-address) onto current main. The original ZeroAddress-at-genesis fix (erigontech#21930) is already merged; this PR adds the matching SystemAddress carve-out, completing the AuRa EIP-161 family. Fixes the gnosis tip-tracking dep-0 abort wedge (verified locally — see verification below). ## Background Two AuRa-specific EIP-161 bugs in parallel exec share the same callsite (`normalizeWriteSet`) and the same family: 1. **erigontech#21930 (already merged):** Block-0 ZeroAddress at genesis. Mirrors serial's `rules = &chain.Rules{}` clobber at `txtask.Execute` so the AuRa `CreateAccount(ZeroAddress, false)` placeholder is retained in parallel. Gates `emptyRemoval` with `be.blockNum != 0` at the callsite. 2. **This PR (cherry-pick of erigontech#21916):** AuRa SystemAddress carve-out everywhere. Extracts `EIP161EmptyRemoval(spuriousDragon, isAura, addr)` helper that exempts the SystemAddress under AuRa; applies it at `updateAccount`, `printAccount`, `calcFees` (coinbase + burnt), `applyVersionedWrites`, and `normalizeWriteSet`. Both layers are now compatible: the block-0 gate sets `emptyRemoval=false` at genesis for any chain (preserves all empty allocs); the helper inside `normalizeWriteSet` then carves out SystemAddress on AuRa for blocks where `emptyRemoval=true`. ## Verification - Existing tests: `TestNormalize|TestFlushToUpdates|TestApplyWrites|TestSD|TestEIP161EmptyRemoval` all green on this branch + lint clean + `make erigon` clean. - **Gnosis tip-tracking wedge — fixed.** I had a release/3.5 gnosis instance wedged for 6 days at block 46,710,713 with deterministic `DependencyTxIndex=0` abort on the AuRa system-init at `forkchoice.go:520 → exec3_parallel.go:301`. I snapshotted the wedged chaindata (~42G real cost via hardlinked snapshots/), built yperbasis's branch at `e3409b6`, and ran it against the snapshot. Result: `[4/6 Execution] parallel executed blk=46711620 blks=909` — **909 blocks applied past the wedge point in one clean cycle, zero errors**. The dep-0 abort was the AuRa system-init writing an empty SystemAddress through `calcFees`/`normalizeWriteSet` (no AuRa carve-out, unlike serial's `updateAccount`), which poisoned OCC dependency tracking for the next block's system-init in the same batch. ## Co-authored by Andrew Ashikhmin / @yperbasis — author of the original erigontech#21916 commit, cherry-picked verbatim. ## Backport A `[r3.5]` cherry-pick PR will follow. ## Supersedes - erigontech#21916 (this is the same diff, rebased onto current main on top of erigontech#21930) Co-authored-by: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #21712.
Summary
CreateAccount(ZeroAddress, false)at genesis (genesiswrite/genesis_write.go) creates an empty account that serial deliberately retains via the rules-clobber at exec/txtask.go (rules = &chain.Rules{}at block 0 — "For Genesis, rules should be empty, so that empty accounts can be included").normalizeWriteSetignored that override and applied EIP-161 emptyRemoval at block 0, emittingSelfDestructPath=truefor ZeroAddress → calc_state producedDeleteUpdate→ divergent trie root.emptyRemovalat the parallel callsite withbe.blockNum != 0, mirroring serial's bypass.Tests
TestNormalizeWriteSet_GenesisBypassRetainsEmptyAccount— pins the new bypass (empty account at block 0 → no SelfDestructPath, FlushToUpdates emits the full account UPDATE).TestNormalizeWriteSet_PostGenesisEmptyAccountTriggersEIP161— contrast (block > 0: SelfDestructPath emitted, DeleteUpdate flushed).Test plan
Backport
An `[r3.5]` cherry-pick PR will follow this one targeting `release/3.5`.