Skip to content

ci, db/state: matrix-test serial vs parallel commitment across the test workflows#22141

Open
mh0lt wants to merge 12 commits into
mainfrom
mh/ci-commitment-mode-matrix
Open

ci, db/state: matrix-test serial vs parallel commitment across the test workflows#22141
mh0lt wants to merge 12 commits into
mainfrom
mh/ci-commitment-mode-matrix

Conversation

@mh0lt

@mh0lt mh0lt commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Parallel execution (dbg.Exec3Parallel) is now the default, so the serial/parallel exec-mode CI matrix added in #21017 no longer needs to toggle it — both legs already run parallel exec. This PR repurposes that matrix axis to exercise serial vs parallel commitment instead, so divergence between statecfg.ExperimentalParallelCommitment true and false is caught on the PR rather than after a release.

Modeled directly on #21017 (the exec-mode matrix PR).

Mechanism

  • New env toggle ERIGON_COMMITMENT_PARALLEL. db/state/statecfg/state_schema.go now initializes ExperimentalParallelCommitment from dbg.EnvBool("COMMITMENT_PARALLEL", false); envLookup in common/dbg/dbg_env.go auto-prepends the ERIGON_ prefix, exactly like EXEC3_PARALLEL.
  • The existing CLI flag still composes:
    • the main erigon binary only ever flips the flag on (node/eth/backend.go), so the env value survives when the flag isn't passed;
    • the integration command's BoolVar now defaults to the env-derived value instead of clobbering it back to false at flag registration.
  • Across the 11 test workflows: the exec_mode matrix axis is renamed commitment_mode, the ERIGON_EXEC3_PARALLEL assignment is dropped (exec is parallel in both legs by default), and ERIGON_COMMITMENT_PARALLEL is driven from the axis. For the two workflow_dispatch perf tests the manual exec_mode input becomes commitment_mode. Docker ENV injection for the hive/kurtosis/txpool runtime images is updated to the new var. Per-mode Go build-cache lineages and artifact/enclave/testbed names carry over unchanged in shape.

Why

ExperimentalParallelCommitment was previously reachable only via a CLI flag, so no CI job exercised the parallel-commitment trie path. Reusing the (now redundant) exec-mode axis gives serial-vs-parallel commitment coverage at no extra matrix cost — same runner count, the axis just tests a different dimension.

Note on coverage trade-off

This drops the dedicated serial-execution CI leg. That is deliberate: parallel execution is the default and is what ships; the serial-exec matrix leg was guarding a non-default path, whereas serial-vs-parallel commitment is the currently-diverging surface worth gating. Serial execution remains runnable locally via ERIGON_EXEC3_PARALLEL=false.

Workflows touched: test-all-erigon, test-all-erigon-race, test-bench, test-hive, test-hive-eest, test-kurtosis-assertoor, qa-stage-exec, qa-txpool-performance-test, qa-rpc-integration-tests-latest, qa-rpc-performance-tests, qa-rpc-performance-comparison-tests.

…st workflows

Parallel execution (dbg.Exec3Parallel) is now the default, so the serial/parallel
exec-mode CI matrix from #21017 no longer needs to toggle it — both legs run
parallel exec. This repurposes that matrix axis to instead exercise serial vs
parallel commitment, so divergence between statecfg.ExperimentalParallelCommitment
true and false is caught on the PR rather than after release.

The toggle is plumbed via ERIGON_COMMITMENT_PARALLEL: state_schema.go now reads
COMMITMENT_PARALLEL via dbg.EnvBool (envLookup auto-prepends ERIGON_), mirroring
EXEC3_PARALLEL. The existing CLI flag still composes — backend.go only flips the
flag on, and the integration command's BoolVar now defaults to the env-derived
value instead of clobbering it to false at registration.

Across the 11 test workflows the exec_mode axis is renamed commitment_mode, the
ERIGON_EXEC3_PARALLEL assignment is dropped, and ERIGON_COMMITMENT_PARALLEL is set
from the axis (or, for the two workflow_dispatch perf tests, from the renamed
input). Docker ENV injection for the hive/kurtosis/txpool images is updated to the
new var. Per-mode Go build-cache lineages and artifact/enclave/testbed names carry
over unchanged in shape.
@yperbasis yperbasis added this to the 3.7.0 milestone Jul 2, 2026
@taratorio

taratorio commented Jul 2, 2026

Copy link
Copy Markdown
Member

@mh0lt need to also update test-eest-spec.yml shards

mh0lt and others added 2 commits July 2, 2026 18:49
Addresses review: the EEST spec shard matrix also toggled execution mode via a
-sequential/-parallel suffix (manifest exec3-parallel → ERIGON_EXEC3_PARALLEL).
Repurpose it the same way as the other workflows: the suffix now selects serial
vs parallel commitment, execution is parallel in every shard (default).

tools/eest-spec-shards.yml: rename the per-entry field exec3-parallel →
commitment-parallel. tools/run-eest-spec-test.sh: read commitment-parallel and
export ERIGON_COMMITMENT_PARALLEL instead of ERIGON_EXEC3_PARALLEL. Shard names
(and therefore the ci-gate check names and Makefile targets) are unchanged.
@mh0lt

mh0lt commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Good catch — done in f86ceab. The EEST spec shards toggled execution via the -sequential/-parallel suffix (manifest exec3-parallelERIGON_EXEC3_PARALLEL), so I repurposed them the same way as the other workflows:

  • tools/eest-spec-shards.yml: per-entry field exec3-parallelcommitment-parallel.
  • tools/run-eest-spec-test.sh: reads commitment-parallel and exports ERIGON_COMMITMENT_PARALLEL instead of ERIGON_EXEC3_PARALLEL; execution is now parallel in every shard (default).

Shard names are unchanged, so the ci-gate check names and make eest-spec-* targets stay stable — the -sequential/-parallel suffix now selects serial vs parallel commitment. Also rebased onto your main-merge.

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.

Pull request overview

This PR repurposes the existing CI “serial vs parallel” matrix axis from execution mode (now parallel by default) to state commitment mode, so CI exercises both serial and parallel commitment paths via a new environment toggle.

Changes:

  • Add ERIGON_COMMITMENT_PARALLEL env plumbing by initializing statecfg.ExperimentalParallelCommitment from dbg.EnvBool("COMMITMENT_PARALLEL", false).
  • Preserve env-derived commitment defaults through CLI flag registration (notably in the integration command).
  • Update CI workflows and EEST tooling to drive serial vs parallel commitment via the new matrix axis and env var.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
db/state/statecfg/state_schema.go Initializes ExperimentalParallelCommitment from env (COMMITMENT_PARALLEL via dbg.EnvBool).
cmd/integration/commands/flags.go Uses env-derived defaults when registering experimental commitment flags so env isn’t clobbered.
tools/run-eest-spec-test.sh Switches EEST shard runner to export ERIGON_COMMITMENT_PARALLEL from the shard manifest.
tools/eest-spec-shards.yml Renames shard-manifest key to commitment-parallel to control commitment mode per shard.
.github/workflows/test-all-erigon.yml Renames matrix axis to commitment_mode and drives ERIGON_COMMITMENT_PARALLEL for Go tests.
.github/workflows/test-all-erigon-race.yml Same as above for race-detector test groups with mode-separated build cache keys.
.github/workflows/test-bench.yml Runs benchmarks in both commitment modes via ERIGON_COMMITMENT_PARALLEL.
.github/workflows/test-hive.yml Updates Hive matrix to commitment_mode and injects ERIGON_COMMITMENT_PARALLEL into the Erigon client Dockerfile.
.github/workflows/test-hive-eest.yml Same commitment-mode matrix + Docker ENV injection for Hive EEST runs.
.github/workflows/test-kurtosis-assertoor.yml Updates Kurtosis matrix axis and bakes ERIGON_COMMITMENT_PARALLEL into the runtime image per leg.
.github/workflows/qa-stage-exec.yml Switches QA stage-exec matrix to commitment mode and disambiguates artifacts/datadirs accordingly.
.github/workflows/qa-txpool-performance-test.yml Switches txpool perf matrix to commitment mode and bakes the env var into the runtime image.
.github/workflows/qa-rpc-integration-tests-latest.yml Switches RPC integration tests to commitment-mode matrix and artifacts naming.
.github/workflows/qa-rpc-performance-tests.yml Renames workflow_dispatch input and runtime env handling to ERIGON_COMMITMENT_PARALLEL.
.github/workflows/qa-rpc-performance-comparison-tests.yml Same input/env handling update for the comparison workflow.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tools/eest-spec-shards.yml Outdated
workers: 12
max-allowed-failures: 0
exec3-parallel: true
commitment-parallel: true
Comment thread tools/eest-spec-shards.yml Outdated
workers: 12
max-allowed-failures: 0
exec3-parallel: true
commitment-parallel: true
@taratorio

Copy link
Copy Markdown
Member

@awskii fyi to check the eest-spec-tests failures

mh0lt and others added 2 commits July 3, 2026 08:38
blocktests-devnet and blocktests-devnet-race-amsterdam carried
commitment-parallel: true as a mechanical rename of the old exec3-parallel: true
(which forced parallel execution — now the default). Those shards have no
-parallel suffix, so per the manifest's suffix-selects-mode rule they must run
the default serial commitment; the override forced parallel commitment with no
serial counterpart. Drop it so commitment-parallel is set iff the shard name
ends in -parallel.
@mh0lt

mh0lt commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the two shard-config comments in c923faae76: dropped commitment-parallel: true from the suffix-less blocktests-devnet and blocktests-devnet-race-amsterdam shards. Those were mechanical renames of the old exec3-parallel: true (which forced parallel execution — now the default), so as suffix-less shards they now run the default serial commitment, matching the manifest's suffix-selects-mode rule. commitment-parallel is now set iff the shard name ends in -parallel (13 parallel / 13 sequential / 5 suffix-less serial; verified). Parallel-commitment coverage comes from the -parallel shards.

mh0lt and others added 5 commits July 4, 2026 17:38
…-matrix

# Conflicts:
#	.github/workflows/test-hive.yml
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.
@awskii awskii requested review from awskii and taratorio as code owners July 7, 2026 09:55
@awskii

awskii commented Jul 7, 2026

Copy link
Copy Markdown
Member

The remaining red legs here (eest blocktests/enginextests parallel, race-tests core-rpc/execution-other parallel) all fail on one class: after an unwind or on a fresh tiny chain, the restored commitment state is a sole-account root with no root branch record, and processMounted either errors (unfold root: empty branch data read during unfold) or silently drops the untouched root leaf (wrong trie root, e.g. TestCallTraceUnwind and TestBlockchainHeaderchainReorgConsistency both produce root f8d8c1e8…).

#22257 fixes this. Verified locally on this branch with it trial-merged: both repro tests pass, and the full enginextests-stable-parallel + blocktests-stable-parallel shards run clean (63920 tests, 0 failed).

So the order is: land #22257, then merge main into this branch again — the parallel legs should go green with no further changes here.

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.

7 participants