-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathinput.rs
44 lines (33 loc) · 1.16 KB
/
input.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use derive_where::derive_where;
use malachitebft_core_types::{
CommitCertificate, Context, Round, SignedProposal, SignedVote, Timeout, ValueOrigin, VoteSet,
};
use crate::types::ProposedValue;
use crate::ValueToPropose;
pub type RequestId = String;
/// Inputs to be handled by the consensus process.
#[derive_where(Clone, Debug, PartialEq, Eq)]
pub enum Input<Ctx>
where
Ctx: Context,
{
/// Start a new height with the given validator set
StartHeight(Ctx::Height, Ctx::ValidatorSet),
/// Process a vote
Vote(SignedVote<Ctx>),
/// Process a proposal
Proposal(SignedProposal<Ctx>),
/// Propose a value
Propose(ValueToPropose<Ctx>),
/// A timeout has elapsed
TimeoutElapsed(Timeout),
/// Received the full proposed value corresponding to a proposal.
/// The origin denotes whether the value was received via consensus or Sync.
ProposedValue(ProposedValue<Ctx>, ValueOrigin),
/// Received a commit certificate from Sync
CommitCertificate(CommitCertificate<Ctx>),
/// Peer needs vote set
VoteSetRequest(RequestId, Ctx::Height, Round),
/// Vote set to be sent to peer
VoteSetResponse(VoteSet<Ctx>),
}