Skip to content

cmd/integration: stage_exec to not reuse doms object - #21952

Merged
AskAlexSharov merged 12 commits into
mainfrom
alex/integration_exec_chiado_36
Jun 23, 2026
Merged

AskAlexSharov merged 12 commits into
mainfrom
alex/integration_exec_chiado_36

Conversation

@AskAlexSharov

@AskAlexSharov AskAlexSharov commented Jun 23, 2026 •

Copy link
Copy Markdown
Collaborator

based on #21951

// Deprecated: a committed SharedDomains is spent — open a fresh one (Commit then
// a new SharedDomains, or Close) rather than reset and reuse.
func (sd *SharedDomains) ClearRam(resetCommitment bool) {

doms object seems doesn't intent to be re-used anymore in main
fixing integration stage_exec to follow new way

otherwise i see trie root missmatch

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.

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@AskAlexSharov AskAlexSharov changed the title cmd/integration: fix stage_exec from-0 wrong trie root (BranchCache); drop --no-commit cmd/integration: stage_exec to not reuse doms object Jun 23, 2026
…o_36

# Conflicts:
#	cmd/integration/commands/stages.go
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.
…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
@AskAlexSharov
AskAlexSharov added this pull request to the merge queue Jun 23, 2026
Merged via the queue into main with commit 977fa9d Jun 23, 2026
91 checks passed
@AskAlexSharov
AskAlexSharov deleted the alex/integration_exec_chiado_36 branch June 23, 2026 07:45
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.

3 participants