Skip to main content

CastValidationRoundFloor

Trait CastValidationRoundFloor 

Source
pub trait CastValidationRoundFloor:
    LockRoundMonotone
    + ProposalGate
    + ConfirmationOnlyInCurrentRound
    + VoteRoundBelowCurrentRound
    + CurrentRoundMonotone
    + RoundFloor { }
Expand description

Invariant (Cast validation rounds leave a floor). If a correct validator has ever cast a validation vote in round s during an instance, then from that moment on

max(validated_vote.round, lock round) ≥ s

where an absent field contributes .

This is the invariant that survives create_final_vote clearing validated_vote, and it is what makes OneValidationVotePerRound hold over a whole instance rather than only between confirmations.

Proof. Induction over the transitions of the instance.

Base. Immediately after the vote, validated_vote is Some(_, s) — the non-fast branch of create_vote ends with self.validated_vote.get_mut().insert(vote).

Step. Only two transitions can lower either side of the maximum. The lock round is non-decreasing by LockRoundMonotone, so only validated_vote can fall, and by the writer table it is set to None in exactly two places:

Implementors§