pub struct ConsensusState {
pub validator_id: ValidatorId,
pub validator_set: ValidatorSet,
pub current_view: ViewNumber,
pub role: ViewRole,
pub step: ViewStep,
pub locked_qc: Option<QuorumCertificate>,
pub highest_double_cert: Option<DoubleCertificate>,
pub highest_qc: Option<QuorumCertificate>,
pub last_committed_height: Height,
}Expand description
Mutable consensus state for a single validator
Fields§
§validator_id: ValidatorId§validator_set: ValidatorSet§current_view: ViewNumber§role: ViewRole§step: ViewStep§locked_qc: Option<QuorumCertificate>§highest_double_cert: Option<DoubleCertificate>§highest_qc: Option<QuorumCertificate>§last_committed_height: HeightImplementations§
Source§impl ConsensusState
impl ConsensusState
pub fn new(validator_id: ValidatorId, validator_set: ValidatorSet) -> Self
pub fn is_leader(&self) -> bool
pub fn update_highest_qc(&mut self, qc: &QuorumCertificate)
pub fn update_locked_qc(&mut self, qc: &QuorumCertificate)
Auto Trait Implementations§
impl Freeze for ConsensusState
impl RefUnwindSafe for ConsensusState
impl Send for ConsensusState
impl Sync for ConsensusState
impl Unpin for ConsensusState
impl UnsafeUnpin for ConsensusState
impl UnwindSafe for ConsensusState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more