Repository navigation
Description
Part of #23473.
Scope
Write the local-safe head into kona-safedb when the engine confirms it, keyed by the L1 block the derivation pipeline was at when the attributes were confirmed. Record the pipeline's origin at confirmation time, not the block's own l1_origin: a span batch can place a block's origin well before the L1 block whose data completed its derivation.
Truncate the database:
- on pipeline reset, to the resume point, re-recording the reset head there (
safe_head_resetsemantics); - at EL-sync completion, to the head derivation resumes from, and resume derivation from the safedb tip when it is older than the EL's safe head (parity with fix(op-node): preserve safedb across EL-sync restarts #21111).
Failure policy: writes fail fast and stop the actor immediately; finalization is queued only after successful recording. No write retries are implemented (#23583).
Starting point
The closed PR #22514 implemented this against the derivation actor and has a fixture where the pipeline origin and the block's l1_origin differ. Revive it against today's actors instead of waiting on #22527.
Done
- Writes happen at local-safe promotion with the pipeline origin as the key.
- Both truncation paths are implemented and unit-tested, including a reset that predates all records.
- Fail-fast persistence handling and persistence-before-finalization ordering are implemented and unit-tested (kona-node: record the safe head history into kona-safedb #23583).
- Static SafeDB invariant review passes for the integration with the proposed failed-reset fix in kona-node: stop derivation when pipeline signals fail #23815; merging that fix remains a kona-node,safedb: integrate persistence, RPCs, and proof consumers #23473 gate.
Status evidence: merged #23583 reports 203 SafeDB/service tests passing. Canonical-tip recovery after EL sync is deferred to #23658; the merged implementation clears history when resuming above its tip. A subsequent full-integration review found a failed-reset error-swallowing bug. #23815 resolves it; the static review passes with that proposed fix, which is not yet merged.
Status — 2026-10-29
24-hour soak passed on 2026-10-29: 7,454/7,454 SafeDB queries matched op-node: 7,422 consecutive queries across L1 12,014,303–12,021,724 plus 32 older queries, with zero RPC errors/mismatches and all 5,758 prior answers unchanged. The upper bound was safe on both nodes at 19:51:48 UTC, beyond the 19:50:49 UTC soak endpoint. Kona retained its original PVC and had zero container restarts after the controlled pod recreation. Final evidence.
This adds live persistence/restart evidence to merged #23583. The later static review and failed-reset fix are tracked in #23815/#23473. The soak does not establish canonical-tip EL-sync recovery; #23658 remains deferred.
Review update — 2026-10-30
#23815 propagates failed pipeline signals before reset acknowledgment, head adoption, or payload submission. The actor regressions and new two-actor supervisor/RPC shutdown regressions fail without the fix and pass with it; all 252 service tests, targeted clippy, and pinned-nightly formatting pass locally. Rust and SafeDB reviews have no findings. All 121 checks now pass for the added shutdown-test commit 55202491e4. This does not complete the parent's combined merged-integration gate.
Activity