Skip to content

"Cockroach" recovery#18

Merged
GCdePaula merged 1 commit into
mainfrom
feature/cockroach-recovery
Jun 30, 2026
Merged

"Cockroach" recovery#18
GCdePaula merged 1 commit into
mainfrom
feature/cockroach-recovery

Conversation

@GCdePaula

Copy link
Copy Markdown
Collaborator

No description provided.

@GCdePaula GCdePaula requested a review from stephenctw June 29, 2026 01:57
@GCdePaula GCdePaula force-pushed the feature/cockroach-recovery branch 2 times, most recently from 37dbd6f to 51f223e Compare June 29, 2026 23:08
@GCdePaula GCdePaula marked this pull request as ready for review June 29, 2026 23:08
Splits the sequencer into a library plus setup/run/flush subcommands, extracts
the accept scheduler into a shared core compiled into both the on-chain canonical
machine and the off-chain sequencer, and adds cockroach recovery — an
operator-driven rebuild of a wiped or diverged DB from a trusted checkpoint plus
L1. Integrates with the existing Lua watchdog.

- Library + commands: `sequencer` is a pure library (binaries in
  examples/wallet-sequencer); `setup` / `run` / `flush-mempool` boot phases with
  classified exit codes for an orchestrator.
- Duality: the off-chain accept-predicate and the canonical fold run the same
  `sequencer-core` scheduler, held in agreement by a differential test (I1).
  Addresses are app data — the core scheduler is address-agnostic; the app owns
  its sequencer addresses.
- Cockroach recovery (`setup --recovery`): flush -> fold -> fill rebuilds
  (S', N') from a checkpoint + L1; the batch tree is anchored at the resume nonce
  N', and the (C, H1] suffix is executed exactly once by `run` (no double-execute,
  no lost deposit). Disjoint-range asserts, fail-loud partial-recovery guards, and
  a deferred gold frontier keep the rebuild sound.
- Keyed-write safety: every L1-signing path (submitter, flush-mempool, both
  recovery flushes) re-verifies the RPC chain id and the key<->submitter identity
  immediately before signing; the long-lived submitter re-checks per send.
  Write-before-broadcast watermark (R1a); observed nonces folded in canonical L1
  order.
- Watchdog: the wallet snapshot (executed state + last_executed_safe_block) is
  served at GET /finalized_state; the Lua watchdog byte-compares it against an
  independent from-genesis cartesi-machine replay.

Verified: workspace unit + integration suite, clippy -D warnings, fmt clean;
canonical guest tests; e2e green (genesis + non-genesis watchdog compares,
cockroach setup -> run round-trip).
@GCdePaula GCdePaula force-pushed the feature/cockroach-recovery branch from 51f223e to 3816539 Compare June 30, 2026 02:37

@stephenctw stephenctw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀🚀🚀

@GCdePaula GCdePaula merged commit 8ce41cf into main Jun 30, 2026
11 of 12 checks passed
@GCdePaula GCdePaula deleted the feature/cockroach-recovery branch June 30, 2026 08:52
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.

2 participants