Linear Leios Trace Verifier
An
Action provides input to the relational semantics
A
TestTrace is a list of actions togther with channels
related to the other functionalities
NOTE: this goes backwards, from the current state to the initial state
Error handling
Errors that occur when verifying a stepIdeally an
Err-InputMismatch/Err-Unsupported
would carry ¬ ValidStep (σ , i) s. That is however not
provable here: the transition’s input index is toRcvType i,
and toRcvType routes through the channel-selection
app, an opaque record projection Agda cannot invert. So we
instead witness the mismatch at the level of the input-channel
selector: every transition rule reads one specific input
constructor, and an action/input pairing is rejected exactly when the
constructor supplied differs from the one the action’s rule consumes.
Errors when verifying a trace
Reusable witnesses for the mismatching input families (payloads are irrelevant):
Error handling
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879iErr-verifyStep {i} {s} .errorMsg {EB-Role-Action _ _} (Err-Slot _) = printf "%u : Err-Slot / EB-Role-Action" (LeiosState.slot s)iErr-verifyStep {i} {s} .errorMsg {VT-Role-Action _ _ _} (Err-Slot _) = printf "%u : Err-Slot / VT-Role-Action" (LeiosState.slot s)iErr-verifyStep {i} {s} .errorMsg {Ftch-Action _} (Err-Slot _) = printf "%u : Err-Slot / Ftch-Action" (LeiosState.slot s)iErr-verifyStep {i} {s} .errorMsg {Slot₁-Action _} (Err-Slot _) = printf "%u : Err-Slot / Slot₁-Action" (LeiosState.slot s)iErr-verifyStep {i} {s} .errorMsg {Slot₂-Action _} (Err-Slot _) = printf "%u : Err-Slot / Slot₂-Action" (LeiosState.slot s)iErr-verifyStep {i} {s} .errorMsg {Base₁-Action _} (Err-Slot _) = printf "%u : Err-Slot / Base₁-Action" (LeiosState.slot s)iErr-verifyStep {i} {s} .errorMsg {Base₂-Action _} (Err-Slot _) = printf "%u : Err-Slot / Base₂-Action" (LeiosState.slot s)iErr-verifyStep {i} {s} .errorMsg {No-EB-Role-Action _} (Err-Slot _) = printf "%u : Err-Slot / No-EB-Role-Action" (LeiosState.slot s)iErr-verifyStep {i} {s} .errorMsg {No-VT-Role-Action _} (Err-Slot _) = printf "%u : Err-Slot / No-VT-Role-Action" (LeiosState.slot s)iErr-verifyStep {i} {s} .errorMsg (Err-EB-Role-premises _) = printf "%u : Err-EB-Role-premises" (LeiosState.slot s)iErr-verifyStep {i} {s} .errorMsg (Err-BaseUpkeep _) = printf "%u : Err-BaseUpkeep" (LeiosState.slot s)iErr-verifyStep {i} {s} .errorMsg (Err-Roles₂-premises _) = printf "%u : Err-Roles₂-premises: no applicable role step to skip" (LeiosState.slot s)iErr-verifyStep {i} {s} .errorMsg {a} (Err-InputMismatch _) = printf "%u : Err-InputMismatch: input channel does not match action %s" (LeiosState.slot s) (actionName a)iErr-verifyStep {i} {s} .errorMsg {a} (Err-Unsupported _) = printf "%u : Err-Unsupported: IO pattern of action %s not modelled" (LeiosState.slot s) (actionName a)iErr-verifyStep {i} {s} .errorMsg (Err-VT-Role-premises {eb = eb} {ebHash = ebHash} {slot' = slot'} _)... | no ¬p = printf "%u : Err-VT-Role-premises: Current EB hash does not match" (LeiosState.slot s)... | no ¬p = printf "%u : Err-VT-Role-premises: Hashes mismatch, ebHash=%s" (LeiosState.slot s) (show ebHash)... | no ¬p = printf "%u : Err-VT-Role-premises: ¬ (slot' ≤ slotNumber eb + Lhdr)" (LeiosState.slot s)... | no ¬p = printf "%u : Err-VT-Role-premises: ¬ (slotNumber eb + 3 * Lhdr ≤ (LeiosState.slot s))" (LeiosState.slot s)... | no ¬p = printf "%u : Err-VT-Role-premises: ¬ ((LeiosState.slot s) ≤ slotNumber eb + 3 * Lhdr + Lvote)" (LeiosState.slot s)... | no ¬p = printf "%u : Err-VT-Role-premises: EB validation not completed (isValidityChecked)" (LeiosState.slot s)... | no ¬p = printf "%u : Err-VT-Role-premises: No registered voting key (keyless committee seat)" (LeiosState.slot s)