tm_protos/protos/
tendermint.types.rs

1#[allow(clippy::derive_partial_eq_without_eq)]
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct ValidatorSet {
4    #[prost(message, repeated, tag = "1")]
5    pub validators: ::prost::alloc::vec::Vec<Validator>,
6    #[prost(message, optional, tag = "2")]
7    pub proposer: ::core::option::Option<Validator>,
8    #[prost(int64, tag = "3")]
9    pub total_voting_power: i64,
10}
11#[allow(clippy::derive_partial_eq_without_eq)]
12#[derive(Clone, PartialEq, ::prost::Message)]
13pub struct Validator {
14    #[prost(bytes = "vec", tag = "1")]
15    pub address: ::prost::alloc::vec::Vec<u8>,
16    #[prost(message, optional, tag = "2")]
17    pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
18    #[prost(int64, tag = "3")]
19    pub voting_power: i64,
20    #[prost(int64, tag = "4")]
21    pub proposer_priority: i64,
22}
23#[allow(clippy::derive_partial_eq_without_eq)]
24#[derive(Clone, PartialEq, ::prost::Message)]
25pub struct SimpleValidator {
26    #[prost(message, optional, tag = "1")]
27    pub pub_key: ::core::option::Option<super::crypto::PublicKey>,
28    #[prost(int64, tag = "2")]
29    pub voting_power: i64,
30}
31/// PartsetHeader
32#[allow(clippy::derive_partial_eq_without_eq)]
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct PartSetHeader {
35    #[prost(uint32, tag = "1")]
36    pub total: u32,
37    #[prost(bytes = "vec", tag = "2")]
38    pub hash: ::prost::alloc::vec::Vec<u8>,
39}
40#[allow(clippy::derive_partial_eq_without_eq)]
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct Part {
43    #[prost(uint32, tag = "1")]
44    pub index: u32,
45    #[prost(bytes = "vec", tag = "2")]
46    pub bytes: ::prost::alloc::vec::Vec<u8>,
47    #[prost(message, optional, tag = "3")]
48    pub proof: ::core::option::Option<super::crypto::Proof>,
49}
50/// BlockID
51#[allow(clippy::derive_partial_eq_without_eq)]
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct BlockId {
54    #[prost(bytes = "vec", tag = "1")]
55    pub hash: ::prost::alloc::vec::Vec<u8>,
56    #[prost(message, optional, tag = "2")]
57    pub part_set_header: ::core::option::Option<PartSetHeader>,
58}
59/// Header defines the structure of a Tendermint block header.
60#[allow(clippy::derive_partial_eq_without_eq)]
61#[derive(Clone, PartialEq, ::prost::Message)]
62pub struct Header {
63    /// basic block info
64    #[prost(message, optional, tag = "1")]
65    pub version: ::core::option::Option<super::version::Consensus>,
66    #[prost(string, tag = "2")]
67    pub chain_id: ::prost::alloc::string::String,
68    #[prost(int64, tag = "3")]
69    pub height: i64,
70    #[prost(message, optional, tag = "4")]
71    pub time: ::core::option::Option<::prost_types::Timestamp>,
72    /// prev block info
73    #[prost(message, optional, tag = "5")]
74    pub last_block_id: ::core::option::Option<BlockId>,
75    /// hashes of block data
76    ///
77    /// commit from validators from the last block
78    #[prost(bytes = "vec", tag = "6")]
79    pub last_commit_hash: ::prost::alloc::vec::Vec<u8>,
80    /// transactions
81    #[prost(bytes = "vec", tag = "7")]
82    pub data_hash: ::prost::alloc::vec::Vec<u8>,
83    /// hashes from the app output from the prev block
84    ///
85    /// validators for the current block
86    #[prost(bytes = "vec", tag = "8")]
87    pub validators_hash: ::prost::alloc::vec::Vec<u8>,
88    /// validators for the next block
89    #[prost(bytes = "vec", tag = "9")]
90    pub next_validators_hash: ::prost::alloc::vec::Vec<u8>,
91    /// consensus params for current block
92    #[prost(bytes = "vec", tag = "10")]
93    pub consensus_hash: ::prost::alloc::vec::Vec<u8>,
94    /// state after txs from the previous block
95    #[prost(bytes = "vec", tag = "11")]
96    pub app_hash: ::prost::alloc::vec::Vec<u8>,
97    /// root hash of all results from the txs from the previous block
98    #[prost(bytes = "vec", tag = "12")]
99    pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
100    /// consensus info
101    ///
102    /// evidence included in the block
103    #[prost(bytes = "vec", tag = "13")]
104    pub evidence_hash: ::prost::alloc::vec::Vec<u8>,
105    /// original proposer of the block
106    #[prost(bytes = "vec", tag = "14")]
107    pub proposer_address: ::prost::alloc::vec::Vec<u8>,
108}
109/// Data contains the set of transactions included in the block
110#[allow(clippy::derive_partial_eq_without_eq)]
111#[derive(Clone, PartialEq, ::prost::Message)]
112pub struct Data {
113    /// Txs that will be applied by state @ block.Height+1.
114    /// NOTE: not all txs here are valid.  We're just agreeing on the order first.
115    /// This means that block.AppHash does not include these txs.
116    #[prost(bytes = "vec", repeated, tag = "1")]
117    pub txs: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
118}
119/// Vote represents a prevote, precommit, or commit vote from validators for
120/// consensus.
121#[allow(clippy::derive_partial_eq_without_eq)]
122#[derive(Clone, PartialEq, ::prost::Message)]
123pub struct Vote {
124    #[prost(enumeration = "SignedMsgType", tag = "1")]
125    pub r#type: i32,
126    #[prost(int64, tag = "2")]
127    pub height: i64,
128    #[prost(int32, tag = "3")]
129    pub round: i32,
130    /// zero if vote is nil.
131    #[prost(message, optional, tag = "4")]
132    pub block_id: ::core::option::Option<BlockId>,
133    #[prost(message, optional, tag = "5")]
134    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
135    #[prost(bytes = "vec", tag = "6")]
136    pub validator_address: ::prost::alloc::vec::Vec<u8>,
137    #[prost(int32, tag = "7")]
138    pub validator_index: i32,
139    #[prost(bytes = "vec", tag = "8")]
140    pub signature: ::prost::alloc::vec::Vec<u8>,
141}
142/// Commit contains the evidence that a block was committed by a set of validators.
143#[allow(clippy::derive_partial_eq_without_eq)]
144#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct Commit {
146    #[prost(int64, tag = "1")]
147    pub height: i64,
148    #[prost(int32, tag = "2")]
149    pub round: i32,
150    #[prost(message, optional, tag = "3")]
151    pub block_id: ::core::option::Option<BlockId>,
152    #[prost(message, repeated, tag = "4")]
153    pub signatures: ::prost::alloc::vec::Vec<CommitSig>,
154}
155/// CommitSig is a part of the Vote included in a Commit.
156#[allow(clippy::derive_partial_eq_without_eq)]
157#[derive(Clone, PartialEq, ::prost::Message)]
158pub struct CommitSig {
159    #[prost(enumeration = "BlockIdFlag", tag = "1")]
160    pub block_id_flag: i32,
161    #[prost(bytes = "vec", tag = "2")]
162    pub validator_address: ::prost::alloc::vec::Vec<u8>,
163    #[prost(message, optional, tag = "3")]
164    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
165    #[prost(bytes = "vec", tag = "4")]
166    pub signature: ::prost::alloc::vec::Vec<u8>,
167}
168#[allow(clippy::derive_partial_eq_without_eq)]
169#[derive(Clone, PartialEq, ::prost::Message)]
170pub struct Proposal {
171    #[prost(enumeration = "SignedMsgType", tag = "1")]
172    pub r#type: i32,
173    #[prost(int64, tag = "2")]
174    pub height: i64,
175    #[prost(int32, tag = "3")]
176    pub round: i32,
177    #[prost(int32, tag = "4")]
178    pub pol_round: i32,
179    #[prost(message, optional, tag = "5")]
180    pub block_id: ::core::option::Option<BlockId>,
181    #[prost(message, optional, tag = "6")]
182    pub timestamp: ::core::option::Option<::prost_types::Timestamp>,
183    #[prost(bytes = "vec", tag = "7")]
184    pub signature: ::prost::alloc::vec::Vec<u8>,
185}
186#[allow(clippy::derive_partial_eq_without_eq)]
187#[derive(Clone, PartialEq, ::prost::Message)]
188pub struct SignedHeader {
189    #[prost(message, optional, tag = "1")]
190    pub header: ::core::option::Option<Header>,
191    #[prost(message, optional, tag = "2")]
192    pub commit: ::core::option::Option<Commit>,
193}
194#[allow(clippy::derive_partial_eq_without_eq)]
195#[derive(Clone, PartialEq, ::prost::Message)]
196pub struct LightBlock {
197    #[prost(message, optional, tag = "1")]
198    pub signed_header: ::core::option::Option<SignedHeader>,
199    #[prost(message, optional, tag = "2")]
200    pub validator_set: ::core::option::Option<ValidatorSet>,
201}
202#[allow(clippy::derive_partial_eq_without_eq)]
203#[derive(Clone, PartialEq, ::prost::Message)]
204pub struct BlockMeta {
205    #[prost(message, optional, tag = "1")]
206    pub block_id: ::core::option::Option<BlockId>,
207    #[prost(int64, tag = "2")]
208    pub block_size: i64,
209    #[prost(message, optional, tag = "3")]
210    pub header: ::core::option::Option<Header>,
211    #[prost(int64, tag = "4")]
212    pub num_txs: i64,
213}
214/// TxProof represents a Merkle proof of the presence of a transaction in the Merkle tree.
215#[allow(clippy::derive_partial_eq_without_eq)]
216#[derive(Clone, PartialEq, ::prost::Message)]
217pub struct TxProof {
218    #[prost(bytes = "vec", tag = "1")]
219    pub root_hash: ::prost::alloc::vec::Vec<u8>,
220    #[prost(bytes = "vec", tag = "2")]
221    pub data: ::prost::alloc::vec::Vec<u8>,
222    #[prost(message, optional, tag = "3")]
223    pub proof: ::core::option::Option<super::crypto::Proof>,
224}
225/// BlockIdFlag indicates which BlcokID the signature is for
226#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
227#[repr(i32)]
228pub enum BlockIdFlag {
229    Unknown = 0,
230    Absent = 1,
231    Commit = 2,
232    Nil = 3,
233}
234impl BlockIdFlag {
235    /// String value of the enum field names used in the ProtoBuf definition.
236    ///
237    /// The values are not transformed in any way and thus are considered stable
238    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
239    pub fn as_str_name(&self) -> &'static str {
240        match self {
241            BlockIdFlag::Unknown => "BLOCK_ID_FLAG_UNKNOWN",
242            BlockIdFlag::Absent => "BLOCK_ID_FLAG_ABSENT",
243            BlockIdFlag::Commit => "BLOCK_ID_FLAG_COMMIT",
244            BlockIdFlag::Nil => "BLOCK_ID_FLAG_NIL",
245        }
246    }
247    /// Creates an enum from field names used in the ProtoBuf definition.
248    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
249        match value {
250            "BLOCK_ID_FLAG_UNKNOWN" => Some(Self::Unknown),
251            "BLOCK_ID_FLAG_ABSENT" => Some(Self::Absent),
252            "BLOCK_ID_FLAG_COMMIT" => Some(Self::Commit),
253            "BLOCK_ID_FLAG_NIL" => Some(Self::Nil),
254            _ => None,
255        }
256    }
257}
258/// SignedMsgType is a type of signed message in the consensus.
259#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
260#[repr(i32)]
261pub enum SignedMsgType {
262    Unknown = 0,
263    /// Votes
264    Prevote = 1,
265    Precommit = 2,
266    /// Proposals
267    Proposal = 32,
268}
269impl SignedMsgType {
270    /// String value of the enum field names used in the ProtoBuf definition.
271    ///
272    /// The values are not transformed in any way and thus are considered stable
273    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
274    pub fn as_str_name(&self) -> &'static str {
275        match self {
276            SignedMsgType::Unknown => "SIGNED_MSG_TYPE_UNKNOWN",
277            SignedMsgType::Prevote => "SIGNED_MSG_TYPE_PREVOTE",
278            SignedMsgType::Precommit => "SIGNED_MSG_TYPE_PRECOMMIT",
279            SignedMsgType::Proposal => "SIGNED_MSG_TYPE_PROPOSAL",
280        }
281    }
282    /// Creates an enum from field names used in the ProtoBuf definition.
283    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
284        match value {
285            "SIGNED_MSG_TYPE_UNKNOWN" => Some(Self::Unknown),
286            "SIGNED_MSG_TYPE_PREVOTE" => Some(Self::Prevote),
287            "SIGNED_MSG_TYPE_PRECOMMIT" => Some(Self::Precommit),
288            "SIGNED_MSG_TYPE_PROPOSAL" => Some(Self::Proposal),
289            _ => None,
290        }
291    }
292}
293/// ConsensusParams contains consensus critical parameters that determine the
294/// validity of blocks.
295#[allow(clippy::derive_partial_eq_without_eq)]
296#[derive(Clone, PartialEq, ::prost::Message)]
297pub struct ConsensusParams {
298    #[prost(message, optional, tag = "1")]
299    pub block: ::core::option::Option<BlockParams>,
300    #[prost(message, optional, tag = "2")]
301    pub evidence: ::core::option::Option<EvidenceParams>,
302    #[prost(message, optional, tag = "3")]
303    pub validator: ::core::option::Option<ValidatorParams>,
304    #[prost(message, optional, tag = "4")]
305    pub version: ::core::option::Option<VersionParams>,
306}
307/// BlockParams contains limits on the block size.
308#[allow(clippy::derive_partial_eq_without_eq)]
309#[derive(Clone, PartialEq, ::prost::Message)]
310pub struct BlockParams {
311    /// Max block size, in bytes.
312    /// Note: must be greater than 0
313    #[prost(int64, tag = "1")]
314    pub max_bytes: i64,
315    /// Max gas per block.
316    /// Note: must be greater or equal to -1
317    #[prost(int64, tag = "2")]
318    pub max_gas: i64,
319    /// Minimum time increment between consecutive blocks (in milliseconds) If the
320    /// block header timestamp is ahead of the system clock, decrease this value.
321    ///
322    /// Not exposed to the application.
323    #[prost(int64, tag = "3")]
324    pub time_iota_ms: i64,
325}
326/// EvidenceParams determine how we handle evidence of malfeasance.
327#[allow(clippy::derive_partial_eq_without_eq)]
328#[derive(Clone, PartialEq, ::prost::Message)]
329pub struct EvidenceParams {
330    /// Max age of evidence, in blocks.
331    ///
332    /// The basic formula for calculating this is: MaxAgeDuration / {average block
333    /// time}.
334    #[prost(int64, tag = "1")]
335    pub max_age_num_blocks: i64,
336    /// Max age of evidence, in time.
337    ///
338    /// It should correspond with an app's "unbonding period" or other similar
339    /// mechanism for handling [Nothing-At-Stake
340    /// attacks](<https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed>).
341    #[prost(message, optional, tag = "2")]
342    pub max_age_duration: ::core::option::Option<::prost_types::Duration>,
343    /// This sets the maximum size of total evidence in bytes that can be committed in a single block.
344    /// and should fall comfortably under the max block bytes.
345    /// Default is 1048576 or 1MB
346    #[prost(int64, tag = "3")]
347    pub max_bytes: i64,
348}
349/// ValidatorParams restrict the public key types validators can use.
350/// NOTE: uses ABCI pubkey naming, not Amino names.
351#[allow(clippy::derive_partial_eq_without_eq)]
352#[derive(Clone, PartialEq, ::prost::Message)]
353pub struct ValidatorParams {
354    #[prost(string, repeated, tag = "1")]
355    pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
356}
357/// VersionParams contains the ABCI application version.
358#[allow(clippy::derive_partial_eq_without_eq)]
359#[derive(Clone, PartialEq, ::prost::Message)]
360pub struct VersionParams {
361    #[prost(uint64, tag = "1")]
362    pub app_version: u64,
363}
364/// HashedParams is a subset of ConsensusParams.
365///
366/// It is hashed into the Header.ConsensusHash.
367#[allow(clippy::derive_partial_eq_without_eq)]
368#[derive(Clone, PartialEq, ::prost::Message)]
369pub struct HashedParams {
370    #[prost(int64, tag = "1")]
371    pub block_max_bytes: i64,
372    #[prost(int64, tag = "2")]
373    pub block_max_gas: i64,
374}