pub struct Pacemaker {
pub view_deadline: Instant,
/* private fields */
}Expand description
Full pacemaker with exponential backoff and TC relay
Fields§
§view_deadline: InstantImplementations§
Source§impl Pacemaker
impl Pacemaker
pub fn new() -> Self
Sourcepub fn reset_timer(&mut self)
pub fn reset_timer(&mut self)
Reset timer with current backoff-adjusted timeout
Sourcepub fn reset_on_progress(&mut self)
pub fn reset_on_progress(&mut self)
Reset timer after successful view completion (resets backoff)
Sourcepub fn on_timeout(&mut self)
pub fn on_timeout(&mut self)
Increase timeout with exponential backoff after a timeout event
pub fn sleep_until_deadline(&self) -> Sleep
pub fn current_timeout(&self) -> Duration
pub fn consecutive_timeouts(&self) -> u32
Sourcepub fn build_wish(
&self,
current_view: ViewNumber,
validator_id: ValidatorId,
highest_qc: Option<QuorumCertificate>,
signer: &dyn Signer,
) -> ConsensusMessage
pub fn build_wish( &self, current_view: ViewNumber, validator_id: ValidatorId, highest_qc: Option<QuorumCertificate>, signer: &dyn Signer, ) -> ConsensusMessage
Build the Wish message for timeout
Sourcepub fn add_wish(
&mut self,
vs: &ValidatorSet,
target_view: ViewNumber,
validator: ValidatorId,
highest_qc: Option<QuorumCertificate>,
signature: Signature,
) -> Option<TimeoutCertificate>
pub fn add_wish( &mut self, vs: &ValidatorSet, target_view: ViewNumber, validator: ValidatorId, highest_qc: Option<QuorumCertificate>, signature: Signature, ) -> Option<TimeoutCertificate>
Add a wish and check if we have 2f+1 to form a TC
Sourcepub fn should_relay_tc(&mut self, tc: &TimeoutCertificate) -> bool
pub fn should_relay_tc(&mut self, tc: &TimeoutCertificate) -> bool
Check if we should relay a received TC (returns true if not yet relayed)
pub fn clear_view(&mut self, view: ViewNumber)
Sourcepub fn prune_before(&mut self, min_view: ViewNumber)
pub fn prune_before(&mut self, min_view: ViewNumber)
Prune old relay tracking data
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Pacemaker
impl RefUnwindSafe for Pacemaker
impl Send for Pacemaker
impl Sync for Pacemaker
impl Unpin for Pacemaker
impl UnsafeUnpin for Pacemaker
impl UnwindSafe for Pacemaker
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