Skip to content

feat: finalized ledger chunks, sidecar drainer, and getBlock ChunkBundle serving - #111

Merged
augustin-cheron merged 9 commits into
mainfrom
feat/finalized-ledger-recovery
Dec 2, 2026
Merged

augustin-cheron merged 9 commits into
mainfrom
feat/finalized-ledger-recovery

Conversation

@augustin-cheron

Copy link
Copy Markdown
Collaborator

Summary

  • crates/blockzilla-finalized-chunks: Immutable 4,096-slot finalized chunk format (chunk.bundles.bin, chunk.index.bin, chunk.extras.zst, chunk.counts.zst, chunk.manifest.json), persistent-WAL SQLite chunk catalog, canonical epoch-grid snapping, and constant-RAM streaming Compact V2 epoch compactor.
  • blockzilla/finalized-ledger: Sidecar drain-chunks, compact-epoch, and publish-epoch CLI/daemon with:
    • Per-slot transient BudgetExceeded/timeout retry with exponential backoff.
    • 32 MiB multipart R2 uploads with AbortMultipartUpload cleanup, SHA-256 verification, and startup crash-consistency repair.
    • statvfs free-disk floor, catchup stall watchdog, mid-run validator restart reload, snapshot boundary safety margin (512 slots), parallel restart-gap recovery, and opt-in auto-graduation with graduated.json retry markers.
    • Optional local bulk payload eviction (--evict-local-payloads) and Agave admin.rpc blockstorePurge behind a 512-slot safety tail (--purge-ledger).
  • blockzilla/get-block & resolver:
    • Resolver chunk_archive lookup (R2Bundle locator, LocalBundle verified pread, instant Skipped 404).
    • Admitted ARCHIVE epoch precedence over native ring + O(1) short-circuit for skipped slots in admitted epochs without spawning ledger_compact.
    • Worker Outcome::ChunkBundle streaming for both GET /block/:slot.json and GET /block/:slot.bin via 1 ETag-pinned R2 Range GET.

Live Verification on bz-2 + Cloudflare

  • 141/141 unit tests passed locally + wasm32-unknown-unknown Worker build + Linux tests on bz-2.
  • Live end-to-end verified on https://getblock.blockzilla.dev:
    • CHUNK_BUNDLE .json and .bin (200 OK, 1 S3 GET, 44–80 ms resolver latency vs 3,088 ms on LEDGER_COMPACT).
    • Proven chunk skip (404 / -32004, 0 S3 GETs).
    • Admitted epoch 1102 produced (ARCHIVE) and skipped (404 / -32004, 0 S3 GETs, 0 helper spawns).
    • Live tip (NATIVE_RECENT, 0 S3 GETs).

@augustin-cheron
augustin-cheron merged commit 6ad7a64 into main Dec 2, 2026
6 checks passed
@augustin-cheron
augustin-cheron deleted the feat/finalized-ledger-recovery branch December 2, 2026 22:58
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