Skip to main content

Module snapshot_store

Module snapshot_store 

Source
Expand description

Sealed snapshot persistence backed by redb.

Stores full JMT snapshots keyed by sequence_no. The unified tree has a single snapshot stream (no per-subtree keys) — namespace separation is at the leaf-key level inside the snapshot body, matching the unified-tree design in the state-tree crate.

Memory: get and latest_at_most return only the lightweight SnapshotHeader from a dedicated header table. The body lives in a separate table and is only read via SnapshotStore::read_body, which streams to a caller-supplied Write impl.

Staleness (§S.19): the store is policy-free — latest_at_most returns snapshots of any age. Consumer-side staleness gating (e.g., operator bootstrap checking MAX_SNAPSHOT_STALENESS_SECS) is enforced at the boundary, not here.

Structs§

SnapshotHeader
Lightweight metadata for a sealed snapshot — no body allocation.
SnapshotStore
redb-backed store for sealed full-tree snapshots.

Constants§

MAX_SNAPSHOT_BODY_BYTES
256 MiB — upper bound on a valid JMT snapshot body.