fix(node): pause derivation during block sync#1020
Conversation
Defer first-run L1 cursor initialization until Tendermint has caught up, preventing Rollup log polling from becoming archival during from-zero syncs.\n\nCloses #1019
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughDerivation startup now waits for P2P block synchronization, defers first-run L1 start-height initialization, and resumes derivation and finalization after synchronization. A regression test verifies no L1 polling or cursor persistence during catch-up. ChangesDerivation sync gating
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Derivation
participant NodeSyncStatus
participant L1RPC
participant DerivationDB
Derivation->>NodeSyncStatus: Check WaitSync()
NodeSyncStatus-->>Derivation: catching_up=true
Derivation->>Derivation: defer derivation and finalizer
Derivation->>NodeSyncStatus: Check WaitSync()
NodeSyncStatus-->>Derivation: catching_up=false
Derivation->>L1RPC: read confirmed height and rollup logs
Derivation->>DerivationDB: persist L1 cursor
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Reviewed against the derivation code — approach is sound. Two clarifications + a coverage note:
Suggestions: log the resolved startHeight / trusted L2 boundary (the trust is currently silent); and consider an explicit, resettable trust-height knob covering both from-zero and fell-behind nodes rather than a from-zero-only auto-default. |
Summary
WaitSync()statusWhy
A from-zero full node can encounter an L1
CommitBatchbefore the corresponding L2 blocks arrive over P2P. The local verifier then pins its L1 cursor and retries the sameeth_getLogsrange until it falls outside a non-archive RPC provider's recent-history window.Treating initial P2P catch-up as a pre-derivation lifecycle phase prevents unprocessable Rollup log polling and resolves the fresh start height only when derivation is ready to run.
Validation
make testmake lintmake morphnodecatching_up=true, observed one pause transition and zero new derivationeth_getLogscalls across multiple polling intervals while P2P block sync continuedCloses #1019
Summary by CodeRabbit