Skip to content

fix(op-supernode): wait for initial EL sync before cold start#20833

Closed
karlfloersch wants to merge 5 commits into
aj/feat/interop-startup-reworkfrom
karl/gate-supernode-cold-start-on-el-sync
Closed

fix(op-supernode): wait for initial EL sync before cold start#20833
karlfloersch wants to merge 5 commits into
aj/feat/interop-startup-reworkfrom
karl/gate-supernode-cold-start-on-el-sync

Conversation

@karlfloersch
Copy link
Copy Markdown
Contributor

Summary

  • expose initial EL-sync state from op-node through supernode virtual nodes and chain containers
  • gate interop cold-start before reading first SafeDB history while any VN is still initial EL syncing
  • add a cold-start regression test that verifies SafeDB is not queried during initial EL sync

Testing

  • mise exec -- go test ./op-supernode/supernode/activity/interop ./op-supernode/supernode/chain_container ./op-supernode/supernode/chain_container/virtual_node ./op-supernode/supernode/activity/supernode ./op-supernode/supernode/activity/superroot ./op-node/node -count=1

Stacked on #20823.

@karlfloersch karlfloersch marked this pull request as ready for review May 18, 2026 17:16
@karlfloersch karlfloersch requested a review from a team as a code owner May 18, 2026 17:16
@karlfloersch
Copy link
Copy Markdown
Contributor Author

Superseded by #20845 - fixes the root cause

pull Bot pushed a commit to mikeyhodl/optimism that referenced this pull request May 19, 2026
…mism#20845)

* refactor(safedb): move L1AtSafeHead lookup into SafeDB

The walkback that resolves "earliest L1 at which an L2 block became safe"
previously lived in op-supernode/virtual_node and went through the
SafeHeadAtL1 point-query interface, requiring repeated SeekLT lookups and
a special case for the earliest recorded entry (the cursorL2 == target
exact-BlockID branch). That special case is unreachable from callers that
only know the target L2 number, which is why FirstProvableSafeHeadNumber
in ethereum-optimism#20833 has to advance the target by +1.

Push the lookup into SafeDB itself: it iterates with a single Pebble
cursor (Last + Prev) and returns the first entry meeting target directly.
SafeDB only writes entries when the deriver actually advances the safe
head, so an entry's L1 is the canonical L1 at which that L2 became safe;
the new method can therefore answer target == firstL2 without any +1
gymnastics. The two error semantics live in the safedb package now:

- ErrL1AtSafeHeadNotFound (transient: empty DB or target > latestL2)
- ErrL1AtSafeHeadUnavailable (permanent: target < firstL2, predates records)

simpleVirtualNode.L1AtSafeHead now delegates to db.L1AtSafeHead and keeps
only the rollup-genesis special case (which SafeDB can't know about).

Replaces the walkback in ethereum-optimism#20833 / ethereum-optimism#20581 with a single iterator pass.

* trim comments

* use decodeEntry in SafeHeadAtL1
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.

1 participant