cometbft_proto/prost/
cometbft.types.v1.rs

1/// ConsensusParams contains consensus critical parameters that determine the
2/// validity of blocks.
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct ConsensusParams {
6    #[prost(message, optional, tag = "1")]
7    pub block: ::core::option::Option<BlockParams>,
8    #[prost(message, optional, tag = "2")]
9    pub evidence: ::core::option::Option<EvidenceParams>,
10    #[prost(message, optional, tag = "3")]
11    pub validator: ::core::option::Option<ValidatorParams>,
12    #[prost(message, optional, tag = "4")]
13    pub version: ::core::option::Option<VersionParams>,
14    #[prost(message, optional, tag = "5")]
15    pub abci: ::core::option::Option<AbciParams>,
16}
17/// BlockParams contains limits on the block size.
18#[allow(clippy::derive_partial_eq_without_eq)]
19#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct BlockParams {
21    /// Max block size, in bytes.
22    /// Note: must be greater than 0
23    #[prost(int64, tag = "1")]
24    pub max_bytes: i64,
25    /// Max gas per block.
26    /// Note: must be greater or equal to -1
27    #[prost(int64, tag = "2")]
28    pub max_gas: i64,
29}
30/// EvidenceParams determine how we handle evidence of malfeasance.
31#[derive(::serde::Deserialize, ::serde::Serialize)]
32#[allow(clippy::derive_partial_eq_without_eq)]
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct EvidenceParams {
35    /// Max age of evidence, in blocks.
36    ///
37    /// The basic formula for calculating this is: MaxAgeDuration / {average block
38    /// time}.
39    #[prost(int64, tag = "1")]
40    #[serde(with = "crate::serializers::from_str", default)]
41    pub max_age_num_blocks: i64,
42    /// Max age of evidence, in time.
43    ///
44    /// It should correspond with an app's "unbonding period" or other similar
45    /// mechanism for handling [Nothing-At-Stake
46    /// attacks](<https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed>).
47    #[prost(message, optional, tag = "2")]
48    pub max_age_duration: ::core::option::Option<crate::google::protobuf::Duration>,
49    /// This sets the maximum size of total evidence in bytes that can be committed in a single block.
50    /// and should fall comfortably under the max block bytes.
51    /// Default is 1048576 or 1MB
52    #[prost(int64, tag = "3")]
53    #[serde(with = "crate::serializers::from_str", default)]
54    pub max_bytes: i64,
55}
56/// ValidatorParams restrict the public key types validators can use.
57/// NOTE: uses ABCI pubkey naming, not Amino names.
58#[allow(clippy::derive_partial_eq_without_eq)]
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct ValidatorParams {
61    #[prost(string, repeated, tag = "1")]
62    pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
63}
64/// VersionParams contains the ABCI application version.
65#[allow(clippy::derive_partial_eq_without_eq)]
66#[derive(Clone, PartialEq, ::prost::Message)]
67pub struct VersionParams {
68    /// Was named app_version in Tendermint 0.34
69    #[prost(uint64, tag = "1")]
70    pub app: u64,
71}
72/// HashedParams is a subset of ConsensusParams.
73///
74/// It is hashed into the Header.ConsensusHash.
75#[allow(clippy::derive_partial_eq_without_eq)]
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct HashedParams {
78    #[prost(int64, tag = "1")]
79    pub block_max_bytes: i64,
80    #[prost(int64, tag = "2")]
81    pub block_max_gas: i64,
82}
83/// ABCIParams configure functionality specific to the Application Blockchain Interface.
84#[allow(clippy::derive_partial_eq_without_eq)]
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct AbciParams {
87    /// vote_extensions_enable_height configures the first height during which
88    /// vote extensions will be enabled. During this specified height, and for all
89    /// subsequent heights, precommit messages that do not contain valid extension data
90    /// will be considered invalid. Prior to this height, vote extensions will not
91    /// be used or accepted by validators on the network.
92    ///
93    /// Once enabled, vote extensions will be created by the application in ExtendVote,
94    /// passed to the application for validation in VerifyVoteExtension and given
95    /// to the application to use when proposing a block during PrepareProposal.
96    #[prost(int64, tag = "1")]
97    pub vote_extensions_enable_height: i64,
98}
99/// ValidatorSet defines a set of validators.
100#[derive(::serde::Deserialize, ::serde::Serialize)]
101#[allow(clippy::derive_partial_eq_without_eq)]
102#[derive(Clone, PartialEq, ::prost::Message)]
103pub struct ValidatorSet {
104    #[prost(message, repeated, tag = "1")]
105    pub validators: ::prost::alloc::vec::Vec<Validator>,
106    #[prost(message, optional, tag = "2")]
107    pub proposer: ::core::option::Option<Validator>,
108    #[prost(int64, tag = "3")]
109    #[serde(with = "crate::serializers::from_str", default)]
110    #[serde(skip_serializing)]
111    pub total_voting_power: i64,
112}
113/// Validator represents a node participating in the consensus protocol.
114#[derive(::serde::Deserialize, ::serde::Serialize)]
115#[allow(clippy::derive_partial_eq_without_eq)]
116#[derive(Clone, PartialEq, ::prost::Message)]
117pub struct Validator {
118    #[prost(bytes = "vec", tag = "1")]
119    #[serde(with = "crate::serializers::bytes::hexstring")]
120    pub address: ::prost::alloc::vec::Vec<u8>,
121    #[prost(message, optional, tag = "2")]
122    pub pub_key: ::core::option::Option<super::super::crypto::v1::PublicKey>,
123    #[prost(int64, tag = "3")]
124    #[serde(alias = "power", with = "crate::serializers::from_str")]
125    pub voting_power: i64,
126    #[prost(int64, tag = "4")]
127    #[serde(with = "crate::serializers::from_str_allow_null")]
128    #[serde(default)]
129    pub proposer_priority: i64,
130}
131/// SimpleValidator is a Validator, which is serialized and hashed in consensus.
132/// Address is removed because it's redundant with the pubkey.
133/// Proposer priority is removed because it changes every round.
134#[allow(clippy::derive_partial_eq_without_eq)]
135#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct SimpleValidator {
137    #[prost(message, optional, tag = "1")]
138    pub pub_key: ::core::option::Option<super::super::crypto::v1::PublicKey>,
139    #[prost(int64, tag = "2")]
140    pub voting_power: i64,
141}
142/// BlockIdFlag indicates which BlockID the signature is for
143#[derive(::num_derive::FromPrimitive, ::num_derive::ToPrimitive)]
144#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
145#[repr(i32)]
146pub enum BlockIdFlag {
147    /// Indicates an error condition
148    Unknown = 0,
149    /// The vote was not received
150    Absent = 1,
151    /// Voted for the block that received the majority
152    Commit = 2,
153    /// Voted for nil
154    Nil = 3,
155}
156impl BlockIdFlag {
157    /// String value of the enum field names used in the ProtoBuf definition.
158    ///
159    /// The values are not transformed in any way and thus are considered stable
160    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
161    pub fn as_str_name(&self) -> &'static str {
162        match self {
163            BlockIdFlag::Unknown => "BLOCK_ID_FLAG_UNKNOWN",
164            BlockIdFlag::Absent => "BLOCK_ID_FLAG_ABSENT",
165            BlockIdFlag::Commit => "BLOCK_ID_FLAG_COMMIT",
166            BlockIdFlag::Nil => "BLOCK_ID_FLAG_NIL",
167        }
168    }
169    /// Creates an enum from field names used in the ProtoBuf definition.
170    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
171        match value {
172            "BLOCK_ID_FLAG_UNKNOWN" => Some(Self::Unknown),
173            "BLOCK_ID_FLAG_ABSENT" => Some(Self::Absent),
174            "BLOCK_ID_FLAG_COMMIT" => Some(Self::Commit),
175            "BLOCK_ID_FLAG_NIL" => Some(Self::Nil),
176            _ => None,
177        }
178    }
179}
180/// Header of the parts set for a block.
181#[derive(::serde::Deserialize, ::serde::Serialize)]
182#[allow(clippy::derive_partial_eq_without_eq)]
183#[derive(Clone, PartialEq, ::prost::Message)]
184pub struct PartSetHeader {
185    #[prost(uint32, tag = "1")]
186    #[serde(with = "crate::serializers::part_set_header_total")]
187    pub total: u32,
188    #[prost(bytes = "vec", tag = "2")]
189    #[serde(with = "crate::serializers::bytes::hexstring")]
190    pub hash: ::prost::alloc::vec::Vec<u8>,
191}
192/// Part of the block.
193#[allow(clippy::derive_partial_eq_without_eq)]
194#[derive(Clone, PartialEq, ::prost::Message)]
195pub struct Part {
196    #[prost(uint32, tag = "1")]
197    pub index: u32,
198    #[prost(bytes = "vec", tag = "2")]
199    pub bytes: ::prost::alloc::vec::Vec<u8>,
200    #[prost(message, optional, tag = "3")]
201    pub proof: ::core::option::Option<super::super::crypto::v1::Proof>,
202}
203/// BlockID defines the unique ID of a block as its hash and its `PartSetHeader`.
204#[derive(::serde::Deserialize, ::serde::Serialize)]
205#[allow(clippy::derive_partial_eq_without_eq)]
206#[derive(Clone, PartialEq, ::prost::Message)]
207pub struct BlockId {
208    #[prost(bytes = "vec", tag = "1")]
209    #[serde(with = "crate::serializers::bytes::hexstring")]
210    pub hash: ::prost::alloc::vec::Vec<u8>,
211    #[prost(message, optional, tag = "2")]
212    #[serde(rename = "parts", alias = "part_set_header")]
213    pub part_set_header: ::core::option::Option<PartSetHeader>,
214}
215/// Header defines the structure of a block header.
216#[derive(::serde::Deserialize, ::serde::Serialize)]
217#[allow(clippy::derive_partial_eq_without_eq)]
218#[derive(Clone, PartialEq, ::prost::Message)]
219pub struct Header {
220    /// basic block info
221    #[prost(message, optional, tag = "1")]
222    pub version: ::core::option::Option<super::super::version::v1::Consensus>,
223    #[prost(string, tag = "2")]
224    pub chain_id: ::prost::alloc::string::String,
225    #[prost(int64, tag = "3")]
226    #[serde(with = "crate::serializers::from_str")]
227    pub height: i64,
228    #[prost(message, optional, tag = "4")]
229    #[serde(with = "crate::serializers::optional")]
230    pub time: ::core::option::Option<crate::google::protobuf::Timestamp>,
231    /// prev block info
232    #[prost(message, optional, tag = "5")]
233    pub last_block_id: ::core::option::Option<BlockId>,
234    /// hashes of block data
235    ///
236    /// commit from validators from the last block
237    #[prost(bytes = "vec", tag = "6")]
238    #[serde(with = "crate::serializers::bytes::hexstring")]
239    pub last_commit_hash: ::prost::alloc::vec::Vec<u8>,
240    /// transactions
241    #[prost(bytes = "vec", tag = "7")]
242    #[serde(with = "crate::serializers::bytes::hexstring")]
243    pub data_hash: ::prost::alloc::vec::Vec<u8>,
244    /// hashes from the app output from the prev block
245    ///
246    /// validators for the current block
247    #[prost(bytes = "vec", tag = "8")]
248    #[serde(with = "crate::serializers::bytes::hexstring")]
249    pub validators_hash: ::prost::alloc::vec::Vec<u8>,
250    /// validators for the next block
251    #[prost(bytes = "vec", tag = "9")]
252    #[serde(with = "crate::serializers::bytes::hexstring")]
253    pub next_validators_hash: ::prost::alloc::vec::Vec<u8>,
254    /// consensus params for current block
255    #[prost(bytes = "vec", tag = "10")]
256    #[serde(with = "crate::serializers::bytes::hexstring")]
257    pub consensus_hash: ::prost::alloc::vec::Vec<u8>,
258    /// state after txs from the previous block
259    #[prost(bytes = "vec", tag = "11")]
260    #[serde(with = "crate::serializers::bytes::hexstring")]
261    pub app_hash: ::prost::alloc::vec::Vec<u8>,
262    /// root hash of all results from the txs from the previous block
263    #[prost(bytes = "vec", tag = "12")]
264    #[serde(with = "crate::serializers::bytes::hexstring")]
265    pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
266    /// consensus info
267    ///
268    /// evidence included in the block
269    #[prost(bytes = "vec", tag = "13")]
270    #[serde(with = "crate::serializers::bytes::hexstring")]
271    pub evidence_hash: ::prost::alloc::vec::Vec<u8>,
272    /// original proposer of the block
273    #[prost(bytes = "vec", tag = "14")]
274    #[serde(with = "crate::serializers::bytes::hexstring")]
275    pub proposer_address: ::prost::alloc::vec::Vec<u8>,
276}
277/// Data contains the set of transactions included in the block
278#[derive(::serde::Deserialize, ::serde::Serialize)]
279#[allow(clippy::derive_partial_eq_without_eq)]
280#[derive(Clone, PartialEq, ::prost::Message)]
281pub struct Data {
282    /// Txs that will be applied by state @ block.Height+1.
283    /// NOTE: not all txs here are valid.  We're just agreeing on the order first.
284    /// This means that block.AppHash does not include these txs.
285    #[prost(bytes = "vec", repeated, tag = "1")]
286    #[serde(with = "crate::serializers::txs")]
287    pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
288}
289/// Vote represents a prevote or precommit vote from validators for
290/// consensus.
291#[derive(::serde::Deserialize, ::serde::Serialize)]
292#[allow(clippy::derive_partial_eq_without_eq)]
293#[derive(Clone, PartialEq, ::prost::Message)]
294pub struct Vote {
295    #[prost(enumeration = "SignedMsgType", tag = "1")]
296    pub r#type: i32,
297    #[prost(int64, tag = "2")]
298    #[serde(with = "crate::serializers::from_str")]
299    pub height: i64,
300    #[prost(int32, tag = "3")]
301    pub round: i32,
302    /// zero if vote is nil.
303    #[prost(message, optional, tag = "4")]
304    pub block_id: ::core::option::Option<BlockId>,
305    #[prost(message, optional, tag = "5")]
306    #[serde(with = "crate::serializers::optional")]
307    pub timestamp: ::core::option::Option<crate::google::protobuf::Timestamp>,
308    #[prost(bytes = "vec", tag = "6")]
309    #[serde(with = "crate::serializers::bytes::hexstring")]
310    pub validator_address: ::prost::alloc::vec::Vec<u8>,
311    #[prost(int32, tag = "7")]
312    pub validator_index: i32,
313    /// Vote signature by the validator if they participated in consensus for the
314    /// associated block.
315    #[prost(bytes = "vec", tag = "8")]
316    #[serde(with = "crate::serializers::bytes::base64string")]
317    pub signature: ::prost::alloc::vec::Vec<u8>,
318    /// Vote extension provided by the application. Only valid for precommit
319    /// messages.
320    #[prost(bytes = "vec", tag = "9")]
321    #[serde(default)]
322    pub extension: ::prost::alloc::vec::Vec<u8>,
323    /// Vote extension signature by the validator if they participated in
324    /// consensus for the associated block.
325    /// Only valid for precommit messages.
326    #[prost(bytes = "vec", tag = "10")]
327    #[serde(default)]
328    pub extension_signature: ::prost::alloc::vec::Vec<u8>,
329}
330/// Commit contains the evidence that a block was committed by a set of validators.
331#[derive(::serde::Deserialize, ::serde::Serialize)]
332#[allow(clippy::derive_partial_eq_without_eq)]
333#[derive(Clone, PartialEq, ::prost::Message)]
334pub struct Commit {
335    #[prost(int64, tag = "1")]
336    #[serde(with = "crate::serializers::from_str")]
337    pub height: i64,
338    #[prost(int32, tag = "2")]
339    pub round: i32,
340    #[prost(message, optional, tag = "3")]
341    pub block_id: ::core::option::Option<BlockId>,
342    #[prost(message, repeated, tag = "4")]
343    #[serde(with = "crate::serializers::nullable")]
344    pub signatures: ::prost::alloc::vec::Vec<CommitSig>,
345}
346/// CommitSig is a part of the Vote included in a Commit.
347#[derive(::serde::Deserialize, ::serde::Serialize)]
348#[allow(clippy::derive_partial_eq_without_eq)]
349#[derive(Clone, PartialEq, ::prost::Message)]
350pub struct CommitSig {
351    #[prost(enumeration = "BlockIdFlag", tag = "1")]
352    pub block_id_flag: i32,
353    #[prost(bytes = "vec", tag = "2")]
354    #[serde(with = "crate::serializers::bytes::hexstring")]
355    pub validator_address: ::prost::alloc::vec::Vec<u8>,
356    #[prost(message, optional, tag = "3")]
357    #[serde(with = "crate::serializers::optional")]
358    pub timestamp: ::core::option::Option<crate::google::protobuf::Timestamp>,
359    #[prost(bytes = "vec", tag = "4")]
360    #[serde(with = "crate::serializers::bytes::base64string")]
361    pub signature: ::prost::alloc::vec::Vec<u8>,
362}
363/// ExtendedCommit is a Commit with ExtendedCommitSig.
364#[allow(clippy::derive_partial_eq_without_eq)]
365#[derive(Clone, PartialEq, ::prost::Message)]
366pub struct ExtendedCommit {
367    #[prost(int64, tag = "1")]
368    pub height: i64,
369    #[prost(int32, tag = "2")]
370    pub round: i32,
371    #[prost(message, optional, tag = "3")]
372    pub block_id: ::core::option::Option<BlockId>,
373    #[prost(message, repeated, tag = "4")]
374    pub extended_signatures: ::prost::alloc::vec::Vec<ExtendedCommitSig>,
375}
376/// ExtendedCommitSig retains all the same fields as CommitSig but adds vote
377/// extension-related fields. We use two signatures to ensure backwards compatibility.
378/// That is the digest of the original signature is still the same in prior versions
379#[allow(clippy::derive_partial_eq_without_eq)]
380#[derive(Clone, PartialEq, ::prost::Message)]
381pub struct ExtendedCommitSig {
382    #[prost(enumeration = "BlockIdFlag", tag = "1")]
383    pub block_id_flag: i32,
384    #[prost(bytes = "vec", tag = "2")]
385    pub validator_address: ::prost::alloc::vec::Vec<u8>,
386    #[prost(message, optional, tag = "3")]
387    pub timestamp: ::core::option::Option<crate::google::protobuf::Timestamp>,
388    #[prost(bytes = "vec", tag = "4")]
389    pub signature: ::prost::alloc::vec::Vec<u8>,
390    /// Vote extension data
391    #[prost(bytes = "vec", tag = "5")]
392    pub extension: ::prost::alloc::vec::Vec<u8>,
393    /// Vote extension signature
394    #[prost(bytes = "vec", tag = "6")]
395    pub extension_signature: ::prost::alloc::vec::Vec<u8>,
396}
397/// Block proposal.
398#[allow(clippy::derive_partial_eq_without_eq)]
399#[derive(Clone, PartialEq, ::prost::Message)]
400pub struct Proposal {
401    #[prost(enumeration = "SignedMsgType", tag = "1")]
402    pub r#type: i32,
403    #[prost(int64, tag = "2")]
404    pub height: i64,
405    #[prost(int32, tag = "3")]
406    pub round: i32,
407    #[prost(int32, tag = "4")]
408    pub pol_round: i32,
409    #[prost(message, optional, tag = "5")]
410    pub block_id: ::core::option::Option<BlockId>,
411    #[prost(message, optional, tag = "6")]
412    pub timestamp: ::core::option::Option<crate::google::protobuf::Timestamp>,
413    #[prost(bytes = "vec", tag = "7")]
414    pub signature: ::prost::alloc::vec::Vec<u8>,
415}
416/// SignedHeader contains a Header(H) and Commit(H+1) with signatures of validators who signed it.
417#[derive(::serde::Deserialize, ::serde::Serialize)]
418#[allow(clippy::derive_partial_eq_without_eq)]
419#[derive(Clone, PartialEq, ::prost::Message)]
420pub struct SignedHeader {
421    #[prost(message, optional, tag = "1")]
422    pub header: ::core::option::Option<Header>,
423    #[prost(message, optional, tag = "2")]
424    pub commit: ::core::option::Option<Commit>,
425}
426/// LightBlock is a combination of SignedHeader and ValidatorSet. It is used by light clients.
427#[derive(::serde::Deserialize, ::serde::Serialize)]
428#[allow(clippy::derive_partial_eq_without_eq)]
429#[derive(Clone, PartialEq, ::prost::Message)]
430pub struct LightBlock {
431    #[prost(message, optional, tag = "1")]
432    pub signed_header: ::core::option::Option<SignedHeader>,
433    #[prost(message, optional, tag = "2")]
434    pub validator_set: ::core::option::Option<ValidatorSet>,
435}
436/// BlockMeta contains meta information about a block.
437#[derive(::serde::Deserialize, ::serde::Serialize)]
438#[allow(clippy::derive_partial_eq_without_eq)]
439#[derive(Clone, PartialEq, ::prost::Message)]
440pub struct BlockMeta {
441    #[prost(message, optional, tag = "1")]
442    pub block_id: ::core::option::Option<BlockId>,
443    #[prost(int64, tag = "2")]
444    #[serde(with = "crate::serializers::from_str")]
445    pub block_size: i64,
446    #[prost(message, optional, tag = "3")]
447    pub header: ::core::option::Option<Header>,
448    #[prost(int64, tag = "4")]
449    #[serde(with = "crate::serializers::from_str")]
450    pub num_txs: i64,
451}
452/// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
453#[derive(::serde::Deserialize, ::serde::Serialize)]
454#[allow(clippy::derive_partial_eq_without_eq)]
455#[derive(Clone, PartialEq, ::prost::Message)]
456pub struct TxProof {
457    #[prost(bytes = "vec", tag = "1")]
458    #[serde(with = "crate::serializers::bytes::hexstring")]
459    pub root_hash: ::prost::alloc::vec::Vec<u8>,
460    #[prost(bytes = "vec", tag = "2")]
461    #[serde(with = "crate::serializers::bytes::base64string")]
462    pub data: ::prost::alloc::vec::Vec<u8>,
463    #[prost(message, optional, tag = "3")]
464    pub proof: ::core::option::Option<super::super::crypto::v1::Proof>,
465}
466/// SignedMsgType is a type of signed message in the consensus.
467#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
468#[repr(i32)]
469pub enum SignedMsgType {
470    /// Unknown
471    Unknown = 0,
472    /// Prevote
473    Prevote = 1,
474    /// Precommit
475    Precommit = 2,
476    /// Proposal
477    Proposal = 32,
478}
479impl SignedMsgType {
480    /// String value of the enum field names used in the ProtoBuf definition.
481    ///
482    /// The values are not transformed in any way and thus are considered stable
483    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
484    pub fn as_str_name(&self) -> &'static str {
485        match self {
486            SignedMsgType::Unknown => "SIGNED_MSG_TYPE_UNKNOWN",
487            SignedMsgType::Prevote => "SIGNED_MSG_TYPE_PREVOTE",
488            SignedMsgType::Precommit => "SIGNED_MSG_TYPE_PRECOMMIT",
489            SignedMsgType::Proposal => "SIGNED_MSG_TYPE_PROPOSAL",
490        }
491    }
492    /// Creates an enum from field names used in the ProtoBuf definition.
493    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
494        match value {
495            "SIGNED_MSG_TYPE_UNKNOWN" => Some(Self::Unknown),
496            "SIGNED_MSG_TYPE_PREVOTE" => Some(Self::Prevote),
497            "SIGNED_MSG_TYPE_PRECOMMIT" => Some(Self::Precommit),
498            "SIGNED_MSG_TYPE_PROPOSAL" => Some(Self::Proposal),
499            _ => None,
500        }
501    }
502}
503/// Evidence is a generic type for wrapping evidence of misbehavior by a validator.
504#[allow(clippy::derive_partial_eq_without_eq)]
505#[derive(Clone, PartialEq, ::prost::Message)]
506pub struct Evidence {
507    /// The type of evidence.
508    #[prost(oneof = "evidence::Sum", tags = "1, 2")]
509    pub sum: ::core::option::Option<evidence::Sum>,
510}
511/// Nested message and enum types in `Evidence`.
512pub mod evidence {
513    /// The type of evidence.
514    #[derive(::serde::Deserialize, ::serde::Serialize)]
515    #[serde(tag = "type", content = "value")]
516    #[allow(clippy::derive_partial_eq_without_eq)]
517    #[derive(Clone, PartialEq, ::prost::Oneof)]
518    pub enum Sum {
519        #[prost(message, tag = "1")]
520        #[serde(rename = "tendermint/DuplicateVoteEvidence")]
521        DuplicateVoteEvidence(super::DuplicateVoteEvidence),
522        #[prost(message, tag = "2")]
523        #[serde(rename = "tendermint/LightClientAttackEvidence")]
524        LightClientAttackEvidence(super::LightClientAttackEvidence),
525    }
526}
527/// DuplicateVoteEvidence contains evidence of a validator signed two conflicting votes.
528#[derive(::serde::Deserialize, ::serde::Serialize)]
529#[allow(clippy::derive_partial_eq_without_eq)]
530#[derive(Clone, PartialEq, ::prost::Message)]
531pub struct DuplicateVoteEvidence {
532    #[prost(message, optional, tag = "1")]
533    pub vote_a: ::core::option::Option<Vote>,
534    #[prost(message, optional, tag = "2")]
535    pub vote_b: ::core::option::Option<Vote>,
536    #[prost(int64, tag = "3")]
537    #[serde(rename = "TotalVotingPower", with = "crate::serializers::from_str")]
538    pub total_voting_power: i64,
539    #[prost(int64, tag = "4")]
540    #[serde(rename = "ValidatorPower", with = "crate::serializers::from_str")]
541    pub validator_power: i64,
542    #[prost(message, optional, tag = "5")]
543    #[serde(rename = "Timestamp")]
544    pub timestamp: ::core::option::Option<crate::google::protobuf::Timestamp>,
545}
546/// LightClientAttackEvidence contains evidence of a set of validators attempting to mislead a light client.
547#[derive(::serde::Deserialize, ::serde::Serialize)]
548#[serde(rename_all = "PascalCase")]
549#[allow(clippy::derive_partial_eq_without_eq)]
550#[derive(Clone, PartialEq, ::prost::Message)]
551pub struct LightClientAttackEvidence {
552    #[prost(message, optional, tag = "1")]
553    pub conflicting_block: ::core::option::Option<LightBlock>,
554    #[prost(int64, tag = "2")]
555    #[serde(with = "crate::serializers::from_str")]
556    pub common_height: i64,
557    #[prost(message, repeated, tag = "3")]
558    pub byzantine_validators: ::prost::alloc::vec::Vec<Validator>,
559    #[prost(int64, tag = "4")]
560    #[serde(with = "crate::serializers::from_str")]
561    pub total_voting_power: i64,
562    #[prost(message, optional, tag = "5")]
563    pub timestamp: ::core::option::Option<crate::google::protobuf::Timestamp>,
564}
565/// EvidenceList is a list of evidence.
566#[derive(::serde::Deserialize, ::serde::Serialize)]
567#[allow(clippy::derive_partial_eq_without_eq)]
568#[derive(Clone, PartialEq, ::prost::Message)]
569pub struct EvidenceList {
570    #[prost(message, repeated, tag = "1")]
571    #[serde(with = "crate::serializers::nullable")]
572    pub evidence: ::prost::alloc::vec::Vec<Evidence>,
573}
574/// Block defines the structure of a block in the CometBFT blockchain.
575#[derive(::serde::Deserialize, ::serde::Serialize)]
576#[allow(clippy::derive_partial_eq_without_eq)]
577#[derive(Clone, PartialEq, ::prost::Message)]
578pub struct Block {
579    #[prost(message, optional, tag = "1")]
580    pub header: ::core::option::Option<Header>,
581    #[prost(message, optional, tag = "2")]
582    pub data: ::core::option::Option<Data>,
583    #[prost(message, optional, tag = "3")]
584    pub evidence: ::core::option::Option<EvidenceList>,
585    #[prost(message, optional, tag = "4")]
586    pub last_commit: ::core::option::Option<Commit>,
587}
588/// EventDataRoundState is emmitted with each new round step.
589#[allow(clippy::derive_partial_eq_without_eq)]
590#[derive(Clone, PartialEq, ::prost::Message)]
591pub struct EventDataRoundState {
592    #[prost(int64, tag = "1")]
593    pub height: i64,
594    #[prost(int32, tag = "2")]
595    pub round: i32,
596    #[prost(string, tag = "3")]
597    pub step: ::prost::alloc::string::String,
598}
599/// CanonicalBlockID is a canonical representation of a BlockID, which gets
600/// serialized and signed.
601#[derive(::serde::Deserialize, ::serde::Serialize)]
602#[allow(clippy::derive_partial_eq_without_eq)]
603#[derive(Clone, PartialEq, ::prost::Message)]
604pub struct CanonicalBlockId {
605    #[prost(bytes = "vec", tag = "1")]
606    pub hash: ::prost::alloc::vec::Vec<u8>,
607    #[prost(message, optional, tag = "2")]
608    pub part_set_header: ::core::option::Option<CanonicalPartSetHeader>,
609}
610/// CanonicalPartSetHeader is a canonical representation of a PartSetHeader,
611/// which gets serialized and signed.
612#[derive(::serde::Deserialize, ::serde::Serialize)]
613#[allow(clippy::derive_partial_eq_without_eq)]
614#[derive(Clone, PartialEq, ::prost::Message)]
615pub struct CanonicalPartSetHeader {
616    #[prost(uint32, tag = "1")]
617    pub total: u32,
618    #[prost(bytes = "vec", tag = "2")]
619    pub hash: ::prost::alloc::vec::Vec<u8>,
620}
621/// CanonicalProposal is a canonical representation of a Proposal, which gets
622/// serialized and signed.
623#[allow(clippy::derive_partial_eq_without_eq)]
624#[derive(Clone, PartialEq, ::prost::Message)]
625pub struct CanonicalProposal {
626    /// type alias for byte
627    #[prost(enumeration = "SignedMsgType", tag = "1")]
628    pub r#type: i32,
629    /// canonicalization requires fixed size encoding here
630    #[prost(sfixed64, tag = "2")]
631    pub height: i64,
632    /// canonicalization requires fixed size encoding here
633    #[prost(sfixed64, tag = "3")]
634    pub round: i64,
635    #[prost(int64, tag = "4")]
636    pub pol_round: i64,
637    #[prost(message, optional, tag = "5")]
638    pub block_id: ::core::option::Option<CanonicalBlockId>,
639    #[prost(message, optional, tag = "6")]
640    pub timestamp: ::core::option::Option<crate::google::protobuf::Timestamp>,
641    #[prost(string, tag = "7")]
642    pub chain_id: ::prost::alloc::string::String,
643}
644/// CanonicalVote is a canonical representation of a Vote, which gets
645/// serialized and signed.
646#[derive(::serde::Deserialize, ::serde::Serialize)]
647#[allow(clippy::derive_partial_eq_without_eq)]
648#[derive(Clone, PartialEq, ::prost::Message)]
649pub struct CanonicalVote {
650    /// type alias for byte
651    #[prost(enumeration = "SignedMsgType", tag = "1")]
652    pub r#type: i32,
653    /// canonicalization requires fixed size encoding here
654    #[prost(sfixed64, tag = "2")]
655    pub height: i64,
656    /// canonicalization requires fixed size encoding here
657    #[prost(sfixed64, tag = "3")]
658    pub round: i64,
659    #[prost(message, optional, tag = "4")]
660    pub block_id: ::core::option::Option<CanonicalBlockId>,
661    #[prost(message, optional, tag = "5")]
662    pub timestamp: ::core::option::Option<crate::google::protobuf::Timestamp>,
663    #[prost(string, tag = "6")]
664    pub chain_id: ::prost::alloc::string::String,
665}
666/// CanonicalVoteExtension provides us a way to serialize a vote extension from
667/// a particular validator such that we can sign over those serialized bytes.
668#[allow(clippy::derive_partial_eq_without_eq)]
669#[derive(Clone, PartialEq, ::prost::Message)]
670pub struct CanonicalVoteExtension {
671    #[prost(bytes = "vec", tag = "1")]
672    pub extension: ::prost::alloc::vec::Vec<u8>,
673    #[prost(sfixed64, tag = "2")]
674    pub height: i64,
675    #[prost(sfixed64, tag = "3")]
676    pub round: i64,
677    #[prost(string, tag = "4")]
678    pub chain_id: ::prost::alloc::string::String,
679}