Skip to main content

ConsensusMsg

Type Alias ConsensusMsg 

Source
pub type ConsensusMsg<Ctx> = Msg<Ctx>;

Aliased Type§

pub enum ConsensusMsg<Ctx> {
    StartHeight(<Ctx as Context>::Height, HeightParams<Ctx>),
    NetworkEvent(NetworkEvent<Ctx>),
    TimeoutElapsed(TimeoutElapsed<Timeout>),
    ProposeValue(LocallyProposedValue<Ctx>),
    ReceivedProposedValue(ProposedValue<Ctx>, ValueOrigin),
    ProcessSyncResponse(ValueResponse<Ctx>),
    RestartHeight(<Ctx as Context>::Height, HeightParams<Ctx>),
    DumpState(RpcReplyPort<Option<StateDump<Ctx>>>),
}

Variants§

§

StartHeight(<Ctx as Context>::Height, HeightParams<Ctx>)

Start consensus for the given height and provided parameters.

§

NetworkEvent(NetworkEvent<Ctx>)

Received an event from the gossip layer

§

TimeoutElapsed(TimeoutElapsed<Timeout>)

A timeout has elapsed

§

ProposeValue(LocallyProposedValue<Ctx>)

The proposal builder has built a value and can be used in a new proposal consensus message

§

ReceivedProposedValue(ProposedValue<Ctx>, ValueOrigin)

Received and assembled the full value proposed by a validator

§

ProcessSyncResponse(ValueResponse<Ctx>)

Process a sync response

§

RestartHeight(<Ctx as Context>::Height, HeightParams<Ctx>)

Instructs consensus to restart at a given height with the provided parameters.

On this input consensus resets the Write-Ahead Log.

§Warning

This operation should be used with extreme caution as it can lead to safety violations:

  1. The application must clean all state associated with the height for which commit has failed
  2. Since consensus resets its write-ahead log, the node may equivocate on proposals and votes for the restarted height, potentially violating protocol safety
§

DumpState(RpcReplyPort<Option<StateDump<Ctx>>>)

Request to dump the current consensus state