Skip to content

kona-node,safedb,perf: persist safe-head updates once per L1 block #23480

Open

Description

@einar-oplabs

Part of ethereum-optimism/protocol-team#442 (long-term Kona improvements).

Timing

This is a long-term optimization, not a completion requirement for the current SafeDB integration (#23473).

Scope

Supersedes #23112 — op-node: write the safe-head DB once per L1 block, not per safe head for the ongoing Kona-only optimization. Carry forward the design from that proposal and superseded #22528: persist the SafeDB update once per L1 block after derivation moves past it, instead of persisting every safe-head advance at the same L1 key.

Design this for kona-node only; op-node is not changed. Preserve existing RPC answers and these constraints:

  • Queries must see pending, not-yet-persisted updates: superroot_atTimestamp expects history for every block at or below local-safe.
  • Finalized must never advance beyond the database on disk. Buffering writes must preserve persistence-before-finalization ordering.
  • Resets, shutdowns, restarts, and write failures must not leave pending updates silently lost or serve inconsistent history.

Gap detection and interval-based storage are tracked separately in #23659. This issue changes write frequency, not how missing coverage is represented. Coordinate the designs if combined; neither optimization requires the other.

Done and testing

  • The buffering, flush boundary, query visibility, and finalization ordering are designed and agreed with the Kona owners.
  • Multiple safe-head advances at one L1 block result in one persistence operation when derivation passes that block, with identical RPC answers.
  • Unit tests cover pending-read visibility, flush timing, persistence-before-finalization, resets, shutdown/restart behavior, and write failures using injected storage.
  • Acceptance coverage verifies complete-history parity with op-node across steady derivation, reset/reorg, and restart.

Related: #23659 (gap detection), #23658 (resume-from-tip recovery), #23473 (current integration).

Status — 2026-10-29

The current integration passed its 24-hour persistence soak and #23479 is closed. Final evidence. The deployed merged build was validated as-is; this does not implement buffered writes or once-per-L1 persistence. This issue remains open as deferred long-term work under ethereum-optimism/protocol-team#442; none of its implementation checkboxes are completed by the soak.

Activity

  1. self-assigned this
    on Oct 16, 2026
  2. einar-oplabs commented on Oct 22, 2026

    @einar-oplabs
    ContributorAuthor

    Design context: the January discussion of a first-class derivation record, including recording every L1 block so gaps are observable and the DerivationDB name, is on Notion: https://app.notion.com/p/oplabs/Derivation-Persistence-SafeDB-2e8f153ee16280548875e0e628b85d94

  3. changed the title [-]kona-safedb,op-node: write once per L1 block and gap detection[/-] [+]kona-safedb: write once per L1 block and gap detection[/+] on Oct 22, 2026
  4. changed the title [-]kona-safedb: write once per L1 block and gap detection[/-] [+]kona-safedb: persist safe-head updates once per L1 block[/+] on Oct 26, 2026
  5. changed the title [-]kona-safedb: persist safe-head updates once per L1 block[/-] [+]kona-node,safedb,perf: persist safe-head updates once per L1 block[/+] on Oct 26, 2026
  6. sebastianst commented on Nov 4, 2026

    @sebastianst
    Member

    🤖 Claude Opus 5.5 says: Two findings from the shelved op-node prototype for #23112 that may help the kona design:

    • Flush points. Keep the pending entry in memory, where queries can see it. Write it when a safe head arrives for a different L1 block, when derivation is idle at the L1 head, before a reset truncates the database, and on close.
    • Finalization ordering. Flushing before every forkchoice update undid the batching on the derive path. Only a forkchoice update that moves finalized has to flush first: after a restart, derivation re-derives an unwritten safe head above finalized, but never one below it, so that one would leave a permanent gap.
  7. removed their assignment
    on Nov 13, 2026
  8. einar-oplabs commented on Nov 13, 2026

    @einar-oplabs
    ContributorAuthor

    This is a long-term goal. Unassigning for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions