osmosis_std/types/tendermint/
consensus.rs

1use osmosis_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    use osmosis_std_derive::CosmwasmExt;
307    #[allow(clippy::derive_partial_eq_without_eq)]
308    #[derive(
309        Clone,
310        PartialEq,
311        Eq,
312        ::prost::Oneof,
313        ::serde::Serialize,
314        ::serde::Deserialize,
315        ::schemars::JsonSchema,
316    )]
317    pub enum Sum {
318        #[prost(message, tag = "1")]
319        NewRoundStep(super::NewRoundStep),
320        #[prost(message, tag = "2")]
321        NewValidBlock(super::NewValidBlock),
322        #[prost(message, tag = "3")]
323        Proposal(super::Proposal),
324        #[prost(message, tag = "4")]
325        ProposalPol(super::ProposalPol),
326        #[prost(message, tag = "5")]
327        BlockPart(super::BlockPart),
328        #[prost(message, tag = "6")]
329        Vote(super::Vote),
330        #[prost(message, tag = "7")]
331        HasVote(super::HasVote),
332        #[prost(message, tag = "8")]
333        VoteSetMaj23(super::VoteSetMaj23),
334        #[prost(message, tag = "9")]
335        VoteSetBits(super::VoteSetBits),
336    }
337}
338/// MsgInfo are msgs from the reactor which may update the state
339#[allow(clippy::derive_partial_eq_without_eq)]
340#[derive(
341    Clone,
342    PartialEq,
343    Eq,
344    ::prost::Message,
345    ::serde::Serialize,
346    ::serde::Deserialize,
347    ::schemars::JsonSchema,
348    CosmwasmExt,
349)]
350#[proto_message(type_url = "/tendermint.consensus.MsgInfo")]
351pub struct MsgInfo {
352    #[prost(message, optional, tag = "1")]
353    pub msg: ::core::option::Option<Message>,
354    #[prost(string, tag = "2")]
355    #[serde(alias = "peerID")]
356    pub peer_id: ::prost::alloc::string::String,
357}
358/// TimeoutInfo internally generated messages which may update the state
359#[allow(clippy::derive_partial_eq_without_eq)]
360#[derive(
361    Clone,
362    PartialEq,
363    Eq,
364    ::prost::Message,
365    ::serde::Serialize,
366    ::serde::Deserialize,
367    ::schemars::JsonSchema,
368    CosmwasmExt,
369)]
370#[proto_message(type_url = "/tendermint.consensus.TimeoutInfo")]
371pub struct TimeoutInfo {
372    #[prost(message, optional, tag = "1")]
373    pub duration: ::core::option::Option<crate::shim::Duration>,
374    #[prost(int64, tag = "2")]
375    #[serde(
376        serialize_with = "crate::serde::as_str::serialize",
377        deserialize_with = "crate::serde::as_str::deserialize"
378    )]
379    pub height: i64,
380    #[prost(int32, tag = "3")]
381    #[serde(
382        serialize_with = "crate::serde::as_str::serialize",
383        deserialize_with = "crate::serde::as_str::deserialize"
384    )]
385    pub round: i32,
386    #[prost(uint32, tag = "4")]
387    #[serde(
388        serialize_with = "crate::serde::as_str::serialize",
389        deserialize_with = "crate::serde::as_str::deserialize"
390    )]
391    pub step: u32,
392}
393/// EndHeight marks the end of the given height inside WAL.
394/// @internal used by scripts/wal2json util.
395#[allow(clippy::derive_partial_eq_without_eq)]
396#[derive(
397    Clone,
398    PartialEq,
399    Eq,
400    ::prost::Message,
401    ::serde::Serialize,
402    ::serde::Deserialize,
403    ::schemars::JsonSchema,
404    CosmwasmExt,
405)]
406#[proto_message(type_url = "/tendermint.consensus.EndHeight")]
407pub struct EndHeight {
408    #[prost(int64, tag = "1")]
409    #[serde(
410        serialize_with = "crate::serde::as_str::serialize",
411        deserialize_with = "crate::serde::as_str::deserialize"
412    )]
413    pub height: i64,
414}
415#[allow(clippy::derive_partial_eq_without_eq)]
416#[derive(
417    Clone,
418    PartialEq,
419    Eq,
420    ::prost::Message,
421    ::serde::Serialize,
422    ::serde::Deserialize,
423    ::schemars::JsonSchema,
424    CosmwasmExt,
425)]
426#[proto_message(type_url = "/tendermint.consensus.WALMessage")]
427pub struct WalMessage {
428    #[prost(oneof = "wal_message::Sum", tags = "1, 2, 3, 4")]
429    pub sum: ::core::option::Option<wal_message::Sum>,
430}
431/// Nested message and enum types in `WALMessage`.
432pub mod wal_message {
433    use osmosis_std_derive::CosmwasmExt;
434    #[allow(clippy::derive_partial_eq_without_eq)]
435    #[derive(
436        Clone,
437        PartialEq,
438        Eq,
439        ::prost::Oneof,
440        ::serde::Serialize,
441        ::serde::Deserialize,
442        ::schemars::JsonSchema,
443    )]
444    pub enum Sum {
445        #[prost(message, tag = "1")]
446        EventDataRoundState(super::super::types::EventDataRoundState),
447        #[prost(message, tag = "2")]
448        MsgInfo(super::MsgInfo),
449        #[prost(message, tag = "3")]
450        TimeoutInfo(super::TimeoutInfo),
451        #[prost(message, tag = "4")]
452        EndHeight(super::EndHeight),
453    }
454}
455/// TimedWALMessage wraps WALMessage and adds Time for debugging purposes.
456#[allow(clippy::derive_partial_eq_without_eq)]
457#[derive(
458    Clone,
459    PartialEq,
460    Eq,
461    ::prost::Message,
462    ::serde::Serialize,
463    ::serde::Deserialize,
464    ::schemars::JsonSchema,
465    CosmwasmExt,
466)]
467#[proto_message(type_url = "/tendermint.consensus.TimedWALMessage")]
468pub struct TimedWalMessage {
469    #[prost(message, optional, tag = "1")]
470    pub time: ::core::option::Option<crate::shim::Timestamp>,
471    #[prost(message, optional, tag = "2")]
472    pub msg: ::core::option::Option<WalMessage>,
473}