From d3d729ee8d85f6a49b87da4e28f618cb57bf4afd Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Mon, 4 Jan 2021 09:40:27 -0800 Subject: [PATCH] Bump cosmos-sdk rev to v0.40.0-rc6 Release notes: https://github.com/cosmos/cosmos-sdk/pull/8249 --- cosmos-sdk-go | 2 +- cosmos-sdk-proto/src/prost/COSMOS_SDK_COMMIT | 2 +- .../prost/cosmos.base.tendermint.v1beta1.rs | 126 ++++++++++ .../src/prost/cosmos.tx.v1beta1.rs | 97 +++++++- .../src/prost/ibc.core.channel.v1.rs | 41 ++-- .../src/prost/ibc.core.client.v1.rs | 222 +++++++++++------- .../src/prost/ibc.core.commitment.v1.rs | 33 +-- .../src/prost/ibc.core.connection.v1.rs | 41 ++-- .../prost/ibc.lightclients.tendermint.v1.rs | 35 ++- proto-build/src/main.rs | 3 +- 10 files changed, 429 insertions(+), 173 deletions(-) create mode 100644 cosmos-sdk-proto/src/prost/cosmos.base.tendermint.v1beta1.rs diff --git a/cosmos-sdk-go b/cosmos-sdk-go index 59035865..f4ce6860 160000 --- a/cosmos-sdk-go +++ b/cosmos-sdk-go @@ -1 +1 @@ -Subproject commit 590358652cc1cbc13872ea1659187e073ea38e75 +Subproject commit f4ce6860d23a95e063f8b5f0bc340b2408a8604c diff --git a/cosmos-sdk-proto/src/prost/COSMOS_SDK_COMMIT b/cosmos-sdk-proto/src/prost/COSMOS_SDK_COMMIT index 6c145dfc..c1d21564 100644 --- a/cosmos-sdk-proto/src/prost/COSMOS_SDK_COMMIT +++ b/cosmos-sdk-proto/src/prost/COSMOS_SDK_COMMIT @@ -1 +1 @@ -v0.40.0-rc3 \ No newline at end of file +v0.40.0-rc6 \ No newline at end of file diff --git a/cosmos-sdk-proto/src/prost/cosmos.base.tendermint.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos.base.tendermint.v1beta1.rs new file mode 100644 index 00000000..1058b946 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos.base.tendermint.v1beta1.rs @@ -0,0 +1,126 @@ +/// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetValidatorSetByHeightRequest { + #[prost(int64, tag = "1")] + pub height: i64, + /// pagination defines an pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::std::option::Option, +} +/// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetValidatorSetByHeightResponse { + #[prost(int64, tag = "1")] + pub block_height: i64, + #[prost(message, repeated, tag = "2")] + pub validators: ::std::vec::Vec, + /// pagination defines an pagination for the response. + #[prost(message, optional, tag = "3")] + pub pagination: ::std::option::Option, +} +/// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetLatestValidatorSetRequest { + /// pagination defines an pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::std::option::Option, +} +/// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetLatestValidatorSetResponse { + #[prost(int64, tag = "1")] + pub block_height: i64, + #[prost(message, repeated, tag = "2")] + pub validators: ::std::vec::Vec, + /// pagination defines an pagination for the response. + #[prost(message, optional, tag = "3")] + pub pagination: ::std::option::Option, +} +/// Validator is the type for the validator-set. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Validator { + #[prost(string, tag = "1")] + pub address: std::string::String, + #[prost(message, optional, tag = "2")] + pub pub_key: ::std::option::Option<::prost_types::Any>, + #[prost(int64, tag = "3")] + pub voting_power: i64, + #[prost(int64, tag = "4")] + pub proposer_priority: i64, +} +/// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetBlockByHeightRequest { + #[prost(int64, tag = "1")] + pub height: i64, +} +/// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetBlockByHeightResponse { + #[prost(message, optional, tag = "1")] + pub block_id: ::std::option::Option<::tendermint_proto::types::BlockId>, + #[prost(message, optional, tag = "2")] + pub block: ::std::option::Option<::tendermint_proto::types::Block>, +} +/// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetLatestBlockRequest {} +/// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetLatestBlockResponse { + #[prost(message, optional, tag = "1")] + pub block_id: ::std::option::Option<::tendermint_proto::types::BlockId>, + #[prost(message, optional, tag = "2")] + pub block: ::std::option::Option<::tendermint_proto::types::Block>, +} +/// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetSyncingRequest {} +/// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetSyncingResponse { + #[prost(bool, tag = "1")] + pub syncing: bool, +} +/// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetNodeInfoRequest {} +/// GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetNodeInfoResponse { + #[prost(message, optional, tag = "1")] + pub default_node_info: ::std::option::Option<::tendermint_proto::p2p::DefaultNodeInfo>, + #[prost(message, optional, tag = "2")] + pub application_version: ::std::option::Option, +} +/// VersionInfo is the type for the GetNodeInfoResponse message. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VersionInfo { + #[prost(string, tag = "1")] + pub name: std::string::String, + #[prost(string, tag = "2")] + pub app_name: std::string::String, + #[prost(string, tag = "3")] + pub version: std::string::String, + #[prost(string, tag = "4")] + pub git_commit: std::string::String, + #[prost(string, tag = "5")] + pub build_tags: std::string::String, + #[prost(string, tag = "6")] + pub go_version: std::string::String, + #[prost(message, repeated, tag = "7")] + pub build_deps: ::std::vec::Vec, +} +/// Module is the type for VersionInfo +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// module path + #[prost(string, tag = "1")] + pub path: std::string::String, + /// module version + #[prost(string, tag = "2")] + pub version: std::string::String, + /// checksum + #[prost(string, tag = "3")] + pub sum: std::string::String, +} diff --git a/cosmos-sdk-proto/src/prost/cosmos.tx.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos.tx.v1beta1.rs index e7a8e27a..22978544 100644 --- a/cosmos-sdk-proto/src/prost/cosmos.tx.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos.tx.v1beta1.rs @@ -62,7 +62,6 @@ pub struct TxBody { /// those messages define the number and order of elements in AuthInfo's /// signer_infos and Tx's signatures. Each required signer address is added to /// the list only the first time it occurs. - /// /// By convention, the first required signer (usually from the first message) /// is referred to as the primary signer and pays the fee for the whole /// transaction. @@ -187,6 +186,49 @@ pub struct Fee { #[prost(string, tag = "4")] pub granter: std::string::String, } +/// GetTxsEventRequest is the request type for the Service.TxsByEvents +/// RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetTxsEventRequest { + /// events is the list of transaction event type. + #[prost(string, repeated, tag = "1")] + pub events: ::std::vec::Vec, + /// pagination defines an pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::std::option::Option, +} +/// GetTxsEventResponse is the response type for the Service.TxsByEvents +/// RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GetTxsEventResponse { + /// txs is the list of queried transactions. + #[prost(message, repeated, tag = "1")] + pub txs: ::std::vec::Vec, + /// tx_responses is the list of queried TxResponses. + #[prost(message, repeated, tag = "2")] + pub tx_responses: ::std::vec::Vec, + /// pagination defines an pagination for the response. + #[prost(message, optional, tag = "3")] + pub pagination: ::std::option::Option, +} +/// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest +/// RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BroadcastTxRequest { + /// tx_bytes is the raw transaction. + #[prost(bytes, tag = "1")] + pub tx_bytes: std::vec::Vec, + #[prost(enumeration = "BroadcastMode", tag = "2")] + pub mode: i32, +} +/// BroadcastTxResponse is the response type for the +/// Service.BroadcastTx method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BroadcastTxResponse { + /// tx_response is the queried TxResponses. + #[prost(message, optional, tag = "1")] + pub tx_response: ::std::option::Option, +} /// SimulateRequest is the request type for the Service.Simulate /// RPC method. #[derive(Clone, PartialEq, ::prost::Message)] @@ -206,7 +248,7 @@ pub struct SimulateResponse { #[prost(message, optional, tag = "2")] pub result: ::std::option::Option, } -/// GetTx is the request type for the Service.GetTx +/// GetTxRequest is the request type for the Service.GetTx /// RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxRequest { @@ -220,6 +262,25 @@ pub struct GetTxResponse { /// tx is the queried transaction. #[prost(message, optional, tag = "1")] pub tx: ::std::option::Option, + /// tx_response is the queried TxResponses. + #[prost(message, optional, tag = "2")] + pub tx_response: ::std::option::Option, +} +/// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum BroadcastMode { + /// zero-value for mode ordering + Unspecified = 0, + /// BROADCAST_MODE_BLOCK defines a tx broadcasting mode where the client waits for + /// the tx to be committed in a block. + Block = 1, + /// BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for + /// a CheckTx execution response only. + Sync = 2, + /// BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns + /// immediately. + Async = 3, } #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] @@ -287,6 +348,38 @@ pub mod service_client { let path = http::uri::PathAndQuery::from_static("/cosmos.tx.v1beta1.Service/GetTx"); self.inner.unary(request.into_request(), path, codec).await } + #[doc = " BroadcastTx broadcast transaction."] + pub async fn broadcast_tx( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.tx.v1beta1.Service/BroadcastTx"); + self.inner.unary(request.into_request(), path, codec).await + } + #[doc = " GetTxsEvent fetches txs by event."] + pub async fn get_txs_event( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.tx.v1beta1.Service/GetTxsEvent"); + self.inner.unary(request.into_request(), path, codec).await + } } impl Clone for ServiceClient { fn clone(&self) -> Self { diff --git a/cosmos-sdk-proto/src/prost/ibc.core.channel.v1.rs b/cosmos-sdk-proto/src/prost/ibc.core.channel.v1.rs index a8ba30a8..d5ce1174 100644 --- a/cosmos-sdk-proto/src/prost/ibc.core.channel.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc.core.channel.v1.rs @@ -176,6 +176,9 @@ pub struct GenesisState { pub recv_sequences: ::std::vec::Vec, #[prost(message, repeated, tag = "7")] pub ack_sequences: ::std::vec::Vec, + /// the sequence for the next generated channel identifier + #[prost(uint64, tag = "8")] + pub next_channel_sequence: u64, } /// PacketSequence defines the genesis type necessary to retrieve and store /// next send and receive sequences. @@ -194,11 +197,9 @@ pub struct PacketSequence { pub struct MsgChannelOpenInit { #[prost(string, tag = "1")] pub port_id: std::string::String, - #[prost(string, tag = "2")] - pub channel_id: std::string::String, - #[prost(message, optional, tag = "3")] + #[prost(message, optional, tag = "2")] pub channel: ::std::option::Option, - #[prost(string, tag = "4")] + #[prost(string, tag = "3")] pub signer: std::string::String, } /// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. @@ -210,19 +211,19 @@ pub struct MsgChannelOpenInitResponse {} pub struct MsgChannelOpenTry { #[prost(string, tag = "1")] pub port_id: std::string::String, + /// in the case of crossing hello's, when both chains call OpenInit, we need the channel identifier + /// of the previous channel in state INIT #[prost(string, tag = "2")] - pub desired_channel_id: std::string::String, - #[prost(string, tag = "3")] - pub counterparty_chosen_channel_id: std::string::String, - #[prost(message, optional, tag = "4")] + pub previous_channel_id: std::string::String, + #[prost(message, optional, tag = "3")] pub channel: ::std::option::Option, - #[prost(string, tag = "5")] + #[prost(string, tag = "4")] pub counterparty_version: std::string::String, - #[prost(bytes, tag = "6")] + #[prost(bytes, tag = "5")] pub proof_init: std::vec::Vec, - #[prost(message, optional, tag = "7")] + #[prost(message, optional, tag = "6")] pub proof_height: ::std::option::Option, - #[prost(string, tag = "8")] + #[prost(string, tag = "7")] pub signer: std::string::String, } /// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. @@ -306,7 +307,7 @@ pub struct MsgRecvPacket { #[prost(message, optional, tag = "1")] pub packet: ::std::option::Option, #[prost(bytes, tag = "2")] - pub proof: std::vec::Vec, + pub proof_commitment: std::vec::Vec, #[prost(message, optional, tag = "3")] pub proof_height: ::std::option::Option, #[prost(string, tag = "4")] @@ -321,7 +322,7 @@ pub struct MsgTimeout { #[prost(message, optional, tag = "1")] pub packet: ::std::option::Option, #[prost(bytes, tag = "2")] - pub proof: std::vec::Vec, + pub proof_unreceived: std::vec::Vec, #[prost(message, optional, tag = "3")] pub proof_height: ::std::option::Option, #[prost(uint64, tag = "4")] @@ -338,7 +339,7 @@ pub struct MsgTimeoutOnClose { #[prost(message, optional, tag = "1")] pub packet: ::std::option::Option, #[prost(bytes, tag = "2")] - pub proof: std::vec::Vec, + pub proof_unreceived: std::vec::Vec, #[prost(bytes, tag = "3")] pub proof_close: std::vec::Vec, #[prost(message, optional, tag = "4")] @@ -359,7 +360,7 @@ pub struct MsgAcknowledgement { #[prost(bytes, tag = "2")] pub acknowledgement: std::vec::Vec, #[prost(bytes, tag = "3")] - pub proof: std::vec::Vec, + pub proof_acked: std::vec::Vec, #[prost(message, optional, tag = "4")] pub proof_height: ::std::option::Option, #[prost(string, tag = "5")] @@ -482,12 +483,12 @@ pub struct QueryChannelConsensusStateRequest { /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: std::string::String, - /// version number of the consensus state + /// revision number of the consensus state #[prost(uint64, tag = "3")] - pub version_number: u64, - /// version height of the consensus state + pub revision_number: u64, + /// revision height of the consensus state #[prost(uint64, tag = "4")] - pub version_height: u64, + pub revision_height: u64, } /// QueryChannelClientStateResponse is the Response type for the /// Query/QueryChannelClientState RPC method diff --git a/cosmos-sdk-proto/src/prost/ibc.core.client.v1.rs b/cosmos-sdk-proto/src/prost/ibc.core.client.v1.rs index da3330ab..b40266bc 100644 --- a/cosmos-sdk-proto/src/prost/ibc.core.client.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc.core.client.v1.rs @@ -1,79 +1,3 @@ -/// MsgCreateClient defines a message to create an IBC client -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateClient { - /// client unique identifier - #[prost(string, tag = "1")] - pub client_id: std::string::String, - /// light client state - #[prost(message, optional, tag = "2")] - pub client_state: ::std::option::Option<::prost_types::Any>, - /// consensus state associated with the client that corresponds to a given - /// height. - #[prost(message, optional, tag = "3")] - pub consensus_state: ::std::option::Option<::prost_types::Any>, - /// signer address - #[prost(string, tag = "4")] - pub signer: std::string::String, -} -/// MsgCreateClientResponse defines the Msg/CreateClient response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateClientResponse {} -/// MsgUpdateClient defines an sdk.Msg to update a IBC client state using -/// the given header. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateClient { - /// client unique identifier - #[prost(string, tag = "1")] - pub client_id: std::string::String, - /// header to update the light client - #[prost(message, optional, tag = "2")] - pub header: ::std::option::Option<::prost_types::Any>, - /// signer address - #[prost(string, tag = "3")] - pub signer: std::string::String, -} -/// MsgUpdateClientResponse defines the Msg/UpdateClient response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateClientResponse {} -/// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpgradeClient { - /// client unique identifier - #[prost(string, tag = "1")] - pub client_id: std::string::String, - /// upgraded client state - #[prost(message, optional, tag = "2")] - pub client_state: ::std::option::Option<::prost_types::Any>, - /// height at which old chain halts and upgrades (i.e last block executed) - #[prost(message, optional, tag = "3")] - pub upgrade_height: ::std::option::Option, - /// proof that old chain committed to new client - #[prost(bytes, tag = "4")] - pub proof_upgrade: std::vec::Vec, - /// signer address - #[prost(string, tag = "5")] - pub signer: std::string::String, -} -/// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpgradeClientResponse {} -/// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for -/// light client misbehaviour. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitMisbehaviour { - /// client unique identifier - #[prost(string, tag = "1")] - pub client_id: std::string::String, - /// misbehaviour used for freezing the light client - #[prost(message, optional, tag = "2")] - pub misbehaviour: ::std::option::Option<::prost_types::Any>, - /// signer address - #[prost(string, tag = "3")] - pub signer: std::string::String, -} -/// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitMisbehaviourResponse {} /// IdentifiedClientState defines a client state with an additional client /// identifier field. #[derive(Clone, PartialEq, ::prost::Message)] @@ -128,19 +52,26 @@ pub struct ClientUpdateProposal { /// that can be compared against another Height for the purposes of updating and /// freezing clients /// -/// Normally the VersionHeight is incremented at each height while keeping version -/// number the same However some consensus algorithms may choose to reset the +/// Normally the RevisionHeight is incremented at each height while keeping RevisionNumber +/// the same. However some consensus algorithms may choose to reset the /// height in certain conditions e.g. hard forks, state-machine breaking changes -/// In these cases, the version number is incremented so that height continues to -/// be monitonically increasing even as the VersionHeight gets reset +/// In these cases, the RevisionNumber is incremented so that height continues to +/// be monitonically increasing even as the RevisionHeight gets reset #[derive(Clone, PartialEq, ::prost::Message)] pub struct Height { - /// the version that the client is currently on + /// the revision that the client is currently on #[prost(uint64, tag = "1")] - pub version_number: u64, - /// the height within the given version + pub revision_number: u64, + /// the height within the given revision #[prost(uint64, tag = "2")] - pub version_height: u64, + pub revision_height: u64, +} +/// Params defines the set of IBC light client parameters. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// allowed_clients defines the list of allowed client state types. + #[prost(string, repeated, tag = "1")] + pub allowed_clients: ::std::vec::Vec, } /// GenesisState defines the ibc client submodule's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] @@ -151,10 +82,113 @@ pub struct GenesisState { /// consensus states from each client #[prost(message, repeated, tag = "2")] pub clients_consensus: ::std::vec::Vec, + /// metadata from each client + #[prost(message, repeated, tag = "3")] + pub clients_metadata: ::std::vec::Vec, + #[prost(message, optional, tag = "4")] + pub params: ::std::option::Option, /// create localhost on initialization - #[prost(bool, tag = "3")] + #[prost(bool, tag = "5")] pub create_localhost: bool, + /// the sequence for the next generated client identifier + #[prost(uint64, tag = "6")] + pub next_client_sequence: u64, +} +/// GenesisMetadata defines the genesis type for metadata that clients may return +/// with ExportMetadata +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisMetadata { + /// store key of metadata without clientID-prefix + #[prost(bytes, tag = "1")] + pub key: std::vec::Vec, + /// metadata value + #[prost(bytes, tag = "2")] + pub value: std::vec::Vec, +} +/// IdentifiedGenesisMetadata has the client metadata with the corresponding client id. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IdentifiedGenesisMetadata { + #[prost(string, tag = "1")] + pub client_id: std::string::String, + #[prost(message, repeated, tag = "2")] + pub client_metadata: ::std::vec::Vec, +} +/// MsgCreateClient defines a message to create an IBC client +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateClient { + /// light client state + #[prost(message, optional, tag = "1")] + pub client_state: ::std::option::Option<::prost_types::Any>, + /// consensus state associated with the client that corresponds to a given + /// height. + #[prost(message, optional, tag = "2")] + pub consensus_state: ::std::option::Option<::prost_types::Any>, + /// signer address + #[prost(string, tag = "3")] + pub signer: std::string::String, +} +/// MsgCreateClientResponse defines the Msg/CreateClient response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateClientResponse {} +/// MsgUpdateClient defines an sdk.Msg to update a IBC client state using +/// the given header. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateClient { + /// client unique identifier + #[prost(string, tag = "1")] + pub client_id: std::string::String, + /// header to update the light client + #[prost(message, optional, tag = "2")] + pub header: ::std::option::Option<::prost_types::Any>, + /// signer address + #[prost(string, tag = "3")] + pub signer: std::string::String, +} +/// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateClientResponse {} +/// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client state +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpgradeClient { + /// client unique identifier + #[prost(string, tag = "1")] + pub client_id: std::string::String, + /// upgraded client state + #[prost(message, optional, tag = "2")] + pub client_state: ::std::option::Option<::prost_types::Any>, + /// upgraded consensus state, only contains enough information to serve as a basis of trust in update logic + #[prost(message, optional, tag = "3")] + pub consensus_state: ::std::option::Option<::prost_types::Any>, + /// proof that old chain committed to new client + #[prost(bytes, tag = "4")] + pub proof_upgrade_client: std::vec::Vec, + /// proof that old chain committed to new consensus state + #[prost(bytes, tag = "5")] + pub proof_upgrade_consensus_state: std::vec::Vec, + /// signer address + #[prost(string, tag = "6")] + pub signer: std::string::String, } +/// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpgradeClientResponse {} +/// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for +/// light client misbehaviour. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitMisbehaviour { + /// client unique identifier + #[prost(string, tag = "1")] + pub client_id: std::string::String, + /// misbehaviour used for freezing the light client + #[prost(message, optional, tag = "2")] + pub misbehaviour: ::std::option::Option<::prost_types::Any>, + /// signer address + #[prost(string, tag = "3")] + pub signer: std::string::String, +} +/// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitMisbehaviourResponse {} /// QueryClientStateRequest is the request type for the Query/ClientState RPC /// method #[derive(Clone, PartialEq, ::prost::Message)] @@ -209,12 +243,12 @@ pub struct QueryConsensusStateRequest { /// client identifier #[prost(string, tag = "1")] pub client_id: std::string::String, - /// consensus state version number + /// consensus state revision number #[prost(uint64, tag = "2")] - pub version_number: u64, - /// consensus state version height + pub revision_number: u64, + /// consensus state revision height #[prost(uint64, tag = "3")] - pub version_height: u64, + pub revision_height: u64, /// latest_height overrrides the height field and queries the latest stored /// ConsensusState #[prost(bool, tag = "4")] @@ -260,3 +294,13 @@ pub struct QueryConsensusStatesResponse { super::super::super::super::cosmos::base::query::v1beta1::PageResponse, >, } +/// QueryClientParamsRequest is the request type for the Query/ClientParams RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClientParamsRequest {} +/// QueryClientParamsResponse is the response type for the Query/ClientParams RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClientParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::std::option::Option, +} diff --git a/cosmos-sdk-proto/src/prost/ibc.core.commitment.v1.rs b/cosmos-sdk-proto/src/prost/ibc.core.commitment.v1.rs index 5e80b0a2..4c59b0f3 100644 --- a/cosmos-sdk-proto/src/prost/ibc.core.commitment.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc.core.commitment.v1.rs @@ -15,40 +15,19 @@ pub struct MerklePrefix { } /// MerklePath is the path used to verify commitment proofs, which can be an /// arbitrary structured object (defined by a commitment type). +/// MerklePath is represented from root-to-leaf #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerklePath { - #[prost(message, optional, tag = "1")] - pub key_path: ::std::option::Option, + #[prost(string, repeated, tag = "1")] + pub key_path: ::std::vec::Vec, } -/// MerkleProof is a wrapper type that contains a merkle proof. +/// MerkleProof is a wrapper type over a chain of CommitmentProofs. /// It demonstrates membership or non-membership for an element or set of /// elements, verifiable in conjunction with a known commitment root. Proofs /// should be succinct. +/// MerkleProofs are ordered from leaf-to-root #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerkleProof { - #[prost(message, optional, tag = "1")] - pub proof: ::std::option::Option<::tendermint_proto::crypto::ProofOps>, -} -/// KeyPath defines a slice of keys -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct KeyPath { #[prost(message, repeated, tag = "1")] - pub keys: ::std::vec::Vec, -} -/// Key defines a proof Key -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Key { - #[prost(bytes, tag = "1")] - pub name: std::vec::Vec, - #[prost(enumeration = "KeyEncoding", tag = "2")] - pub enc: i32, -} -/// KeyEncoding defines the encoding format of a key's bytes. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum KeyEncoding { - /// URL encoding - UrlUnspecified = 0, - /// Hex encoding - Hex = 1, + pub proofs: ::std::vec::Vec, } diff --git a/cosmos-sdk-proto/src/prost/ibc.core.connection.v1.rs b/cosmos-sdk-proto/src/prost/ibc.core.connection.v1.rs index b04c417a..13d9ec33 100644 --- a/cosmos-sdk-proto/src/prost/ibc.core.connection.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc.core.connection.v1.rs @@ -2,7 +2,8 @@ // https://github.com/cosmos/ics/tree/master/spec/ics-003-connection-semantics#data-structures /// ConnectionEnd defines a stateful object on a chain connected to another -/// separate one. NOTE: there must only be 2 defined ConnectionEnds to establish +/// separate one. +/// NOTE: there must only be 2 defined ConnectionEnds to establish /// a connection between two chains. #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectionEnd { @@ -10,7 +11,7 @@ pub struct ConnectionEnd { #[prost(string, tag = "1")] pub client_id: std::string::String, /// IBC version which can be utilised to determine encodings or protocols for - /// channels or packets utilising this connection + /// channels or packets utilising this connection. #[prost(message, repeated, tag = "2")] pub versions: ::std::vec::Vec, /// current state of the connection end. @@ -19,6 +20,10 @@ pub struct ConnectionEnd { /// counterparty chain associated with this connection. #[prost(message, optional, tag = "4")] pub counterparty: ::std::option::Option, + /// delay period that must pass before a consensus state can be used for packet-verification + /// NOTE: delay period logic is only implemented by some clients. + #[prost(uint64, tag = "5")] + pub delay_period: u64, } /// IdentifiedConnection defines a connection with additional connection /// identifier field. @@ -40,6 +45,9 @@ pub struct IdentifiedConnection { /// counterparty chain associated with this connection. #[prost(message, optional, tag = "5")] pub counterparty: ::std::option::Option, + /// delay period associated with this connection. + #[prost(uint64, tag = "6")] + pub delay_period: u64, } /// Counterparty defines the counterparty chain associated with a connection end. #[derive(Clone, PartialEq, ::prost::Message)] @@ -52,7 +60,7 @@ pub struct Counterparty { /// given connection. #[prost(string, tag = "2")] pub connection_id: std::string::String, - /// commitment merkle prefix of the counterparty chain + /// commitment merkle prefix of the counterparty chain. #[prost(message, optional, tag = "3")] pub prefix: ::std::option::Option, } @@ -106,6 +114,9 @@ pub struct GenesisState { pub connections: ::std::vec::Vec, #[prost(message, repeated, tag = "2")] pub client_connection_paths: ::std::vec::Vec, + /// the sequence for the next generated connection identifier + #[prost(uint64, tag = "3")] + pub next_connection_sequence: u64, } /// MsgConnectionOpenInit defines the msg sent by an account on Chain A to /// initialize a connection with Chain B. @@ -113,12 +124,12 @@ pub struct GenesisState { pub struct MsgConnectionOpenInit { #[prost(string, tag = "1")] pub client_id: std::string::String, - #[prost(string, tag = "2")] - pub connection_id: std::string::String, - #[prost(message, optional, tag = "3")] + #[prost(message, optional, tag = "2")] pub counterparty: ::std::option::Option, - #[prost(message, optional, tag = "4")] + #[prost(message, optional, tag = "3")] pub version: ::std::option::Option, + #[prost(uint64, tag = "4")] + pub delay_period: u64, #[prost(string, tag = "5")] pub signer: std::string::String, } @@ -131,14 +142,16 @@ pub struct MsgConnectionOpenInitResponse {} pub struct MsgConnectionOpenTry { #[prost(string, tag = "1")] pub client_id: std::string::String, + /// in the case of crossing hello's, when both chains call OpenInit, we need the connection identifier + /// of the previous connection in state INIT #[prost(string, tag = "2")] - pub desired_connection_id: std::string::String, - #[prost(string, tag = "3")] - pub counterparty_chosen_connection_id: std::string::String, - #[prost(message, optional, tag = "4")] + pub previous_connection_id: std::string::String, + #[prost(message, optional, tag = "3")] pub client_state: ::std::option::Option<::prost_types::Any>, - #[prost(message, optional, tag = "5")] + #[prost(message, optional, tag = "4")] pub counterparty: ::std::option::Option, + #[prost(uint64, tag = "5")] + pub delay_period: u64, #[prost(message, repeated, tag = "6")] pub counterparty_versions: ::std::vec::Vec, #[prost(message, optional, tag = "7")] @@ -311,9 +324,9 @@ pub struct QueryConnectionConsensusStateRequest { #[prost(string, tag = "1")] pub connection_id: std::string::String, #[prost(uint64, tag = "2")] - pub version_number: u64, + pub revision_number: u64, #[prost(uint64, tag = "3")] - pub version_height: u64, + pub revision_height: u64, } /// QueryConnectionConsensusStateResponse is the response type for the /// Query/ConnectionConsensusState RPC method diff --git a/cosmos-sdk-proto/src/prost/ibc.lightclients.tendermint.v1.rs b/cosmos-sdk-proto/src/prost/ibc.lightclients.tendermint.v1.rs index c83072ba..a6dceb97 100644 --- a/cosmos-sdk-proto/src/prost/ibc.lightclients.tendermint.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc.lightclients.tendermint.v1.rs @@ -22,22 +22,23 @@ pub struct ClientState { /// Latest height the client was updated to #[prost(message, optional, tag = "7")] pub latest_height: ::std::option::Option, - /// Consensus params of the chain - #[prost(message, optional, tag = "8")] - pub consensus_params: ::std::option::Option<::tendermint_proto::abci::ConsensusParams>, /// Proof specifications used in verifying counterparty state - #[prost(message, repeated, tag = "9")] + #[prost(message, repeated, tag = "8")] pub proof_specs: ::std::vec::Vec, - /// Path at which next upgraded client will be committed - #[prost(string, tag = "10")] - pub upgrade_path: std::string::String, + /// Path at which next upgraded client will be committed. + /// Each element corresponds to the key for a single CommitmentProof in the chained proof. + /// NOTE: ClientState must stored under `{upgradePath}/{upgradeHeight}/clientState` + /// ConsensusState must be stored under `{upgradepath}/{upgradeHeight}/consensusState` + /// For SDK chains using the default upgrade module, upgrade_path should be []string{"upgrade", "upgradedIBCState"}` + #[prost(string, repeated, tag = "9")] + pub upgrade_path: ::std::vec::Vec, /// This flag, when set to true, will allow governance to recover a client /// which has expired - #[prost(bool, tag = "11")] + #[prost(bool, tag = "10")] pub allow_update_after_expiry: bool, /// This flag, when set to true, will allow governance to unfreeze a client /// whose chain has experienced a misbehaviour event - #[prost(bool, tag = "12")] + #[prost(bool, tag = "11")] pub allow_update_after_misbehaviour: bool, } /// ConsensusState defines the consensus state from Tendermint. @@ -59,11 +60,9 @@ pub struct ConsensusState { pub struct Misbehaviour { #[prost(string, tag = "1")] pub client_id: std::string::String, - #[prost(string, tag = "2")] - pub chain_id: std::string::String, - #[prost(message, optional, tag = "3")] + #[prost(message, optional, tag = "2")] pub header_1: ::std::option::Option
, - #[prost(message, optional, tag = "4")] + #[prost(message, optional, tag = "3")] pub header_2: ::std::option::Option
, } /// Header defines the Tendermint client consensus Header. @@ -89,11 +88,11 @@ pub struct Header { #[prost(message, optional, tag = "4")] pub trusted_validators: ::std::option::Option<::tendermint_proto::types::ValidatorSet>, } -/// Fraction defines the protobuf message type for tmmath.Fraction +/// Fraction defines the protobuf message type for tmmath.Fraction that only supports positive values. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Fraction { - #[prost(int64, tag = "1")] - pub numerator: i64, - #[prost(int64, tag = "2")] - pub denominator: i64, + #[prost(uint64, tag = "1")] + pub numerator: u64, + #[prost(uint64, tag = "2")] + pub denominator: u64, } diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index ca799844..9d9591ce 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -14,7 +14,7 @@ use std::{ use walkdir::WalkDir; /// The Cosmos commit or tag to be cloned and used to build the proto files -const COSMOS_REV: &str = "v0.40.0-rc3"; +const COSMOS_REV: &str = "v0.40.0-rc6"; // All paths must end with a / and either be absolute or include a ./ to reference the current // working directory. @@ -73,6 +73,7 @@ fn run_git(args: impl IntoIterator>) { fn update_submodule() { println!("[info] Updating cosmos/cosmos-sdk submodule..."); run_git(&["submodule", "update", "--init"]); + run_git(&["-C", COSMOS_SDK_DIR, "fetch"]); run_git(&["-C", COSMOS_SDK_DIR, "reset", "--hard", COSMOS_REV]); }