Skip to content

Commit

Permalink
cosmos-sdk-proto: Remove IBC protos in favour of the ibc-proto crate (
Browse files Browse the repository at this point in the history
#495)

- Remove ibc-go submodule
- Do not generate ibc-go protos anymore
- Remove export of ibc-go protos
- Re-export ICS23 proto definitions from the `ics23` crate
- Use tendermint proto from `tendermint_proto` instead of `tendermint_proto::v0_34`
  • Loading branch information
romac committed Aug 15, 2024
1 parent edb8bd7 commit fb341da
Show file tree
Hide file tree
Showing 76 changed files with 115 additions and 59,861 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,3 @@
[submodule "wasmd"]
path = wasmd
url = https://github.com/CosmWasm/wasmd.git
[submodule "ibc-go"]
path = ibc-go
url = https://github.com/cosmos/ibc-go
79 changes: 79 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This is a place for commonly shared rust resources related to the Cosmos ecosyst

The goal of this repository is to create a place for upstream consensus in the Cosmos Rust community. Different applications will have different requirements from libraries, this repo should strive to contain only code that is useful and actively used by more than one organization.

Current maintainers of this repo include [InformalSystems](https://github.com/informalsystems), [Iqlusion](https://github.com/iqlusioninc), [Confio](https://github.com/confio), and [Althea](https://github.com/althea-net)
Current maintainers of this repo include [Informal Systems](https://github.com/informalsystems), [Iqlusion](https://github.com/iqlusioninc), [Confio](https://github.com/confio), and [Althea](https://github.com/althea-net)

A pull request should be approved by representatives from at least two of those organizations
before being merged. In order to update membership or update these rules a pull request changing
Expand Down
3 changes: 2 additions & 1 deletion cosmos-sdk-proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ edition = "2021"
rust-version = "1.72"

[dependencies]
ics23 = { version = "0.12.0" }
prost = { version = "0.13", default-features = false }
tendermint-proto = "0.39.1"
tendermint-proto = { version = "0.39.1" }

# Optional dependencies
tonic = { version = "0.12", optional = true, default-features = false, features = ["codegen", "prost"] }
Expand Down
106 changes: 1 addition & 105 deletions cosmos-sdk-proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,7 @@ pub mod cosmos {

/// ICS23 protobuf definitions.
pub mod ics23 {
pub mod v1 {
include!("prost/ibc-go/cosmos.ics23.v1.rs");
}
pub use ::ics23 as v1;
}

/// Messages and services handling minting
Expand Down Expand Up @@ -234,105 +232,3 @@ pub mod cosmwasm {
}
}
}

/// IBC protobuf definitions.
pub mod ibc {
/// IBC applications.
pub mod applications {
/// Interchain accounts support.
pub mod interchain_accounts {
pub mod controller {
pub mod v1 {
include!("prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.rs");
}
}

pub mod host {
pub mod v1 {
include!("prost/ibc-go/ibc.applications.interchain_accounts.host.v1.rs");
}
}

pub mod v1 {
include!("prost/ibc-go/ibc.applications.interchain_accounts.v1.rs");
}
}

/// Transfer support.
pub mod transfer {
pub mod v1 {
include!("prost/ibc-go/ibc.applications.transfer.v1.rs");
}

pub mod v2 {
include!("prost/ibc-go/ibc.applications.transfer.v2.rs");
}
}
}

/// IBC core.
pub mod core {
/// IBC channels.
pub mod channel {
pub mod v1 {
include!("prost/ibc-go/ibc.core.channel.v1.rs");
}
}

/// IBC client.
pub mod client {
pub mod v1 {
include!("prost/ibc-go/ibc.core.client.v1.rs");
}
}

/// IBC commitments.
pub mod commitment {
pub mod v1 {
include!("prost/ibc-go/ibc.core.commitment.v1.rs");
}
}

/// IBC connections.
pub mod connection {
pub mod v1 {
include!("prost/ibc-go/ibc.core.connection.v1.rs");
}
}

/// IBC types.
pub mod types {
pub mod v1 {
include!("prost/ibc-go/ibc.core.types.v1.rs");
}
}
}

/// IBC light clients.
pub mod lightclients {
pub mod localhost {
pub mod v2 {
include!("prost/ibc-go/ibc.lightclients.localhost.v2.rs");
}
}
pub mod solomachine {
pub mod v2 {
include!("prost/ibc-go/ibc.lightclients.solomachine.v2.rs");
}

pub mod v3 {
include!("prost/ibc-go/ibc.lightclients.solomachine.v3.rs");
}
}
pub mod tendermint {
pub mod v1 {
include!("prost/ibc-go/ibc.lightclients.tendermint.v1.rs");
}
}
pub mod wasm {
pub mod v1 {
include!("prost/ibc-go/ibc.lightclients.wasm.v1.rs");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub struct TxResponse {
///
/// Since: cosmos-sdk 0.42.11, 0.44.5, 0.45
#[prost(message, repeated, tag = "13")]
pub events: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::abci::Event>,
pub events: ::prost::alloc::vec::Vec<::tendermint_proto::abci::Event>,
}
impl ::prost::Name for TxResponse {
const NAME: &'static str = "TxResponse";
Expand Down Expand Up @@ -148,7 +148,7 @@ pub struct Result {
/// Events contains a slice of Event objects that were emitted during message
/// or handler execution.
#[prost(message, repeated, tag = "3")]
pub events: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::abci::Event>,
pub events: ::prost::alloc::vec::Vec<::tendermint_proto::abci::Event>,
/// msg_responses contains the Msg handler responses type packed in Anys.
///
/// Since: cosmos-sdk 0.46
Expand Down Expand Up @@ -269,7 +269,7 @@ pub struct SearchBlocksResult {
pub limit: i64,
/// List of blocks in current page
#[prost(message, repeated, tag = "6")]
pub blocks: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::types::Block>,
pub blocks: ::prost::alloc::vec::Vec<::tendermint_proto::types::Block>,
}
impl ::prost::Name for SearchBlocksResult {
const NAME: &'static str = "SearchBlocksResult";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ pub struct Block {
#[prost(message, optional, tag = "1")]
pub header: ::core::option::Option<Header>,
#[prost(message, optional, tag = "2")]
pub data: ::core::option::Option<::tendermint_proto::v0_34::types::Data>,
pub data: ::core::option::Option<::tendermint_proto::types::Data>,
#[prost(message, optional, tag = "3")]
pub evidence: ::core::option::Option<::tendermint_proto::v0_34::types::EvidenceList>,
pub evidence: ::core::option::Option<::tendermint_proto::types::EvidenceList>,
#[prost(message, optional, tag = "4")]
pub last_commit: ::core::option::Option<::tendermint_proto::v0_34::types::Commit>,
pub last_commit: ::core::option::Option<::tendermint_proto::types::Commit>,
}
impl ::prost::Name for Block {
const NAME: &'static str = "Block";
Expand All @@ -26,7 +26,7 @@ impl ::prost::Name for Block {
pub struct Header {
/// basic block info
#[prost(message, optional, tag = "1")]
pub version: ::core::option::Option<::tendermint_proto::v0_34::version::Consensus>,
pub version: ::core::option::Option<::tendermint_proto::version::Consensus>,
#[prost(string, tag = "2")]
pub chain_id: ::prost::alloc::string::String,
#[prost(int64, tag = "3")]
Expand All @@ -35,7 +35,7 @@ pub struct Header {
pub time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>,
/// prev block info
#[prost(message, optional, tag = "5")]
pub last_block_id: ::core::option::Option<::tendermint_proto::v0_34::types::BlockId>,
pub last_block_id: ::core::option::Option<::tendermint_proto::types::BlockId>,
/// hashes of block data
///
/// commit from validators from the last block
Expand Down Expand Up @@ -190,10 +190,10 @@ impl ::prost::Name for GetBlockByHeightRequest {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBlockByHeightResponse {
#[prost(message, optional, tag = "1")]
pub block_id: ::core::option::Option<::tendermint_proto::v0_34::types::BlockId>,
pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>,
/// Deprecated: please use `sdk_block` instead
#[prost(message, optional, tag = "2")]
pub block: ::core::option::Option<::tendermint_proto::v0_34::types::Block>,
pub block: ::core::option::Option<::tendermint_proto::types::Block>,
/// Since: cosmos-sdk 0.47
#[prost(message, optional, tag = "3")]
pub sdk_block: ::core::option::Option<Block>,
Expand Down Expand Up @@ -221,10 +221,10 @@ impl ::prost::Name for GetLatestBlockRequest {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLatestBlockResponse {
#[prost(message, optional, tag = "1")]
pub block_id: ::core::option::Option<::tendermint_proto::v0_34::types::BlockId>,
pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>,
/// Deprecated: please use `sdk_block` instead
#[prost(message, optional, tag = "2")]
pub block: ::core::option::Option<::tendermint_proto::v0_34::types::Block>,
pub block: ::core::option::Option<::tendermint_proto::types::Block>,
/// Since: cosmos-sdk 0.47
#[prost(message, optional, tag = "3")]
pub sdk_block: ::core::option::Option<Block>,
Expand Down Expand Up @@ -277,7 +277,7 @@ impl ::prost::Name for GetNodeInfoRequest {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNodeInfoResponse {
#[prost(message, optional, tag = "1")]
pub default_node_info: ::core::option::Option<::tendermint_proto::v0_34::p2p::DefaultNodeInfo>,
pub default_node_info: ::core::option::Option<::tendermint_proto::p2p::DefaultNodeInfo>,
#[prost(message, optional, tag = "2")]
pub application_version: ::core::option::Option<VersionInfo>,
}
Expand Down
10 changes: 5 additions & 5 deletions cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct QueryParamsResponse {
/// Please note that `params.version` is not populated in this response, it is
/// tracked separately in the x/upgrade module.
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<::tendermint_proto::v0_34::types::ConsensusParams>,
pub params: ::core::option::Option<::tendermint_proto::types::ConsensusParams>,
}
impl ::prost::Name for QueryParamsResponse {
const NAME: &'static str = "QueryParamsResponse";
Expand All @@ -40,14 +40,14 @@ pub struct MsgUpdateParams {
///
/// NOTE: All parameters must be supplied.
#[prost(message, optional, tag = "2")]
pub block: ::core::option::Option<::tendermint_proto::v0_34::types::BlockParams>,
pub block: ::core::option::Option<::tendermint_proto::types::BlockParams>,
#[prost(message, optional, tag = "3")]
pub evidence: ::core::option::Option<::tendermint_proto::v0_34::types::EvidenceParams>,
pub evidence: ::core::option::Option<::tendermint_proto::types::EvidenceParams>,
#[prost(message, optional, tag = "4")]
pub validator: ::core::option::Option<::tendermint_proto::v0_34::types::ValidatorParams>,
pub validator: ::core::option::Option<::tendermint_proto::types::ValidatorParams>,
/// Since: cosmos-sdk 0.50
#[prost(message, optional, tag = "5")]
pub abci: ::core::option::Option<::tendermint_proto::v0_34::types::AbciParams>,
pub abci: ::core::option::Option<::tendermint_proto::types::AbciParams>,
}
impl ::prost::Name for MsgUpdateParams {
const NAME: &'static str = "MsgUpdateParams";
Expand Down
Loading

0 comments on commit fb341da

Please sign in to comment.