Skip to content

op-devstack,op-acceptance-tests: run EL-resync tests on op-reth - #23827

Merged
joshklop merged 4 commits into
developfrom
joshklop/reth-safedb-resync-tests
Nov 12, 2026
Merged

joshklop merged 4 commits into
developfrom
joshklop/reth-safedb-resync-tests

Conversation

@joshklop

@joshklop joshklop commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

TestTruncateDatabaseOnELResync, TestPreserveDatabaseOnCLResync and TestELSyncSafeRetractedByOffset stop the verifier EL on the assumption that doing so wipes its chain. Only op-geth (in-memory) behaves that way. op-reth keeps its datadir across Stop/Start, so on op-reth these tests would restart an EL that still has its chain, and never exercise a resync. They were skipped on op-reth, and op-geth now skips every Karst chain, so on develop they currently run in no configuration.

With this PR, ELs can be wiped explicitly. The three tests now run in the normal op-reth acceptance jobs. Locally, with op-node, the wiped verifier EL-syncs from genesis and the SafeDB is reset after EL sync completes; with kona-node, the two SafeDB tests also pass. That would also make a separate op-geth invocation for these tests unnecessary (see #23787 (comment)). This PR overlaps with #23787 in the two SafeDB test files, so whichever lands second needs a small rebase.

Stop/Start semantics are unchanged; Wipe is opt-in, so existing tests that rely on op-reth keeping its data across a restart are unaffected. The original "peering issue" skips no longer reproduce: their recorded failures match bugs fixed in #22052, #22153 and #22487.

Not covered: TestELSyncSafeRetractedByOffset now skips on kona-node, which rejects OffsetELSafe (it was never reachable there before); tracked in #23828. gap_clp2p also wipes now, but stays skipped on op-reth: with the wipe it gets past its old failure and hits a different one, now recorded in the skip comment. go-code-reviewer ran and its findings are applied. safedb-reviewer was not run because no SafeDB code changes. op-geth was not exercised locally, because these chains activate Karst.

🤖 Generated with Claude Code

@wiz-0f98cca50a

wiz-0f98cca50a Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total -

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio.

Comment thread op-devstack/sysgo/l2_el_opreth.go Resolved
Comment thread op-devstack/sysgo/l2_el_opreth.go Resolved
@einar-oplabs

Copy link
Copy Markdown
Contributor

Wipe is opt-in,

what are the pros and cons of opt-in vs opt-out in this context?

einar-oplabs
einar-oplabs previously approved these changes Nov 10, 2026
Comment thread op-devstack/sysgo/l2_el_opgeth.go Resolved
Comment thread op-devstack/dsl/l2_el.go Resolved
Comment thread op-devstack/presets/rpc_frontends.go Resolved
Comment thread op-devstack/sysgo/l2_el_opreth.go Resolved
Comment thread op-devstack/sysgo/l2_el_opgeth.go Resolved
@einar-oplabs

Copy link
Copy Markdown
Contributor

Wipe is opt-in,

what are the pros and cons of opt-in vs opt-out in this context?

Opus 5.5 (high): Opt-in means Stop/Start keep the chain (on op-reth) and a test calls Wipe to start from genesis. Opt-out would mean Stop wipes unless the test asks to keep the data.

Opt-in, pros

  • Stop/Start behave like a real process restart, which is what op-reth and production nodes do.
  • Tests that rely on keeping data work unchanged: sync/el_restart ("EL must come back with its chain") and safedb_parity's TestSafeHeadRecordsMatchAfterKonaCLAndELRestart ("The EL keeps its data dir").
  • A test's intent shows at the call site: Stop(); Wipe() reads as "resync from genesis".

Opt-in, cons

  • Backends still differ on a plain restart: op-geth always loses its chain (in memory) and op-reth always keeps it. A new resync test that forgets Wipe resyncs on op-geth and only restarts on op-reth, and nothing reports it. That is the false pass this PR fixes, just moved to the next test that gets written.

Opt-out, pros

  • Matches what op-geth does today, so a forgotten call fails safe for resync tests: you get more resync, not less.

Opt-out, cons

  • A Stop that deletes data is surprising and unlike production.
  • Every test that restarts with its data has to change.
  • op-geth couldn't honor "keep" without a persistent datadir, so those tests stay SkipOnOpGeth either way.

Opt-in seems right to me. The remaining risk is the forgotten Wipe, and that can be guarded cheaply: resync tests can assert that the EL is back at genesis after Start, as safedb_parity/cl_resync_test.go does (Require().Zero(... BlockRefByLabel(eth.Unsafe).Number ...)), or Wipe could record a flag that the next Start checks.

sebastianst
sebastianst previously approved these changes Nov 12, 2026

@sebastianst sebastianst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Wipe() is opt-in, fails loudly when called on a running node or on a backend that can't wipe, and resets exactly the reth datadir and the proofs-history dir while keeping the p2p key. So the peering and resync paths now really run on op-reth, in both CL lanes. einar's threads are addressed or declined for reasons that hold.

Two things outside this diff:

  • TestTruncateDatabaseOnELResync checks no lower bound, so it cannot tell a truncated SafeDB from a preserved one. I'm looking into what op-node actually does there and will file a follow-up if the test needs pinning.
  • #23787 adds WithJovianAtGenesis to these two tests unconditionally. After this lands, that part should be dropped there, or the op-reth lanes lose Karst coverage for them.

🤖 Co-created with Claude Fable 5.2

@einar-oplabs
einar-oplabs force-pushed the joshklop/reth-safedb-resync-tests branch from cfaf3fd to 26880aa Compare November 12, 2026 15:08
joshklop and others added 4 commits November 12, 2026 16:12
The SafeDB resync and offset-EL-safe tests stop the verifier EL expecting
that to wipe its chain, which only holds for op-geth's in-memory storage.
op-reth keeps its datadir across Stop/Start, so the tests were skipped on
op-reth (and, under Karst, op-geth skips them too).

Add an opt-in Wipe step for L2 ELs: op-reth deletes its data dirs and
re-runs init, op-geth only checks that it is stopped. The tests now wipe
explicitly and run on op-reth.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- offset_el_safe: wait for the restarted EL before peering, and allow the
  same 90-attempt budget as TestTruncateDatabaseOnELResync for the full EL
  sync after the wipe.
- safeheaddb_clsync: fix the comment; the verifier is in CL sync mode, so
  after the wipe it derives the chain again from L1 rather than EL-syncing.
- op-reth: drop the separate dataDir field and recreate every entry in
  dataDirs, so the wipe and init cannot disagree about which directory to
  reset.
- gap_clp2p: link the op-reth skip to #23317.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without a lower bound, these tests pass even if Wipe leaves the chain in
place. Check that the verifier EL's unsafe head is genesis right after it
restarts, before its CL starts, as safedb_parity/cl_resync_test.go does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@einar-oplabs
einar-oplabs force-pushed the joshklop/reth-safedb-resync-tests branch from 26880aa to b050c96 Compare November 12, 2026 15:12
@joshklop
joshklop added this pull request to the merge queue Nov 12, 2026
Merged via the queue into develop with commit 68b4e7b Nov 12, 2026
57 checks passed
@joshklop
joshklop deleted the joshklop/reth-safedb-resync-tests branch November 12, 2026 15:42
einar-oplabs added a commit that referenced this pull request Nov 12, 2026
…ning-validation

Resolve the SafeDB resync tests to develop's versions from #23827 (explicit
EL wipe, no op-reth skips, no Jovian pins), keeping this branch's
safeheaddb_clsync package name and client-neutral restart comment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
einar-oplabs added a commit that referenced this pull request Nov 12, 2026
TestTruncateDatabaseOnELResync and TestPreserveDatabaseOnCLResync run in
the normal op-reth acceptance jobs since #23827, and op-geth is being
removed from op-devstack (#20257, #21744).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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