From c90bf9c6e9fbd0c443e5c6e620f23687f31d8a9c Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Fri, 5 Apr 2024 10:34:25 +0200 Subject: [PATCH] proto: Add missing serde derives on Protobuf definitions (#1389) * Cleanup * Add missing serde derives on some Protobuf definitions * Remove redundant use of `num-traits::ToPrimitive` for `BlockIDFlag` * Fix warning * Add changelog entry --- .../1389-blockidflag-to-primitive.md | 2 + .../features/1389-missing-serde-derives.md | 2 + proto/Cargo.toml | 2 - proto/src/lib.rs | 25 +- proto/src/prelude.rs | 5 +- proto/src/prost/v0_34/tendermint.abci.rs | 49 ++++ proto/src/prost/v0_34/tendermint.crypto.rs | 2 + proto/src/prost/v0_34/tendermint.p2p.rs | 100 ++++---- proto/src/prost/v0_34/tendermint.types.rs | 51 ++-- proto/src/prost/v0_37/tendermint.abci.rs | 52 +++++ proto/src/prost/v0_37/tendermint.crypto.rs | 2 + proto/src/prost/v0_37/tendermint.p2p.rs | 100 ++++---- proto/src/prost/v0_37/tendermint.types.rs | 183 ++++++++------- proto/src/prost/v0_38/tendermint.abci.rs | 54 +++++ proto/src/prost/v0_38/tendermint.crypto.rs | 2 + proto/src/prost/v0_38/tendermint.p2p.rs | 100 ++++---- proto/src/prost/v0_38/tendermint.types.rs | 220 +++++++++--------- tendermint/src/block/commit_sig.rs | 13 +- tools/proto-compiler/src/constants.rs | 53 +++-- 19 files changed, 618 insertions(+), 399 deletions(-) create mode 100644 .changelog/unreleased/breaking-changes/1389-blockidflag-to-primitive.md create mode 100644 .changelog/unreleased/features/1389-missing-serde-derives.md diff --git a/.changelog/unreleased/breaking-changes/1389-blockidflag-to-primitive.md b/.changelog/unreleased/breaking-changes/1389-blockidflag-to-primitive.md new file mode 100644 index 000000000..cb69748ff --- /dev/null +++ b/.changelog/unreleased/breaking-changes/1389-blockidflag-to-primitive.md @@ -0,0 +1,2 @@ +- `[tendermint-proto]` Remove redundant impl of `num_traits::ToPrimitive` for `BlockIDFlag` + ([\#1389](https://github.com/informalsystems/tendermint-rs/pull/1389)) diff --git a/.changelog/unreleased/features/1389-missing-serde-derives.md b/.changelog/unreleased/features/1389-missing-serde-derives.md new file mode 100644 index 000000000..aa032ddbd --- /dev/null +++ b/.changelog/unreleased/features/1389-missing-serde-derives.md @@ -0,0 +1,2 @@ +- `[tendermint-proto]` Add missing `serde` derives on Protobuf definitions + ([\#1389](https://github.com/informalsystems/tendermint-rs/pull/1389)) diff --git a/proto/Cargo.toml b/proto/Cargo.toml index f978f2268..38be76385 100644 --- a/proto/Cargo.toml +++ b/proto/Cargo.toml @@ -28,8 +28,6 @@ bytes = { version = "1.0", default-features = false, features = ["serde"]} serde = { version = "1.0", default-features = false, features = ["derive"] } serde_bytes = { version = "0.11", default-features = false, features = ["alloc"] } subtle-encoding = { version = "0.5", default-features = false, features = ["hex", "base64", "alloc"] } -num-traits = { version = "0.2", default-features = false } -num-derive = { version = "0.4", default-features = false } time = { version = "0.3", default-features = false, features = ["macros", "parsing"] } flex-error = { version = "0.4.4", default-features = false } tonic = { version = "0.10", optional = true } diff --git a/proto/src/lib.rs b/proto/src/lib.rs index 4c4d67bbd..ebff4132f 100644 --- a/proto/src/lib.rs +++ b/proto/src/lib.rs @@ -7,32 +7,29 @@ extern crate alloc; -mod prelude; - -/// Built-in prost_types with slight customization to enable JSON-encoding -#[allow(warnings)] -pub mod google { - pub mod protobuf { - // custom Timeout and Duration types that have valid doctest documentation texts - include!("protobuf.rs"); - } -} - mod error; -#[allow(warnings)] +mod prelude; mod tendermint; +use bytes::{Buf, BufMut}; use core::fmt::Display; +use prost::Message; -use bytes::{Buf, BufMut}; pub use error::Error; -use prost::Message; pub use tendermint::*; pub mod serializers; use prelude::*; +/// Built-in prost_types with slight customization to enable JSON-encoding +pub mod google { + pub mod protobuf { + // custom Timeout and Duration types that have valid doctest documentation texts + include!("protobuf.rs"); + } +} + /// Allows for easy Google Protocol Buffers encoding and decoding of domain /// types with validation. /// diff --git a/proto/src/prelude.rs b/proto/src/prelude.rs index 58cac4a45..4dbfe5673 100644 --- a/proto/src/prelude.rs +++ b/proto/src/prelude.rs @@ -1,11 +1,12 @@ // Re-export according to alloc::prelude::v1 because it is not yet stabilized // https://doc.rust-lang.org/src/alloc/prelude/v1.rs.html -#[allow(unused_imports)] -pub use alloc::vec; +#![allow(unused_imports)] + pub use alloc::{ format, string::{String, ToString}, + vec, vec::Vec, }; pub use core::prelude::v1::*; diff --git a/proto/src/prost/v0_34/tendermint.abci.rs b/proto/src/prost/v0_34/tendermint.abci.rs index 2bb9c5a05..e4a78b783 100644 --- a/proto/src/prost/v0_34/tendermint.abci.rs +++ b/proto/src/prost/v0_34/tendermint.abci.rs @@ -1,3 +1,4 @@ +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Request { @@ -9,6 +10,7 @@ pub struct Request { } /// Nested message and enum types in `Request`. pub mod request { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { @@ -44,15 +46,18 @@ pub mod request { ApplySnapshotChunk(super::RequestApplySnapshotChunk), } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestEcho { #[prost(string, tag = "1")] pub message: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestFlush {} +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestInfo { @@ -64,6 +69,7 @@ pub struct RequestInfo { pub p2p_version: u64, } /// nondeterministic +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestSetOption { @@ -72,6 +78,7 @@ pub struct RequestSetOption { #[prost(string, tag = "2")] pub value: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestInitChain { @@ -88,6 +95,7 @@ pub struct RequestInitChain { #[prost(int64, tag = "6")] pub initial_height: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestQuery { @@ -100,6 +108,7 @@ pub struct RequestQuery { #[prost(bool, tag = "4")] pub prove: bool, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestBeginBlock { @@ -112,6 +121,7 @@ pub struct RequestBeginBlock { #[prost(message, repeated, tag = "4")] pub byzantine_validators: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestCheckTx { @@ -120,26 +130,31 @@ pub struct RequestCheckTx { #[prost(enumeration = "CheckTxType", tag = "2")] pub r#type: i32, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestDeliverTx { #[prost(bytes = "bytes", tag = "1")] pub tx: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestEndBlock { #[prost(int64, tag = "1")] pub height: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestCommit {} /// lists available snapshots +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestListSnapshots {} /// offers a snapshot to the application +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestOfferSnapshot { @@ -151,6 +166,7 @@ pub struct RequestOfferSnapshot { pub app_hash: ::prost::bytes::Bytes, } /// loads a snapshot chunk +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestLoadSnapshotChunk { @@ -162,6 +178,7 @@ pub struct RequestLoadSnapshotChunk { pub chunk: u32, } /// Applies a snapshot chunk +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestApplySnapshotChunk { @@ -172,6 +189,7 @@ pub struct RequestApplySnapshotChunk { #[prost(string, tag = "3")] pub sender: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Response { @@ -183,6 +201,7 @@ pub struct Response { } /// Nested message and enum types in `Response`. pub mod response { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { @@ -221,18 +240,21 @@ pub mod response { } } /// nondeterministic +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseException { #[prost(string, tag = "1")] pub error: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseEcho { #[prost(string, tag = "1")] pub message: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseFlush {} @@ -258,6 +280,7 @@ pub struct ResponseInfo { pub last_block_app_hash: ::prost::bytes::Bytes, } /// nondeterministic +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseSetOption { @@ -269,6 +292,7 @@ pub struct ResponseSetOption { #[prost(string, tag = "4")] pub info: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseInitChain { @@ -279,6 +303,7 @@ pub struct ResponseInitChain { #[prost(bytes = "bytes", tag = "3")] pub app_hash: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseQuery { @@ -305,12 +330,14 @@ pub struct ResponseQuery { #[prost(string, tag = "10")] pub codespace: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseBeginBlock { #[prost(message, repeated, tag = "1")] pub events: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseCheckTx { @@ -341,6 +368,7 @@ pub struct ResponseCheckTx { #[prost(string, tag = "11")] pub mempool_error: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseDeliverTx { @@ -364,6 +392,7 @@ pub struct ResponseDeliverTx { #[prost(string, tag = "8")] pub codespace: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseEndBlock { @@ -374,6 +403,7 @@ pub struct ResponseEndBlock { #[prost(message, repeated, tag = "3")] pub events: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseCommit { @@ -383,12 +413,14 @@ pub struct ResponseCommit { #[prost(int64, tag = "3")] pub retain_height: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseListSnapshots { #[prost(message, repeated, tag = "1")] pub snapshots: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseOfferSnapshot { @@ -397,6 +429,7 @@ pub struct ResponseOfferSnapshot { } /// Nested message and enum types in `ResponseOfferSnapshot`. pub mod response_offer_snapshot { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[derive( Clone, Copy, @@ -452,12 +485,14 @@ pub mod response_offer_snapshot { } } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseLoadSnapshotChunk { #[prost(bytes = "bytes", tag = "1")] pub chunk: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseApplySnapshotChunk { @@ -472,6 +507,7 @@ pub struct ResponseApplySnapshotChunk { } /// Nested message and enum types in `ResponseApplySnapshotChunk`. pub mod response_apply_snapshot_chunk { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[derive( Clone, Copy, @@ -529,6 +565,7 @@ pub mod response_apply_snapshot_chunk { } /// ConsensusParams contains all consensus-relevant parameters /// that can be adjusted by the abci app +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsensusParams { @@ -542,6 +579,7 @@ pub struct ConsensusParams { pub version: ::core::option::Option, } /// BlockParams contains limits on the block size. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockParams { @@ -552,6 +590,7 @@ pub struct BlockParams { #[prost(int64, tag = "2")] pub max_gas: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct LastCommitInfo { @@ -563,6 +602,7 @@ pub struct LastCommitInfo { /// Event allows application developers to attach additional information to /// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. /// Later, transactions may be queried using these events. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Event { @@ -572,6 +612,7 @@ pub struct Event { pub attributes: ::prost::alloc::vec::Vec, } /// EventAttribute is a single key-value pair, associated with an event. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventAttribute { @@ -586,6 +627,7 @@ pub struct EventAttribute { /// TxResult contains results of executing the transaction. /// /// One usage is indexing transaction results. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxResult { @@ -599,6 +641,7 @@ pub struct TxResult { pub result: ::core::option::Option, } /// Validator +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Validator { @@ -612,6 +655,7 @@ pub struct Validator { pub power: i64, } /// ValidatorUpdate +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorUpdate { @@ -621,6 +665,7 @@ pub struct ValidatorUpdate { pub power: i64, } /// VoteInfo +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VoteInfo { @@ -629,6 +674,7 @@ pub struct VoteInfo { #[prost(bool, tag = "2")] pub signed_last_block: bool, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Evidence { @@ -649,6 +695,7 @@ pub struct Evidence { #[prost(int64, tag = "5")] pub total_voting_power: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Snapshot { @@ -668,6 +715,7 @@ pub struct Snapshot { #[prost(bytes = "bytes", tag = "5")] pub metadata: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum CheckTxType { @@ -694,6 +742,7 @@ impl CheckTxType { } } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum EvidenceType { diff --git a/proto/src/prost/v0_34/tendermint.crypto.rs b/proto/src/prost/v0_34/tendermint.crypto.rs index cfd024d19..0b1c3e197 100644 --- a/proto/src/prost/v0_34/tendermint.crypto.rs +++ b/proto/src/prost/v0_34/tendermint.crypto.rs @@ -38,6 +38,7 @@ pub struct DominoOp { /// ProofOp defines an operation used for calculating Merkle root /// The data could be arbitrary format, providing nessecary data /// for example neighbouring node hash +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOp { @@ -49,6 +50,7 @@ pub struct ProofOp { pub data: ::prost::alloc::vec::Vec, } /// ProofOps is Merkle proof defined by the list of ProofOps +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOps { diff --git a/proto/src/prost/v0_34/tendermint.p2p.rs b/proto/src/prost/v0_34/tendermint.p2p.rs index bfaa808cb..1b96c2577 100644 --- a/proto/src/prost/v0_34/tendermint.p2p.rs +++ b/proto/src/prost/v0_34/tendermint.p2p.rs @@ -1,46 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketPing {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketPong {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketMsg { - #[prost(int32, tag = "1")] - pub channel_id: i32, - #[prost(bool, tag = "2")] - pub eof: bool, - #[prost(bytes = "vec", tag = "3")] - pub data: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Packet { - #[prost(oneof = "packet::Sum", tags = "1, 2, 3")] - pub sum: ::core::option::Option, -} -/// Nested message and enum types in `Packet`. -pub mod packet { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Sum { - #[prost(message, tag = "1")] - PacketPing(super::PacketPing), - #[prost(message, tag = "2")] - PacketPong(super::PacketPong), - #[prost(message, tag = "3")] - PacketMsg(super::PacketMsg), - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AuthSigMessage { - #[prost(message, optional, tag = "1")] - pub pub_key: ::core::option::Option, - #[prost(bytes = "vec", tag = "2")] - pub sig: ::prost::alloc::vec::Vec, -} +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct NetAddress { @@ -51,6 +9,7 @@ pub struct NetAddress { #[prost(uint32, tag = "3")] pub port: u32, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtocolVersion { @@ -61,6 +20,7 @@ pub struct ProtocolVersion { #[prost(uint64, tag = "3")] pub app: u64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DefaultNodeInfo { @@ -81,6 +41,7 @@ pub struct DefaultNodeInfo { #[prost(message, optional, tag = "8")] pub other: ::core::option::Option, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DefaultNodeInfoOther { @@ -89,15 +50,67 @@ pub struct DefaultNodeInfoOther { #[prost(string, tag = "2")] pub rpc_address: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PacketPing {} +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PacketPong {} +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PacketMsg { + #[prost(int32, tag = "1")] + pub channel_id: i32, + #[prost(bool, tag = "2")] + pub eof: bool, + #[prost(bytes = "vec", tag = "3")] + pub data: ::prost::alloc::vec::Vec, +} +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Packet { + #[prost(oneof = "packet::Sum", tags = "1, 2, 3")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `Packet`. +pub mod packet { + #[derive(::serde::Deserialize, ::serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Sum { + #[prost(message, tag = "1")] + PacketPing(super::PacketPing), + #[prost(message, tag = "2")] + PacketPong(super::PacketPong), + #[prost(message, tag = "3")] + PacketMsg(super::PacketMsg), + } +} +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AuthSigMessage { + #[prost(message, optional, tag = "1")] + pub pub_key: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + pub sig: ::prost::alloc::vec::Vec, +} +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PexRequest {} +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PexAddrs { #[prost(message, repeated, tag = "1")] pub addrs: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Message { @@ -106,6 +119,7 @@ pub struct Message { } /// Nested message and enum types in `Message`. pub mod message { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Sum { diff --git a/proto/src/prost/v0_34/tendermint.types.rs b/proto/src/prost/v0_34/tendermint.types.rs index d33c44a08..1d31b82f6 100644 --- a/proto/src/prost/v0_34/tendermint.types.rs +++ b/proto/src/prost/v0_34/tendermint.types.rs @@ -271,7 +271,6 @@ pub struct TxProof { pub proof: ::core::option::Option, } /// BlockIdFlag indicates which BlcokID the signature is for -#[derive(::num_derive::FromPrimitive, ::num_derive::ToPrimitive)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum BlockIdFlag { @@ -339,8 +338,19 @@ impl SignedMsgType { } } } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventDataRoundState { + #[prost(int64, tag = "1")] + pub height: i64, + #[prost(int32, tag = "2")] + pub round: i32, + #[prost(string, tag = "3")] + pub step: ::prost::alloc::string::String, +} /// ConsensusParams contains consensus critical parameters that determine the /// validity of blocks. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConsensusParams { @@ -354,6 +364,7 @@ pub struct ConsensusParams { pub version: ::core::option::Option, } /// BlockParams contains limits on the block size. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockParams { @@ -400,6 +411,7 @@ pub struct EvidenceParams { } /// ValidatorParams restrict the public key types validators can use. /// NOTE: uses ABCI pubkey naming, not Amino names. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorParams { @@ -407,6 +419,7 @@ pub struct ValidatorParams { pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// VersionParams contains the ABCI application version. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VersionParams { @@ -426,16 +439,6 @@ pub struct HashedParams { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct EventDataRoundState { - #[prost(int64, tag = "1")] - pub height: i64, - #[prost(int32, tag = "2")] - pub round: i32, - #[prost(string, tag = "3")] - pub step: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] pub struct Evidence { #[prost(oneof = "evidence::Sum", tags = "1, 2")] pub sum: ::core::option::Option, @@ -504,19 +507,6 @@ pub struct EvidenceList { #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct Block { - #[prost(message, optional, tag = "1")] - pub header: ::core::option::Option
, - #[prost(message, optional, tag = "2")] - pub data: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub evidence: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub last_commit: ::core::option::Option, -} -#[derive(::serde::Deserialize, ::serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] pub struct CanonicalBlockId { #[prost(bytes = "vec", tag = "1")] pub hash: ::prost::alloc::vec::Vec, @@ -573,3 +563,16 @@ pub struct CanonicalVote { #[prost(string, tag = "6")] pub chain_id: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Block { + #[prost(message, optional, tag = "1")] + pub header: ::core::option::Option
, + #[prost(message, optional, tag = "2")] + pub data: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub evidence: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub last_commit: ::core::option::Option, +} diff --git a/proto/src/prost/v0_37/tendermint.abci.rs b/proto/src/prost/v0_37/tendermint.abci.rs index e68e18cd6..ed5a863e4 100644 --- a/proto/src/prost/v0_37/tendermint.abci.rs +++ b/proto/src/prost/v0_37/tendermint.abci.rs @@ -1,3 +1,4 @@ +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Request { @@ -9,6 +10,7 @@ pub struct Request { } /// Nested message and enum types in `Request`. pub mod request { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { @@ -46,15 +48,18 @@ pub mod request { ProcessProposal(super::RequestProcessProposal), } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestEcho { #[prost(string, tag = "1")] pub message: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestFlush {} +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestInfo { @@ -67,6 +72,7 @@ pub struct RequestInfo { #[prost(string, tag = "4")] pub abci_version: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestInitChain { @@ -83,6 +89,7 @@ pub struct RequestInitChain { #[prost(int64, tag = "6")] pub initial_height: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestQuery { @@ -95,6 +102,7 @@ pub struct RequestQuery { #[prost(bool, tag = "4")] pub prove: bool, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestBeginBlock { @@ -107,6 +115,7 @@ pub struct RequestBeginBlock { #[prost(message, repeated, tag = "4")] pub byzantine_validators: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestCheckTx { @@ -115,26 +124,31 @@ pub struct RequestCheckTx { #[prost(enumeration = "CheckTxType", tag = "2")] pub r#type: i32, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestDeliverTx { #[prost(bytes = "bytes", tag = "1")] pub tx: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestEndBlock { #[prost(int64, tag = "1")] pub height: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestCommit {} /// lists available snapshots +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestListSnapshots {} /// offers a snapshot to the application +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestOfferSnapshot { @@ -146,6 +160,7 @@ pub struct RequestOfferSnapshot { pub app_hash: ::prost::bytes::Bytes, } /// loads a snapshot chunk +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestLoadSnapshotChunk { @@ -157,6 +172,7 @@ pub struct RequestLoadSnapshotChunk { pub chunk: u32, } /// Applies a snapshot chunk +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestApplySnapshotChunk { @@ -167,6 +183,7 @@ pub struct RequestApplySnapshotChunk { #[prost(string, tag = "3")] pub sender: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestPrepareProposal { @@ -191,6 +208,7 @@ pub struct RequestPrepareProposal { #[prost(bytes = "bytes", tag = "8")] pub proposer_address: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestProcessProposal { @@ -213,6 +231,7 @@ pub struct RequestProcessProposal { #[prost(bytes = "bytes", tag = "8")] pub proposer_address: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Response { @@ -224,6 +243,7 @@ pub struct Response { } /// Nested message and enum types in `Response`. pub mod response { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { @@ -264,18 +284,21 @@ pub mod response { } } /// nondeterministic +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseException { #[prost(string, tag = "1")] pub error: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseEcho { #[prost(string, tag = "1")] pub message: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseFlush {} @@ -300,6 +323,7 @@ pub struct ResponseInfo { #[serde(skip_serializing_if = "bytes::Bytes::is_empty")] pub last_block_app_hash: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseInitChain { @@ -310,6 +334,7 @@ pub struct ResponseInitChain { #[prost(bytes = "bytes", tag = "3")] pub app_hash: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseQuery { @@ -336,12 +361,14 @@ pub struct ResponseQuery { #[prost(string, tag = "10")] pub codespace: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseBeginBlock { #[prost(message, repeated, tag = "1")] pub events: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseCheckTx { @@ -372,6 +399,7 @@ pub struct ResponseCheckTx { #[prost(string, tag = "11")] pub mempool_error: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseDeliverTx { @@ -395,6 +423,7 @@ pub struct ResponseDeliverTx { #[prost(string, tag = "8")] pub codespace: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseEndBlock { @@ -405,6 +434,7 @@ pub struct ResponseEndBlock { #[prost(message, repeated, tag = "3")] pub events: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseCommit { @@ -414,12 +444,14 @@ pub struct ResponseCommit { #[prost(int64, tag = "3")] pub retain_height: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseListSnapshots { #[prost(message, repeated, tag = "1")] pub snapshots: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseOfferSnapshot { @@ -428,6 +460,7 @@ pub struct ResponseOfferSnapshot { } /// Nested message and enum types in `ResponseOfferSnapshot`. pub mod response_offer_snapshot { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[derive( Clone, Copy, @@ -483,12 +516,14 @@ pub mod response_offer_snapshot { } } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseLoadSnapshotChunk { #[prost(bytes = "bytes", tag = "1")] pub chunk: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseApplySnapshotChunk { @@ -503,6 +538,7 @@ pub struct ResponseApplySnapshotChunk { } /// Nested message and enum types in `ResponseApplySnapshotChunk`. pub mod response_apply_snapshot_chunk { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[derive( Clone, Copy, @@ -558,12 +594,14 @@ pub mod response_apply_snapshot_chunk { } } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponsePrepareProposal { #[prost(bytes = "bytes", repeated, tag = "1")] pub txs: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseProcessProposal { @@ -572,6 +610,7 @@ pub struct ResponseProcessProposal { } /// Nested message and enum types in `ResponseProcessProposal`. pub mod response_process_proposal { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[derive( Clone, Copy, @@ -612,6 +651,7 @@ pub mod response_process_proposal { } } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommitInfo { @@ -620,6 +660,7 @@ pub struct CommitInfo { #[prost(message, repeated, tag = "2")] pub votes: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExtendedCommitInfo { @@ -634,6 +675,7 @@ pub struct ExtendedCommitInfo { /// Event allows application developers to attach additional information to /// ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx. /// Later, transactions may be queried using these events. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Event { @@ -643,6 +685,7 @@ pub struct Event { pub attributes: ::prost::alloc::vec::Vec, } /// EventAttribute is a single key-value pair, associated with an event. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventAttribute { @@ -657,6 +700,7 @@ pub struct EventAttribute { /// TxResult contains results of executing the transaction. /// /// One usage is indexing transaction results. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxResult { @@ -670,6 +714,7 @@ pub struct TxResult { pub result: ::core::option::Option, } /// Validator +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Validator { @@ -683,6 +728,7 @@ pub struct Validator { pub power: i64, } /// ValidatorUpdate +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorUpdate { @@ -692,6 +738,7 @@ pub struct ValidatorUpdate { pub power: i64, } /// VoteInfo +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VoteInfo { @@ -700,6 +747,7 @@ pub struct VoteInfo { #[prost(bool, tag = "2")] pub signed_last_block: bool, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExtendedVoteInfo { @@ -711,6 +759,7 @@ pub struct ExtendedVoteInfo { #[prost(bytes = "bytes", tag = "3")] pub vote_extension: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Misbehavior { @@ -731,6 +780,7 @@ pub struct Misbehavior { #[prost(int64, tag = "5")] pub total_voting_power: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Snapshot { @@ -750,6 +800,7 @@ pub struct Snapshot { #[prost(bytes = "bytes", tag = "5")] pub metadata: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum CheckTxType { @@ -776,6 +827,7 @@ impl CheckTxType { } } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum MisbehaviorType { diff --git a/proto/src/prost/v0_37/tendermint.crypto.rs b/proto/src/prost/v0_37/tendermint.crypto.rs index cfd024d19..0b1c3e197 100644 --- a/proto/src/prost/v0_37/tendermint.crypto.rs +++ b/proto/src/prost/v0_37/tendermint.crypto.rs @@ -38,6 +38,7 @@ pub struct DominoOp { /// ProofOp defines an operation used for calculating Merkle root /// The data could be arbitrary format, providing nessecary data /// for example neighbouring node hash +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOp { @@ -49,6 +50,7 @@ pub struct ProofOp { pub data: ::prost::alloc::vec::Vec, } /// ProofOps is Merkle proof defined by the list of ProofOps +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOps { diff --git a/proto/src/prost/v0_37/tendermint.p2p.rs b/proto/src/prost/v0_37/tendermint.p2p.rs index bfaa808cb..1b96c2577 100644 --- a/proto/src/prost/v0_37/tendermint.p2p.rs +++ b/proto/src/prost/v0_37/tendermint.p2p.rs @@ -1,46 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketPing {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketPong {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketMsg { - #[prost(int32, tag = "1")] - pub channel_id: i32, - #[prost(bool, tag = "2")] - pub eof: bool, - #[prost(bytes = "vec", tag = "3")] - pub data: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Packet { - #[prost(oneof = "packet::Sum", tags = "1, 2, 3")] - pub sum: ::core::option::Option, -} -/// Nested message and enum types in `Packet`. -pub mod packet { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Sum { - #[prost(message, tag = "1")] - PacketPing(super::PacketPing), - #[prost(message, tag = "2")] - PacketPong(super::PacketPong), - #[prost(message, tag = "3")] - PacketMsg(super::PacketMsg), - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AuthSigMessage { - #[prost(message, optional, tag = "1")] - pub pub_key: ::core::option::Option, - #[prost(bytes = "vec", tag = "2")] - pub sig: ::prost::alloc::vec::Vec, -} +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct NetAddress { @@ -51,6 +9,7 @@ pub struct NetAddress { #[prost(uint32, tag = "3")] pub port: u32, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtocolVersion { @@ -61,6 +20,7 @@ pub struct ProtocolVersion { #[prost(uint64, tag = "3")] pub app: u64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DefaultNodeInfo { @@ -81,6 +41,7 @@ pub struct DefaultNodeInfo { #[prost(message, optional, tag = "8")] pub other: ::core::option::Option, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DefaultNodeInfoOther { @@ -89,15 +50,67 @@ pub struct DefaultNodeInfoOther { #[prost(string, tag = "2")] pub rpc_address: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PacketPing {} +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PacketPong {} +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PacketMsg { + #[prost(int32, tag = "1")] + pub channel_id: i32, + #[prost(bool, tag = "2")] + pub eof: bool, + #[prost(bytes = "vec", tag = "3")] + pub data: ::prost::alloc::vec::Vec, +} +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Packet { + #[prost(oneof = "packet::Sum", tags = "1, 2, 3")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `Packet`. +pub mod packet { + #[derive(::serde::Deserialize, ::serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Sum { + #[prost(message, tag = "1")] + PacketPing(super::PacketPing), + #[prost(message, tag = "2")] + PacketPong(super::PacketPong), + #[prost(message, tag = "3")] + PacketMsg(super::PacketMsg), + } +} +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AuthSigMessage { + #[prost(message, optional, tag = "1")] + pub pub_key: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + pub sig: ::prost::alloc::vec::Vec, +} +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PexRequest {} +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PexAddrs { #[prost(message, repeated, tag = "1")] pub addrs: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Message { @@ -106,6 +119,7 @@ pub struct Message { } /// Nested message and enum types in `Message`. pub mod message { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Sum { diff --git a/proto/src/prost/v0_37/tendermint.types.rs b/proto/src/prost/v0_37/tendermint.types.rs index 7d2145ef6..1b0f6ba68 100644 --- a/proto/src/prost/v0_37/tendermint.types.rs +++ b/proto/src/prost/v0_37/tendermint.types.rs @@ -271,7 +271,6 @@ pub struct TxProof { pub proof: ::core::option::Option, } /// BlockIdFlag indicates which BlcokID the signature is for -#[derive(::num_derive::FromPrimitive, ::num_derive::ToPrimitive)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum BlockIdFlag { @@ -339,95 +338,6 @@ impl SignedMsgType { } } } -/// ConsensusParams contains consensus critical parameters that determine the -/// validity of blocks. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsensusParams { - #[prost(message, optional, tag = "1")] - pub block: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub evidence: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub validator: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub version: ::core::option::Option, -} -/// BlockParams contains limits on the block size. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BlockParams { - /// Max block size, in bytes. - /// Note: must be greater than 0 - #[prost(int64, tag = "1")] - pub max_bytes: i64, - /// Max gas per block. - /// Note: must be greater or equal to -1 - #[prost(int64, tag = "2")] - pub max_gas: i64, -} -/// EvidenceParams determine how we handle evidence of malfeasance. -#[derive(::serde::Deserialize, ::serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct EvidenceParams { - /// Max age of evidence, in blocks. - /// - /// The basic formula for calculating this is: MaxAgeDuration / {average block - /// time}. - #[prost(int64, tag = "1")] - #[serde(with = "crate::serializers::from_str", default)] - pub max_age_num_blocks: i64, - /// Max age of evidence, in time. - /// - /// It should correspond with an app's "unbonding period" or other similar - /// mechanism for handling [Nothing-At-Stake - /// attacks](). - #[prost(message, optional, tag = "2")] - pub max_age_duration: ::core::option::Option, - /// This sets the maximum size of total evidence in bytes that can be committed in a single block. - /// and should fall comfortably under the max block bytes. - /// Default is 1048576 or 1MB - #[prost(int64, tag = "3")] - #[serde(with = "crate::serializers::from_str", default)] - pub max_bytes: i64, -} -/// ValidatorParams restrict the public key types validators can use. -/// NOTE: uses ABCI pubkey naming, not Amino names. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ValidatorParams { - #[prost(string, repeated, tag = "1")] - pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// VersionParams contains the ABCI application version. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VersionParams { - #[prost(uint64, tag = "1")] - pub app: u64, -} -/// HashedParams is a subset of ConsensusParams. -/// -/// It is hashed into the Header.ConsensusHash. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HashedParams { - #[prost(int64, tag = "1")] - pub block_max_bytes: i64, - #[prost(int64, tag = "2")] - pub block_max_gas: i64, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct EventDataRoundState { - #[prost(int64, tag = "1")] - pub height: i64, - #[prost(int32, tag = "2")] - pub round: i32, - #[prost(string, tag = "3")] - pub step: ::prost::alloc::string::String, -} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Evidence { @@ -508,6 +418,99 @@ pub struct Block { #[prost(message, optional, tag = "4")] pub last_commit: ::core::option::Option, } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventDataRoundState { + #[prost(int64, tag = "1")] + pub height: i64, + #[prost(int32, tag = "2")] + pub round: i32, + #[prost(string, tag = "3")] + pub step: ::prost::alloc::string::String, +} +/// ConsensusParams contains consensus critical parameters that determine the +/// validity of blocks. +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConsensusParams { + #[prost(message, optional, tag = "1")] + pub block: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub evidence: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub validator: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub version: ::core::option::Option, +} +/// BlockParams contains limits on the block size. +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BlockParams { + /// Max block size, in bytes. + /// Note: must be greater than 0 + #[prost(int64, tag = "1")] + pub max_bytes: i64, + /// Max gas per block. + /// Note: must be greater or equal to -1 + #[prost(int64, tag = "2")] + pub max_gas: i64, +} +/// EvidenceParams determine how we handle evidence of malfeasance. +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EvidenceParams { + /// Max age of evidence, in blocks. + /// + /// The basic formula for calculating this is: MaxAgeDuration / {average block + /// time}. + #[prost(int64, tag = "1")] + #[serde(with = "crate::serializers::from_str", default)] + pub max_age_num_blocks: i64, + /// Max age of evidence, in time. + /// + /// It should correspond with an app's "unbonding period" or other similar + /// mechanism for handling [Nothing-At-Stake + /// attacks](). + #[prost(message, optional, tag = "2")] + pub max_age_duration: ::core::option::Option, + /// This sets the maximum size of total evidence in bytes that can be committed in a single block. + /// and should fall comfortably under the max block bytes. + /// Default is 1048576 or 1MB + #[prost(int64, tag = "3")] + #[serde(with = "crate::serializers::from_str", default)] + pub max_bytes: i64, +} +/// ValidatorParams restrict the public key types validators can use. +/// NOTE: uses ABCI pubkey naming, not Amino names. +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ValidatorParams { + #[prost(string, repeated, tag = "1")] + pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// VersionParams contains the ABCI application version. +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VersionParams { + #[prost(uint64, tag = "1")] + pub app: u64, +} +/// HashedParams is a subset of ConsensusParams. +/// +/// It is hashed into the Header.ConsensusHash. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HashedParams { + #[prost(int64, tag = "1")] + pub block_max_bytes: i64, + #[prost(int64, tag = "2")] + pub block_max_gas: i64, +} #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/proto/src/prost/v0_38/tendermint.abci.rs b/proto/src/prost/v0_38/tendermint.abci.rs index e7a223e28..34ab13e8d 100644 --- a/proto/src/prost/v0_38/tendermint.abci.rs +++ b/proto/src/prost/v0_38/tendermint.abci.rs @@ -1,3 +1,4 @@ +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Request { @@ -9,6 +10,7 @@ pub struct Request { } /// Nested message and enum types in `Request`. pub mod request { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { @@ -46,15 +48,18 @@ pub mod request { FinalizeBlock(super::RequestFinalizeBlock), } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestEcho { #[prost(string, tag = "1")] pub message: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestFlush {} +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestInfo { @@ -67,6 +72,7 @@ pub struct RequestInfo { #[prost(string, tag = "4")] pub abci_version: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestInitChain { @@ -83,6 +89,7 @@ pub struct RequestInitChain { #[prost(int64, tag = "6")] pub initial_height: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestQuery { @@ -95,6 +102,7 @@ pub struct RequestQuery { #[prost(bool, tag = "4")] pub prove: bool, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestCheckTx { @@ -103,14 +111,17 @@ pub struct RequestCheckTx { #[prost(enumeration = "CheckTxType", tag = "2")] pub r#type: i32, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestCommit {} /// lists available snapshots +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestListSnapshots {} /// offers a snapshot to the application +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestOfferSnapshot { @@ -122,6 +133,7 @@ pub struct RequestOfferSnapshot { pub app_hash: ::prost::bytes::Bytes, } /// loads a snapshot chunk +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestLoadSnapshotChunk { @@ -133,6 +145,7 @@ pub struct RequestLoadSnapshotChunk { pub chunk: u32, } /// Applies a snapshot chunk +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestApplySnapshotChunk { @@ -143,6 +156,7 @@ pub struct RequestApplySnapshotChunk { #[prost(string, tag = "3")] pub sender: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestPrepareProposal { @@ -167,6 +181,7 @@ pub struct RequestPrepareProposal { #[prost(bytes = "bytes", tag = "8")] pub proposer_address: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestProcessProposal { @@ -190,6 +205,7 @@ pub struct RequestProcessProposal { pub proposer_address: ::prost::bytes::Bytes, } /// Extends a vote with application-injected data +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestExtendVote { @@ -215,6 +231,7 @@ pub struct RequestExtendVote { pub proposer_address: ::prost::bytes::Bytes, } /// Verify the vote extension +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestVerifyVoteExtension { @@ -229,6 +246,7 @@ pub struct RequestVerifyVoteExtension { #[prost(bytes = "bytes", tag = "4")] pub vote_extension: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RequestFinalizeBlock { @@ -251,6 +269,7 @@ pub struct RequestFinalizeBlock { #[prost(bytes = "bytes", tag = "8")] pub proposer_address: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Response { @@ -262,6 +281,7 @@ pub struct Response { } /// Nested message and enum types in `Response`. pub mod response { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { @@ -302,18 +322,21 @@ pub mod response { } } /// nondeterministic +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseException { #[prost(string, tag = "1")] pub error: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseEcho { #[prost(string, tag = "1")] pub message: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseFlush {} @@ -338,6 +361,7 @@ pub struct ResponseInfo { #[serde(skip_serializing_if = "bytes::Bytes::is_empty")] pub last_block_app_hash: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseInitChain { @@ -348,6 +372,7 @@ pub struct ResponseInitChain { #[prost(bytes = "bytes", tag = "3")] pub app_hash: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseQuery { @@ -374,6 +399,7 @@ pub struct ResponseQuery { #[prost(string, tag = "10")] pub codespace: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseCheckTx { @@ -396,18 +422,21 @@ pub struct ResponseCheckTx { #[prost(string, tag = "8")] pub codespace: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseCommit { #[prost(int64, tag = "3")] pub retain_height: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseListSnapshots { #[prost(message, repeated, tag = "1")] pub snapshots: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseOfferSnapshot { @@ -416,6 +445,7 @@ pub struct ResponseOfferSnapshot { } /// Nested message and enum types in `ResponseOfferSnapshot`. pub mod response_offer_snapshot { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[derive( Clone, Copy, @@ -471,12 +501,14 @@ pub mod response_offer_snapshot { } } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseLoadSnapshotChunk { #[prost(bytes = "bytes", tag = "1")] pub chunk: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseApplySnapshotChunk { @@ -491,6 +523,7 @@ pub struct ResponseApplySnapshotChunk { } /// Nested message and enum types in `ResponseApplySnapshotChunk`. pub mod response_apply_snapshot_chunk { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[derive( Clone, Copy, @@ -546,12 +579,14 @@ pub mod response_apply_snapshot_chunk { } } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponsePrepareProposal { #[prost(bytes = "bytes", repeated, tag = "1")] pub txs: ::prost::alloc::vec::Vec<::prost::bytes::Bytes>, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseProcessProposal { @@ -560,6 +595,7 @@ pub struct ResponseProcessProposal { } /// Nested message and enum types in `ResponseProcessProposal`. pub mod response_process_proposal { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[derive( Clone, Copy, @@ -600,12 +636,14 @@ pub mod response_process_proposal { } } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseExtendVote { #[prost(bytes = "bytes", tag = "1")] pub vote_extension: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseVerifyVoteExtension { @@ -614,6 +652,7 @@ pub struct ResponseVerifyVoteExtension { } /// Nested message and enum types in `ResponseVerifyVoteExtension`. pub mod response_verify_vote_extension { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[derive( Clone, Copy, @@ -658,6 +697,7 @@ pub mod response_verify_vote_extension { } } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ResponseFinalizeBlock { @@ -679,6 +719,7 @@ pub struct ResponseFinalizeBlock { #[prost(bytes = "bytes", tag = "5")] pub app_hash: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommitInfo { @@ -690,6 +731,7 @@ pub struct CommitInfo { /// ExtendedCommitInfo is similar to CommitInfo except that it is only used in /// the PrepareProposal request such that CometBFT can provide vote extensions /// to the application. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExtendedCommitInfo { @@ -704,6 +746,7 @@ pub struct ExtendedCommitInfo { /// Event allows application developers to attach additional information to /// ResponseFinalizeBlock and ResponseCheckTx. /// Later, transactions may be queried using these events. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Event { @@ -713,6 +756,7 @@ pub struct Event { pub attributes: ::prost::alloc::vec::Vec, } /// EventAttribute is a single key-value pair, associated with an event. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventAttribute { @@ -727,6 +771,7 @@ pub struct EventAttribute { /// ExecTxResult contains results of executing one individual transaction. /// /// * Its structure is equivalent to #ResponseDeliverTx which will be deprecated/deleted +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExecTxResult { @@ -753,6 +798,7 @@ pub struct ExecTxResult { /// TxResult contains results of executing the transaction. /// /// One usage is indexing transaction results. +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxResult { @@ -765,6 +811,7 @@ pub struct TxResult { #[prost(message, optional, tag = "4")] pub result: ::core::option::Option, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Validator { @@ -777,6 +824,7 @@ pub struct Validator { #[prost(int64, tag = "3")] pub power: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorUpdate { @@ -785,6 +833,7 @@ pub struct ValidatorUpdate { #[prost(int64, tag = "2")] pub power: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VoteInfo { @@ -793,6 +842,7 @@ pub struct VoteInfo { #[prost(enumeration = "super::types::BlockIdFlag", tag = "3")] pub block_id_flag: i32, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExtendedVoteInfo { @@ -809,6 +859,7 @@ pub struct ExtendedVoteInfo { #[prost(enumeration = "super::types::BlockIdFlag", tag = "5")] pub block_id_flag: i32, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Misbehavior { @@ -829,6 +880,7 @@ pub struct Misbehavior { #[prost(int64, tag = "5")] pub total_voting_power: i64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Snapshot { @@ -848,6 +900,7 @@ pub struct Snapshot { #[prost(bytes = "bytes", tag = "5")] pub metadata: ::prost::bytes::Bytes, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum CheckTxType { @@ -874,6 +927,7 @@ impl CheckTxType { } } } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum MisbehaviorType { diff --git a/proto/src/prost/v0_38/tendermint.crypto.rs b/proto/src/prost/v0_38/tendermint.crypto.rs index cfd024d19..0b1c3e197 100644 --- a/proto/src/prost/v0_38/tendermint.crypto.rs +++ b/proto/src/prost/v0_38/tendermint.crypto.rs @@ -38,6 +38,7 @@ pub struct DominoOp { /// ProofOp defines an operation used for calculating Merkle root /// The data could be arbitrary format, providing nessecary data /// for example neighbouring node hash +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOp { @@ -49,6 +50,7 @@ pub struct ProofOp { pub data: ::prost::alloc::vec::Vec, } /// ProofOps is Merkle proof defined by the list of ProofOps +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOps { diff --git a/proto/src/prost/v0_38/tendermint.p2p.rs b/proto/src/prost/v0_38/tendermint.p2p.rs index bfaa808cb..1b96c2577 100644 --- a/proto/src/prost/v0_38/tendermint.p2p.rs +++ b/proto/src/prost/v0_38/tendermint.p2p.rs @@ -1,46 +1,4 @@ -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketPing {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketPong {} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketMsg { - #[prost(int32, tag = "1")] - pub channel_id: i32, - #[prost(bool, tag = "2")] - pub eof: bool, - #[prost(bytes = "vec", tag = "3")] - pub data: ::prost::alloc::vec::Vec, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Packet { - #[prost(oneof = "packet::Sum", tags = "1, 2, 3")] - pub sum: ::core::option::Option, -} -/// Nested message and enum types in `Packet`. -pub mod packet { - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Sum { - #[prost(message, tag = "1")] - PacketPing(super::PacketPing), - #[prost(message, tag = "2")] - PacketPong(super::PacketPong), - #[prost(message, tag = "3")] - PacketMsg(super::PacketMsg), - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AuthSigMessage { - #[prost(message, optional, tag = "1")] - pub pub_key: ::core::option::Option, - #[prost(bytes = "vec", tag = "2")] - pub sig: ::prost::alloc::vec::Vec, -} +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct NetAddress { @@ -51,6 +9,7 @@ pub struct NetAddress { #[prost(uint32, tag = "3")] pub port: u32, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProtocolVersion { @@ -61,6 +20,7 @@ pub struct ProtocolVersion { #[prost(uint64, tag = "3")] pub app: u64, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DefaultNodeInfo { @@ -81,6 +41,7 @@ pub struct DefaultNodeInfo { #[prost(message, optional, tag = "8")] pub other: ::core::option::Option, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DefaultNodeInfoOther { @@ -89,15 +50,67 @@ pub struct DefaultNodeInfoOther { #[prost(string, tag = "2")] pub rpc_address: ::prost::alloc::string::String, } +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PacketPing {} +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PacketPong {} +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PacketMsg { + #[prost(int32, tag = "1")] + pub channel_id: i32, + #[prost(bool, tag = "2")] + pub eof: bool, + #[prost(bytes = "vec", tag = "3")] + pub data: ::prost::alloc::vec::Vec, +} +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Packet { + #[prost(oneof = "packet::Sum", tags = "1, 2, 3")] + pub sum: ::core::option::Option, +} +/// Nested message and enum types in `Packet`. +pub mod packet { + #[derive(::serde::Deserialize, ::serde::Serialize)] + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Sum { + #[prost(message, tag = "1")] + PacketPing(super::PacketPing), + #[prost(message, tag = "2")] + PacketPong(super::PacketPong), + #[prost(message, tag = "3")] + PacketMsg(super::PacketMsg), + } +} +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AuthSigMessage { + #[prost(message, optional, tag = "1")] + pub pub_key: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + pub sig: ::prost::alloc::vec::Vec, +} +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PexRequest {} +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PexAddrs { #[prost(message, repeated, tag = "1")] pub addrs: ::prost::alloc::vec::Vec, } +#[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Message { @@ -106,6 +119,7 @@ pub struct Message { } /// Nested message and enum types in `Message`. pub mod message { + #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Sum { diff --git a/proto/src/prost/v0_38/tendermint.types.rs b/proto/src/prost/v0_38/tendermint.types.rs index 52a3a5d2e..863ef73f4 100644 --- a/proto/src/prost/v0_38/tendermint.types.rs +++ b/proto/src/prost/v0_38/tendermint.types.rs @@ -1,100 +1,3 @@ -/// ConsensusParams contains consensus critical parameters that determine the -/// validity of blocks. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsensusParams { - #[prost(message, optional, tag = "1")] - pub block: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub evidence: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub validator: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub version: ::core::option::Option, - #[prost(message, optional, tag = "5")] - pub abci: ::core::option::Option, -} -/// BlockParams contains limits on the block size. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BlockParams { - /// Max block size, in bytes. - /// Note: must be greater than 0 - #[prost(int64, tag = "1")] - pub max_bytes: i64, - /// Max gas per block. - /// Note: must be greater or equal to -1 - #[prost(int64, tag = "2")] - pub max_gas: i64, -} -/// EvidenceParams determine how we handle evidence of malfeasance. -#[derive(::serde::Deserialize, ::serde::Serialize)] -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct EvidenceParams { - /// Max age of evidence, in blocks. - /// - /// The basic formula for calculating this is: MaxAgeDuration / {average block - /// time}. - #[prost(int64, tag = "1")] - #[serde(with = "crate::serializers::from_str", default)] - pub max_age_num_blocks: i64, - /// Max age of evidence, in time. - /// - /// It should correspond with an app's "unbonding period" or other similar - /// mechanism for handling [Nothing-At-Stake - /// attacks](). - #[prost(message, optional, tag = "2")] - pub max_age_duration: ::core::option::Option, - /// This sets the maximum size of total evidence in bytes that can be committed in a single block. - /// and should fall comfortably under the max block bytes. - /// Default is 1048576 or 1MB - #[prost(int64, tag = "3")] - #[serde(with = "crate::serializers::from_str", default)] - pub max_bytes: i64, -} -/// ValidatorParams restrict the public key types validators can use. -/// NOTE: uses ABCI pubkey naming, not Amino names. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ValidatorParams { - #[prost(string, repeated, tag = "1")] - pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -/// VersionParams contains the ABCI application version. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct VersionParams { - #[prost(uint64, tag = "1")] - pub app: u64, -} -/// HashedParams is a subset of ConsensusParams. -/// -/// It is hashed into the Header.ConsensusHash. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HashedParams { - #[prost(int64, tag = "1")] - pub block_max_bytes: i64, - #[prost(int64, tag = "2")] - pub block_max_gas: i64, -} -/// ABCIParams configure functionality specific to the Application Blockchain Interface. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct AbciParams { - /// vote_extensions_enable_height configures the first height during which - /// vote extensions will be enabled. During this specified height, and for all - /// subsequent heights, precommit messages that do not contain valid extension data - /// will be considered invalid. Prior to this height, vote extensions will not - /// be used or accepted by validators on the network. - /// - /// Once enabled, vote extensions will be created by the application in ExtendVote, - /// passed to the application for validation in VerifyVoteExtension and given - /// to the application to use when proposing a block during PrepareProposal. - #[prost(int64, tag = "1")] - pub vote_extensions_enable_height: i64, -} #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -134,7 +37,6 @@ pub struct SimpleValidator { pub voting_power: i64, } /// BlockIdFlag indicates which BlockID the signature is for -#[derive(::num_derive::FromPrimitive, ::num_derive::ToPrimitive)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum BlockIdFlag { @@ -486,16 +388,6 @@ impl SignedMsgType { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct EventDataRoundState { - #[prost(int64, tag = "1")] - pub height: i64, - #[prost(int32, tag = "2")] - pub round: i32, - #[prost(string, tag = "3")] - pub step: ::prost::alloc::string::String, -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] pub struct Evidence { #[prost(oneof = "evidence::Sum", tags = "1, 2")] pub sum: ::core::option::Option, @@ -574,6 +466,118 @@ pub struct Block { #[prost(message, optional, tag = "4")] pub last_commit: ::core::option::Option, } +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventDataRoundState { + #[prost(int64, tag = "1")] + pub height: i64, + #[prost(int32, tag = "2")] + pub round: i32, + #[prost(string, tag = "3")] + pub step: ::prost::alloc::string::String, +} +/// ConsensusParams contains consensus critical parameters that determine the +/// validity of blocks. +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConsensusParams { + #[prost(message, optional, tag = "1")] + pub block: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub evidence: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub validator: ::core::option::Option, + #[prost(message, optional, tag = "4")] + pub version: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub abci: ::core::option::Option, +} +/// BlockParams contains limits on the block size. +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BlockParams { + /// Max block size, in bytes. + /// Note: must be greater than 0 + #[prost(int64, tag = "1")] + pub max_bytes: i64, + /// Max gas per block. + /// Note: must be greater or equal to -1 + #[prost(int64, tag = "2")] + pub max_gas: i64, +} +/// EvidenceParams determine how we handle evidence of malfeasance. +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EvidenceParams { + /// Max age of evidence, in blocks. + /// + /// The basic formula for calculating this is: MaxAgeDuration / {average block + /// time}. + #[prost(int64, tag = "1")] + #[serde(with = "crate::serializers::from_str", default)] + pub max_age_num_blocks: i64, + /// Max age of evidence, in time. + /// + /// It should correspond with an app's "unbonding period" or other similar + /// mechanism for handling [Nothing-At-Stake + /// attacks](). + #[prost(message, optional, tag = "2")] + pub max_age_duration: ::core::option::Option, + /// This sets the maximum size of total evidence in bytes that can be committed in a single block. + /// and should fall comfortably under the max block bytes. + /// Default is 1048576 or 1MB + #[prost(int64, tag = "3")] + #[serde(with = "crate::serializers::from_str", default)] + pub max_bytes: i64, +} +/// ValidatorParams restrict the public key types validators can use. +/// NOTE: uses ABCI pubkey naming, not Amino names. +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ValidatorParams { + #[prost(string, repeated, tag = "1")] + pub pub_key_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// VersionParams contains the ABCI application version. +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VersionParams { + #[prost(uint64, tag = "1")] + pub app: u64, +} +/// HashedParams is a subset of ConsensusParams. +/// +/// It is hashed into the Header.ConsensusHash. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HashedParams { + #[prost(int64, tag = "1")] + pub block_max_bytes: i64, + #[prost(int64, tag = "2")] + pub block_max_gas: i64, +} +/// ABCIParams configure functionality specific to the Application Blockchain Interface. +#[derive(::serde::Deserialize, ::serde::Serialize)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AbciParams { + /// vote_extensions_enable_height configures the first height during which + /// vote extensions will be enabled. During this specified height, and for all + /// subsequent heights, precommit messages that do not contain valid extension data + /// will be considered invalid. Prior to this height, vote extensions will not + /// be used or accepted by validators on the network. + /// + /// Once enabled, vote extensions will be created by the application in ExtendVote, + /// passed to the application for validation in VerifyVoteExtension and given + /// to the application to use when proposing a block during PrepareProposal. + #[prost(int64, tag = "1")] + pub vote_extensions_enable_height: i64, +} #[derive(::serde::Deserialize, ::serde::Serialize)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/tendermint/src/block/commit_sig.rs b/tendermint/src/block/commit_sig.rs index d239e630b..c386468a0 100644 --- a/tendermint/src/block/commit_sig.rs +++ b/tendermint/src/block/commit_sig.rs @@ -84,14 +84,13 @@ tendermint_pb_modules! { use super::{CommitSig, ZERO_TIMESTAMP}; use crate::{error::Error, prelude::*, Signature}; - use num_traits::ToPrimitive; use pb::types::{BlockIdFlag, CommitSig as RawCommitSig}; impl TryFrom for CommitSig { type Error = Error; fn try_from(value: RawCommitSig) -> Result { - if value.block_id_flag == BlockIdFlag::Absent.to_i32().unwrap() { + if value.block_id_flag == BlockIdFlag::Absent as i32 { if value.timestamp.is_some() { let timestamp = value.timestamp.unwrap(); // 0001-01-01T00:00:00.000Z translates to EPOCH-62135596800 seconds @@ -111,7 +110,7 @@ tendermint_pb_modules! { return Ok(CommitSig::BlockIdFlagAbsent); } - if value.block_id_flag == BlockIdFlag::Commit.to_i32().unwrap() { + if value.block_id_flag == BlockIdFlag::Commit as i32 { if value.signature.is_empty() { return Err(Error::invalid_signature( "expected non-empty signature for regular commitsig".to_string(), @@ -133,7 +132,7 @@ tendermint_pb_modules! { signature: Signature::new(value.signature)?, }); } - if value.block_id_flag == BlockIdFlag::Nil.to_i32().unwrap() { + if value.block_id_flag == BlockIdFlag::Nil as i32 { if value.signature.is_empty() { return Err(Error::invalid_signature( "nil commitsig has no signature".to_string(), @@ -159,7 +158,7 @@ tendermint_pb_modules! { fn from(commit: CommitSig) -> RawCommitSig { match commit { CommitSig::BlockIdFlagAbsent => RawCommitSig { - block_id_flag: BlockIdFlag::Absent.to_i32().unwrap(), + block_id_flag: BlockIdFlag::Absent as i32, validator_address: Vec::new(), timestamp: Some(ZERO_TIMESTAMP), signature: Vec::new(), @@ -169,7 +168,7 @@ tendermint_pb_modules! { timestamp, signature, } => RawCommitSig { - block_id_flag: BlockIdFlag::Nil.to_i32().unwrap(), + block_id_flag: BlockIdFlag::Nil as i32, validator_address: validator_address.into(), timestamp: Some(timestamp.into()), signature: signature.map(|s| s.into_bytes()).unwrap_or_default(), @@ -179,7 +178,7 @@ tendermint_pb_modules! { timestamp, signature, } => RawCommitSig { - block_id_flag: BlockIdFlag::Commit.to_i32().unwrap(), + block_id_flag: BlockIdFlag::Commit as i32, validator_address: validator_address.into(), timestamp: Some(timestamp.into()), signature: signature.map(|s| s.into_bytes()).unwrap_or_default(), diff --git a/tools/proto-compiler/src/constants.rs b/tools/proto-compiler/src/constants.rs index 9f2c8ad33..edc603b03 100644 --- a/tools/proto-compiler/src/constants.rs +++ b/tools/proto-compiler/src/constants.rs @@ -34,7 +34,6 @@ pub const TENDERMINT_VERSIONS: &[TendermintVersion] = &[ ]; /// Predefined custom attributes for message annotations -const PRIMITIVE_ENUM: &str = r#"#[derive(::num_derive::FromPrimitive, ::num_derive::ToPrimitive)]"#; const SERIALIZED: &str = r#"#[derive(::serde::Deserialize, ::serde::Serialize)]"#; const TYPE_TAG: &str = r#"#[serde(tag = "type", content = "value")]"#; @@ -75,40 +74,47 @@ const RENAME_PARTS: &str = r#"#[serde(rename = "parts", alias = "part_set_header /// The first item is a path as defined in the prost_build::Config::btree_map here: /// https://docs.rs/prost-build/0.6.1/prost_build/struct.Config.html#method.btree_map pub static CUSTOM_TYPE_ATTRIBUTES: &[(&str, &str)] = &[ + (".tendermint.abci", SERIALIZED), + (".tendermint.crypto.Proof", SERIALIZED), + (".tendermint.crypto.ProofOp", SERIALIZED), + (".tendermint.crypto.ProofOps", SERIALIZED), + (".tendermint.crypto.PublicKey.sum", SERIALIZED), + (".tendermint.crypto.PublicKey.sum", TYPE_TAG), (".tendermint.libs.bits.BitArray", SERIALIZED), - (".tendermint.types.BlockIDFlag", PRIMITIVE_ENUM), + (".tendermint.p2p", SERIALIZED), + (".tendermint.types.ABCIParams", SERIALIZED), (".tendermint.types.Block", SERIALIZED), + (".tendermint.types.BlockID", SERIALIZED), + (".tendermint.types.BlockMeta", SERIALIZED), + (".tendermint.types.CanonicalBlockID", SERIALIZED), + (".tendermint.types.CanonicalPartSetHeader", SERIALIZED), + (".tendermint.types.CanonicalVote", SERIALIZED), + (".tendermint.types.Commit", SERIALIZED), + (".tendermint.types.CommitSig", SERIALIZED), + (".tendermint.types.ConsensusParams", SERIALIZED), (".tendermint.types.Data", SERIALIZED), - (".tendermint.types.EvidenceParams", SERIALIZED), + (".tendermint.types.DuplicateVoteEvidence", SERIALIZED), (".tendermint.types.Evidence.sum", SERIALIZED), (".tendermint.types.Evidence.sum", TYPE_TAG), (".tendermint.types.EvidenceList", SERIALIZED), - (".tendermint.types.DuplicateVoteEvidence", SERIALIZED), - (".tendermint.types.Vote", SERIALIZED), - (".tendermint.types.BlockID", SERIALIZED), - (".tendermint.types.PartSetHeader", SERIALIZED), + (".tendermint.types.EvidenceParams", SERIALIZED), + (".tendermint.types.Header", SERIALIZED), + (".tendermint.types.LightBlock", SERIALIZED), (".tendermint.types.LightClientAttackEvidence", SERIALIZED), ( ".tendermint.types.LightClientAttackEvidence", RENAME_ALL_PASCALCASE, ), - (".tendermint.types.LightBlock", SERIALIZED), + (".tendermint.types.PartSetHeader", SERIALIZED), (".tendermint.types.SignedHeader", SERIALIZED), - (".tendermint.types.Header", SERIALIZED), - (".tendermint.version.Consensus", SERIALIZED), - (".tendermint.types.Commit", SERIALIZED), - (".tendermint.types.CommitSig", SERIALIZED), - (".tendermint.types.ValidatorSet", SERIALIZED), - (".tendermint.crypto.PublicKey.sum", SERIALIZED), - (".tendermint.crypto.PublicKey.sum", TYPE_TAG), - (".tendermint.abci.ResponseInfo", SERIALIZED), - (".tendermint.types.CanonicalBlockID", SERIALIZED), - (".tendermint.types.CanonicalPartSetHeader", SERIALIZED), - (".tendermint.types.Validator", SERIALIZED), - (".tendermint.types.CanonicalVote", SERIALIZED), - (".tendermint.types.BlockMeta", SERIALIZED), (".tendermint.types.TxProof", SERIALIZED), - (".tendermint.crypto.Proof", SERIALIZED), + (".tendermint.types.Validator", SERIALIZED), + (".tendermint.types.ValidatorSet", SERIALIZED), + (".tendermint.types.VersionParams", SERIALIZED), + (".tendermint.types.ValidatorParams", SERIALIZED), + (".tendermint.types.BlockParams", SERIALIZED), + (".tendermint.types.Vote", SERIALIZED), + (".tendermint.version.Consensus", SERIALIZED), ]; /// Custom field attributes applied on top of protobuf fields in (a) struct(s) @@ -200,7 +206,8 @@ pub static CUSTOM_FIELD_ATTRIBUTES: &[(&str, &str)] = &[ ".tendermint.types.Validator.proposer_priority", QUOTED_ALLOW_NULL, ), // null occurs in some LightBlock data - (".tendermint.types.Validator.proposer_priority", DEFAULT), // Default is for /genesis deserialization + (".tendermint.types.Validator.proposer_priority", DEFAULT), /* Default is for /genesis + * deserialization */ ( ".tendermint.types.ValidatorSet.total_voting_power", QUOTED_WITH_DEFAULT,