cmd/integration: stage_exec to not reuse doms object - #21952
Merged
Merged
Conversation
stage_exec persisted each batch with doms.Flush + manual tx.Commit while reusing the SharedDomains. Flush does not refresh the aggregator BranchCache, so freshly-written commitment branches landed in the DB while the shared cache kept stale entries; the next batch read the stale branch and computed a wrong trie root (chiado from-0, parallel and serial, surfaced with small --batchSize; hidden by large batches that commit once). Erigon's own RunLoop and the chaintip loop already commit via doms.Commit, which refreshes the cache. Commit each batch with doms.Commit (+ ClearRam so the reused SD is clean). Also drop the --no-commit flag to simplify the loop. Regression test in execmoduletester drives the integration path with a 1KB batch and badBlockHalt=true; it fails on the old Flush path and passes on Commit.
doms object
…o_36 # Conflicts: # cmd/integration/commands/stages.go
sudeepdino008
approved these changes
Jun 23, 2026
The "parallel starting" log computed limit as startBlockNum+blockLimit-1. When blockLimit == 0 (no per-cycle limit, e.g. integration stage_exec from 0) this underflows to 18446744073709551615 (max uint64) in the log. Log the effective last block instead: maxBlockNum when unlimited, else min(startBlockNum+blockLimit-1, maxBlockNum). Log-only; execution unaffected.
…ation_exec_chiado_36
…collate+prune per batch Both chaintip and non-chaintip now run each batch via execBlocksBatch (own rwtx + fresh SharedDomains, doms.Commit) and then agg.CollateAndPrune (prune + background file build). Replaces the reused-SD + ClearRam path.
…_chiado_36 # Conflicts: # cmd/integration/commands/stages.go
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.
based on #21951
domsobject seems doesn't intent to be re-used anymore inmainfixing
integration stage_execto follow new wayotherwise i see trie root missmatch