Skip to content

feat(storage): persist and replay durable blocks - #12

Merged
kaikisegfault merged 1 commit into
mainfrom
feat/11-durable-block-replay
Jul 24, 2026
Merged

feat(storage): persist and replay durable blocks#12
kaikisegfault merged 1 commit into
mainfrom
feat/11-durable-block-replay

Conversation

@kaikisegfault

Copy link
Copy Markdown
Owner

Outcome

Implements the first end-to-end durable block path for issue #11:

  • applies ordered raw inputs to an independent ledger candidate;
  • atomically stores changed materialized accounts, exact admitted transaction bytes, receipts, roots, headers, block IDs, and head metadata;
  • publishes only after durable commit with a non-throwing owning-pointer swap;
  • reopens through trusted-genesis validation and full ordered replay;
  • compares every kernel output and the complete materialized head before publication.

Scope and effects

  • Adapter-only operational persistence change.
  • Storage schema version 1 is unchanged.
  • Consensus-visible transaction, receipt, state-root, and block semantics are unchanged.
  • Snapshot recovery, portable archives, commit-phase fault injection, and long repeated-restart sequences remain follow-up issue Persist atomic ledger state and verify crash recovery #11 work.
  • No new wire decoder was added; stored transactions re-enter the existing bounded kernel admission path, while SQLite rows retain exact schema width and count checks.

Verification

Passed on commit 2196e29:

  • PROTOCOL_STACK_PRESET=gcc-debug tools/verify.sh — 16/16
  • ASAN_OPTIONS=detect_leaks=0 PROTOCOL_STACK_PRESET=gcc-sanitizers tools/verify.sh — 16/16
  • PROTOCOL_STACK_PRESET=clang-debug tools/verify.sh — 16/16
  • ASAN_OPTIONS=detect_leaks=0 PROTOCOL_STACK_PRESET=clang-sanitizers tools/verify.sh — 19/19, including three fuzz smoke tests
  • Python bytecode compilation, shell syntax, JSON/TOML/YAML parsing, internal Markdown links, and git diff --check passed.

Leak detection is disabled only because the managed execution sandbox runs under ptrace; ASan and UBSan remain enabled for project code and the SQLite amalgamation.

Refs #11

Apply blocks to an independent ledger candidate, commit materialized state and canonical admitted history atomically, and publish only after durable commit. Reopen now validates trusted genesis, full-replays ordered history, compares every kernel output, and requires exact materialized-head agreement.\n\nStorage schema version 1 and consensus-visible kernel behavior are unchanged.\n\nRefs #11
@kaikisegfault
kaikisegfault merged commit dc6823e into main Jul 24, 2026
4 checks passed
@kaikisegfault
kaikisegfault deleted the feat/11-durable-block-replay branch July 24, 2026 20:28
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.

1 participant