hotstuff_rs::hotstuff::implementation

Enum ProposalStatus

source
pub enum ProposalStatus {
    WaitingForProposal,
    OneLeaderProposed {
        leader: VerifyingKey,
    },
    AllLeadersProposed,
}
Expand description

Keeps track of the set of Proposals 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

§

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

source

fn has_one_leader_proposed(&self, leader: &VerifyingKey) -> bool

Has this leader already proposed/nudged in the current view?

source

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.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V