diff --git a/.changelog/unreleased/breaking-changes/956-bump-MSRV-to-1-64.md b/.changelog/unreleased/breaking-changes/956-bump-MSRV-to-1-64.md new file mode 100644 index 000000000..37056378e --- /dev/null +++ b/.changelog/unreleased/breaking-changes/956-bump-MSRV-to-1-64.md @@ -0,0 +1,2 @@ +- Bump minimum supported Rust version to 1.64 + ([\#956](https://github.com/cosmos/ibc-rs/issues/956)) diff --git a/.changelog/unreleased/improvements/955-use-workspace-dependencies.md b/.changelog/unreleased/improvements/955-use-workspace-dependencies.md new file mode 100644 index 000000000..51846aba0 --- /dev/null +++ b/.changelog/unreleased/improvements/955-use-workspace-dependencies.md @@ -0,0 +1,2 @@ +- Enhance dependency management with workspace inheritance + ([\#955](https://github.com/cosmos/ibc-rs/issues/955)) diff --git a/Cargo.toml b/Cargo.toml index 87820e6e9..7f65e463b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,62 @@ [workspace] - resolver = "2" - members = [ "crates/ibc", "crates/ibc-derive", "crates/ibc-testkit", "crates/ibc-query", ] - exclude = [ "ci/cw-check", "ci/no-std-check", ] + +[workspace.package] +version = "0.47.0" +license = "Apache-2.0" +edition = "2021" +rust-version = "1.64" +readme = "README.md" +repository = "https://github.com/cosmos/ibc-rs" +authors = ["Informal Systems "] + +[workspace.dependencies] +# external dependencies +borsh = {version = "0.10", default-features = false } +bytes = { version = "1.5.0", default-features = false } +displaydoc = { version = "0.2", default-features = false } +derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display", "try_into"] } +env_logger = "0.10.0" +num-traits = { version = "0.2.17", default-features = false } +parking_lot = { version = "0.12.1", default-features = false } +primitive-types = { version = "0.12.2", default-features = false, features = ["serde_no_std"] } +prost = { version = "0.12", default-features = false } +rstest = "0.18.2" +schemars = { version = "0.8.15"} +sha2 = { version = "0.10.8", default-features = false } +serde = { version = "1.0", default-features = false } +serde_derive = { version = "1.0", default-features = false } +serde_json = { package = "serde-json-wasm", version = "1.0.0" , default-features = false } +subtle-encoding = { version = "0.5", default-features = false } +test-log = { version = "0.2.13", features = ["trace"] } +time = { version = ">=0.3.0, <0.3.31", default-features = false } +tracing = { version = "0.1.40", default-features = false } +tracing-subscriber = { version = "0.3.17", features = ["fmt", "env-filter", "json"] } +typed-builder = { version = "0.18.0"} + +# ibc dependencies +ibc-derive = { version = "0.3.0", path = "../ibc-derive" } +ibc-proto = { version = "0.38.0", default-features = false } +ics23 = { version = "0.11", default-features = false } + +# cosmos dependencies +tendermint = { version = "0.34.0", default-features = false } +tendermint-light-client = { version = "0.34.0", default-features = false } +tendermint-light-client-verifier = { version = "0.34.0", default-features = false } +tendermint-proto = { version = "0.34.0", default-features = false } +tendermint-rpc = { version = "0.34.0", default-features = false } +tendermint-testgen = { version = "0.34.0", default-features = false } + +# parity dependencies +parity-scale-codec = { version = "3.6.5", default-features = false, features = ["full"] } +scale-info = { version = "2.10.0", default-features = false, features = ["derive"] } diff --git a/README.md b/README.md index ac2cfd9fc..6bcd01fe8 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ [![Code Coverage][codecov-image]][codecov-link] [![Apache 2.0 Licensed][license-image]][license-link] ![Rust Stable][rustc-image] -![Rust 1.60+][rustc-version] +![Rust 1.64+][rustc-version] ![Lines of Code][loc-image] diff --git a/ci/no-std-check/Cargo.lock b/ci/no-std-check/Cargo.lock index 440218f08..01cf92efa 100644 --- a/ci/no-std-check/Cargo.lock +++ b/ci/no-std-check/Cargo.lock @@ -1216,6 +1216,7 @@ name = "ibc" version = "0.47.0" dependencies = [ "bytes", + "cfg-if", "derive_more", "displaydoc", "ibc-derive", diff --git a/crates/ibc-query/Cargo.toml b/crates/ibc-query/Cargo.toml index da50f931b..c6af07d99 100644 --- a/crates/ibc-query/Cargo.toml +++ b/crates/ibc-query/Cargo.toml @@ -1,24 +1,27 @@ [package] name = "ibc-query" -version = "0.47.0" -edition = "2021" -license = "Apache-2.0" +version = { workspace = true } +authors = { workspace = true } +edition = { workspace = true } +rust-version = { workspace = true } +license = { workspace = true } +repository = { workspace = true } readme = "README.md" keywords = ["blockchain", "cosmos", "ibc", "rpc", "grpc"] -repository = "https://github.com/cosmos/ibc-rs" -authors = ["Informal Systems "] -rust-version = "1.60" description = """ 'ibc-query' contains essential IBC query methods and gRPC query service implementations for the IBC core. """ -[features] -default = ["std"] -std = ["ibc-proto/std", "ibc/std"] - [dependencies] -ibc = { version = "0.47.0", path = "../ibc", default-features = false } -ibc-proto = { version = "0.38.0", default-features = false, features = ["server"] } +# external dependencies displaydoc = { version = "0.2", default-features = false } tonic = "0.10" + +# ibc dependencies +ibc = { version = "0.47.0", path = "../ibc", default-features = false } +ibc-proto = { workspace = true, features = ["server"] } + +[features] +default = ["std"] +std = ["ibc-proto/std", "ibc/std"] diff --git a/crates/ibc-testkit/Cargo.toml b/crates/ibc-testkit/Cargo.toml index cdb496220..8a8c9137d 100644 --- a/crates/ibc-testkit/Cargo.toml +++ b/crates/ibc-testkit/Cargo.toml @@ -1,12 +1,13 @@ [package] name = "ibc-testkit" -version = "0.47.0" -edition = "2021" +version = { workspace = true } +authors = { workspace = true } +edition = { workspace = true } +rust-version = { workspace = true } +license = { workspace = true } +repository = { workspace = true } readme = "README.md" keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] -repository = "https://github.com/cosmos/ibc-rs" -authors = ["Informal Systems "] -rust-version = "1.60" description = """ `ibc-testkit` is a versatile library that provides essential abstractions and implementations, fulfilling a dual role of enabling rigorous integration testing for the `ibc-rs` implementation @@ -14,6 +15,33 @@ description = """ their integration with `ibc-rs`. """ +[dependencies] +# external dependencies +bytes = { workspace = true } +derive_more = { workspace = true } +displaydoc = { workspace = true } +parking_lot = { workspace = true } +primitive-types = { workspace = true } +prost = { workspace = true } +serde = { workspace = true, optional = true } +serde_json = { workspace = true, optional = true } +subtle-encoding = { workspace = true } +tracing = { workspace = true } +typed-builder = { workspace = true } + +# ibc dependencies +ibc = { version = "0.47.0" , path = "../ibc" } # NOTE: since `ibc-testkit` does not well support `no_std` yet, we keep `ibc` default features enabled + +# cosmos dependencies +tendermint = { workspace = true } +tendermint-testgen = { workspace = true } + +[dev-dependencies] +env_logger = { workspace = true } +rstest = { workspace = true } +tracing-subscriber = { workspace = true } +test-log = { workspace = true } + [features] default = ["std"] std = [ @@ -26,26 +54,3 @@ std = [ # This feature is required for token transfer (ICS-20) serde = ["dep:serde", "ibc/serde", "serde_json"] - -[dependencies] -bytes = { version = "1.2.1", default-features = false } -derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display", "try_into"] } -displaydoc = { version = "0.2", default-features = false } -ibc = { version = "0.47.0" , path = "../ibc" } # NOTE: since `ibc-testkit` does not well support `no_std` yet, we keep `ibc` default features enabled -parking_lot = { version = "0.12.1", default-features = false } -prost = { version = "0.12", default-features = false } -serde = { version = "1.0", default-features = false, optional = true } -serde_json = { version = "1", default-features = false, optional = true } -subtle-encoding = { version = "0.5", default-features = false } -tendermint = { version = "0.34", default-features = false } -tendermint-testgen = { version = "0.34", default-features = false } -tracing = { version = "0.1.36", default-features = false } -typed-builder = "0.18.0" -primitive-types = { version = "0.12.0", default-features = false, features = ["serde_no_std"] } - - -[dev-dependencies] -env_logger = "0.10.0" -rstest = "0.18.1" -tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"]} -test-log = { version = "0.2.10", features = ["trace"] } diff --git a/crates/ibc/Cargo.toml b/crates/ibc/Cargo.toml index 52238ed20..8bd87b26f 100644 --- a/crates/ibc/Cargo.toml +++ b/crates/ibc/Cargo.toml @@ -1,13 +1,13 @@ [package] name = "ibc" -version = "0.47.0" -edition = "2021" -license = "Apache-2.0" -readme = "README.md" +version = { workspace = true } +authors = { workspace = true } +edition = { workspace = true } +rust-version = { workspace = true } +license = { workspace = true } +repository = { workspace = true } keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] -repository = "https://github.com/cosmos/ibc-rs" -authors = ["Informal Systems "] -rust-version = "1.60" +readme = "README.md" description = """ Implementation of the Inter-Blockchain Communication Protocol (IBC). This crate comprises the main data structures and on-chain logic. @@ -16,8 +16,50 @@ description = """ [package.metadata.docs.rs] all-features = true +[dependencies] +# external dependencies +borsh = { workspace = true, optional = true } +bytes = { workspace = true } +derive_more = { workspace = true } +displaydoc = { workspace = true } +primitive-types = { workspace = true } +prost = { workspace = true } +serde_derive = { workspace = true, optional = true } +serde = { workspace = true, optional = true } +serde_json = { workspace = true, optional = true} +subtle-encoding = { workspace = true, default-features = false } +sha2 = { workspace = true, default-features = false } +time = { workspace = true, default-features = false } +schemars = { workspace = true, optional = true } +typed-builder = { workspace = true, optional = true } +uint = { version = "0.9", default-features = false } + +# ibc dependencies +ibc-derive = { version = "0.3.0", path = "../ibc-derive" } +ibc-proto = { workspace = true } +ics23 = { workspace = true, features = ["host-functions"] } + +# cosmos dependencies +tendermint = { workspace = true } +tendermint-proto = { workspace = true } +tendermint-light-client-verifier = { workspace = true, features = ["rust-crypto"] } + +## parity dependencies +parity-scale-codec = { workspace = true , optional = true } +scale-info = { workspace = true , optional = true } + + +[dev-dependencies] +ibc-testkit = { version = "0.47.0", path = "../ibc-testkit", default-features = false, features = ["serde"] } +env_logger = { workspace = true } +rstest = { workspace = true } +tracing-subscriber = { workspace = true } +test-log = { workspace = true } +tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } + [features] default = ["std"] + std = [ "ibc-proto/std", "ics23/std", @@ -33,7 +75,9 @@ std = [ "tendermint/clock", "tendermint/std", ] + parity-scale-codec = ["dep:parity-scale-codec", "dep:scale-info", "ibc-proto/parity-scale-codec"] + borsh = ["dep:borsh", "ibc-proto/borsh"] # This feature is required for token transfer (ICS-20) @@ -41,52 +85,3 @@ serde = ["dep:serde", "dep:serde_derive", "serde_json", "ibc-proto/serde", "ics2 # CosmWasm message API generator compatible, should not be inside on chain code schema = ["dep:schemars", "ibc-proto/json-schema", "serde", "std"] - -[dependencies] -# Proto definitions for all IBC-related interfaces, e.g., connections or channels. -ibc-proto = { version = "0.38.0", default-features = false } -ics23 = { version = "0.11", default-features = false, features = ["host-functions"] } -time = { version = ">=0.3.0, <0.3.31", default-features = false } -serde_derive = { version = "1.0", default-features = false, optional = true } -serde = { version = "1.0", default-features = false, optional = true } -serde_json = { package = "serde-json-wasm", version = "1.0.0" , default-features = false, optional = true} -prost = { version = "0.12", default-features = false } -bytes = { version = "1.5.0", default-features = false } -subtle-encoding = { version = "0.5", default-features = false } -sha2 = { version = "0.10.8", default-features = false } -displaydoc = { version = "0.2", default-features = false } -derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display", "try_into"] } -uint = { version = "0.9", default-features = false } -primitive-types = { version = "0.12.2", default-features = false, features = ["serde_no_std"] } - -## for codec encode or decode -parity-scale-codec = { version = "3.6.5", default-features = false, features = ["full"], optional = true } -scale-info = { version = "2.10.0", default-features = false, features = ["derive"], optional = true } -## for borsh encode or decode -borsh = {version = "0.10", default-features = false, optional = true } -typed-builder = { version = "0.18.0", optional = true } - -ibc-derive = { version = "0.3.0", path = "../ibc-derive" } - -schemars = { version = "0.8.15", optional = true } - -[dependencies.tendermint] -version = "0.34" -default-features = false - -[dependencies.tendermint-proto] -version = "0.34" -default-features = false - -[dependencies.tendermint-light-client-verifier] -version = "0.34" -default-features = false -features = ["rust-crypto"] - -[dev-dependencies] -ibc-testkit = { version = "0.47.0", path = "../ibc-testkit", default-features = false, features = ["serde"] } -env_logger = "0.10.0" -rstest = "0.18.2" -tracing-subscriber = { version = "0.3.17", features = ["fmt", "env-filter", "json"]} -test-log = { version = "0.2.13", features = ["trace"] } -tendermint-rpc = { version = "0.34", features = ["http-client", "websocket-client"] } diff --git a/crates/ibc/src/core/ics04_channel/channel.rs b/crates/ibc/src/core/ics04_channel/channel.rs index 49717cde4..43eceacb5 100644 --- a/crates/ibc/src/core/ics04_channel/channel.rs +++ b/crates/ibc/src/core/ics04_channel/channel.rs @@ -435,19 +435,14 @@ impl From for RawCounterparty { )] #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] #[cfg_attr(feature = "schema", derive(schemars::JsonSchema))] -#[derive(Clone, Copy, Debug, PartialEq, Eq)] +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub enum Order { None = 0isize, + #[default] Unordered = 1isize, Ordered = 2isize, } -impl Default for Order { - fn default() -> Self { - Order::Unordered - } -} - impl Display for Order { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "{}", self.as_str())