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 stepErr-InputMismatch carries the real refutation
¬ ValidStep (σ , i) s. Deriving it requires inverting the
transition’s input index toRcvType i, whose channel
selections are opaque in categorical-crypto; the lemmas
below therefore sit in an opaque unfolding _⊗₀_ block,
where the selections reduce to constructor form and Agda can dismiss the
impossible transition rules. The refutation is mediated by the
input-channel selector: input-sound proves that
every derivable step consumes the input constructor its action’s rule
expects, so a selector mismatch refutes the step.
Ftch rule reads its input through an
output-typed channel selection, which nevertheless coincides with
toRcvType (inj₂ (inj₂ FetchLdgI)) once the selections
reduce; Ftch-step witnesses this inside the unfolding
block, letting verifyStep' accept the pairing.
Errors when verifying a trace
Reusable witnesses for the mismatching input families:
Error handling
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778iErr-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-Base₂-premises _) = printf "%u : Err-Base₂-premises: Base upkeep spent, or EB role not yet settled" (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 (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)