cometbft_proto/prost/
cometbft.consensus.v1.rs

1/// NewRoundStep is sent for every step taken in the ConsensusState.
2/// For every height/round/step transition
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct NewRoundStep {
6    #[prost(int64, tag = "1")]
7    pub height: i64,
8    #[prost(int32, tag = "2")]
9    pub round: i32,
10    #[prost(uint32, tag = "3")]
11    pub step: u32,
12    #[prost(int64, tag = "4")]
13    pub seconds_since_start_time: i64,
14    #[prost(int32, tag = "5")]
15    pub last_commit_round: i32,
16}
17/// NewValidBlock is sent when a validator observes a valid block B in some round r,
18/// i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r.
19/// In case the block is also committed, then IsCommit flag is set to true.
20#[allow(clippy::derive_partial_eq_without_eq)]
21#[derive(Clone, PartialEq, ::prost::Message)]
22pub struct NewValidBlock {
23    #[prost(int64, tag = "1")]
24    pub height: i64,
25    #[prost(int32, tag = "2")]
26    pub round: i32,
27    #[prost(message, optional, tag = "3")]
28    pub block_part_set_header: ::core::option::Option<
29        super::super::types::v1::PartSetHeader,
30    >,
31    #[prost(message, optional, tag = "4")]
32    pub block_parts: ::core::option::Option<super::super::libs::bits::v1::BitArray>,
33    #[prost(bool, tag = "5")]
34    pub is_commit: bool,
35}
36/// Proposal is sent when a new block is proposed.
37#[allow(clippy::derive_partial_eq_without_eq)]
38#[derive(Clone, PartialEq, ::prost::Message)]
39pub struct Proposal {
40    #[prost(message, optional, tag = "1")]
41    pub proposal: ::core::option::Option<super::super::types::v1::Proposal>,
42}
43/// ProposalPOL is sent when a previous proposal is re-proposed.
44#[allow(clippy::derive_partial_eq_without_eq)]
45#[derive(Clone, PartialEq, ::prost::Message)]
46pub struct ProposalPol {
47    #[prost(int64, tag = "1")]
48    pub height: i64,
49    #[prost(int32, tag = "2")]
50    pub proposal_pol_round: i32,
51    #[prost(message, optional, tag = "3")]
52    pub proposal_pol: ::core::option::Option<super::super::libs::bits::v1::BitArray>,
53}
54/// BlockPart is sent when gossipping a piece of the proposed block.
55#[allow(clippy::derive_partial_eq_without_eq)]
56#[derive(Clone, PartialEq, ::prost::Message)]
57pub struct BlockPart {
58    #[prost(int64, tag = "1")]
59    pub height: i64,
60    #[prost(int32, tag = "2")]
61    pub round: i32,
62    #[prost(message, optional, tag = "3")]
63    pub part: ::core::option::Option<super::super::types::v1::Part>,
64}
65/// Vote is sent when voting for a proposal (or lack thereof).
66#[allow(clippy::derive_partial_eq_without_eq)]
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct Vote {
69    #[prost(message, optional, tag = "1")]
70    pub vote: ::core::option::Option<super::super::types::v1::Vote>,
71}
72/// HasVote is sent to indicate that a particular vote has been received.
73#[allow(clippy::derive_partial_eq_without_eq)]
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct HasVote {
76    #[prost(int64, tag = "1")]
77    pub height: i64,
78    #[prost(int32, tag = "2")]
79    pub round: i32,
80    #[prost(enumeration = "super::super::types::v1::SignedMsgType", tag = "3")]
81    pub r#type: i32,
82    #[prost(int32, tag = "4")]
83    pub index: i32,
84}
85/// VoteSetMaj23 is sent to indicate that a given BlockID has seen +2/3 votes.
86#[allow(clippy::derive_partial_eq_without_eq)]
87#[derive(Clone, PartialEq, ::prost::Message)]
88pub struct VoteSetMaj23 {
89    #[prost(int64, tag = "1")]
90    pub height: i64,
91    #[prost(int32, tag = "2")]
92    pub round: i32,
93    #[prost(enumeration = "super::super::types::v1::SignedMsgType", tag = "3")]
94    pub r#type: i32,
95    #[prost(message, optional, tag = "4")]
96    pub block_id: ::core::option::Option<super::super::types::v1::BlockId>,
97}
98/// VoteSetBits is sent to communicate the bit-array of votes seen for the BlockID.
99#[allow(clippy::derive_partial_eq_without_eq)]
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct VoteSetBits {
102    #[prost(int64, tag = "1")]
103    pub height: i64,
104    #[prost(int32, tag = "2")]
105    pub round: i32,
106    #[prost(enumeration = "super::super::types::v1::SignedMsgType", tag = "3")]
107    pub r#type: i32,
108    #[prost(message, optional, tag = "4")]
109    pub block_id: ::core::option::Option<super::super::types::v1::BlockId>,
110    #[prost(message, optional, tag = "5")]
111    pub votes: ::core::option::Option<super::super::libs::bits::v1::BitArray>,
112}
113/// HasProposalBlockPart is sent to indicate that a particular proposal block part has been received.
114#[allow(clippy::derive_partial_eq_without_eq)]
115#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct HasProposalBlockPart {
117    #[prost(int64, tag = "1")]
118    pub height: i64,
119    #[prost(int32, tag = "2")]
120    pub round: i32,
121    #[prost(int32, tag = "3")]
122    pub index: i32,
123}
124/// Message is an abstract consensus message.
125#[allow(clippy::derive_partial_eq_without_eq)]
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct Message {
128    /// Sum of all possible messages.
129    #[prost(oneof = "message::Sum", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10")]
130    pub sum: ::core::option::Option<message::Sum>,
131}
132/// Nested message and enum types in `Message`.
133pub mod message {
134    /// Sum of all possible messages.
135    #[allow(clippy::derive_partial_eq_without_eq)]
136    #[derive(Clone, PartialEq, ::prost::Oneof)]
137    pub enum Sum {
138        #[prost(message, tag = "1")]
139        NewRoundStep(super::NewRoundStep),
140        #[prost(message, tag = "2")]
141        NewValidBlock(super::NewValidBlock),
142        #[prost(message, tag = "3")]
143        Proposal(super::Proposal),
144        #[prost(message, tag = "4")]
145        ProposalPol(super::ProposalPol),
146        #[prost(message, tag = "5")]
147        BlockPart(super::BlockPart),
148        #[prost(message, tag = "6")]
149        Vote(super::Vote),
150        #[prost(message, tag = "7")]
151        HasVote(super::HasVote),
152        #[prost(message, tag = "8")]
153        VoteSetMaj23(super::VoteSetMaj23),
154        #[prost(message, tag = "9")]
155        VoteSetBits(super::VoteSetBits),
156        #[prost(message, tag = "10")]
157        HasProposalBlockPart(super::HasProposalBlockPart),
158    }
159}
160/// MsgInfo are msgs from the reactor which may update the state
161#[allow(clippy::derive_partial_eq_without_eq)]
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct MsgInfo {
164    #[prost(message, optional, tag = "1")]
165    pub msg: ::core::option::Option<Message>,
166    #[prost(string, tag = "2")]
167    pub peer_id: ::prost::alloc::string::String,
168}
169/// TimeoutInfo internally generated messages which may update the state
170#[allow(clippy::derive_partial_eq_without_eq)]
171#[derive(Clone, PartialEq, ::prost::Message)]
172pub struct TimeoutInfo {
173    #[prost(message, optional, tag = "1")]
174    pub duration: ::core::option::Option<crate::google::protobuf::Duration>,
175    #[prost(int64, tag = "2")]
176    pub height: i64,
177    #[prost(int32, tag = "3")]
178    pub round: i32,
179    #[prost(uint32, tag = "4")]
180    pub step: u32,
181}
182/// EndHeight marks the end of the given height inside WAL.
183/// @internal used by scripts/wal2json util.
184#[allow(clippy::derive_partial_eq_without_eq)]
185#[derive(Clone, PartialEq, ::prost::Message)]
186pub struct EndHeight {
187    #[prost(int64, tag = "1")]
188    pub height: i64,
189}
190/// WALMessage describes a consensus WAL (Write Ahead Log) entry.
191#[allow(clippy::derive_partial_eq_without_eq)]
192#[derive(Clone, PartialEq, ::prost::Message)]
193pub struct WalMessage {
194    /// Sum of all possible messages.
195    #[prost(oneof = "wal_message::Sum", tags = "1, 2, 3, 4")]
196    pub sum: ::core::option::Option<wal_message::Sum>,
197}
198/// Nested message and enum types in `WALMessage`.
199pub mod wal_message {
200    /// Sum of all possible messages.
201    #[allow(clippy::derive_partial_eq_without_eq)]
202    #[derive(Clone, PartialEq, ::prost::Oneof)]
203    pub enum Sum {
204        #[prost(message, tag = "1")]
205        EventDataRoundState(super::super::super::types::v1::EventDataRoundState),
206        #[prost(message, tag = "2")]
207        MsgInfo(super::MsgInfo),
208        #[prost(message, tag = "3")]
209        TimeoutInfo(super::TimeoutInfo),
210        #[prost(message, tag = "4")]
211        EndHeight(super::EndHeight),
212    }
213}
214/// TimedWALMessage wraps WALMessage and adds Time for debugging purposes.
215#[allow(clippy::derive_partial_eq_without_eq)]
216#[derive(Clone, PartialEq, ::prost::Message)]
217pub struct TimedWalMessage {
218    #[prost(message, optional, tag = "1")]
219    pub time: ::core::option::Option<crate::google::protobuf::Timestamp>,
220    #[prost(message, optional, tag = "2")]
221    pub msg: ::core::option::Option<WalMessage>,
222}