neutron_std/types/tendermint/
consensus.rs

1use neutron_std_derive::CosmwasmExt;
2/// NewRoundStep is sent for every step taken in the ConsensusState.
3/// For every height/round/step transition
4#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(
6    Clone,
7    PartialEq,
8    Eq,
9    ::prost::Message,
10    ::serde::Serialize,
11    ::serde::Deserialize,
12    ::schemars::JsonSchema,
13    CosmwasmExt,
14)]
15#[proto_message(type_url = "/tendermint.consensus.NewRoundStep")]
16pub struct NewRoundStep {
17    #[prost(int64, tag = "1")]
18    #[serde(
19        serialize_with = "crate::serde::as_str::serialize",
20        deserialize_with = "crate::serde::as_str::deserialize"
21    )]
22    pub height: i64,
23    #[prost(int32, tag = "2")]
24    #[serde(
25        serialize_with = "crate::serde::as_str::serialize",
26        deserialize_with = "crate::serde::as_str::deserialize"
27    )]
28    pub round: i32,
29    #[prost(uint32, tag = "3")]
30    #[serde(
31        serialize_with = "crate::serde::as_str::serialize",
32        deserialize_with = "crate::serde::as_str::deserialize"
33    )]
34    pub step: u32,
35    #[prost(int64, tag = "4")]
36    #[serde(
37        serialize_with = "crate::serde::as_str::serialize",
38        deserialize_with = "crate::serde::as_str::deserialize"
39    )]
40    pub seconds_since_start_time: i64,
41    #[prost(int32, tag = "5")]
42    #[serde(
43        serialize_with = "crate::serde::as_str::serialize",
44        deserialize_with = "crate::serde::as_str::deserialize"
45    )]
46    pub last_commit_round: i32,
47}
48/// NewValidBlock is sent when a validator observes a valid block B in some round r,
49/// i.e., there is a Proposal for block B and 2/3+ prevotes for the block B in the round r.
50/// In case the block is also committed, then IsCommit flag is set to true.
51#[allow(clippy::derive_partial_eq_without_eq)]
52#[derive(
53    Clone,
54    PartialEq,
55    Eq,
56    ::prost::Message,
57    ::serde::Serialize,
58    ::serde::Deserialize,
59    ::schemars::JsonSchema,
60    CosmwasmExt,
61)]
62#[proto_message(type_url = "/tendermint.consensus.NewValidBlock")]
63pub struct NewValidBlock {
64    #[prost(int64, tag = "1")]
65    #[serde(
66        serialize_with = "crate::serde::as_str::serialize",
67        deserialize_with = "crate::serde::as_str::deserialize"
68    )]
69    pub height: i64,
70    #[prost(int32, tag = "2")]
71    #[serde(
72        serialize_with = "crate::serde::as_str::serialize",
73        deserialize_with = "crate::serde::as_str::deserialize"
74    )]
75    pub round: i32,
76    #[prost(message, optional, tag = "3")]
77    pub block_part_set_header: ::core::option::Option<super::types::PartSetHeader>,
78    #[prost(message, optional, tag = "4")]
79    pub block_parts: ::core::option::Option<super::libs::bits::BitArray>,
80    #[prost(bool, tag = "5")]
81    pub is_commit: bool,
82}
83/// Proposal is sent when a new block is proposed.
84#[allow(clippy::derive_partial_eq_without_eq)]
85#[derive(
86    Clone,
87    PartialEq,
88    Eq,
89    ::prost::Message,
90    ::serde::Serialize,
91    ::serde::Deserialize,
92    ::schemars::JsonSchema,
93    CosmwasmExt,
94)]
95#[proto_message(type_url = "/tendermint.consensus.Proposal")]
96pub struct Proposal {
97    #[prost(message, optional, tag = "1")]
98    pub proposal: ::core::option::Option<super::types::Proposal>,
99}
100/// ProposalPOL is sent when a previous proposal is re-proposed.
101#[allow(clippy::derive_partial_eq_without_eq)]
102#[derive(
103    Clone,
104    PartialEq,
105    Eq,
106    ::prost::Message,
107    ::serde::Serialize,
108    ::serde::Deserialize,
109    ::schemars::JsonSchema,
110    CosmwasmExt,
111)]
112#[proto_message(type_url = "/tendermint.consensus.ProposalPOL")]
113pub struct ProposalPol {
114    #[prost(int64, tag = "1")]
115    #[serde(
116        serialize_with = "crate::serde::as_str::serialize",
117        deserialize_with = "crate::serde::as_str::deserialize"
118    )]
119    pub height: i64,
120    #[prost(int32, tag = "2")]
121    #[serde(
122        serialize_with = "crate::serde::as_str::serialize",
123        deserialize_with = "crate::serde::as_str::deserialize"
124    )]
125    pub proposal_pol_round: i32,
126    #[prost(message, optional, tag = "3")]
127    pub proposal_pol: ::core::option::Option<super::libs::bits::BitArray>,
128}
129/// BlockPart is sent when gossipping a piece of the proposed block.
130#[allow(clippy::derive_partial_eq_without_eq)]
131#[derive(
132    Clone,
133    PartialEq,
134    Eq,
135    ::prost::Message,
136    ::serde::Serialize,
137    ::serde::Deserialize,
138    ::schemars::JsonSchema,
139    CosmwasmExt,
140)]
141#[proto_message(type_url = "/tendermint.consensus.BlockPart")]
142pub struct BlockPart {
143    #[prost(int64, tag = "1")]
144    #[serde(
145        serialize_with = "crate::serde::as_str::serialize",
146        deserialize_with = "crate::serde::as_str::deserialize"
147    )]
148    pub height: i64,
149    #[prost(int32, tag = "2")]
150    #[serde(
151        serialize_with = "crate::serde::as_str::serialize",
152        deserialize_with = "crate::serde::as_str::deserialize"
153    )]
154    pub round: i32,
155    #[prost(message, optional, tag = "3")]
156    pub part: ::core::option::Option<super::types::Part>,
157}
158/// Vote is sent when voting for a proposal (or lack thereof).
159#[allow(clippy::derive_partial_eq_without_eq)]
160#[derive(
161    Clone,
162    PartialEq,
163    Eq,
164    ::prost::Message,
165    ::serde::Serialize,
166    ::serde::Deserialize,
167    ::schemars::JsonSchema,
168    CosmwasmExt,
169)]
170#[proto_message(type_url = "/tendermint.consensus.Vote")]
171pub struct Vote {
172    #[prost(message, optional, tag = "1")]
173    pub vote: ::core::option::Option<super::types::Vote>,
174}
175/// HasVote is sent to indicate that a particular vote has been received.
176#[allow(clippy::derive_partial_eq_without_eq)]
177#[derive(
178    Clone,
179    PartialEq,
180    Eq,
181    ::prost::Message,
182    ::serde::Serialize,
183    ::serde::Deserialize,
184    ::schemars::JsonSchema,
185    CosmwasmExt,
186)]
187#[proto_message(type_url = "/tendermint.consensus.HasVote")]
188pub struct HasVote {
189    #[prost(int64, tag = "1")]
190    #[serde(
191        serialize_with = "crate::serde::as_str::serialize",
192        deserialize_with = "crate::serde::as_str::deserialize"
193    )]
194    pub height: i64,
195    #[prost(int32, tag = "2")]
196    #[serde(
197        serialize_with = "crate::serde::as_str::serialize",
198        deserialize_with = "crate::serde::as_str::deserialize"
199    )]
200    pub round: i32,
201    #[prost(enumeration = "super::types::SignedMsgType", tag = "3")]
202    #[serde(
203        serialize_with = "crate::serde::as_str::serialize",
204        deserialize_with = "crate::serde::as_str::deserialize"
205    )]
206    pub r#type: i32,
207    #[prost(int32, tag = "4")]
208    #[serde(
209        serialize_with = "crate::serde::as_str::serialize",
210        deserialize_with = "crate::serde::as_str::deserialize"
211    )]
212    pub index: i32,
213}
214/// VoteSetMaj23 is sent to indicate that a given BlockID has seen +2/3 votes.
215#[allow(clippy::derive_partial_eq_without_eq)]
216#[derive(
217    Clone,
218    PartialEq,
219    Eq,
220    ::prost::Message,
221    ::serde::Serialize,
222    ::serde::Deserialize,
223    ::schemars::JsonSchema,
224    CosmwasmExt,
225)]
226#[proto_message(type_url = "/tendermint.consensus.VoteSetMaj23")]
227pub struct VoteSetMaj23 {
228    #[prost(int64, tag = "1")]
229    #[serde(
230        serialize_with = "crate::serde::as_str::serialize",
231        deserialize_with = "crate::serde::as_str::deserialize"
232    )]
233    pub height: i64,
234    #[prost(int32, tag = "2")]
235    #[serde(
236        serialize_with = "crate::serde::as_str::serialize",
237        deserialize_with = "crate::serde::as_str::deserialize"
238    )]
239    pub round: i32,
240    #[prost(enumeration = "super::types::SignedMsgType", tag = "3")]
241    #[serde(
242        serialize_with = "crate::serde::as_str::serialize",
243        deserialize_with = "crate::serde::as_str::deserialize"
244    )]
245    pub r#type: i32,
246    #[prost(message, optional, tag = "4")]
247    #[serde(alias = "blockID")]
248    pub block_id: ::core::option::Option<super::types::BlockId>,
249}
250/// VoteSetBits is sent to communicate the bit-array of votes seen for the BlockID.
251#[allow(clippy::derive_partial_eq_without_eq)]
252#[derive(
253    Clone,
254    PartialEq,
255    Eq,
256    ::prost::Message,
257    ::serde::Serialize,
258    ::serde::Deserialize,
259    ::schemars::JsonSchema,
260    CosmwasmExt,
261)]
262#[proto_message(type_url = "/tendermint.consensus.VoteSetBits")]
263pub struct VoteSetBits {
264    #[prost(int64, tag = "1")]
265    #[serde(
266        serialize_with = "crate::serde::as_str::serialize",
267        deserialize_with = "crate::serde::as_str::deserialize"
268    )]
269    pub height: i64,
270    #[prost(int32, tag = "2")]
271    #[serde(
272        serialize_with = "crate::serde::as_str::serialize",
273        deserialize_with = "crate::serde::as_str::deserialize"
274    )]
275    pub round: i32,
276    #[prost(enumeration = "super::types::SignedMsgType", tag = "3")]
277    #[serde(
278        serialize_with = "crate::serde::as_str::serialize",
279        deserialize_with = "crate::serde::as_str::deserialize"
280    )]
281    pub r#type: i32,
282    #[prost(message, optional, tag = "4")]
283    #[serde(alias = "blockID")]
284    pub block_id: ::core::option::Option<super::types::BlockId>,
285    #[prost(message, optional, tag = "5")]
286    pub votes: ::core::option::Option<super::libs::bits::BitArray>,
287}
288#[allow(clippy::derive_partial_eq_without_eq)]
289#[derive(
290    Clone,
291    PartialEq,
292    Eq,
293    ::prost::Message,
294    ::serde::Serialize,
295    ::serde::Deserialize,
296    ::schemars::JsonSchema,
297    CosmwasmExt,
298)]
299#[proto_message(type_url = "/tendermint.consensus.Message")]
300pub struct Message {
301    #[prost(oneof = "message::Sum", tags = "1, 2, 3, 4, 5, 6, 7, 8, 9")]
302    pub sum: ::core::option::Option<message::Sum>,
303}
304/// Nested message and enum types in `Message`.
305pub mod message {
306    #[allow(clippy::derive_partial_eq_without_eq)]
307    #[derive(
308        Clone,
309        PartialEq,
310        Eq,
311        ::prost::Oneof,
312        ::serde::Serialize,
313        ::serde::Deserialize,
314        ::schemars::JsonSchema,
315    )]
316    pub enum Sum {
317        #[prost(message, tag = "1")]
318        NewRoundStep(super::NewRoundStep),
319        #[prost(message, tag = "2")]
320        NewValidBlock(super::NewValidBlock),
321        #[prost(message, tag = "3")]
322        Proposal(super::Proposal),
323        #[prost(message, tag = "4")]
324        ProposalPol(super::ProposalPol),
325        #[prost(message, tag = "5")]
326        BlockPart(super::BlockPart),
327        #[prost(message, tag = "6")]
328        Vote(super::Vote),
329        #[prost(message, tag = "7")]
330        HasVote(super::HasVote),
331        #[prost(message, tag = "8")]
332        VoteSetMaj23(super::VoteSetMaj23),
333        #[prost(message, tag = "9")]
334        VoteSetBits(super::VoteSetBits),
335    }
336}
337/// MsgInfo are msgs from the reactor which may update the state
338#[allow(clippy::derive_partial_eq_without_eq)]
339#[derive(
340    Clone,
341    PartialEq,
342    Eq,
343    ::prost::Message,
344    ::serde::Serialize,
345    ::serde::Deserialize,
346    ::schemars::JsonSchema,
347    CosmwasmExt,
348)]
349#[proto_message(type_url = "/tendermint.consensus.MsgInfo")]
350pub struct MsgInfo {
351    #[prost(message, optional, tag = "1")]
352    pub msg: ::core::option::Option<Message>,
353    #[prost(string, tag = "2")]
354    #[serde(alias = "peerID")]
355    pub peer_id: ::prost::alloc::string::String,
356}
357/// TimeoutInfo internally generated messages which may update the state
358#[allow(clippy::derive_partial_eq_without_eq)]
359#[derive(
360    Clone,
361    PartialEq,
362    Eq,
363    ::prost::Message,
364    ::serde::Serialize,
365    ::serde::Deserialize,
366    ::schemars::JsonSchema,
367    CosmwasmExt,
368)]
369#[proto_message(type_url = "/tendermint.consensus.TimeoutInfo")]
370pub struct TimeoutInfo {
371    #[prost(message, optional, tag = "1")]
372    pub duration: ::core::option::Option<crate::shim::Duration>,
373    #[prost(int64, tag = "2")]
374    #[serde(
375        serialize_with = "crate::serde::as_str::serialize",
376        deserialize_with = "crate::serde::as_str::deserialize"
377    )]
378    pub height: i64,
379    #[prost(int32, tag = "3")]
380    #[serde(
381        serialize_with = "crate::serde::as_str::serialize",
382        deserialize_with = "crate::serde::as_str::deserialize"
383    )]
384    pub round: i32,
385    #[prost(uint32, tag = "4")]
386    #[serde(
387        serialize_with = "crate::serde::as_str::serialize",
388        deserialize_with = "crate::serde::as_str::deserialize"
389    )]
390    pub step: u32,
391}
392/// EndHeight marks the end of the given height inside WAL.
393/// @internal used by scripts/wal2json util.
394#[allow(clippy::derive_partial_eq_without_eq)]
395#[derive(
396    Clone,
397    PartialEq,
398    Eq,
399    ::prost::Message,
400    ::serde::Serialize,
401    ::serde::Deserialize,
402    ::schemars::JsonSchema,
403    CosmwasmExt,
404)]
405#[proto_message(type_url = "/tendermint.consensus.EndHeight")]
406pub struct EndHeight {
407    #[prost(int64, tag = "1")]
408    #[serde(
409        serialize_with = "crate::serde::as_str::serialize",
410        deserialize_with = "crate::serde::as_str::deserialize"
411    )]
412    pub height: i64,
413}
414#[allow(clippy::derive_partial_eq_without_eq)]
415#[derive(
416    Clone,
417    PartialEq,
418    Eq,
419    ::prost::Message,
420    ::serde::Serialize,
421    ::serde::Deserialize,
422    ::schemars::JsonSchema,
423    CosmwasmExt,
424)]
425#[proto_message(type_url = "/tendermint.consensus.WALMessage")]
426pub struct WalMessage {
427    #[prost(oneof = "wal_message::Sum", tags = "1, 2, 3, 4")]
428    pub sum: ::core::option::Option<wal_message::Sum>,
429}
430/// Nested message and enum types in `WALMessage`.
431pub mod wal_message {
432    #[allow(clippy::derive_partial_eq_without_eq)]
433    #[derive(
434        Clone,
435        PartialEq,
436        Eq,
437        ::prost::Oneof,
438        ::serde::Serialize,
439        ::serde::Deserialize,
440        ::schemars::JsonSchema,
441    )]
442    pub enum Sum {
443        #[prost(message, tag = "1")]
444        EventDataRoundState(super::super::types::EventDataRoundState),
445        #[prost(message, tag = "2")]
446        MsgInfo(super::MsgInfo),
447        #[prost(message, tag = "3")]
448        TimeoutInfo(super::TimeoutInfo),
449        #[prost(message, tag = "4")]
450        EndHeight(super::EndHeight),
451    }
452}
453/// TimedWALMessage wraps WALMessage and adds Time for debugging purposes.
454#[allow(clippy::derive_partial_eq_without_eq)]
455#[derive(
456    Clone,
457    PartialEq,
458    Eq,
459    ::prost::Message,
460    ::serde::Serialize,
461    ::serde::Deserialize,
462    ::schemars::JsonSchema,
463    CosmwasmExt,
464)]
465#[proto_message(type_url = "/tendermint.consensus.TimedWALMessage")]
466pub struct TimedWalMessage {
467    #[prost(message, optional, tag = "1")]
468    pub time: ::core::option::Option<crate::shim::Timestamp>,
469    #[prost(message, optional, tag = "2")]
470    pub msg: ::core::option::Option<WalMessage>,
471}