Invariants / DC-CONS-21

DC-CONS-21

DC derived enforced

Snapshot encode/decode round-trip equivalence: for any reachable (LedgerState, PraosChainDepState), decode(encode(state)) yields a state whose ade_ledger::fingerprint::fingerprint matches the original's. Encoder is canonical (BTreeMap iteration, no HashMap, no floats, no wall-clock); encoded bytes start with a closed version tag and embed the source state's fingerprint for decode- side cross-check.

Source

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

Enforcement trace

Tests 5

  • snapshot::framing::tests::snapshot_round_trip
  • snapshot::framing::tests::round_trip_via_fingerprint_combined
  • snapshot::ledger::tests::encode_then_decode_roundtrips_via_fingerprint
  • rollback::persistent_cache::tests::persistent_cache_capture_then_nearest_le_round_trips
  • rollback::persistent_cache::tests::persistent_cache_matches_in_memory_cache_semantics

Cross-references

Strengthened in