Skip to main content

LeaderEligibility

Trait LeaderEligibility 

Source
pub trait LeaderEligibility { }
Expand description

Lemma (Leader eligibility). In a SingleLeader or Validator round, exactly one owner may propose, namely ChainManager::round_leader(round); in a MultiLeader round any chain owner may (or anyone, when open_multi_leader_rounds); in Round::Fast only a super owner may. A super owner may additionally propose in any non-Validator round.

The leader of round n is drawn by seeding a ChaCha8Rng with u64::from(n).rotate_left(32) + seed and sampling the stake-weighted WeightedAliasIndex built from the owners — or, for a Validator round, from fallback_owners, which ChainManager::reset populates with the committee’s account keys and weights. The seed is the block height, so the leader schedule is fixed per instance and identical at every correct validator.

Proof. ChainManager::can_propose returns !round.is_validator() for a super owner, and otherwise dispatches: false for Round::Fast, ownership.can_propose_in_multi_leader_round(owner) for MultiLeader, and self.round_leader(round) == Some(owner) for the other two. It is enforced at the entry point: ChainWorkerState::try_handle_block_proposal rejects a proposal with WorkerError::InvalidOwner unless chain.manager.can_propose(&owner, proposal.content.round), where owner is recovered from the proposal’s signature. The leader computation is the private compute_round_leader / round_leader_index pair. ∎

Implementors§