pub trait LeaderSelection {
    type Block: Block;
    type Error: Error;
    type LeaderId: LeaderId;
    type State: State;
    fn retrieve(state: &Self::State) -> Self;
fn get_leader_at(
        &self,
        date: <Self::Block as Block>::Date
    ) -> Result<Self::LeaderId, Self::Error>; }
Expand description

interface for the leader selection algorithm

this is the interface that is responsible to verify the Block are created by the right Leaders (i.e. that everyone follows the consensus algorithm).

This is also the same interface that is used to detect if we are the leader for the block at the given date.

Associated Types

the block that we will get the information from

Leader Selection error type

Identifier of the leader (e.g. a public key).

Required methods

return the ID of the leader of the blockchain at the given date.

Implementors