Invariants / DC-STORE-07

DC-STORE-07

DC derived enforced

Snapshot cadence determinism: the decision to take a snapshot at slot S is a pure function of (slot, block_no, cadence_params, last_snapshot). Same canonical input chain history produces the same set of snapshot slot keys. Cadence is BLUE-structural; not operator-tunable in this cluster (operator-tunable cadence is out of scope until represented as anchored, replay-derivable runtime data).

Source

docs/planning/ledger-snapshot-rollback-invariants.md §1 (I-8)

Cluster
PHASE4-N-I
Authority surface
snapshot cadence decision + in-memory cache

Enforcement trace

Tests 7

  • should_snapshot_after_block_every_n_returns_true_at_cadence
  • should_snapshot_after_block_returns_false_off_cadence
  • should_snapshot_after_block_returns_false_when_already_at_or_after_slot
  • should_snapshot_after_block_is_pure
  • snapshot_cadence_default_is_100_blocks
  • in_memory_snapshot_cache_nearest_le_returns_largest_key
  • in_memory_snapshot_cache_iteration_is_btreemap_ordered

Cross-references

Evidence

  • should_snapshot_after_block_is_pure replays inputs and asserts identical outputs across two runs.

  • CI gate ci_check_snapshot_cadence_purity.sh enforces that SnapshotCadence has exactly one field (every_n_blocks) — no operator-tunable runtime input.

  • InMemorySnapshotCache uses BTreeMap iteration only (no HashMap); iteration test pins ordering.