Skip to main content

Module verifier

Module verifier 

Source
Expand description

Off-trader verifier that proves a run file’s integrity before the trader opens it.

See README.md “Storage backend” and “Determinism contract” sections for the SPEC posture: redb 4.x does not framewise-checksum data pages, so a zero-tail corruption opens cleanly and panics on first read. The verifier therefore exercises every entry and every stored index pair, accumulating findings so a single run produces one actionable report rather than failing fast on the first hit. The supervisor runs the verifier in an isolated process so a bad file aborts the verifier, not trading.

Scope:

  • Walk every seq over [1, high_watermark] and recompute crate::EntryHash.
  • Detect gaps in the seq sequence (the SPEC’s gap-detection idempotency primitive).
  • Validate that every client_order_id and venue_order_id stored target seq still resolves to a clean entry; full payload-derived rebuild is deferred until the wrapper-type encoders land.
  • Validate manifest invariants: high_watermark matches the durable last seq, the recorded start_ts_init and end_ts_init bracket the entry stream, and a sealed manifest’s status is a terminal state.

The library API stays narrow: a single Verifier type that owns a backend, a VerifyReport structured for downstream operator tooling, and a VerifyError reserved for failures that prevent the verifier from producing any report at all.

Structs§

GapRange
An inclusive [from, to] range of missing seqs.
Verifier
Verifier over a single open run.
VerifyReport
The structured report produced by Verifier::verify.

Enums§

IndexDrift
The kind of drift observed for a sidecar index key.
ManifestField
A manifest field flagged by VerifyFinding::ManifestMismatch.
VerifyError
Errors that prevent the verifier from producing a report at all.
VerifyFinding
One actionable integrity finding from a verifier run.