[bal-devnet-3] execution/state: don't seed initial BAL balance from post-write reads#20864
Merged
mh0lt merged 2 commits intobal-devnet-3from Apr 28, 2026
Merged
[bal-devnet-3] execution/state: don't seed initial BAL balance from post-write reads#20864mh0lt merged 2 commits intobal-devnet-3from
mh0lt merged 2 commits intobal-devnet-3from
Conversation
The parallel executor's block-end finalize creates a fresh IBS (unlike the assembler which reuses the same IBS with cached state objects). This fresh IBS generates BalancePath reads for accounts that were already written during the same block — the initialize-phase system calls (EIP-4788 beacon root, EIP-2935 history storage), the burnt contract (EIP-1559 base-fee burn), or any account whose tx-1 write was pre-populated into the version map from a stored BAL sidecar in the chain-tip FCU validation path. These post-write reads were treated as the "initial" (pre-block) balance by `updateRead`, so `applyToBalance`'s net-zero filter would later drop the legitimate write whose value happened to equal the post-write read. The block's computed BAL hash then disagreed with the header-attested BAL hash, putting the node in an unrecoverable retry loop on the offending payload. Tighten the guard to only set `initialBalanceValue` from a balance read that arrives BEFORE any balance writes have been recorded. Reads arriving after a write reflect post-write state and cannot be used as a pre-block reference. Reproduced on bal-devnet-3 at block 91648 where the node looped on "BAL mismatch: got 0x973750... expected 0xff40db...". The diff was a single missing entry: balanceChanges=[1:0x16eaeb76] for the zero address (the EIP-1559 burnt contract on this devnet). The fresh IBS read at finalize observed the value already pre-populated from the sidecar BAL for tx 1 (0x16eaeb76), set initialBalanceValue to that, and the net-zero filter then dropped the very write whose value the read had borrowed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…oning Captures the bal-devnet-3 block-91648 BAL hash mismatch in a single-file test: a balance write at txIndex=1 followed by a later BalancePath read of the same value (the pattern emitted by the parallel executor's fresh-IBS finalize, or by a BAL-prepopulated read of a tx's predicted write). Without the previous commit's `updateRead` guard, the late read seeds `initialBalanceValue` and `applyToBalance`'s net-zero filter then drops the legitimate write — the exact symptom that put `lighthouse-erigon-super-1` into a retry loop on the offending payload. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.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.
Cherry-pick of #20843 to bal-devnet-3.