Expand description
Responder-side commitment builder + rotation state.
Phase 2b of the v12 storage-bound audit design. Builds, signs, and
caches a StorageCommitment over the responder’s currently-stored
key set; serves audit lookups by expected_commitment_hash; retains
recently-gossiped commitments for a bounded TTL window (with a slot
backstop) so an audit pinned to a still-answerable commitment does not
false-fail across rotations.
Rotation strategy:
rotate(new_built)atomically replacescurrentwithnew_builtand demotes the priorcurrenttoprevious. The priorpreviousis dropped.lookup(hash)reads the in-memory map and returns anArcto the matchingBuiltCommitment, keeping it alive for the audit response regardless of subsequent rotation (mirrors theArcSwapsemantics specified in v6 §2: an in-flight reader holding itsArcis unaffected by a concurrent rotate).
Retention is persisted across restart (ADR-0004 A1): ResponderCommitmentState::snapshot
captures the signed commitments + their key sets + gossip stamps, and
ResponderCommitmentState::restore reloads them and rebuilds each tree from
its persisted key set — so an honest restarted node can answer every pin that
is still inside its answerability window, and an unanswerable pin is provable
misbehaviour rather than an honest crash-restart. Trees are otherwise rebuilt
from LmdbStorage at the next rotation tick. Memory cost is bounded by
2 × (key_count × ~64 bytes + signature_size) — for 10k keys, ~1.3 MB.
Structs§
- Built
Commitment - A fully-built commitment: signed wire blob, cached hash, Merkle tree
for inclusion proofs, and a sorted leaf-index lookup for the auditor’s
leaf_indexfield. - Peer
Commitment Record - Auditor-side per-peer commitment state.
- Persisted
Retention - The persisted responder retention. Slots are newest-first;
has_currentsays whetherslots[0]was the live advertised commitment. - Responder
Commitment State - Responder retention state (ADR-0002).