pub enum ProposalStatus {
WaitingForProposal,
OneLeaderProposed {
leader: VerifyingKey,
},
AllLeadersProposed,
}
Expand description
Keeps track of the set of Proposal
s that have been received by the HotStuff
struct in the current
view.
Keeping track of ProposalStatus
ensures that a leader can only propose once in a view – any
subsequent proposals will be ignored.
§Persistence
Note that a variable of this type is stored in memory allocated to the program at runtime, rather
than persistent storage. This is because losing the information stored in ProposalStatus
, unlike
losing the information about the highest view the replica has phase-voted in, does lead to safety
violations. In the worst case, it can only enable temporary liveness violations.
Variants§
WaitingForProposal
No proposal or nudge was seen in this view so far. Proposals and nudges from a valid leader (proposer) can be accepted.
OneLeaderProposed
The leader with a given public key has already proposed or nudged. No more proposals or nudges from this leader can be accepted.
Fields
leader: VerifyingKey
AllLeadersProposed
All leaders for the view have proposed or nudged, hence no more proposals or nudges can be accepted in this view.
Implementations§
source§impl ProposalStatus
impl ProposalStatus
sourcefn has_one_leader_proposed(&self, leader: &VerifyingKey) -> bool
fn has_one_leader_proposed(&self, leader: &VerifyingKey) -> bool
Has this leader already proposed/nudged in the current view?
sourcefn have_all_leaders_proposed(&self) -> bool
fn have_all_leaders_proposed(&self) -> bool
Have all (max. 2) leaders already proposed/nudged in this view?
Note: this can evaluate to true only during the validator set update period.