pub enum ConsensusEvent<V, A> {
Gossip(NetworkMessage<V, A>),
RequestProposal {
height: u64,
round: u32,
},
Decision {
height: u64,
round: u32,
value: V,
},
Error(Error),
}Expand description
Events that the consensus engine emits for the application to handle.
These events represent the output of the consensus engine and tell the application what actions it needs to take.
Variants§
Gossip(NetworkMessage<V, A>)
The consensus wants this message to be gossiped to peers.
The application should send this message to all peers in the network.
RequestProposal
The consensus needs the app to build and inject a proposal.
The application should create a proposal for the given height and round, then submit it to the consensus engine.
Decision
The consensus has reached a decision and committed a block.
This event indicates that consensus has been reached for the given height and the value should be committed to the blockchain.
Error(Error)
An internal error occurred in consensus.
The application should handle this error appropriately, possibly by logging it or taking corrective action.