Invariants / DC-CONS-22

DC-CONS-22

DC derived enforced

Replay-forward correctness: given state_at_slot_S and the ordered block sequence blocks(S+1..=T) from ChainDb, the replay-forward driver yields a state whose fingerprint matches the state that would result from applying those blocks via apply_block_with_verdicts in normal forward operation. Snapshot+ replay-forward is a pure cache for direct-apply; never an authoritative side path. Replay-forward MUST honor the unique epoch-boundary authority for any range crossing one (¬P-9).

Source

docs/planning/ledger-snapshot-rollback-invariants.md §1 (I-3, I-4)

Cluster
PHASE4-N-I
Authority surface
rollback materialization replay-forward fold

Enforcement trace

Tests 4

  • materialize_with_snapshot_at_target_returns_snapshot_state
  • materialize_with_snapshot_below_target_replays_forward
  • materialize_replay_forward_equals_direct_apply
  • materialize_fails_closed_on_invalid_block

Cross-references

Strengthened in

Evidence

  • The core test materialize_replay_forward_equals_direct_apply proves DC-CONS-22: direct-apply state at T and snapshot@S + replay-forward to T have byte-identical ade_ledger fingerprints. Snapshotting is a pure cache.

  • Epoch boundary handling is inherited from apply_block_with_verdicts (rules.rs:244-250) which calls detect_epoch_transition + apply_epoch_boundary_full before block application. No duplicate epoch-transition path in materialize.

  • N-J restart-safety: PersistentSnapshotCache lets replay-forward bootstrap from a persisted snapshot after restart while preserving DC-CONS-22's byte-identical-fingerprint contract (cross-impl test persistent_cache_matches_in_memory_cache_semantics).