fix(op-supernode): wait for initial EL sync before cold start#20833
Closed
karlfloersch wants to merge 5 commits into
Closed
fix(op-supernode): wait for initial EL sync before cold start#20833karlfloersch wants to merge 5 commits into
karlfloersch wants to merge 5 commits into
Conversation
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
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.
Summary
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=1Stacked on #20823.