execution/commitment: parallel-commitment trie-context deferral and worker file-generation pin - #22360
Closed
awskii wants to merge 5 commits into
Closed
execution/commitment: parallel-commitment trie-context deferral and worker file-generation pin#22360awskii wants to merge 5 commits into
awskii wants to merge 5 commits into
Conversation
With COMMITMENT_PARALLEL set globally, every SharedDomains selected the parallel trie, but only DB-backed consumers (exec, builder, squeeze, backtester) wire the per-worker TrieContextFactory it needs — integrity checks, RPC-created domains, and test harnesses failed with 'ParallelPatriciaHashed.Process requires a TrieContextFactory'. The context now starts on the sequential trie and upgrades to the selected parallel/streaming variant when EnableParaTrieDB provides the DB. SeekCommitment may restore state before the DB is wired, so the upgrade adopts the already-restored trie as the parallel template instead of re-encoding (SetState re-reads a sole-account root through the not-yet-installed context). Touching before the upgrade panics: keys collected on the sequential buffer would be dropped. (cherry picked from commit 1436a65)
…el-commitment worker reads Parallel-commitment workers each opened a fresh BeginTemporalRo, pinning whatever aggregator visible-file generation was current — possibly newer than the main commitment tx. A deleted/reincarnated account then read AccountsDomain=empty (from the in-memory overlay) but CodeDomain=stale (from the worker's newer file view, since the code delete leaves no mem tombstone when prevVal is nil), failing the ERIGON_ASSERT code-hash consistency check and wedging the node. Serial commitment reads through one tx and stayed consistent, so this only surfaced once CI began exercising the parallel-commitment axis. Add a files-pin API (AggregatorRoTx.Pin -> AggregatorFilesPin, kv.TemporalFilesPin): ComputeCommitment pins the main tx's file generation and opens worker read txns from it, so all concurrent workers observe the snapshot the in-memory overlay was built against. Forwarded through the block-overlay wrapper for the builder path; falls back (with a warning) for backends that can't pin files. (cherry picked from commit a8cb055)
The pin's worker tx copied BeginTemporalRo's forkaggs setup, which main removed; the branch+main merge build then failed on the now-undefined forkaggs. Commitment workers read only state domains via aggtx, so the worker tx needs just the pinned file snapshot. (cherry picked from commit bd0dbb0)
…rial warmup The pin was also applied to the warmup factory, which serves serial/streaming commitment's page-cache warmup. Warmup does not compute the root, and pinning it regressed serial commitment to a wrong trie root on mainnet. Restrict the pin to the ParallelPatriciaHashed fold factory (which computes the root and had the torn Accounts/Code read); serial warmup keeps its independent snapshot, so the serial path is behaviorally identical to before the pin change. (cherry picked from commit 995f74c)
awskii
requested review from
AskAlexSharov,
mh0lt,
sudeepdino008 and
taratorio
as code owners
July 9, 2026 11:47
awskii
marked this pull request as draft
July 10, 2026 02:05
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.
ExperimentalParallelCommitmenthad correctness bugs that only surface once the parallel-commitment trie path is actually exercised:SharedDomains(integrity checks, RPC-created domains, test harnesses) selected the parallel trie but never got the per-workerTrieContextFactoryit needs, panicking withParallelPatriciaHashed.Process requires a TrieContextFactory.BeginTemporalRo, pinning a possibly-newer aggregator file generation than the main commitment tx. A deleted/reincarnated account then readAccountsDomain=empty (from the in-memory overlay) butCodeDomain=stale (from the worker's newer file view, since the code delete leaves no mem tombstone whenprevValis nil), tripping theERIGON_ASSERTcode-hash consistency check and wedging the node. Serial commitment reads through one tx and stayed consistent.Changes
EnableParaTrieDB: the context starts on the sequential trie and upgrades to the selected variant when the DB is wired.SeekCommitmentmay restore state before the DB is available, so the upgrade adopts the already-restored trie as the parallel template instead of re-encoding.AggregatorRoTx.Pin→AggregatorFilesPin,kv.TemporalFilesPin):ComputeCommitmentpins the main tx's file generation and opens worker read txns from it, so all concurrent workers observe the snapshot the in-memory overlay was built against. Forwarded through the block-overlay wrapper for the builder path; falls back with a warning for backends that can't pin files.ParallelPatriciaHashedfold factory; serial/streaming warmup keeps its independent snapshot (pinning warmup regressed serial commitment to a wrong trie root on mainnet).Split out of #22141 so the parallel-commitment fixes land independently of the CI matrix change that exercises them.