In progress
Trace Verifier for Cardano Mini-Protocols
A sound and complete trace verifier, developed in Agda, for checking Cardano network logs against formal specifications of the mini-protocols.
Problem
Formal models describe what the mini-protocols should do. Running nodes produce logs of what they actually did. A verifier that checks logs against the specifications connects the two, so that protocol violations in real or test-network runs can be found mechanically rather than by reading logs.
Approach
The verifier is developed in Agda, building on the Cardano network model and csp-ptree-agda. The aim is a verifier that is sound and complete with respect to the session specifications: it accepts a log exactly when the log is permitted by the specification.
- Raw node logs are normalised into per-session mini-protocol traces.
- Two executables check those traces against first-order session specifications, which are linked to the process-tree models through protocol-specific bridges.
- Supported protocols include ChainSync, BlockFetch, TxSubmission2, LeiosNotify and LeiosFetch, in local, interleaved and paired modes. Paired mode checks communication consistency between the two endpoints of a connection.
Scope
The verifier accepts prefixes, including sessions unfinished at the end of a log. An accepted prefix shows that the observed behaviour is consistent with the specification. It is not evidence that every message was delivered or that a session completed. Wire formats and constants are pinned to stated revisions of the implementation.