pub trait TimeoutVoteConditions { }Expand description
Lemma (Timeout vote conditions). A correct validator signs a
Timeout vote in round r only if, at that moment:
requals itsChainManager::current_round;- its
round_timeoutisSome(t)withlocal_time ≥ t; - it has not already signed a timeout vote in round
r;
and the value it signs is Timeout::new(chain_id, height, epoch) for the chain’s pending
height and current epoch.
Code correspondence.
| transition | ChainManager::create_timeout_vote |
| reads | current_round, round_timeout, timeout_vote |
| writes | timeout_vote |
| precondition | height equals ChainTipState::next_block_height, checked by the caller ChainWorkerState::vote_for_leader_timeout |
Proof. Direct reading of ChainManager::create_timeout_vote: it returns Ok(false)
without a key pair, then ensure!(round == self.current_round()), then
let Some(round_timeout) = *self.round_timeout.get() else { return Err(RoundDoesNotTimeOut) },
then ensure!(local_time >= round_timeout), then returns Ok(false) if
timeout_vote.round == round. Only after all four does it construct the vote. ∎