pub struct Nudge {
pub chain_id: ChainID,
pub view: ViewNumber,
pub justify: PhaseCertificate,
}Expand description
Message broadcasted by a leader in view to “nudge” other validators to participate in the voting
phase after justify.phase in order to make progress in committing a validator-set-updating
block in the block tree identified by chain_id.
§Permissible variants of justify.phase
nudge.justify.phase must be Prepare, Precommit, or Commit. This invariant is enforced in
two places:
- When a validator creates a
Nudgeusingnew. - When a replica receives a
Nudgeand checks thesafe_nudgepredicate.
Fields§
§chain_id: ChainIDChainID of the block tree that justify.block is part of.
view: ViewNumberCurrent ViewNumber of the proposer that created this
Nudge.
justify: PhaseCertificatePhaseVotes for this Nudge should be for the Phase immediately after justify.phase. E.g.,
if justify.phase == Precommit, then phase_vote.phase should be Commit.
Implementations§
source§impl Nudge
impl Nudge
sourcepub fn new(
chain_id: ChainID,
view: ViewNumber,
justify: PhaseCertificate,
) -> Self
pub fn new( chain_id: ChainID, view: ViewNumber, justify: PhaseCertificate, ) -> Self
Create a new Nudge message containing the given chain_id, view, and justify-ing PC.
§Panics
justify.phase must be Prepare or Precommit. This function panics otherwise.
Trait Implementations§
source§impl BorshDeserialize for Nudge
impl BorshDeserialize for Nudge
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self, Error>
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Auto Trait Implementations§
impl Freeze for Nudge
impl RefUnwindSafe for Nudge
impl Send for Nudge
impl Sync for Nudge
impl Unpin for Nudge
impl UnwindSafe for Nudge
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)