Repository navigation
op-reth: unit test the proofs storage startup reconciliation - #23419
Closed
einar-oplabs wants to merge 1 commit into
Closed
einar-oplabs wants to merge 1 commit into
einar-oplabs wants to merge 1 commit into
Conversation
This was referenced Oct 14, 2026
sebastianst
force-pushed
the
seb/proofs-startup-reconcile
branch
from
October 19, 2026 12:29
b601541 to
4e0fb2d
Compare
einar-oplabs
force-pushed
the
einar/23387-proofs-reconcile-tests
branch
3 times, most recently
from
November 10, 2026 13:19
c9231e5 to
e1a6caa
Compare
einar-oplabs
marked this pull request as ready for review
November 10, 2026 13:19
Contributor
Author
|
Claude: GPT-6.1-Sol (xhigh): No actionable findings in the review of commit Reviewed fixture construction, production reconciliation and pruning behavior, startup error cases, and reimported state-root assertions. Validation: all 82 focused tests passed, covering both storage backends, both reth persistence splits, and both engine flush cadences where applicable. The 27 unrelated tests were excluded by the filter. The tests ran outside the sandbox because the reth test context requires local network sockets. cargo nextest run --locked --offline -p reth-optimism-exex startup_reconciliation |
einar-oplabs
force-pushed
the
einar/23387-proofs-reconcile-tests
branch
from
November 10, 2026 15:33
510b9ec to
216004c
Compare
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio. |
einar-oplabs
force-pushed
the
einar/23387-proofs-reconcile-tests
branch
from
November 10, 2026 15:46
216004c to
b80a5dc
Compare
einar-oplabs
force-pushed
the
einar/23387-proofs-reconcile-tests
branch
from
November 10, 2026 18:53
3592d85 to
a776ccb
Compare
Covers the startup reconciliation of the proofs storage against reth's chain as rstest tables over a real BlockchainProvider: storage behind, equal to or ahead of reth on its chain, on a fork above, at or below reth's tip, a fork point below the window, a window above reth's tip and an uninitialized storage, with reth's last few or most blocks held in memory; the re-import after an unwind, which must leave the canonical state root in the storage; the pruner cap at reth's Finish stage checkpoint, and two cases driven through run with a real EVM: a startup error returns promptly with the storage untouched, and an unwind is followed by run's sync_to up to reth's tip. The ExEx's startup prologue moves into OpProofsExEx::startup so the tests call what run calls, the reconcile_tests! suite and the helpers the tables supersede are removed from lib.rs, and the in-memory proofs store's cursors take the read lock with read() instead of try_read(), so a reader that lands while the engine's save thread holds the write lock waits instead of failing (the same change sits on optimism#23449 and becomes a no-op there), which leaves OpProofsStorageError::TryLockError without a producer, so it goes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
einar-oplabs
force-pushed
the
einar/23387-proofs-reconcile-tests
branch
from
November 10, 2026 19:24
cea54b7 to
69cd9da
Compare
This branch was successfully deployed
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.
Pins down the proofs storage startup reconciliation that #23358 added, over every relation between the storage's window and reth's chain, so a regression in the reconcile or in the pruner cap that keeps the window reconcilable fails a unit test instead of a devnet. Closes #23387.
rust/op-reth/crates/exex/src/tests/startup_reconciliation.rscalls the production startup step (OpProofsExEx::startup, extracted fromrun) against a realBlockchainProviderholding blocks 1..=60, with reth's last 7 or 50 blocks kept in its canonical in-memory state so fork points land in the database or in memory, and theFinishstage checkpoint seeded at the persisted head. The canonical blocks are empty blocks whose state is the accumulated block reward, so a realEthEvmConfigin the ExEx context reproduces their state roots.startup_reconciles_storage_with_reth_chain:rstesttable over reth split {7, 50} x backend {MDBX, in-memory} for the cases that probe a block below reth's persisted head: storage behind reth, fork point below the window.startup_reconciles_storage_with_reth_tip: the cases that probe only genesis or reth's tip, over backend: storage equal to reth, initialized at the tip, ahead on reth's chain, ahead from the tip, ahead on a fork above the tip, a single foreign block at height 0, window above reth's tip; plus an uninitialized storage.startup_unwinds_storage_to_fork_point: the on-fork cases below reth's tip, over reth split {7, 50} x backend. They exercise the state-root criterion, which a match by height would miss, and check the unwound block's state root.run_reconciles_storage_then_syncs:runitself, over backend: the startup error returns fromrun, and an unwind to fork point 50 is followed byrun'ssync_to, whose engine executes 51..=60 on the proofs storage's state and ends at reth's tip with the canonical state root.startup_unwind_lets_reth_reimport_be_indexed: after the unwind, reth re-imports the blocks and the ExEx indexes them to the canonical state root (the Implement CI release pipeline #464 sequence), over persistence thresholds of 1 and 3 blocks for the 6 re-imported ones.pruner_caps_earliest_at_reth_persisted_head: one case proving the real provider'sFinishstage checkpoint reaches the pruner; the cap arithmetic is pinned by the pruner's own unit tests.The
reconcile_tests!suite and the helpers only it used are deleted; the tables cover its six scenarios. Production changes: thestartupmethod, and the in-memory proofs store's cursors now wait for a writer instead of failing withTryLockError, which made the in-memory engine-sync cases flaky (mirrors #23449), and the variant, constructed nowhere any more, is removed.Breakdown
AI Reviews
🤖 Generated with Claude Code