cometbft_proto/prost/
cometbft.state.v1.rs

1/// LegacyABCIResponses retains the responses
2/// of the legacy ABCI calls during block processing.
3/// Note ReponseDeliverTx is renamed to ExecTxResult but they are semantically the same
4/// Kept for backwards compatibility for versions prior to v0.38
5#[allow(clippy::derive_partial_eq_without_eq)]
6#[derive(Clone, PartialEq, ::prost::Message)]
7pub struct LegacyAbciResponses {
8    #[prost(message, repeated, tag = "1")]
9    pub deliver_txs: ::prost::alloc::vec::Vec<super::super::abci::v1::ExecTxResult>,
10    #[prost(message, optional, tag = "2")]
11    pub end_block: ::core::option::Option<ResponseEndBlock>,
12    #[prost(message, optional, tag = "3")]
13    pub begin_block: ::core::option::Option<ResponseBeginBlock>,
14}
15/// ResponseBeginBlock is kept for backward compatibility for versions prior to v0.38,
16/// as it was then defined in the cometbft.abci packages.
17#[allow(clippy::derive_partial_eq_without_eq)]
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct ResponseBeginBlock {
20    #[prost(message, repeated, tag = "1")]
21    pub events: ::prost::alloc::vec::Vec<super::super::abci::v1::Event>,
22}
23/// ResponseEndBlock is kept for backward compatibility for versions prior to v0.38,
24/// its earlier revisions were defined in the cometbft.abci packages.
25/// It uses an updated definition for the consensus_param_updates field to keep the
26/// generated data types interoperable with the latest protocol.
27#[allow(clippy::derive_partial_eq_without_eq)]
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct ResponseEndBlock {
30    #[prost(message, repeated, tag = "1")]
31    pub validator_updates: ::prost::alloc::vec::Vec<
32        super::super::abci::v1::ValidatorUpdate,
33    >,
34    #[prost(message, optional, tag = "2")]
35    pub consensus_param_updates: ::core::option::Option<
36        super::super::types::v1::ConsensusParams,
37    >,
38    #[prost(message, repeated, tag = "3")]
39    pub events: ::prost::alloc::vec::Vec<super::super::abci::v1::Event>,
40}
41/// ValidatorsInfo represents the latest validator set, or the last height it changed
42#[allow(clippy::derive_partial_eq_without_eq)]
43#[derive(Clone, PartialEq, ::prost::Message)]
44pub struct ValidatorsInfo {
45    #[prost(message, optional, tag = "1")]
46    pub validator_set: ::core::option::Option<super::super::types::v1::ValidatorSet>,
47    #[prost(int64, tag = "2")]
48    pub last_height_changed: i64,
49}
50/// ConsensusParamsInfo represents the latest consensus params, or the last height it changed
51#[allow(clippy::derive_partial_eq_without_eq)]
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct ConsensusParamsInfo {
54    #[prost(message, optional, tag = "1")]
55    pub consensus_params: ::core::option::Option<
56        super::super::types::v1::ConsensusParams,
57    >,
58    #[prost(int64, tag = "2")]
59    pub last_height_changed: i64,
60}
61/// ABCIResponsesInfo retains the responses of the ABCI calls during block processing.
62#[allow(clippy::derive_partial_eq_without_eq)]
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct AbciResponsesInfo {
65    /// Retains the responses of the legacy ABCI calls during block processing.
66    #[prost(message, optional, tag = "1")]
67    pub legacy_abci_responses: ::core::option::Option<LegacyAbciResponses>,
68    #[prost(int64, tag = "2")]
69    pub height: i64,
70    #[prost(message, optional, tag = "3")]
71    pub finalize_block: ::core::option::Option<
72        super::super::abci::v1::FinalizeBlockResponse,
73    >,
74}
75/// Version is a message for storing versioning information.
76#[allow(clippy::derive_partial_eq_without_eq)]
77#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct Version {
79    #[prost(message, optional, tag = "1")]
80    pub consensus: ::core::option::Option<super::super::version::v1::Consensus>,
81    #[prost(string, tag = "2")]
82    pub software: ::prost::alloc::string::String,
83}
84/// State represents the state of the blockchain.
85#[allow(clippy::derive_partial_eq_without_eq)]
86#[derive(Clone, PartialEq, ::prost::Message)]
87pub struct State {
88    #[prost(message, optional, tag = "1")]
89    pub version: ::core::option::Option<Version>,
90    /// immutable
91    #[prost(string, tag = "2")]
92    pub chain_id: ::prost::alloc::string::String,
93    #[prost(int64, tag = "14")]
94    pub initial_height: i64,
95    /// LastBlockHeight=0 at genesis (ie. block(H=0) does not exist)
96    #[prost(int64, tag = "3")]
97    pub last_block_height: i64,
98    #[prost(message, optional, tag = "4")]
99    pub last_block_id: ::core::option::Option<super::super::types::v1::BlockId>,
100    #[prost(message, optional, tag = "5")]
101    pub last_block_time: ::core::option::Option<crate::google::protobuf::Timestamp>,
102    /// LastValidators is used to validate block.LastCommit.
103    /// Validators are persisted to the database separately every time they change,
104    /// so we can query for historical validator sets.
105    /// Note that if s.LastBlockHeight causes a valset change,
106    /// we set s.LastHeightValidatorsChanged = s.LastBlockHeight + 1 + 1
107    /// Extra +1 due to nextValSet delay.
108    #[prost(message, optional, tag = "6")]
109    pub next_validators: ::core::option::Option<super::super::types::v1::ValidatorSet>,
110    #[prost(message, optional, tag = "7")]
111    pub validators: ::core::option::Option<super::super::types::v1::ValidatorSet>,
112    #[prost(message, optional, tag = "8")]
113    pub last_validators: ::core::option::Option<super::super::types::v1::ValidatorSet>,
114    #[prost(int64, tag = "9")]
115    pub last_height_validators_changed: i64,
116    /// Consensus parameters used for validating blocks.
117    /// Changes returned by EndBlock and updated after Commit.
118    #[prost(message, optional, tag = "10")]
119    pub consensus_params: ::core::option::Option<
120        super::super::types::v1::ConsensusParams,
121    >,
122    #[prost(int64, tag = "11")]
123    pub last_height_consensus_params_changed: i64,
124    /// Merkle root of the results from executing prev block
125    #[prost(bytes = "vec", tag = "12")]
126    pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
127    /// the latest AppHash we've received from calling abci.Commit()
128    #[prost(bytes = "vec", tag = "13")]
129    pub app_hash: ::prost::alloc::vec::Vec<u8>,
130}