From baef13990a5a49180b897838c1a77c0d238f1629 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 18 Jan 2024 14:53:20 +0100 Subject: [PATCH 001/200] Use `CosmosSdk` as the chain type if omitted, for backward compatibility (#3787) * Use `CosmosSdk` as the chain type if omitted, for backward compatibility Doing this requires a bit of hack, due to serde's lack of support for specifying a default variant when a tag is not provided. See the doc comment on the `ChainConfig` struct for more details. * Add parsing test for default chain type * Check we parse the correct default type --------- Co-authored-by: Luca Joss --- Cargo.lock | 22 ++++++++ config.toml | 4 +- crates/relayer-cli/src/chain_registry.rs | 1 + crates/relayer/Cargo.toml | 1 + crates/relayer/src/chain/cosmos/config.rs | 6 ++ crates/relayer/src/config.rs | 32 ++++++++++- ...layer_conf_example_default_chain_type.toml | 56 +++++++++++++++++++ tools/test-framework/src/types/single/node.rs | 1 + 8 files changed, 118 insertions(+), 5 deletions(-) create mode 100644 crates/relayer/tests/config/fixtures/relayer_conf_example_default_chain_type.toml diff --git a/Cargo.lock b/Cargo.lock index adca6e2e9c..7bb0fd276b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1425,6 +1425,7 @@ dependencies = [ "ibc-telemetry", "itertools 0.10.5", "moka", + "monostate", "num-bigint", "num-rational", "once_cell", @@ -1887,6 +1888,27 @@ dependencies = [ "uuid 1.6.1", ] +[[package]] +name = "monostate" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "878c2a1f1c70e5724fa28f101ca787b6a7e8ad5c5e4ae4ca3b0fa4a419fa9075" +dependencies = [ + "monostate-impl", + "serde", +] + +[[package]] +name = "monostate-impl" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f686d68a09079e63b1d2c64aa305095887ce50565f00a922ebfaeeee0d9ba6ce" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" diff --git a/config.toml b/config.toml index 9ff0aa5ed3..06dabdac13 100644 --- a/config.toml +++ b/config.toml @@ -154,7 +154,8 @@ port = 5555 # Specify the chain ID. Required id = 'ibc-0' -# Specify the chain type, currently only `"CosmosSdk"` is supported. +# Specify the chain type, currently only `CosmosSdk` is supported. +# Default: CosmosSdk type = "CosmosSdk" # Whether or not this is a CCV consumer chain. Default: false @@ -422,7 +423,6 @@ memo_prefix = '' [[chains]] id = 'ibc-1' -type = "CosmosSdk" rpc_addr = 'http://127.0.0.1:26557' grpc_addr = 'http://127.0.0.1:9091' event_source = { mode = 'push', url = 'ws://127.0.0.1:26557/websocket', batch_delay = '500ms' } diff --git a/crates/relayer-cli/src/chain_registry.rs b/crates/relayer-cli/src/chain_registry.rs index df63a513c1..520a58a011 100644 --- a/crates/relayer-cli/src/chain_registry.rs +++ b/crates/relayer-cli/src/chain_registry.rs @@ -121,6 +121,7 @@ where }; Ok(ChainConfig::CosmosSdk(CosmosSdkConfig { + r#type: Default::default(), id: chain_data.chain_id, rpc_addr: rpc_data.rpc_address, grpc_addr: grpc_address, diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 1a6db3787f..c60227263b 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -70,6 +70,7 @@ strum = { version = "0.25", features = ["derive"] } tokio-stream = "0.1.14" once_cell = "1.19.0" tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"] } +monostate = "0.1.11" [dependencies.byte-unit] version = "4.0.19" diff --git a/crates/relayer/src/chain/cosmos/config.rs b/crates/relayer/src/chain/cosmos/config.rs index 225b7aa039..a8e91c479f 100644 --- a/crates/relayer/src/chain/cosmos/config.rs +++ b/crates/relayer/src/chain/cosmos/config.rs @@ -2,6 +2,7 @@ use core::time::Duration; use std::path::PathBuf; use byte_unit::Byte; +use monostate::MustBe; use serde_derive::{Deserialize, Serialize}; use tendermint_rpc::Url; @@ -23,6 +24,11 @@ pub mod error; #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct CosmosSdkConfig { + /// The type of this chain, must be "CosmosSdk" + /// This is the default if not specified. + #[serde(default)] + pub r#type: MustBe!("CosmosSdk"), + /// The chain's network identifier pub id: ChainId, diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index 1427f1e7e1..10721a7348 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -16,7 +16,7 @@ use core::time::Duration; use std::{fs, fs::File, io::Write, ops::Range, path::Path}; use byte_unit::Byte; -use serde_derive::{Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; use tendermint::block::Height as BlockHeight; use tendermint_rpc::Url; use tendermint_rpc::WebSocketClientUrl; @@ -618,9 +618,18 @@ pub enum EventSourceMode { }, } +// NOTE: +// To work around a limitation of serde, which does not allow +// to specify a default variant if not tag is present, +// every underlying chain config MUST have a field `r#type` of +// type `monotstate::MustBe!("VariantName")`. +// +// For chains other than CosmosSdk, this field MUST NOT be annotated +// with `#[serde(default)]`. +// +// See https://github.com/serde-rs/serde/issues/2231 #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] -#[serde(deny_unknown_fields)] -#[serde(tag = "type")] +#[serde(untagged)] pub enum ChainConfig { CosmosSdk(CosmosSdkConfig), } @@ -770,6 +779,7 @@ mod tests { use super::{load, parse_gas_prices, store_writer}; use crate::config::GasPrice; + use monostate::MustBe; use test_log::test; #[test] @@ -830,6 +840,22 @@ mod tests { assert!(load(path).is_err()); } + #[test] + fn parse_default_chain_type() { + let path = concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/config/fixtures/relayer_conf_example_default_chain_type.toml" + ); + + let config = load(path).expect("could not parse config"); + + match config.chains[0] { + super::ChainConfig::CosmosSdk(ref config) => { + assert_eq!(config.r#type, MustBe!("CosmosSdk")); + } + } + } + #[test] fn serialize_valid_config() { let path = concat!( diff --git a/crates/relayer/tests/config/fixtures/relayer_conf_example_default_chain_type.toml b/crates/relayer/tests/config/fixtures/relayer_conf_example_default_chain_type.toml new file mode 100644 index 0000000000..6df007f2f7 --- /dev/null +++ b/crates/relayer/tests/config/fixtures/relayer_conf_example_default_chain_type.toml @@ -0,0 +1,56 @@ +[global] +log_level = 'error' + +[mode] + +[mode.clients] +enabled = true +refresh = true +misbehaviour = true + +[mode.connections] +enabled = false + +[mode.channels] +enabled = false + +[mode.packets] +enabled = true +clear_interval = 100 +clear_on_start = true +tx_confirmation = true + +[[chains]] +id = 'chain_A' +rpc_addr = 'http://127.0.0.1:26657' +grpc_addr = 'http://127.0.0.1:9090' +event_source = { mode = 'push', url = 'ws://localhost:26657/websocket', batch_delay = '500ms' } +rpc_timeout = '10s' +account_prefix = 'cosmos' +key_name = 'testkey' +store_prefix = 'ibc' +max_gas = 200000 +gas_price = { price = 0.001, denom = 'stake' } +max_msg_num = 4 +max_tx_size = 1048576 +max_grpc_decoding_size = '4MiB' +clock_drift = '5s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'cosmos' } + +[[chains]] +id = 'chain_B' +rpc_addr = 'http://127.0.0.1:26557' +grpc_addr = 'http://127.0.0.1:9090' +event_source = { mode = 'push', url = 'ws://localhost:26557/websocket', batch_delay = '500ms' } +rpc_timeout = '10s' +account_prefix = 'cosmos' +key_name = 'testkey' +store_prefix = 'ibc' +gas_price = { price = 0.001, denom = 'stake' } +max_grpc_decoding_size = '5.91 MB' +clock_drift = '5s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'ethermint', proto_type = { pk_type = '/injective.crypto.v1beta1.ethsecp256k1.PubKey' } } \ No newline at end of file diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index 4fbc20b938..9cf81d3cd0 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -155,6 +155,7 @@ impl FullNode { }; Ok(config::ChainConfig::CosmosSdk(CosmosSdkConfig { + r#type: Default::default(), id: self.chain_driver.chain_id.clone(), rpc_addr: Url::from_str(&self.chain_driver.rpc_address())?, grpc_addr: Url::from_str(&self.chain_driver.grpc_address())?, From a5836662b99a5695107d7b68366ea760d59f8fa0 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Fri, 19 Jan 2024 16:09:33 +0100 Subject: [PATCH 002/200] Add memo and/or receiver filter metric (#3795) * Add new 'filtered_packets' metric * Add changelog entry * Update telemetry guide page with new metric * Github suggestions --- .../3794-memo-receiver-filter-metric.md | 3 ++ crates/relayer/src/link/relay_path.rs | 10 ++++++ crates/telemetry/src/state.rs | 36 +++++++++++++++++++ .../src/documentation/telemetry/operators.md | 1 + 4 files changed, 50 insertions(+) create mode 100644 .changelog/unreleased/features/ibc-telemetry/3794-memo-receiver-filter-metric.md diff --git a/.changelog/unreleased/features/ibc-telemetry/3794-memo-receiver-filter-metric.md b/.changelog/unreleased/features/ibc-telemetry/3794-memo-receiver-filter-metric.md new file mode 100644 index 0000000000..d62c3790a0 --- /dev/null +++ b/.changelog/unreleased/features/ibc-telemetry/3794-memo-receiver-filter-metric.md @@ -0,0 +1,3 @@ +- Add a new metric `filtered_packets` which counts the number of + packets filtered due to having a memo or receiver field too big + ([\#3794](https://github.com/informalsystems/hermes/issues/3794)) \ No newline at end of file diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index 2a1d4307be..6abdd59620 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -568,6 +568,16 @@ impl RelayPath { self.max_memo_size, self.max_receiver_size, ) { + telemetry!( + filtered_packets, + &self.src_chain().id(), + &self.dst_chain().id(), + &packet.source_channel, + &packet.destination_channel, + &packet.source_port, + &packet.destination_port, + 1 + ); continue; } } diff --git a/crates/telemetry/src/state.rs b/crates/telemetry/src/state.rs index 00461eb2fc..ea05147321 100644 --- a/crates/telemetry/src/state.rs +++ b/crates/telemetry/src/state.rs @@ -200,6 +200,9 @@ pub struct TelemetryState { /// Number of errors observed by Hermes when broadcasting a Tx broadcast_errors: Counter, + + /// Number of ICS-20 packets filtered because the memo and/or the receiver fields were exceeding the configured limits + filtered_packets: Counter, } impl TelemetryState { @@ -381,6 +384,11 @@ impl TelemetryState { "Number of errors observed by Hermes when broadcasting a Tx", ) .init(), + + filtered_packets: meter + .u64_counter("filtered_packets") + .with_description("Number of ICS-20 packets filtered because the memo and/or the receiver fields were exceeding the configured limits") + .init(), } } @@ -1127,6 +1135,34 @@ impl TelemetryState { self.broadcast_errors.add(&cx, 1, labels); } + + /// Increment number of packets filtered because the memo field is too big + #[allow(clippy::too_many_arguments)] + pub fn filtered_packets( + &self, + src_chain: &ChainId, + dst_chain: &ChainId, + src_channel: &ChannelId, + dst_channel: &ChannelId, + src_port: &PortId, + dst_port: &PortId, + count: u64, + ) { + let cx = Context::current(); + + if count > 0 { + let labels = &[ + KeyValue::new("src_chain", src_chain.to_string()), + KeyValue::new("dst_chain", dst_chain.to_string()), + KeyValue::new("src_channel", src_channel.to_string()), + KeyValue::new("dst_channel", dst_channel.to_string()), + KeyValue::new("src_port", src_port.to_string()), + KeyValue::new("dst_port", dst_port.to_string()), + ]; + + self.filtered_packets.add(&cx, count, labels); + } + } } use std::sync::Arc; diff --git a/guide/src/documentation/telemetry/operators.md b/guide/src/documentation/telemetry/operators.md index 96204843c4..c990dfb01a 100644 --- a/guide/src/documentation/telemetry/operators.md +++ b/guide/src/documentation/telemetry/operators.md @@ -142,6 +142,7 @@ If this metric is increasing, it signals that the packet queue is increasing and | `cleared_send_packet_count_total`  | Number of SendPacket events received during the initial and periodic clearing, per chain, counterparty chain, channel and port | `u64` Counter | Packet workers enabled, and periodic packet clearing or clear on start enabled | | `cleared_acknowledgment_count_total` | Number of WriteAcknowledgement events received during the initial and periodic clearing, per chain, counterparty chain, channel and port | `u64` Counter | Packet workers enabled, and periodic packet clearing or clear on start enabled | | `broadcast_errors_total` | Number of errors observed by Hermes when broadcasting a Tx, per error type and account | `u64` Counter | Packet workers enabled | +| `filtered_packets` | Number of ICS-20 packets filtered because the memo and/or the receiver fields were exceeding the configured limits | `u64` Counter | Packet workers enabled, and `ics20_max_memo_size` and/or `ics20_max_receiver_size` enabled | Notes: - The two metrics `cleared_send_packet_count_total` and `cleared_acknowledgment_count_total` are only populated if `tx_confirmation = true`. From 90ebd6bea29a3ac323d470d6bc6398216f9434fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Jan 2024 18:20:05 +0100 Subject: [PATCH 003/200] Bump actions/cache from 3 to 4 (#3790) Bumps [actions/cache](https://github.com/actions/cache) from 3 to 4. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Romain Ruetschi --- .github/workflows/audit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/audit.yaml b/.github/workflows/audit.yaml index ffafedc37c..e6ad8d0de2 100644 --- a/.github/workflows/audit.yaml +++ b/.github/workflows/audit.yaml @@ -10,7 +10,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Cache cargo bin - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ~/.cargo/bin key: ${{ runner.os }}-cargo-audit-v0.11.2 From 65ffa50686b6fc3ece89515d300b07d8d8e4940c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:06:47 +0100 Subject: [PATCH 004/200] Bump uuid from 1.6.1 to 1.7.0 (#3807) Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.6.1 to 1.7.0. - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/1.6.1...1.7.0) --- updated-dependencies: - dependency-name: uuid dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/relayer/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7bb0fd276b..90555ab873 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1460,7 +1460,7 @@ dependencies = [ "tonic", "tracing", "tracing-subscriber", - "uuid 1.6.1", + "uuid 1.7.0", ] [[package]] @@ -1885,7 +1885,7 @@ dependencies = [ "tagptr", "thiserror", "triomphe", - "uuid 1.6.1", + "uuid 1.7.0", ] [[package]] @@ -3898,9 +3898,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ "getrandom", ] diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index c60227263b..07164f24e7 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -58,7 +58,7 @@ semver = "1.0" humantime = "2.1.0" regex = "1" moka = { version = "0.12.0", features = ["sync"] } -uuid = { version = "1.6.1", features = ["v4"] } +uuid = { version = "1.7.0", features = ["v4"] } bs58 = "0.5.0" digest = "0.10.6" ed25519 = "2.2.2" From c4db70e053c10f593bbbbfab3f53cee5d8dc57ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:06:57 +0100 Subject: [PATCH 005/200] Bump semver from 1.0.20 to 1.0.21 (#3806) Bumps [semver](https://github.com/dtolnay/semver) from 1.0.20 to 1.0.21. - [Release notes](https://github.com/dtolnay/semver/releases) - [Commits](https://github.com/dtolnay/semver/compare/1.0.20...1.0.21) --- updated-dependencies: - dependency-name: semver dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- tools/test-framework/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 90555ab873..7fd45f8efc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2735,9 +2735,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 8a380f5f7d..be30a1302b 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -36,7 +36,7 @@ toml = "0.8" subtle-encoding = "0.5.1" sha2 = "0.10.6" crossbeam-channel = "0.5.11" -semver = "1.0.16" +semver = "1.0.21" flex-error = "0.4.4" prost = { version = "0.12" } tonic = { version = "0.10", features = ["tls", "tls-roots"] } From e3e10ae005e7159f5301616286d0e8b7c7501c0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:07:09 +0100 Subject: [PATCH 006/200] Bump thiserror from 1.0.50 to 1.0.56 (#3805) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.50 to 1.0.56. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.50...1.0.56) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/relayer/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7fd45f8efc..abc882aa42 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3381,18 +3381,18 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 07164f24e7..79a0a5874e 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -28,7 +28,7 @@ subtle-encoding = "0.5" humantime-serde = "1.1.1" serde = "1.0" serde_derive = "1.0" -thiserror = "1.0.40" +thiserror = "1.0.56" toml = "0.8" tracing = "0.1.36" tokio = { version = "1.0", features = ["rt-multi-thread", "time", "sync"] } From a78ed5022708132b80d5ff866313a836c3b49fb4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:07:20 +0100 Subject: [PATCH 007/200] Bump serde_json from 1.0.108 to 1.0.111 (#3804) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.108 to 1.0.111. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.108...v1.0.111) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/telemetry/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index abc882aa42..a5eae32306 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2783,9 +2783,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index 4f4d6838e5..b70652ea9d 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -21,7 +21,7 @@ opentelemetry-prometheus = "0.12.0" prometheus = "0.13.2" moka = { version = "0.12.0", features = ["sync"] } dashmap = "5.4.0" -serde_json = "1.0.94" +serde_json = "1.0.111" serde = "1.0.195" axum = "0.6.18" tokio = "1.26.0" From 091fa7ad62790cc903bc78f0371cae0af41c4aaf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 09:07:31 +0100 Subject: [PATCH 008/200] Bump h2 from 0.3.22 to 0.3.24 (#3799) Bumps [h2](https://github.com/hyperium/h2) from 0.3.22 to 0.3.24. - [Release notes](https://github.com/hyperium/h2/releases) - [Changelog](https://github.com/hyperium/h2/blob/v0.3.24/CHANGELOG.md) - [Commits](https://github.com/hyperium/h2/compare/v0.3.22...v0.3.24) --- updated-dependencies: - dependency-name: h2 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a5eae32306..97a2bf7e9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1146,9 +1146,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.22" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", From d9c939f880781b631f8e08d30c87cc4314b5db81 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 23 Jan 2024 09:08:39 +0100 Subject: [PATCH 009/200] Improve error message when deserializing an invalid chain config (#3803) * Improve error message when deserializing an invalid chain config Error messages when deserializing an invalid chain config have gotten a lot worse since https://github.com/informalsystems/hermes/pull/3787. For example, when mistyping the `gas_multiplier` field as `gas_multiplie` in the per-chain config: ``` data did not match any variant of untagged enum ChainConfig for key `chains` at line 424 column 1 ``` After this commit (same message as before #3787): ``` invalid CosmosSdk config: unknown field `gas_multiplie`, expected one of `id`, `rpc_addr`, `grpc_addr`, `event_source`, `rpc_timeout`, `trusted_node`, `account_prefix`, `key_name`, `key_store_type`, `key_store_folder`, `store_prefix`, `default_gas`, `max_gas`, `genesis_restart`, `gas_adjustment`, `gas_multiplier`, `fee_granter`, `max_msg_num`, `max_tx_size`, `max_grpc_decoding_size`, `query_packets_chunk_size`, `clock_drift`, `max_block_time`, `trusting_period`, `client_refresh_rate`, `ccv_consumer_chain`, `memo_prefix`, `sequential_batch_tx`, `proof_specs`, `trust_threshold`, `gas_price`, `packet_filter`, `address_type`, `extension_options`, `compat_mode`, `clear_interval` for key `chains` at line 424 column 1 ``` For this, we now use a custom deserializer for ChainConfig instead of relying on an untagged enum. * Remove `monostate::MustBe!` hack * Fix relayer REST mock test * Remove outdated changelog entry --- .../ibc-relayer-cli/3636-config-chain-type.md | 8 --- Cargo.lock | 22 ------- crates/relayer-cli/src/chain_registry.rs | 1 - crates/relayer-rest/tests/mock.rs | 2 +- crates/relayer/Cargo.toml | 1 - crates/relayer/src/chain/cosmos/config.rs | 6 -- crates/relayer/src/config.rs | 58 ++++++++++++++----- tools/test-framework/src/types/single/node.rs | 1 - 8 files changed, 45 insertions(+), 54 deletions(-) delete mode 100644 .changelog/unreleased/breaking-changes/ibc-relayer-cli/3636-config-chain-type.md diff --git a/.changelog/unreleased/breaking-changes/ibc-relayer-cli/3636-config-chain-type.md b/.changelog/unreleased/breaking-changes/ibc-relayer-cli/3636-config-chain-type.md deleted file mode 100644 index 601455dec7..0000000000 --- a/.changelog/unreleased/breaking-changes/ibc-relayer-cli/3636-config-chain-type.md +++ /dev/null @@ -1,8 +0,0 @@ -- The `type` key in the `[[chains]]` section is now required. ([\#3636](https://github.com/informalsystems/hermes/issues/3636)) - If you previously did not specify that key, you must now set it to `type = "CosmosSdk"`, eg. - - ```rust - [[chains]] - id = "osmosis-1" - type = "CosmosSdk" - ``` diff --git a/Cargo.lock b/Cargo.lock index 97a2bf7e9a..f2a986eeca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1425,7 +1425,6 @@ dependencies = [ "ibc-telemetry", "itertools 0.10.5", "moka", - "monostate", "num-bigint", "num-rational", "once_cell", @@ -1888,27 +1887,6 @@ dependencies = [ "uuid 1.7.0", ] -[[package]] -name = "monostate" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878c2a1f1c70e5724fa28f101ca787b6a7e8ad5c5e4ae4ca3b0fa4a419fa9075" -dependencies = [ - "monostate-impl", - "serde", -] - -[[package]] -name = "monostate-impl" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f686d68a09079e63b1d2c64aa305095887ce50565f00a922ebfaeeee0d9ba6ce" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "nu-ansi-term" version = "0.46.0" diff --git a/crates/relayer-cli/src/chain_registry.rs b/crates/relayer-cli/src/chain_registry.rs index 520a58a011..df63a513c1 100644 --- a/crates/relayer-cli/src/chain_registry.rs +++ b/crates/relayer-cli/src/chain_registry.rs @@ -121,7 +121,6 @@ where }; Ok(ChainConfig::CosmosSdk(CosmosSdkConfig { - r#type: Default::default(), id: chain_data.chain_id, rpc_addr: rpc_data.rpc_address, grpc_addr: grpc_address, diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index b0f49c9bb4..a108e619ac 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -41,7 +41,7 @@ where Err(e) => panic!("got an error: {e}"), }); - tokio::time::sleep(Duration::from_millis(500)).await; + tokio::time::sleep(Duration::from_millis(200)).await; let response = reqwest::get(&format!("http://127.0.0.1:{port}{path}")) .await diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 79a0a5874e..80e7ee25d7 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -70,7 +70,6 @@ strum = { version = "0.25", features = ["derive"] } tokio-stream = "0.1.14" once_cell = "1.19.0" tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"] } -monostate = "0.1.11" [dependencies.byte-unit] version = "4.0.19" diff --git a/crates/relayer/src/chain/cosmos/config.rs b/crates/relayer/src/chain/cosmos/config.rs index a8e91c479f..225b7aa039 100644 --- a/crates/relayer/src/chain/cosmos/config.rs +++ b/crates/relayer/src/chain/cosmos/config.rs @@ -2,7 +2,6 @@ use core::time::Duration; use std::path::PathBuf; use byte_unit::Byte; -use monostate::MustBe; use serde_derive::{Deserialize, Serialize}; use tendermint_rpc::Url; @@ -24,11 +23,6 @@ pub mod error; #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct CosmosSdkConfig { - /// The type of this chain, must be "CosmosSdk" - /// This is the default if not specified. - #[serde(default)] - pub r#type: MustBe!("CosmosSdk"), - /// The chain's network identifier pub id: ChainId, diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index 10721a7348..27c1fee2dc 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -618,18 +618,14 @@ pub enum EventSourceMode { }, } -// NOTE: -// To work around a limitation of serde, which does not allow -// to specify a default variant if not tag is present, -// every underlying chain config MUST have a field `r#type` of -// type `monotstate::MustBe!("VariantName")`. +// NOTE: To work around a limitation of serde, which does not allow +// to specify a default variant if not tag is present, we use +// a custom Deserializer impl. // -// For chains other than CosmosSdk, this field MUST NOT be annotated -// with `#[serde(default)]`. -// -// See https://github.com/serde-rs/serde/issues/2231 -#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)] -#[serde(untagged)] +// IMPORTANT: Do not forget to update the `Deserializer` impl +// below when adding a new chain type. +#[derive(Clone, Debug, PartialEq, Serialize)] +#[serde(tag = "type")] pub enum ChainConfig { CosmosSdk(CosmosSdkConfig), } @@ -704,6 +700,41 @@ impl ChainConfig { } } +// /!\ Update me when adding a new chain type! +impl<'de> Deserialize<'de> for ChainConfig { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let mut value = serde_json::Value::deserialize(deserializer)?; + + // Remove the `type` key from the TOML value in order for deserialization to work, + // otherwise it would fail with: `unknown field `type`. + let type_value = value + .as_object_mut() + .ok_or_else(|| serde::de::Error::custom("invalid chain config, must be a table"))? + .remove("type") + .unwrap_or_else(|| serde_json::json!("CosmosSdk")); + + let type_str = type_value + .as_str() + .ok_or_else(|| serde::de::Error::custom("invalid chain type, must be a string"))?; + + match type_str { + "CosmosSdk" => CosmosSdkConfig::deserialize(value) + .map(Self::CosmosSdk) + .map_err(|e| serde::de::Error::custom(format!("invalid CosmosSdk config: {e}"))), + + // + // <-- Add new chain types here --> + // + chain_type => Err(serde::de::Error::custom(format!( + "unknown chain type: {chain_type}", + ))), + } + } +} + /// Attempt to load and parse the TOML config file as a `Config`. pub fn load(path: impl AsRef) -> Result { let config_toml = std::fs::read_to_string(&path).map_err(Error::io)?; @@ -779,7 +810,6 @@ mod tests { use super::{load, parse_gas_prices, store_writer}; use crate::config::GasPrice; - use monostate::MustBe; use test_log::test; #[test] @@ -850,8 +880,8 @@ mod tests { let config = load(path).expect("could not parse config"); match config.chains[0] { - super::ChainConfig::CosmosSdk(ref config) => { - assert_eq!(config.r#type, MustBe!("CosmosSdk")); + super::ChainConfig::CosmosSdk(_) => { + // all good } } } diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index 9cf81d3cd0..4fbc20b938 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -155,7 +155,6 @@ impl FullNode { }; Ok(config::ChainConfig::CosmosSdk(CosmosSdkConfig { - r#type: Default::default(), id: self.chain_driver.chain_id.clone(), rpc_addr: Url::from_str(&self.chain_driver.rpc_address())?, grpc_addr: Url::from_str(&self.chain_driver.grpc_address())?, From 04868db11466498be5e8975e7a99eb3fe91b1e7f Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 23 Jan 2024 11:27:53 +0100 Subject: [PATCH 010/200] Port Osmosis EIP fee query feature (#3771) * Fix README badge (#3675) * Fix a bug in `query_next_sequence_receive`, where if we didnt ask for a proof, then the query height was ignored (#3662) * Enable serde feature of ibc-proto (#3678) * Update misbehaviour-ics tests (#3681) * Update light_client_attack_freeze_test.sh Update script to work with ICS `feat/ics-misbehaviour-handling` branch binary at `28e0c14b`. Signed-off-by: Simon Noetzlin * Update nix flake and remaining misbehaviour tests * Fix env variable increment * Use Cosmos Nix 'master' branch --------- Signed-off-by: Simon Noetzlin Co-authored-by: Luca Joss * Bump version to v1.7.1 * Do not perform client update if consensus state already exists (#3555) * Do not perform client update if consensus state already exists On some chains there are a few active channels using the same connection and therefore clients. This PR adds a check in the client update code and not create the message if the consensus state at desired height is already present. This helps with reducing relayer fees, state bloating, etc by eliminating redundant updates. * Improve error message in `update client` command * Add changelog entry for #3521 * Fix guide config files and balance outputs (#3690) * Add per chain `clear_interval` configuration (#3693) * Add per chain clear_interval configuration * Add changelog entry * Add guide entry for packet clearing * Reword config comment Signed-off-by: Romain Ruetschi --------- Signed-off-by: Romain Ruetschi Co-authored-by: Romain Ruetschi * Add CompatMode configuration (#3667) * Update test bootstrap to work with Celestia chain * Update Nix flake and add Celestia CI job * Add changelog entry * Add guide section for 'compat_mode' configuration * Apply suggestions from code review Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * Implement serialization and deserialization for CompatMode * Update crates/relayer/src/util/compat_mode.rs Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi * docs: fix typos (#3687) * docs: fix typos * test: fix error because of typo * Fix misbehaviour test --------- Co-authored-by: Luca Joss Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * Update changelog * Apply suggestions from code review Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Signed-off-by: Romain Ruetschi * Release Hermes v1.7.2 (#3709) * Add metric to count skipped client update messages (#3706) * Add metric to count skipped client update messages * Update guide with new metric * Add changelog entry * Update versions * Fix cargo doc warnings and update version reference in relayer crate * Fix clippy error * Fix relayer-rest test * Fix typo in changelog * Add `broadcast_errors` metric (#3710) * Add metric for broadcast errors * Update the guide with the new broadcast error metric * Add changelog entry * Update release date * Update changelog and summary message * Apply github suggestion and add missing entry in Changelog * Release Hermes v1.7.3 (#3715) * evidence: More reliable evidence reporting + couple of bug fixes (#3702) * evidence: Only fetch counterparty clients of chains present in the config * Harden the evidence reporting code in the face of runtime errors * Fix bug where the counterparty client id returned was actually the original client id * Bump version to v1.7.3 * Release changelog * Release Hermes v1.7.4 (#3729) * Improve `broadcast_errors` metric (#3719) * Use short description for 'broadcast_errors' metric * Add changelog entry * Fix hyperlink in doc comment Signed-off-by: Romain Ruetschi * Fix hyperlink in doc comment --------- Signed-off-by: Romain Ruetschi Co-authored-by: Romain Ruetschi * Fetch the light block at trusted_height + 1 when detecting misbehavior (#3727) * fetch the light block at trusted_height+1 when detecting misbehaviour * Add changelog entry * Fix typo --------- Co-authored-by: beer-1 <147697694+beer-1@users.noreply.github.com> * Initialise v1.7.4 release * Avoid retrieving a worker which is being removed by the idle worker clean-up process (#3725) * prevent returning stopping workers * clear only the specific worker * Add ibc-go v8 to integration tests (#3694) * Add simapp v8 to CI jobs * Add simapp v8 to nix flake * Handle CLI breaking changes of Cosmos SDK v0.50 in test bootstrap * Handle genesis config 'voting_perdiod' and CLI 'query txs' changes for Cosmos SDK v0.50.1 * Use 'MsgSubmitProposal' instead of deprecated 'UpgradeProposal' to initiate a chain upgrade * Update 'tx upgrade-chain' CLI template * Fix 'tx chain-upgrade' tests * Update chain upgrade for compatibility between different ibc-go versions * Improve assertion for client upgrade tests * Update ibc-proto-rs to v0.39.0 * Add changelog entry * Fix and improve guide section for client upgrade * Wait before querying client state for client upgrade tests * Apply suggestions from code review Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * Rename method 'ibc_version()' to 'version_specs' * Extract the verification of legacy version in a method * Implement 'FromStr' instead of 'TryFrom' for 'ProposalStatus' * Fix cargo-doc warning * Add changelog entry for CLI * Change the '--gov-account' flag as optional but will fail if trying to upgrade a chain with ibc-go v8+ * Update guide * Move and update changelog entry for CLI * Return a 'Specs' struct in 'version_specs()' method * Fix clippy errors --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi * Update Gaia used in tests from v12 to v13 & v14 (#3700) * Update Gaia v12 to v13 and v14 in tests * Fix Celestia CI job * Replace Gaia v12 with v13 and v14 in multi-chain tests (#3701) * Add changelog entry --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: beer-1 <147697694+beer-1@users.noreply.github.com> Co-authored-by: Romain Ruetschi * Add PR 3703 to patch release * Improve `backlog` metrics (#3722) * Update backlog metric when packet clearing is triggered * Fix update backlog and add unit tests * Uncomment conditional compilation from telemetry tests * Add changelog entry * Update guide section regarding 'backlog_*' metrics * Correctly update the backlog when querying commitments on chain * Update backlog_oldest_timestamp to backlog_latest_update_timestamp * Update changelog entry * Fix bug in backlog update * Guard tests module by test cfg Signed-off-by: Romain Ruetschi * Update from GitHub suggestions --------- Signed-off-by: Romain Ruetschi Co-authored-by: Romain Ruetschi * Update changelog * Update release summary --------- Signed-off-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi Co-authored-by: beer-1 <147697694+beer-1@users.noreply.github.com> * Fix changelog * add query for eip value * add lcd as optional field * initial integration * using dynamic * dynamic pricing * added better logs * use block_on * remove lcd * Add DynamicGas configuration * Add test for dynamic gas configuration * Fix dynamic gas price computation * Remove test related changes * Remove dynamic gas test * Change dynamic_gas_price to dynamic_gas configuration name * Correctly deserialize DynamicGas config * Fix formatting following merge * dynamic gas price: Add integration test (#3788) * Dynamic gas fee test * Add dynamic gas fee test to CI * Fix issue with nested calls to `block_on` (#3789) * Fix test for dynamic gas price --------- Co-authored-by: Luca Joss * Avoid depending on `cosmwasm-std` and `osmosis-std` * Cleanup * Use rustls instead of openssl with reqwest * Use same feature flag as tendermint-rpc for reqwest * Cleanup feature flag for reqwest dep in chain-registry * Undo changes to Cargo.lock * Add dynamic gas fees metrics (#3798) * Add simple metric for dynamic gas price after multiplication * Add max gas price configuration to dynamic gas configuration * Apply dynamic max gas configuration * Add 2 new metrics for dynamic gas fees * Add guide entry for Dynamic gas configuration and metrics * Fix EIP query parsing * Use chain id instead of RPC address in emitted metrics --------- Co-authored-by: Romain Ruetschi <106849+romac@users.noreply.github.com> * Add changelog entry * Reword changelog entry * Remove lower bound on max dynamic gas price * Small refactor * Fix unused variable warning * Simplify deserialization code * Fix wrong error message * Fixup changelog entry * Add example to the config * Fix integration test framework * Fix typo in config file * Apply suggestions from code review Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Signed-off-by: Romain Ruetschi * Use dynamic gas for Osmosis in auto-generated config * Small improvement to `config auto` command output and usage * Fix typo Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Signed-off-by: Romain Ruetschi * Update guide template * Fix guide * Rename configuration 'dynamic_gas' to 'dynamic_gas_price' * Rename 'dynamic_gas_price' subconfigurations 'max_gas_price' to 'max' and 'gas_price_multiplier' to 'multiplier' --------- Signed-off-by: Simon Noetzlin Signed-off-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Signed-off-by: Romain Ruetschi Co-authored-by: Romain Ruetschi Co-authored-by: Simon Noetzlin Co-authored-by: GoodDaisy <90915921+GoodDaisy@users.noreply.github.com> Co-authored-by: beer-1 <147697694+beer-1@users.noreply.github.com> Co-authored-by: Adam Tucker Co-authored-by: Nicolas Lara Co-authored-by: Romain Ruetschi <106849+romac@users.noreply.github.com> --- .../ibc-relayer/3738-dynamic-gas-fees.md | 12 + .../3738-dynamic-gas-fees-metrics.md | 8 + .github/workflows/integration.yaml | 2 +- Cargo.lock | 8 +- config.toml | 12 + crates/chain-registry/Cargo.toml | 2 +- crates/relayer-cli/src/chain_registry.rs | 9 + .../relayer-cli/src/commands/config/auto.rs | 39 +-- crates/relayer/Cargo.toml | 1 + crates/relayer/src/chain/cosmos.rs | 13 + crates/relayer/src/chain/cosmos/batch.rs | 72 ++++-- crates/relayer/src/chain/cosmos/config.rs | 4 + .../relayer/src/chain/cosmos/eip_base_fee.rs | 141 +++++++++++ crates/relayer/src/chain/cosmos/estimate.rs | 14 +- crates/relayer/src/chain/cosmos/gas.rs | 69 ++++- crates/relayer/src/chain/cosmos/types/gas.rs | 3 + crates/relayer/src/config.rs | 1 + crates/relayer/src/config/dynamic_gas.rs | 142 +++++++++++ crates/relayer/src/error.rs | 32 +++ crates/relayer/src/lib.rs | 1 - crates/telemetry/src/state.rs | 60 ++++- flake.lock | 238 +++++++++++++----- guide/src/SUMMARY.md | 3 +- guide/src/documentation/commands/config.md | 4 +- .../configuration/configure-hermes.md | 2 +- .../configuration/dynamic-gas-fees.md | 21 ++ .../src/documentation/telemetry/operators.md | 18 +- .../commands/hermes/config/auto_1.md | 2 +- .../templates/help_templates/config/auto.md | 6 +- .../src/tutorials/production/setup-hermes.md | 2 +- tools/check-guide/Cargo.lock | 212 +++++++++------- tools/integration-test/Cargo.toml | 1 + .../src/tests/dynamic_gas_fee.rs | 214 ++++++++++++++++ tools/integration-test/src/tests/mod.rs | 3 + tools/test-framework/src/relayer/tx.rs | 6 + tools/test-framework/src/types/single/node.rs | 2 + 36 files changed, 1166 insertions(+), 213 deletions(-) create mode 100644 .changelog/unreleased/features/ibc-relayer/3738-dynamic-gas-fees.md create mode 100644 .changelog/unreleased/features/ibc-telemetry/3738-dynamic-gas-fees-metrics.md create mode 100644 crates/relayer/src/chain/cosmos/eip_base_fee.rs create mode 100644 crates/relayer/src/config/dynamic_gas.rs create mode 100644 guide/src/documentation/configuration/dynamic-gas-fees.md create mode 100644 tools/integration-test/src/tests/dynamic_gas_fee.rs diff --git a/.changelog/unreleased/features/ibc-relayer/3738-dynamic-gas-fees.md b/.changelog/unreleased/features/ibc-relayer/3738-dynamic-gas-fees.md new file mode 100644 index 0000000000..578056b876 --- /dev/null +++ b/.changelog/unreleased/features/ibc-relayer/3738-dynamic-gas-fees.md @@ -0,0 +1,12 @@ +- Add a new per-chain configuration table `dynamic_gas_price` which enables + querying the current gas price from the chain instead of the static `gas_price`, + when the chain has [EIP-1559][eip]-like dynamic gas price. + The new configuration setting can be configured per-chain as follows: + ```toml + dynamic_gas_price = { enabled = true, multiplier = 1.1, max = 0.6 } + ``` + At the moment, only chains which support the `osmosis.txfees.v1beta1.Query/GetEipBaseFee` + query can be used with dynamic gas price enabled. + ([\#3738](https://github.com/informalsystems/hermes/issues/3738)) + +[eip]: https://metamask.io/1559/ diff --git a/.changelog/unreleased/features/ibc-telemetry/3738-dynamic-gas-fees-metrics.md b/.changelog/unreleased/features/ibc-telemetry/3738-dynamic-gas-fees-metrics.md new file mode 100644 index 0000000000..98a9555967 --- /dev/null +++ b/.changelog/unreleased/features/ibc-telemetry/3738-dynamic-gas-fees-metrics.md @@ -0,0 +1,8 @@ +- Add three metrics related to EIP gas price: + - `dynamic_gas_queried_fees` contains data on the queried values + before applying any filter + - `dynamic_gas_queried_success_fees` contains data on the queried + values if the query was successful and before applying any filter + - `dynamic_gas_paid_fees` contains data on the queried values after + applying the `max` filter + ([\#3738](https://github.com/informalsystems/hermes/issues/3738)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 78ef604845..bc9f4a5427 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -79,7 +79,7 @@ jobs: command: osmosisd account_prefix: osmo native_token: stake - features: '' + features: dynamic-gas-fee - package: juno command: junod account_prefix: juno diff --git a/Cargo.lock b/Cargo.lock index f2a986eeca..b8ab401cbc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1430,6 +1430,7 @@ dependencies = [ "once_cell", "prost", "regex", + "reqwest", "retry", "ripemd", "secp256k1", @@ -2477,7 +2478,6 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", "winreg", ] @@ -4005,12 +4005,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - [[package]] name = "winapi" version = "0.3.9" diff --git a/config.toml b/config.toml index 06dabdac13..f45e2289cf 100644 --- a/config.toml +++ b/config.toml @@ -303,6 +303,18 @@ gas_price = { price = 0.025, denom = 'stake' } # Minimum value: 1.0 gas_multiplier = 1.1 +# Query the current gas price from the chain instead of using the static `gas_price` from the config. +# Useful for chains which have [EIP-1559][eip]-like dynamic gas price. +# +# At the moment, only chains which support the `osmosis.txfees.v1beta1.Query/GetEipBaseFee` +# query can be used with dynamic gas price enabled. +# +# See this page in the Hermes guide for more information: +# https://hermes.informal.systems/documentation/configuration/dynamic-gas-fees.html +# +# Default: { enabled = false, multiplier = 1.1, max = 0.6 } +dynamic_gas_price = { enabled = false, multiplier = 1.1, max = 0.6 } + # Specify how many IBC messages at most to include in a single transaction. # Default: 30 max_msg_num = 30 diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index 5724404d1f..b28dc1de05 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -21,7 +21,7 @@ flex-error = { version = "0.4.4", default-features = false } futures = { version = "0.3.27", features = ["executor"] } http = "0.2" itertools = "0.10.5" -reqwest = { version = "0.11.13", features = ["rustls-tls", "json"], default-features = false } +reqwest = { version = "0.11.13", features = ["rustls-tls-native-roots", "json"], default-features = false } serde = "1.0.195" serde_json = "1" tokio = "1.17.0" diff --git a/crates/relayer-cli/src/chain_registry.rs b/crates/relayer-cli/src/chain_registry.rs index df63a513c1..cbaae53590 100644 --- a/crates/relayer-cli/src/chain_registry.rs +++ b/crates/relayer-cli/src/chain_registry.rs @@ -6,6 +6,7 @@ use std::marker::Send; use futures::future::join_all; use http::Uri; +use ibc_relayer::config::dynamic_gas::DynamicGasPrice; use tokio::task::{JoinError, JoinHandle}; use tracing::trace; @@ -120,6 +121,13 @@ where 0.1 }; + // Use EIP-1559 dynamic gas price for Osmosis + let dynamic_gas_price = if chain_data.chain_id.as_str() == "osmosis-1" { + DynamicGasPrice::unsafe_new(true, 1.1, 0.6) + } else { + DynamicGasPrice::disabled() + }; + Ok(ChainConfig::CosmosSdk(CosmosSdkConfig { id: chain_data.chain_id, rpc_addr: rpc_data.rpc_address, @@ -140,6 +148,7 @@ where max_gas: Some(400000), gas_adjustment: None, gas_multiplier: Some(GasMultiplier::new(1.1).unwrap()), + dynamic_gas_price, fee_granter: None, max_msg_num: MaxMsgNum::default(), max_tx_size: MaxTxSize::default(), diff --git a/crates/relayer-cli/src/commands/config/auto.rs b/crates/relayer-cli/src/commands/config/auto.rs index 66fbd0969c..64241d030d 100644 --- a/crates/relayer-cli/src/commands/config/auto.rs +++ b/crates/relayer-cli/src/commands/config/auto.rs @@ -1,6 +1,7 @@ use crate::chain_registry::get_configs; use abscissa_core::clap::Parser; use abscissa_core::{Command, Runnable}; +use itertools::Itertools; use crate::conclude::Output; @@ -25,7 +26,7 @@ fn find_key(chain_config: &ChainConfig) -> Option { /// If a is specified then it will be used without verifying that it exists. #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] #[clap( - override_usage = "hermes config auto [OPTIONS] --output --chains " + override_usage = "hermes config auto [OPTIONS] --output --chain --chain " )] pub struct AutoCmd { #[clap( @@ -39,11 +40,14 @@ pub struct AutoCmd { #[clap( long = "chains", + alias = "chain", required = true, multiple = true, value_name = "CHAIN_NAME:OPTIONAL_KEY_NAME", help_heading = "REQUIRED", - help = "Names of the chains to include in the config. Every chain must be in the chain registry." + help = "Names of the chains to include in the configuration, together with an optional key name. \ + Either repeat this argument for every chain or pass a space-separated list of chains. \ + Every chain must be found in the chain registry." )] chain_names: Vec, @@ -149,23 +153,22 @@ impl Runnable for AutoCmd { }; match store(&config, &self.path) { + Ok(_) if missing_chains_set.is_empty() => { + Output::success_msg(format!( + "Config file written successfully at '{}'", + self.path.display() + )) + .exit() + }, Ok(_) => { - if missing_chains_set.is_empty() { - Output::success_msg(format!( - "Config file written successfully at '{}'", - self.path.display() - )) - .exit() - } else { - Output::success_msg(format!( - "Config file written successfully at '{}'. - However, configurations for the following chains were not able to be generated: {:?}", - self.path.display(), - missing_chains_set, - )) - .exit() - } - } + Output::success_msg(format!( + "Config file written successfully at '{}'. \ + However, configurations for the following chains were not able to be generated: {}", + self.path.display(), + missing_chains_set.iter().join(", "), + )) + .exit() + }, Err(e) => Output::error(format!( "An error occurred while attempting to write the config file: {}", e diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 80e7ee25d7..faf0d93c7c 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -51,6 +51,7 @@ dirs-next = "2.0.0" retry = { version = "2.0.0", default-features = false } async-stream = "0.3.5" http = "0.2.9" +reqwest = { version = "0.11", features = ["rustls-tls-native-roots", "json"], default-features = false } flex-error = { version = "0.4.4", default-features = false } signature = "2.1.0" anyhow = "1.0" diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index f1935d12a8..d5ccc13242 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -105,13 +105,16 @@ use crate::util::pretty::{ }; use crate::{chain::client::ClientSettings, config::Error as ConfigError}; +use self::gas::dynamic_gas_price; use self::types::app_state::GenesisAppState; +use self::types::gas::GasConfig; use self::version::Specs; pub mod batch; pub mod client; pub mod compatibility; pub mod config; +pub mod eip_base_fee; pub mod encode; pub mod estimate; pub mod fee; @@ -490,6 +493,16 @@ impl CosmosSdkChain { Ok(min_gas_price) } + pub fn dynamic_gas_price(&self) -> GasPrice { + let gas_config = GasConfig::from(self.config()); + + self.rt.block_on(dynamic_gas_price( + &gas_config, + &self.config.id, + &self.config.rpc_addr, + )) + } + /// The unbonding period of this chain pub fn unbonding_period(&self) -> Result { crate::time!( diff --git a/crates/relayer/src/chain/cosmos/batch.rs b/crates/relayer/src/chain/cosmos/batch.rs index ca82b2d5c7..3e52f52aec 100644 --- a/crates/relayer/src/chain/cosmos/batch.rs +++ b/crates/relayer/src/chain/cosmos/batch.rs @@ -102,7 +102,7 @@ pub async fn send_batched_messages_and_wait_check_tx( return Ok(Vec::new()); } - let batches = batch_messages(config, key_pair, account, tx_memo, messages)?; + let batches = batch_messages(config, key_pair, account, tx_memo, messages).await?; let mut responses = Vec::new(); @@ -132,7 +132,7 @@ async fn send_messages_as_batches( let message_count = messages.len(); - let batches = batch_messages(config, key_pair, account, tx_memo, messages)?; + let batches = batch_messages(config, key_pair, account, tx_memo, messages).await?; debug!( "sending {} messages as {} batches to chain {} in parallel", @@ -173,7 +173,7 @@ async fn sequential_send_messages_as_batches( let message_count = messages.len(); - let batches = batch_messages(config, key_pair, account, tx_memo, messages)?; + let batches = batch_messages(config, key_pair, account, tx_memo, messages).await?; debug!( "sending {} messages as {} batches to chain {} in serial", @@ -238,7 +238,7 @@ fn response_to_tx_sync_result( } } -fn batch_messages( +async fn batch_messages( config: &TxConfig, key_pair: &Secp256k1KeyPair, account: &Account, @@ -253,7 +253,14 @@ fn batch_messages( // Estimate the overhead of the transaction envelope's encoding, // by taking the encoded length of an empty tx with the same auth info and signatures. // Use the maximum possible fee to get an upper bound for varint encoding. - let max_fee = gas_amount_to_fee(&config.gas_config, config.gas_config.max_gas); + let max_fee = gas_amount_to_fee( + &config.gas_config, + config.gas_config.max_gas, + &config.chain_id, + &config.rpc_address, + ) + .await; + let tx_metrics = encoded_tx_metrics(config, key_pair, account, tx_memo, &[], &max_fee)?; let tx_envelope_len = tx_metrics.envelope_len; let empty_body_len = tx_metrics.body_bytes_len; @@ -364,10 +371,16 @@ mod tests { (tx_config, key_pair, account) } - #[test] - fn batch_does_not_exceed_max_tx_size() { + #[tokio::test] + async fn batch_does_not_exceed_max_tx_size() { let (config, key_pair, account) = test_fixture(); - let max_fee = gas_amount_to_fee(&config.gas_config, config.gas_config.max_gas); + let max_fee = gas_amount_to_fee( + &config.gas_config, + config.gas_config.max_gas, + &config.chain_id, + &config.rpc_address, + ) + .await; let mut messages = vec![Any { type_url: "/example.Baz".into(), value: vec![0; 2], @@ -404,6 +417,7 @@ mod tests { &memo, messages.clone(), ) + .await .unwrap(); assert_eq!(batches.len(), 2); @@ -420,8 +434,8 @@ mod tests { } } - #[test] - fn batch_error_on_oversized_message() { + #[tokio::test] + async fn batch_error_on_oversized_message() { const MAX_TX_SIZE: usize = 203; let (config, key_pair, account) = test_fixture(); @@ -442,25 +456,32 @@ mod tests { &memo, messages.clone(), ) + .await .unwrap(); assert_eq!(batches.len(), 1); assert_eq!(batches[0].len(), 1); - let max_fee = gas_amount_to_fee(&config.gas_config, config.gas_config.max_gas); + let max_fee = gas_amount_to_fee( + &config.gas_config, + config.gas_config.max_gas, + &config.chain_id, + &config.rpc_address, + ) + .await; let tx_bytes = sign_and_encode_tx(&config, &key_pair, &account, &memo, &batches[0], &max_fee).unwrap(); assert_eq!(tx_bytes.len(), MAX_TX_SIZE); limited_config.max_tx_size = MaxTxSize::new(MAX_TX_SIZE - 1).unwrap(); - let res = batch_messages(&limited_config, &key_pair, &account, &memo, messages); + let res = batch_messages(&limited_config, &key_pair, &account, &memo, messages).await; assert!(res.is_err()); } - #[test] - fn test_batches_are_structured_appropriately_per_max_msg_num() { + #[tokio::test] + async fn test_batches_are_structured_appropriately_per_max_msg_num() { let (config, key_pair, account) = test_fixture(); // Ensure that when MaxMsgNum is 1, the resulting batch @@ -499,6 +520,7 @@ mod tests { &Memo::new("").unwrap(), messages.clone(), ) + .await .unwrap(); assert_eq!(batches.len(), 5); @@ -517,14 +539,15 @@ mod tests { &Memo::new("").unwrap(), messages, ) + .await .unwrap(); assert_eq!(batches.len(), 1); assert_eq!(batches[0].len(), 5); } - #[test] - fn test_batches_are_structured_appropriately_per_max_tx_size() { + #[tokio::test] + async fn test_batches_are_structured_appropriately_per_max_tx_size() { const MAX_TX_SIZE: usize = 198; let (config, key_pair, account) = test_fixture(); @@ -565,11 +588,18 @@ mod tests { &memo, messages.clone(), ) + .await .unwrap(); assert_eq!(batches.len(), 5); - let max_fee = gas_amount_to_fee(&config.gas_config, config.gas_config.max_gas); + let max_fee = gas_amount_to_fee( + &config.gas_config, + config.gas_config.max_gas, + &config.chain_id, + &config.rpc_address, + ) + .await; for batch in batches { assert_eq!(batch.len(), 1); @@ -589,15 +619,16 @@ mod tests { &Memo::new("").unwrap(), messages, ) + .await .unwrap(); assert_eq!(batches.len(), 1); assert_eq!(batches[0].len(), 5); } - #[test] + #[tokio::test] #[should_panic(expected = "`max_msg_num` must be greater than or equal to 1, found 0")] - fn test_max_msg_num_of_zero_panics() { + async fn test_max_msg_num_of_zero_panics() { let (mut config, key_pair, account) = test_fixture(); config.max_msg_num = MaxMsgNum::new(0).unwrap(); let _batches = batch_messages( @@ -606,6 +637,7 @@ mod tests { &account, &Memo::new("").unwrap(), vec![], - ); + ) + .await; } } diff --git a/crates/relayer/src/chain/cosmos/config.rs b/crates/relayer/src/chain/cosmos/config.rs index 225b7aa039..57314bccf5 100644 --- a/crates/relayer/src/chain/cosmos/config.rs +++ b/crates/relayer/src/chain/cosmos/config.rs @@ -10,6 +10,7 @@ use ibc_relayer_types::core::ics24_host::identifier::ChainId; use crate::chain::cosmos::config::error::Error as ConfigError; use crate::config::compat_mode::CompatMode; +use crate::config::dynamic_gas::DynamicGasPrice; use crate::config::gas_multiplier::GasMultiplier; use crate::config::types::{MaxMsgNum, MaxTxSize, Memo, TrustThreshold}; use crate::config::{ @@ -133,6 +134,9 @@ pub struct CosmosSdkConfig { #[serde(default)] pub packet_filter: PacketFilter, + #[serde(default)] + pub dynamic_gas_price: DynamicGasPrice, + #[serde(default)] pub address_type: AddressType, #[serde(default = "Vec::new", skip_serializing_if = "Vec::is_empty")] diff --git a/crates/relayer/src/chain/cosmos/eip_base_fee.rs b/crates/relayer/src/chain/cosmos/eip_base_fee.rs new file mode 100644 index 0000000000..75cc9eedd4 --- /dev/null +++ b/crates/relayer/src/chain/cosmos/eip_base_fee.rs @@ -0,0 +1,141 @@ +use core::fmt; +use std::ops::Div; +use std::str::FromStr; + +use serde::Deserialize; +use subtle_encoding::base64; +use tendermint_rpc::Url; +use tracing::debug; + +use ibc_proto::cosmos::base::v1beta1::DecProto; + +use crate::error::Error; + +pub async fn query_eip_base_fee(rpc_address: &Url) -> Result { + debug!("Querying Omosis EIP-1559 base fee from {rpc_address}"); + + let url = + format!("{rpc_address}/abci_query?path=\"/osmosis.txfees.v1beta1.Query/GetEipBaseFee\""); + + let response = reqwest::get(&url).await.map_err(Error::http_request)?; + + if !response.status().is_success() { + return Err(Error::http_response(response.status())); + } + + #[derive(Deserialize)] + struct EipBaseFeeHTTPResult { + result: EipBaseFeeResult, + } + + #[derive(Deserialize)] + struct EipBaseFeeResult { + response: EipBaseFeeResponse, + } + + #[derive(Deserialize)] + struct EipBaseFeeResponse { + value: String, + } + + let result: EipBaseFeeHTTPResult = response.json().await.map_err(Error::http_response_body)?; + + let encoded = result.result.response.value; + let decoded = base64::decode(encoded).map_err(Error::base64_decode)?; + + let dec_proto: DecProto = prost::Message::decode(decoded.as_ref()) + .map_err(|e| Error::protobuf_decode("cosmos.base.v1beta1.DecProto".to_string(), e))?; + + let base_fee_uint128 = Uint128::from_str(&dec_proto.dec).map_err(Error::parse_int)?; + + let dec = Decimal::new(base_fee_uint128); + let base_fee = f64::from_str(dec.to_string().as_str()).map_err(Error::parse_float)?; + + debug!("Omosis EIP-1559 base fee is {}", base_fee); + + Ok(base_fee) +} + +/// Extracted from `cosmwasm-std` +/// +/// +#[derive(Clone, Copy)] +struct Uint128(u128); + +impl Uint128 { + pub const fn new(value: u128) -> Self { + Self(value) + } + + pub fn is_zero(&self) -> bool { + self.0 == 0 + } + + pub fn checked_rem(&self, rhs: Self) -> Option { + self.0.checked_rem(rhs.0).map(Self) + } +} + +impl FromStr for Uint128 { + type Err = std::num::ParseIntError; + + fn from_str(s: &str) -> Result { + s.parse::().map(Self) + } +} + +impl Div for Uint128 { + type Output = Self; + + fn div(self, rhs: Self) -> Self::Output { + Self( + self.0 + .checked_div(rhs.0) + .expect("attempt to divide by zero"), + ) + } +} + +impl fmt::Display for Uint128 { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + self.0.fmt(f) + } +} + +/// Extracted from `cosmwasm-std` +/// +/// +#[derive(Clone, Copy)] +struct Decimal(Uint128); + +impl Decimal { + const DECIMAL_FRACTIONAL: Uint128 = Uint128::new(1_000_000_000_000_000_000u128); // 1*10**18 + pub const DECIMAL_PLACES: u32 = 18; + + pub const fn new(value: Uint128) -> Self { + Self(value) + } +} + +impl fmt::Display for Decimal { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + use core::fmt::Write; + + let whole = (self.0) / Self::DECIMAL_FRACTIONAL; + let fractional = (self.0).checked_rem(Self::DECIMAL_FRACTIONAL).unwrap(); + + if fractional.is_zero() { + write!(f, "{whole}") + } else { + let fractional_string = format!( + "{:0>padding$}", + fractional, + padding = Self::DECIMAL_PLACES as usize + ); + f.write_str(&whole.to_string())?; + f.write_char('.')?; + f.write_str(fractional_string.trim_end_matches('0'))?; + Ok(()) + } + } +} diff --git a/crates/relayer/src/chain/cosmos/estimate.rs b/crates/relayer/src/chain/cosmos/estimate.rs index 35c76a92ad..87a18a26b4 100644 --- a/crates/relayer/src/chain/cosmos/estimate.rs +++ b/crates/relayer/src/chain/cosmos/estimate.rs @@ -1,6 +1,7 @@ use ibc_proto::cosmos::tx::v1beta1::{Fee, Tx}; use ibc_proto::google::protobuf::Any; use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use tendermint_rpc::Url; use tonic::codegen::http::Uri; use tracing::{debug, error, span, warn, Level}; @@ -44,8 +45,14 @@ pub async fn estimate_tx_fees( signatures: signed_tx.signatures, }; - let estimated_fee = - estimate_fee_with_tx(gas_config, &config.grpc_address, &config.chain_id, tx).await?; + let estimated_fee = estimate_fee_with_tx( + gas_config, + &config.grpc_address, + &config.rpc_address, + &config.chain_id, + tx, + ) + .await?; Ok(estimated_fee) } @@ -53,6 +60,7 @@ pub async fn estimate_tx_fees( async fn estimate_fee_with_tx( gas_config: &GasConfig, grpc_address: &Uri, + rpc_address: &Url, chain_id: &ChainId, tx: Tx, ) -> Result { @@ -80,7 +88,7 @@ async fn estimate_fee_with_tx( )); } - let adjusted_fee = gas_amount_to_fee(gas_config, estimated_gas); + let adjusted_fee = gas_amount_to_fee(gas_config, estimated_gas, chain_id, rpc_address).await; debug!( id = %chain_id, diff --git a/crates/relayer/src/chain/cosmos/gas.rs b/crates/relayer/src/chain/cosmos/gas.rs index 6f27923af5..07b4b6a20f 100644 --- a/crates/relayer/src/chain/cosmos/gas.rs +++ b/crates/relayer/src/chain/cosmos/gas.rs @@ -1,13 +1,24 @@ use core::cmp::min; use ibc_proto::cosmos::base::v1beta1::Coin; use ibc_proto::cosmos::tx::v1beta1::Fee; +use ibc_relayer_types::core::ics24_host::identifier::ChainId; use num_bigint::BigInt; use num_rational::BigRational; +use tendermint_rpc::Url; +use tracing::warn; use crate::chain::cosmos::types::gas::GasConfig; use crate::config::GasPrice; +use crate::telemetry; -pub fn gas_amount_to_fee(config: &GasConfig, gas_amount: u64) -> Fee { +use super::eip_base_fee::query_eip_base_fee; + +pub async fn gas_amount_to_fee( + config: &GasConfig, + gas_amount: u64, + chain_id: &ChainId, + rpc_address: &Url, +) -> Fee { let adjusted_gas_limit = adjust_estimated_gas(AdjustGas { gas_multiplier: config.gas_multiplier, max_gas: config.max_gas, @@ -15,7 +26,8 @@ pub fn gas_amount_to_fee(config: &GasConfig, gas_amount: u64) -> Fee { }); // The fee in coins based on gas amount - let amount = calculate_fee(adjusted_gas_limit, &config.gas_price); + let dynamic_gas_price = dynamic_gas_price(config, chain_id, rpc_address).await; + let amount = calculate_fee(adjusted_gas_limit, &dynamic_gas_price); Fee { amount: vec![amount], @@ -25,6 +37,59 @@ pub fn gas_amount_to_fee(config: &GasConfig, gas_amount: u64) -> Fee { } } +pub async fn dynamic_gas_price( + config: &GasConfig, + chain_id: &ChainId, + rpc_address: &Url, +) -> GasPrice { + if config.dynamic_gas_price.enabled { + let dynamic_gas_price = query_eip_base_fee(rpc_address) + .await + .map(|base_fee| base_fee * config.dynamic_gas_price.multiplier) + .map(|new_price| GasPrice { + price: new_price, + denom: config.gas_price.denom.clone(), + }); + + let dynamic_gas_price = match dynamic_gas_price { + Ok(dynamic_gas_price) => { + telemetry!( + dynamic_gas_queried_success_fees, + chain_id, + dynamic_gas_price.price + ); + + dynamic_gas_price + } + Err(e) => { + warn!("failed to query EIP base fee, will fallback to configured `gas_price`: {e}"); + config.gas_price.clone() + } + }; + + { + telemetry!(dynamic_gas_queried_fees, chain_id, dynamic_gas_price.price); + let _ = chain_id; + } + + if dynamic_gas_price.price > config.dynamic_gas_price.max { + warn!( + "queried EIP gas price is higher than configured max gas price, \ + will fallback to configured `max`. Queried: {}, maximum: {}", + dynamic_gas_price.price, config.dynamic_gas_price.max + ); + + return GasPrice::new(config.dynamic_gas_price.max, dynamic_gas_price.denom); + } + + telemetry!(dynamic_gas_paid_fees, chain_id, dynamic_gas_price.price); + + dynamic_gas_price + } else { + config.gas_price.clone() + } +} + pub fn calculate_fee(adjusted_gas_amount: u64, gas_price: &GasPrice) -> Coin { let fee_amount = mul_ceil(adjusted_gas_amount, gas_price.price); diff --git a/crates/relayer/src/chain/cosmos/types/gas.rs b/crates/relayer/src/chain/cosmos/types/gas.rs index 80291faaab..e472eb91af 100644 --- a/crates/relayer/src/chain/cosmos/types/gas.rs +++ b/crates/relayer/src/chain/cosmos/types/gas.rs @@ -2,6 +2,7 @@ use ibc_proto::cosmos::tx::v1beta1::Fee; use crate::chain::cosmos::calculate_fee; use crate::chain::cosmos::config::CosmosSdkConfig; +use crate::config::dynamic_gas::DynamicGasPrice; use crate::config::GasPrice; /// Default gas limit when submitting a transaction. @@ -17,6 +18,7 @@ pub struct GasConfig { pub gas_price: GasPrice, pub max_fee: Fee, pub fee_granter: String, + pub dynamic_gas_price: DynamicGasPrice, } impl<'a> From<&'a CosmosSdkConfig> for GasConfig { @@ -28,6 +30,7 @@ impl<'a> From<&'a CosmosSdkConfig> for GasConfig { gas_price: config.gas_price.clone(), max_fee: max_fee_from_config(config), fee_granter: fee_granter_from_config(config), + dynamic_gas_price: config.dynamic_gas_price, } } } diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index 27c1fee2dc..2f335e13d0 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -1,6 +1,7 @@ //! Relayer configuration pub mod compat_mode; +pub mod dynamic_gas; pub mod error; pub mod filter; pub mod gas_multiplier; diff --git a/crates/relayer/src/config/dynamic_gas.rs b/crates/relayer/src/config/dynamic_gas.rs new file mode 100644 index 0000000000..f18246f7eb --- /dev/null +++ b/crates/relayer/src/config/dynamic_gas.rs @@ -0,0 +1,142 @@ +use serde::de::Error as DeserializeError; +use serde::de::Unexpected; +use serde::Deserialize; +use serde::Deserializer; +use serde_derive::Serialize; + +flex_error::define_error! { + Error { + MultiplierTooSmall + { value: f64 } + |e| { + format_args!("`multiplier` in dynamic_gas configuration must be greater than or equal to {}, found {}", + DynamicGasPrice::MIN_MULTIPLIER, e.value) + }, + } +} + +#[derive(Debug, Clone, Copy, PartialEq, PartialOrd, Serialize)] +pub struct DynamicGasPrice { + pub enabled: bool, + pub multiplier: f64, + pub max: f64, +} + +impl DynamicGasPrice { + const DEFAULT_MULTIPLIER: f64 = 1.1; + const DEFAULT_MAX: f64 = 0.6; + const MIN_MULTIPLIER: f64 = 1.0; + + pub fn enabled(multiplier: f64, max: f64) -> Result { + Self::new(true, multiplier, max) + } + + pub fn disabled() -> Self { + Self { + enabled: false, + multiplier: Self::DEFAULT_MULTIPLIER, + max: Self::DEFAULT_MAX, + } + } + + pub fn new(enabled: bool, multiplier: f64, max: f64) -> Result { + if multiplier < Self::MIN_MULTIPLIER { + return Err(Error::multiplier_too_small(multiplier)); + } + + Ok(Self { + enabled, + multiplier, + max, + }) + } + + // Unsafe GasMultiplier used for test cases only. + pub fn unsafe_new(enabled: bool, multiplier: f64, max: f64) -> Self { + Self { + enabled, + multiplier, + max, + } + } +} + +impl Default for DynamicGasPrice { + fn default() -> Self { + Self::disabled() + } +} + +impl<'de> Deserialize<'de> for DynamicGasPrice { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + #[derive(Deserialize)] + struct DynGas { + enabled: bool, + multiplier: f64, + max: f64, + } + + let DynGas { + enabled, + multiplier, + max, + } = DynGas::deserialize(deserializer)?; + + DynamicGasPrice::new(enabled, multiplier, max).map_err(|e| match e.detail() { + ErrorDetail::MultiplierTooSmall(_) => D::Error::invalid_value( + Unexpected::Float(multiplier), + &format!( + "a floating-point value greater than {}", + Self::MIN_MULTIPLIER + ) + .as_str(), + ), + }) + } +} + +#[cfg(test)] +#[allow(dead_code)] // the field of the struct `DummyConfig` defined below is never accessed +mod tests { + use super::*; + + use serde::Deserialize; + use test_log::test; + + #[test] + fn parse_invalid_gas_multiplier() { + #[derive(Debug, Deserialize)] + struct DummyConfig { + dynamic_gas: DynamicGasPrice, + } + + let err = toml::from_str::( + "dynamic_gas = { enabled = true, multiplier = 0.9, max = 0.6 }", + ) + .unwrap_err() + .to_string(); + + println!("err: {err}"); + + assert!(err.contains("expected a floating-point value greater than")); + } + + #[test] + fn safe_gas_multiplier() { + let dynamic_gas = DynamicGasPrice::new(true, 0.6, 0.6); + assert!( + dynamic_gas.is_err(), + "Gas multiplier should be an error if value is lower than 1.0: {dynamic_gas:?}" + ); + } + + #[test] + fn unsafe_gas_multiplier() { + let dynamic_gas = DynamicGasPrice::unsafe_new(true, 0.6, 0.4); + assert_eq!(dynamic_gas.multiplier, 0.6); + assert_eq!(dynamic_gas.max, 0.4); + } +} diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index e16a1c4e75..2f3a964547 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -586,6 +586,38 @@ define_error! { InvalidCompatMode [ TendermintRpcError ] |_| { "Invalid CompatMode queried from chain and no `compat_mode` configured in Hermes. This can be fixed by specifying a `compat_mode` in Hermes config.toml" }, + + HttpRequest + [ TraceError ] + |_| { "HTTP request error" }, + + HttpResponse + { status: reqwest::StatusCode } + |e| { format!("HTTP response error with status code {}", e.status) }, + + HttpResponseBody + [ TraceError ] + |_| { "HTTP response body error" }, + + JsonDeserialize + [ TraceError ] + |_| { "JSON deserialization error" }, + + JsonField + { field: String } + |e| { format!("Missing or invalid JSON field: {}", e.field) }, + + ParseFloat + [ TraceError ] + |_| { "Error parsing float" }, + + ParseInt + [ TraceError ] + |_| { "Error parsing integer" }, + + Base64Decode + [ TraceError ] + |_| { "Error decoding base64-encoded data" }, } } diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index 0bca2140c0..16744ad6aa 100644 --- a/crates/relayer/src/lib.rs +++ b/crates/relayer/src/lib.rs @@ -1,6 +1,5 @@ #![forbid(unsafe_code)] #![deny( - warnings, trivial_casts, trivial_numeric_casts, unused_import_braces, diff --git a/crates/telemetry/src/state.rs b/crates/telemetry/src/state.rs index ea05147321..bf48381d1f 100644 --- a/crates/telemetry/src/state.rs +++ b/crates/telemetry/src/state.rs @@ -201,6 +201,15 @@ pub struct TelemetryState { /// Number of errors observed by Hermes when broadcasting a Tx broadcast_errors: Counter, + /// The EIP-1559 base fee queried + dynamic_gas_queried_fees: ObservableGauge, + + /// The EIP-1559 base fee paid + dynamic_gas_paid_fees: ObservableGauge, + + /// The EIP-1559 base fee successfully queried + dynamic_gas_queried_success_fees: ObservableGauge, + /// Number of ICS-20 packets filtered because the memo and/or the receiver fields were exceeding the configured limits filtered_packets: Counter, } @@ -385,7 +394,22 @@ impl TelemetryState { ) .init(), - filtered_packets: meter + dynamic_gas_queried_fees: meter + .f64_observable_gauge("dynamic_gas_queried_fees") + .with_description("The EIP-1559 base fee queried") + .init(), + + dynamic_gas_paid_fees: meter + .f64_observable_gauge("dynamic_gas_paid_fees") + .with_description("The EIP-1559 base fee paid") + .init(), + + dynamic_gas_queried_success_fees: meter + .f64_observable_gauge("dynamic_gas_queried_fees") + .with_description("The EIP-1559 base fee successfully queried") + .init(), + + filtered_packets: meter .u64_counter("filtered_packets") .with_description("Number of ICS-20 packets filtered because the memo and/or the receiver fields were exceeding the configured limits") .init(), @@ -1136,6 +1160,31 @@ impl TelemetryState { self.broadcast_errors.add(&cx, 1, labels); } + pub fn dynamic_gas_queried_fees(&self, chain_id: &ChainId, amount: f64) { + let cx = Context::current(); + + let labels = &[KeyValue::new("identifier", chain_id.to_string())]; + + self.dynamic_gas_queried_fees.observe(&cx, amount, labels); + } + + pub fn dynamic_gas_paid_fees(&self, chain_id: &ChainId, amount: f64) { + let cx = Context::current(); + + let labels = &[KeyValue::new("identifier", chain_id.to_string())]; + + self.dynamic_gas_paid_fees.observe(&cx, amount, labels); + } + + pub fn dynamic_gas_queried_success_fees(&self, chain_id: &ChainId, amount: f64) { + let cx = Context::current(); + + let labels = &[KeyValue::new("identifier", chain_id.to_string())]; + + self.dynamic_gas_queried_success_fees + .observe(&cx, amount, labels); + } + /// Increment number of packets filtered because the memo field is too big #[allow(clippy::too_many_arguments)] pub fn filtered_packets( @@ -1232,6 +1281,15 @@ impl AggregatorSelector for CustomAggregatorSelector { // TODO: Once quantile sketches are supported, replace histograms with that. "tx_latency_submitted" => Some(Arc::new(histogram(&self.get_submitted_range()))), "tx_latency_confirmed" => Some(Arc::new(histogram(&self.get_confirmed_range()))), + "dynamic_gas_queried_fees" => Some(Arc::new(histogram(&[ + 0.0025, 0.005, 0.01, 0.05, 0.1, 0.5, 1.0, 5.0, + ]))), + "dynamic_gas_paid_fees" => Some(Arc::new(histogram(&[ + 0.0025, 0.005, 0.01, 0.05, 0.1, 0.5, 1.0, 5.0, + ]))), + "dynamic_gas_queried_success_fees" => Some(Arc::new(histogram(&[ + 0.0025, 0.005, 0.01, 0.05, 0.1, 0.5, 1.0, 5.0, + ]))), "ics29_period_fees" => Some(Arc::new(last_value())), _ => Some(Arc::new(sum())), } diff --git a/flake.lock b/flake.lock index 874e699bf9..a0dbfb5653 100644 --- a/flake.lock +++ b/flake.lock @@ -20,16 +20,16 @@ "apalache-src": { "flake": false, "locked": { - "lastModified": 1650241137, - "narHash": "sha256-15jzwbBc7ByxHJbpHmIukSNvih9oxTXeinNamgXirCU=", + "lastModified": 1692625213, + "narHash": "sha256-Z/tmBMv+QshFJLo2kBgBdkqfKwF93CgURVIbYF3dwJE=", "owner": "informalsystems", "repo": "apalache", - "rev": "40d9ec66b3defe8e72803ca9241a73366497eeee", + "rev": "ec979d4554360faf9d73ddf72dccf350614076d5", "type": "github" }, "original": { "owner": "informalsystems", - "ref": "v0.24.0", + "ref": "v0.42.0", "repo": "apalache", "type": "github" } @@ -114,6 +114,7 @@ "cosmwasm-src": "cosmwasm-src", "crescent-src": "crescent-src", "cw-plus-src": "cw-plus-src", + "dydx-src": "dydx-src", "evmos-src": "evmos-src", "flake-parts": "flake-parts", "gaia-main-src": "gaia-main-src", @@ -129,6 +130,7 @@ "gaia8-src": "gaia8-src", "gaia9-src": "gaia9-src", "gex-src": "gex-src", + "gomod2nix": "gomod2nix", "hermes-src": "hermes-src", "ibc-go-v2-src": "ibc-go-v2-src", "ibc-go-v3-src": "ibc-go-v3-src", @@ -146,9 +148,10 @@ "ixo-src": "ixo-src", "juno-src": "juno-src", "migaloo-src": "migaloo-src", + "namada-src": "namada-src", "neutron-src": "neutron-src", "nix-std": "nix-std", - "nixpkgs": "nixpkgs", + "nixpkgs": "nixpkgs_2", "osmosis-src": "osmosis-src", "provenance-src": "provenance-src", "regen-src": "regen-src", @@ -175,11 +178,11 @@ "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" }, "locked": { - "lastModified": 1701457684, - "narHash": "sha256-Tx3WsOM9scTXDHFyL5vNcQnCmT7Mx0dYg1Nmz8cFwt4=", + "lastModified": 1705315275, + "narHash": "sha256-XnjvjdTdXkwWFWx1nRflbsDyazSBV09QOmr/aiAuZ1M=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "c0bb979a518aa08ba064112a85e03fbc7a7d2869", + "rev": "04ef5159b4262b7dd445544838468a84a1d987cf", "type": "github" }, "original": { @@ -256,19 +259,36 @@ "type": "github" } }, + "dydx-src": { + "flake": false, + "locked": { + "lastModified": 1702405483, + "narHash": "sha256-NiC+Nol8Cye0z/U5cgQ+zhvlbDJX6DouaMo8oYsRGDQ=", + "owner": "dydxprotocol", + "repo": "v4-chain", + "rev": "35b87db422b0ef4138101ba73b0f00d16780ba89", + "type": "github" + }, + "original": { + "owner": "dydxprotocol", + "ref": "protocol/v3.0.0-dev0", + "repo": "v4-chain", + "type": "github" + } + }, "evmos-src": { "flake": false, "locked": { - "lastModified": 1666728289, - "narHash": "sha256-hMry1q+31jqSe0krg880LIMcz0xgftB3mwfywWoLX3w=", - "owner": "tharsis", + "lastModified": 1702504794, + "narHash": "sha256-ECXXQ0hx/MXascMP6aXf880zts/dNPpQM9jOCIHTLZQ=", + "owner": "evmos", "repo": "evmos", - "rev": "80c38f659a65a983b221e2a568c6172b8ac3bffc", + "rev": "6f94d2002c01b7f7908a69089ed6996ac2bb450c", "type": "github" }, "original": { - "owner": "tharsis", - "ref": "v9.1.0", + "owner": "evmos", + "ref": "v16.0.0-rc4", "repo": "evmos", "type": "github" } @@ -278,11 +298,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1698882062, - "narHash": "sha256-HkhafUayIqxXyHH1X8d9RDl1M2CkFgZLjKD3MzabiEo=", + "lastModified": 1701473968, + "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "8c9fa2545007b49a5db5f650ae91f227672c3877", + "rev": "34fed993f1674c8d06d58b37ce1e0fe5eebcb9f5", "type": "github" }, "original": { @@ -295,6 +315,24 @@ "inputs": { "systems": "systems" }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, "locked": { "lastModified": 1681202837, "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", @@ -309,7 +347,7 @@ "type": "github" } }, - "flake-utils_2": { + "flake-utils_3": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -324,16 +362,16 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_4": { "inputs": { - "systems": "systems_2" + "systems": "systems_3" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { @@ -345,11 +383,11 @@ "gaia-main-src": { "flake": false, "locked": { - "lastModified": 1697456548, - "narHash": "sha256-iXcwU0/kDAGzQKYrHKTMX6/ayB6Ns0KBYMOpi5uNYJk=", + "lastModified": 1702388853, + "narHash": "sha256-1O8ncSd0mUNEUHSTi2U9d21Dv1yszQKohjp/AS6IxcU=", "owner": "cosmos", "repo": "gaia", - "rev": "e6da2cc3d1602a6c64fc50c90ea60651177d911b", + "rev": "2dc2b82ea9da34b3c4823458919004f1a583a597", "type": "github" }, "original": { @@ -562,19 +600,39 @@ "type": "github" } }, + "gomod2nix": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1702956934, + "narHash": "sha256-f1NuMA2mZ3Chw2CjlUkRAzNgDw0TYyj1i5YZJRByDdo=", + "owner": "JonathanLorimer", + "repo": "gomod2nix", + "rev": "6d2fce6003d08eee42648f2931de8449d3de1f5f", + "type": "github" + }, + "original": { + "owner": "JonathanLorimer", + "ref": "jonathan/update-go", + "repo": "gomod2nix", + "type": "github" + } + }, "hermes-src": { "flake": false, "locked": { - "lastModified": 1689751768, - "narHash": "sha256-yq+jdHSwUejMA1hURSHWHJ8QSyhDdnhpKE+tejgWSSE=", + "lastModified": 1702629809, + "narHash": "sha256-JTZMp4By/pGsMdKzfi4H1LQS1RKYQHBq5NEju5ADX/s=", "owner": "informalsystems", "repo": "hermes", - "rev": "1c1cf02988db67507de7d484e1a7f317fe494d6c", + "rev": "ab732666fe35de129ada98731280d03411f6375f", "type": "github" }, "original": { "owner": "informalsystems", - "ref": "v1.6.0", + "ref": "v1.7.4", "repo": "hermes", "type": "github" } @@ -684,16 +742,16 @@ "ibc-go-v8-channel-upgrade-src": { "flake": false, "locked": { - "lastModified": 1695726576, - "narHash": "sha256-mM6h1KAi8lQUrJakxI6f8WI+vpmBhCnAysk3hTZBI7M=", + "lastModified": 1703189903, + "narHash": "sha256-vxzv+b40TKqCIN4FAkeIu+jmlPP5XRLR+P0uEIjr7AE=", "owner": "cosmos", "repo": "ibc-go", - "rev": "63c30108f0ecf954108cf51f50f3d36ec58c7e51", + "rev": "7a89e5d5b5ebb7643ce3992c34008c35373ecf34", "type": "github" }, "original": { "owner": "cosmos", - "ref": "04-channel-upgrades-alpha.0", + "ref": "04-channel-upgrades-rc.0", "repo": "ibc-go", "type": "github" } @@ -768,11 +826,11 @@ "interchain-security-src": { "flake": false, "locked": { - "lastModified": 1697113174, - "narHash": "sha256-J+duWnA9ipgHryO5+9sv6uwcPVN2ceL0PGoCyVvN5YQ=", + "lastModified": 1700577019, + "narHash": "sha256-adBzn51PKoRsCL9gIzC5Tcqmu7u3GjxTcDj2jpZ/da8=", "owner": "cosmos", "repo": "interchain-security", - "rev": "28e0c14b34d5d15ea0eb19b694c74513667afe09", + "rev": "03aada4af3243dbf739a12adfacc7b37232df694", "type": "github" }, "original": { @@ -850,6 +908,23 @@ "type": "github" } }, + "namada-src": { + "flake": false, + "locked": { + "lastModified": 1702488720, + "narHash": "sha256-WyIVffqszY3rz3ClQJlpDaexLGQk8pVK+Y3k/D9Lvxg=", + "owner": "anoma", + "repo": "namada", + "rev": "468d3d3bcadd2bd11760855d2bbfcc0b4ce27e14", + "type": "github" + }, + "original": { + "owner": "anoma", + "ref": "v0.28.1", + "repo": "namada", + "type": "github" + } + }, "neutron-src": { "flake": false, "locked": { @@ -869,11 +944,11 @@ }, "nix-std": { "locked": { - "lastModified": 1685917625, - "narHash": "sha256-2manVKofCZrCToVDnDYNvtYUFBYOM5JhdDoNGVY4fq4=", + "lastModified": 1701658249, + "narHash": "sha256-KIt1TUuBvldhaVRta010MI5FeQlB8WadjqljybjesN0=", "owner": "chessai", "repo": "nix-std", - "rev": "e20af8822b5739434b875643bfc61fe0195ea2fb", + "rev": "715db541ffff4194620e48d210b76f73a74b5b5d", "type": "github" }, "original": { @@ -884,16 +959,16 @@ }, "nixpkgs": { "locked": { - "lastModified": 1701040486, - "narHash": "sha256-vawYwoHA5CwvjfqaT3A5CT9V36Eq43gxdwpux32Qkjw=", + "lastModified": 1702272962, + "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=", "owner": "nixos", "repo": "nixpkgs", - "rev": "45827faa2132b8eade424f6bdd48d8828754341a", + "rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d", "type": "github" }, "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", + "owner": "NixOS", + "ref": "master", "repo": "nixpkgs", "type": "github" } @@ -901,11 +976,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1698611440, - "narHash": "sha256-jPjHjrerhYDy3q9+s5EAsuhyhuknNfowY6yt6pjn9pc=", + "lastModified": 1701253981, + "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "0cbe9f69c234a7700596e943bfae7ef27a31b735", + "rev": "e92039b55bcd58469325ded85d4f58dd5a4eaf58", "type": "github" }, "original": { @@ -917,6 +992,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1701040486, + "narHash": "sha256-vawYwoHA5CwvjfqaT3A5CT9V36Eq43gxdwpux32Qkjw=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "45827faa2132b8eade424f6bdd48d8828754341a", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1681358109, "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", @@ -932,7 +1023,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1674990008, "narHash": "sha256-4zOyp+hFW2Y7imxIpZqZGT8CEqKmDjwgfD6BzRUE0mQ=", @@ -948,13 +1039,13 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { - "lastModified": 1701693815, - "narHash": "sha256-7BkrXykVWfkn6+c1EhFA3ko4MLi3gVG0p9G96PNnKTM=", + "lastModified": 1705505490, + "narHash": "sha256-HS+Zg50Zm1Ehfat/OgGS2YJqU7/4ohsQhK+ClwcKmVA=", "owner": "nixos", "repo": "nixpkgs", - "rev": "09ec6a0881e1a36c29d67497693a67a16f4da573", + "rev": "f36047a5a4b5631f75210859abac7f97ba1ba7a7", "type": "github" }, "original": { @@ -967,16 +1058,16 @@ "osmosis-src": { "flake": false, "locked": { - "lastModified": 1700576443, - "narHash": "sha256-UE3XEgdSp8mlgIKQRrBfb4wiPEeagB/wNWfDvDq4up4=", + "lastModified": 1702398856, + "narHash": "sha256-4uLO7izIZ8JvKTfUXbYkxQFpIjwMEcO81WvhklrzI9E=", "owner": "osmosis-labs", "repo": "osmosis", - "rev": "d9965b09d3e8690c77050bb095bc5b69772ebdfb", + "rev": "b0aee0006ce55d0851773084bd7880db7e32ad70", "type": "github" }, "original": { "owner": "osmosis-labs", - "ref": "v20.4.0", + "ref": "v21.0.0", "repo": "osmosis", "type": "github" } @@ -1035,21 +1126,21 @@ "root": { "inputs": { "cosmos-nix": "cosmos-nix", - "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_4" + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_5" } }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs_2" + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1701310566, - "narHash": "sha256-CL9J3xUR2Ejni4LysrEGX0IdO+Y4BXCiH/By0lmF3eQ=", + "lastModified": 1702347444, + "narHash": "sha256-ueDw7aQf4Xyk69XnDD0YNWDlFdlOgJGPeWFa7uu/cfw=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "6d3c6e185198b8bf7ad639f22404a75aa9a09bff", + "rev": "bc13176f27cf3be724d18924b4f6aa47686ca2e3", "type": "github" }, "original": { @@ -1060,8 +1151,8 @@ }, "sbt-derivation": { "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_3" + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1698464090, @@ -1224,6 +1315,21 @@ "type": "github" } }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "umee-src": { "flake": false, "locked": { diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index e85b810e6b..fbef9c31b3 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -28,12 +28,13 @@ - [Start relaying](./tutorials/production/start-relaying.md) - [Configuration](./documentation/configuration/index.md) + - [CometBFT Compatibility modes](./documentation/configuration/comet-compat-mode.md) - [Configure Hermes](./documentation/configuration/configure-hermes.md) - [Description of the parameters](./documentation/configuration/description.md) + - [Dynamic gas fees](./documentation/configuration/dynamic-gas-fees.md) - [Filter incentivized packets](./documentation/configuration/filter-incentivized.md) - [Packet clearing](./documentation/configuration/packet-clearing.md) - [Performance tuning](./documentation/configuration/performance.md) - - [CometBFT Compatibility modes](./documentation/configuration/comet-compat-mode.md) - [Telemetry](./documentation/telemetry/index.md) - [Operators guide](./documentation/telemetry/operators.md) diff --git a/guide/src/documentation/commands/config.md b/guide/src/documentation/commands/config.md index 793a1a523c..40e6ab85a2 100644 --- a/guide/src/documentation/commands/config.md +++ b/guide/src/documentation/commands/config.md @@ -27,7 +27,7 @@ __Example__ Use `config auto` to generate a configuration file that is able to relay between `cosmoshub` and `osmosis`. This command assumes the existence of a key file for `cosmoshub-4` and `osmosis-1` in `$HOME/.hermes/keys`. ``` -{{#template ../../templates/commands/hermes/config/auto_1.md PATH=~/example_config.toml CHAIN_NAME:OPTIONAL_KEY_NAME=cosmoshub osmosis}} +{{#template ../../templates/commands/hermes/config/auto_1.md PATH=~/example_config.toml CHAIN1_NAME:OPTIONAL_KEY_NAME=cosmoshub osmosis}} 2022-08-16T17:27:26.966233Z INFO ThreadId(01) using default configuration from '~/.hermes/config.toml' 2022-08-16T17:27:27.800213Z INFO ThreadId(01) cosmoshub-4: uses key "key_cosmoshub" @@ -38,7 +38,7 @@ SUCCESS Config file written successfully at '~/example_config.toml' It is also possible to manually specify a key name for any chain. ``` -{{#template ../../templates/commands/hermes/config/auto_1.md PATH=~/example_config.toml CHAIN_NAME:OPTIONAL_KEY_NAME=cosmoshub:random_key osmosis}} +{{#template ../../templates/commands/hermes/config/auto_1.md PATH=~/example_config.toml CHAIN1_NAME:OPTIONAL_KEY_NAME=cosmoshub:random_key osmosis}} 2022-08-16T17:29:56.902499Z INFO ThreadId(01) using default configuration from '~/.hermes/config.toml' 2022-08-16T17:29:57.288874Z INFO ThreadId(01) cosmoshub-4: uses key "random_key" diff --git a/guide/src/documentation/configuration/configure-hermes.md b/guide/src/documentation/configuration/configure-hermes.md index cec76e4fb7..c63fab7200 100644 --- a/guide/src/documentation/configuration/configure-hermes.md +++ b/guide/src/documentation/configuration/configure-hermes.md @@ -27,7 +27,7 @@ hermes [--config CONFIG_FILE] COMMAND The simplest way to configure Hermes for a given chain is by running the command ```shell -{{#template ../../templates/commands/hermes/config/auto_1.md PATH=~//config.toml CHAIN_NAME:OPTIONAL_KEY_NAME= }} +{{#template ../../templates/commands/hermes/config/auto_1.md PATH=~//config.toml CHAIN1_NAME:OPTIONAL_KEY_NAME= }} ``` This will generate a `config.toml` file for some specified chains. Note, however, that the configuration is generated by pulling the chain data from the Cosmos [chain registry][chain-registry]. The specified chain(s) must exist in the registry for the command to work. Check out [this][config-auto-reference] section of the Hermes commands reference to find more information on the `config auto` command. diff --git a/guide/src/documentation/configuration/dynamic-gas-fees.md b/guide/src/documentation/configuration/dynamic-gas-fees.md new file mode 100644 index 0000000000..81762167ff --- /dev/null +++ b/guide/src/documentation/configuration/dynamic-gas-fees.md @@ -0,0 +1,21 @@ +# Dynamic Gas Fees + +Some chains use a dynamic gas price system instead of static gas price. By configuring the `dynamic_gas_price` for those chains, Hermes will query the gas price and apply the configured multiplier instead of using the configured static gas price: + +```toml +... +[.dynamic_gas_price] +enabled = true +multiplier = 1.1 +max = 0.6 +... +``` + +## Notes + +* If the query fails, Hermes will fallback to the configured static gas price. +* If the queried gas price is higher than the maximum configured gas price, Hermes will use the maximum gas price but this might cause the relaying of the packet to fail due to insufficient fees. + +## Monitoring + +As this feature can be delicate to handle, multiple metrics have been added in order to monitor the dynamic gas fees. Please consult the [Dynamic Gas Metrics](../telemetry/operators.md#dynamic-gas-fees) section for detailed information on these metrics. \ No newline at end of file diff --git a/guide/src/documentation/telemetry/operators.md b/guide/src/documentation/telemetry/operators.md index c990dfb01a..2496b6e91a 100644 --- a/guide/src/documentation/telemetry/operators.md +++ b/guide/src/documentation/telemetry/operators.md @@ -162,4 +162,20 @@ Note that this metrics is disabled if `misbehaviour = false` in your Hermes conf | Name | Description | OpenTelemetry type | Configuration Dependencies | | ------------------- | --------------------------------------------------------------------------- | ------------------- | -------------------------- | | `ics29_fee_amounts_total` | Total amount received from ICS29 fees  | `u64` Counter  | None | -| `ics29_period_fees` | Amount of ICS29 fees rewarded over the past 7 days type | `u64` ValueRecorder | None | \ No newline at end of file +| `ics29_period_fees` | Amount of ICS29 fees rewarded over the past 7 days type | `u64` ValueRecorder | None | + +## Dynamic gas fees + +The introduction of dynamic gas fees adds additional configuration which can be delicate to handle correctly. The following metrics can help correctly configure your relayer. + +| Name | Description | OpenTelemetry type | Configuration Dependencies | +| ---------------------------------- | -------------------------------------------------------------------- | ------------------- | -------------------------- | +| `dynamic_gas_queried_fees` | The EIP-1559 base fee queried  | `u64` ValueRecorder | None | +| `dynamic_gas_queried_success_fees` | The EIP-1559 base fee successfully queried   | `u64` ValueRecorder | None | +| `dynamic_gas_paid_fees` | The EIP-1559 base fee paid  | `u64` ValueRecorder | None | + +Notes: + +- The `dynamic_gas_queried_fees` contains the gas price used after the query but before filtering by configured `max`. This means that this metric might contain the static gas price if the query failed. +- The `dynamic_gas_queried_success_fees` will only contain the gas price when the query succeeds, if this metric doesn't contain values or less values that the `dynamic_gas_queried_fees` this could indicate an issue with the endpoint used to query the fees. +- `dynamic_gas_paid_fees` will contain the price used by the relayer, the maximum value for this metric is `max`. If there are multiple values in the same bucket as the `max` it could indicate that the gas price queried is often higher than the configured `max`. \ No newline at end of file diff --git a/guide/src/templates/commands/hermes/config/auto_1.md b/guide/src/templates/commands/hermes/config/auto_1.md index c7c4e932b0..e7bec76e08 100644 --- a/guide/src/templates/commands/hermes/config/auto_1.md +++ b/guide/src/templates/commands/hermes/config/auto_1.md @@ -1 +1 @@ -[[#BINARY hermes]][[#GLOBALOPTIONS]] config auto[[#OPTIONS]] --output [[#PATH]] --chains [[#CHAIN_NAME:OPTIONAL_KEY_NAME]] +[[#BINARY hermes]][[#GLOBALOPTIONS]] config auto[[#OPTIONS]] --output [[#PATH]] --chain [[#CHAIN1_NAME:OPTIONAL_KEY_NAME]] --chain [[#CHAIN2_NAME:OPTIONAL_KEY_NAME]] diff --git a/guide/src/templates/help_templates/config/auto.md b/guide/src/templates/help_templates/config/auto.md index b1b9e1773e..1c0f7bc7af 100644 --- a/guide/src/templates/help_templates/config/auto.md +++ b/guide/src/templates/help_templates/config/auto.md @@ -2,7 +2,7 @@ DESCRIPTION: Automatically generate a config.toml for the specified chain(s) USAGE: - hermes config auto [OPTIONS] --output --chains + hermes config auto [OPTIONS] --output --chain --chain OPTIONS: --commit Commit hash from which the chain configs will be generated. If @@ -11,7 +11,9 @@ OPTIONS: REQUIRED: --chains ... - Names of the chains to include in the config. Every chain must be in the chain registry. + Names of the chains to include in the configuration, together with an optional key name. + Either repeat this argument for every chain or pass a space-separated list of chains. + Every chain must be found in the chain registry. --output Path to the configuration file diff --git a/guide/src/tutorials/production/setup-hermes.md b/guide/src/tutorials/production/setup-hermes.md index 81c4509061..7f666b0372 100644 --- a/guide/src/tutorials/production/setup-hermes.md +++ b/guide/src/tutorials/production/setup-hermes.md @@ -36,7 +36,7 @@ Then, you need to create a configuration file for Hermes (more details in the [d The command `hermes config auto` provides a way to automatically generate a configuration file for chains in the [chain-registry](https://github.com/cosmos/chain-registry): ```shell -{{#template ../../templates/commands/hermes/config/auto_1.md PATH=$HOME/.hermes/config.toml CHAIN_NAME:OPTIONAL_KEY_NAME=cosmoshub:keyhub osmosis:keyosmosis}} +{{#template ../../templates/commands/hermes/config/auto_1.md PATH=$HOME/.hermes/config.toml CHAIN1_NAME:OPTIONAL_KEY_NAME=cosmoshub:keyhub osmosis:keyosmosis}} ``` >__NOTE__: This command also automatically finds IBC paths and generates packet filters from the [_IBC](https://github.com/cosmos/chain-registry/tree/master/_IBC) folder in the chain-registry. diff --git a/tools/check-guide/Cargo.lock b/tools/check-guide/Cargo.lock index 735f88c9a3..e5ab2c34a5 100644 --- a/tools/check-guide/Cargo.lock +++ b/tools/check-guide/Cargo.lock @@ -172,7 +172,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -183,7 +183,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -313,6 +313,12 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +[[package]] +name = "bech32" +version = "0.10.0-beta" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98f7eed2b2781a6f0b5c903471d48e15f56fb4e1165df8a9a2337fd1a59d45ea" + [[package]] name = "bit-set" version = "0.5.3" @@ -330,18 +336,28 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitcoin" -version = "0.30.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e99ff7289b20a7385f66a0feda78af2fc119d28fb56aea8886a9cd0a4abdd75" +checksum = "fd00f3c09b5f21fb357abe32d29946eb8bb7a0862bae62c0b5e4a692acbbe73c" dependencies = [ - "bech32", - "bitcoin-private", - "bitcoin_hashes", + "bech32 0.10.0-beta", + "bitcoin-internals", + "bitcoin_hashes 0.13.0", + "hex-conservative", "hex_lit", "secp256k1", "serde", ] +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" +dependencies = [ + "serde", +] + [[package]] name = "bitcoin-private" version = "0.1.0" @@ -355,6 +371,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501" dependencies = [ "bitcoin-private", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative", "serde", ] @@ -712,12 +738,11 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils 0.8.16", + "crossbeam-utils 0.8.19", ] [[package]] @@ -728,7 +753,7 @@ checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" dependencies = [ "autocfg", "cfg-if 1.0.0", - "crossbeam-utils 0.8.16", + "crossbeam-utils 0.8.19", "memoffset", "scopeguard", ] @@ -746,12 +771,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if 1.0.0", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -806,7 +828,7 @@ checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -1276,7 +1298,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -1500,6 +1522,12 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex-conservative" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" + [[package]] name = "hex_lit" version = "0.1.1" @@ -1654,7 +1682,7 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.26.1" +version = "0.26.4" dependencies = [ "async-trait", "flex-error", @@ -1690,16 +1718,16 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.26.1" +version = "0.26.4" dependencies = [ "anyhow", "async-stream", - "bech32", + "bech32 0.9.1", "bitcoin", "bs58", "byte-unit", "bytes", - "crossbeam-channel 0.5.8", + "crossbeam-channel 0.5.11", "digest 0.10.7", "dirs-next", "ed25519", @@ -1718,11 +1746,13 @@ dependencies = [ "ibc-telemetry", "itertools 0.10.5", "moka", + "monostate", "num-bigint", "num-rational", "once_cell", "prost", "regex", + "reqwest", "retry", "ripemd", "secp256k1", @@ -1745,23 +1775,23 @@ dependencies = [ "tiny-keccak", "tokio", "tokio-stream", - "toml 0.7.8", + "toml 0.8.8", "tonic", "tracing", "tracing-subscriber", - "uuid 1.4.1", + "uuid 1.7.0", ] [[package]] name = "ibc-relayer-cli" -version = "1.7.1" +version = "1.7.4" dependencies = [ "abscissa_core", "clap 3.2.25", "clap_complete 3.2.5", "color-eyre", "console", - "crossbeam-channel 0.5.8", + "crossbeam-channel 0.5.11", "dialoguer", "dirs-next", "eyre", @@ -1793,10 +1823,10 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.26.1" +version = "0.26.4" dependencies = [ "axum", - "crossbeam-channel 0.5.8", + "crossbeam-channel 0.5.11", "ibc-relayer", "ibc-relayer-types", "serde", @@ -1806,7 +1836,7 @@ dependencies = [ [[package]] name = "ibc-relayer-types" -version = "0.26.1" +version = "0.26.4" dependencies = [ "bytes", "derive_more", @@ -1832,7 +1862,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.26.1" +version = "0.26.4" dependencies = [ "axum", "dashmap", @@ -2254,9 +2284,9 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8017ec3548ffe7d4cef7ac0e12b044c01164a74c0f3119420faeaf13490ad8b" dependencies = [ - "crossbeam-channel 0.5.8", + "crossbeam-channel 0.5.11", "crossbeam-epoch", - "crossbeam-utils 0.8.16", + "crossbeam-utils 0.8.19", "once_cell", "parking_lot", "quanta", @@ -2266,7 +2296,28 @@ dependencies = [ "tagptr", "thiserror", "triomphe", - "uuid 1.4.1", + "uuid 1.7.0", +] + +[[package]] +name = "monostate" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "878c2a1f1c70e5724fa28f101ca787b6a7e8ad5c5e4ae4ca3b0fa4a419fa9075" +dependencies = [ + "monostate-impl", + "serde", +] + +[[package]] +name = "monostate-impl" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f686d68a09079e63b1d2c64aa305095887ce50565f00a922ebfaeeee0d9ba6ce" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] @@ -2291,7 +2342,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ "bitflags 2.4.0", - "crossbeam-channel 0.5.8", + "crossbeam-channel 0.5.11", "filetime", "fsevent-sys", "inotify", @@ -2309,7 +2360,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e55ee272914f4563a2f8b8553eb6811f3c0caea81c756346bad15b7e3ef969f0" dependencies = [ - "crossbeam-channel 0.5.8", + "crossbeam-channel 0.5.11", "notify", ] @@ -2399,9 +2450,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "oneline-eyre" @@ -2479,7 +2530,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b3a2a91fdbfdd4d212c0dcc2ab540de2c2bcbbd90be17de7a7daf8822d010c1" dependencies = [ "async-trait", - "crossbeam-channel 0.5.8", + "crossbeam-channel 0.5.11", "dashmap", "fnv", "futures-channel", @@ -2612,7 +2663,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -2681,7 +2732,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -2761,9 +2812,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -2803,7 +2854,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -2838,7 +2889,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" dependencies = [ - "crossbeam-utils 0.8.16", + "crossbeam-utils 0.8.19", "libc", "mach2", "once_cell", @@ -2850,9 +2901,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -3006,7 +3057,6 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", "winreg", ] @@ -3195,11 +3245,11 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.27.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +checksum = "3f622567e3b4b38154fb8190bcf6b160d7a4301d70595a49195b48c116007a27" dependencies = [ - "bitcoin_hashes", + "bitcoin_hashes 0.12.0", "rand", "secp256k1-sys", "serde", @@ -3207,9 +3257,9 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.8.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" dependencies = [ "cc", ] @@ -3258,9 +3308,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.188" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] @@ -3286,13 +3336,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -3324,14 +3374,14 @@ checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -3578,7 +3628,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -3615,9 +3665,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -3909,7 +3959,7 @@ checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -4029,7 +4079,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -4090,9 +4140,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.8" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", @@ -4102,18 +4152,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ "indexmap 2.0.2", "serde", @@ -4212,7 +4262,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] [[package]] @@ -4424,9 +4474,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.4.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ "getrandom", ] @@ -4528,7 +4578,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", "wasm-bindgen-shared", ] @@ -4562,7 +4612,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4583,12 +4633,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" - [[package]] name = "winapi" version = "0.3.9" @@ -4797,5 +4841,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.48", ] diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 3b2327aff1..640b0871a9 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -42,6 +42,7 @@ interchain-security = [] celestia = [] async-icq = [] juno = [] +dynamic-gas-fee = [] [[bin]] name = "test_setup_with_binary_channel" diff --git a/tools/integration-test/src/tests/dynamic_gas_fee.rs b/tools/integration-test/src/tests/dynamic_gas_fee.rs new file mode 100644 index 0000000000..3e30ec468d --- /dev/null +++ b/tools/integration-test/src/tests/dynamic_gas_fee.rs @@ -0,0 +1,214 @@ +//! The [`DynamicGasTest`] test ensures that the [`DynamicGas`] +//! configuration works correctly. The test can enable or disable the dynamic +//! gas price for the second chain. +//! +//! To test dynamic gas configuration, it will enable dynamic gas price on the +//! second chain only. It will then create and relay a first IBC transfer with a +//! big memo. The gas fee paid is then recorded. +//! A second IBC transfer without memo will then be relayed. The gas fee paid +//! will also be recorded. The test will assert that the Tx with a big memo +//! and dynamic gas enabled is lower than the Tx without memo and dynamic gas +//! disabled. +//! +//! The second test disables the dynamic gas price on both chains in +//! order to ensure that the first IBC transfer will cost more if dynamic +//! gas is disabled. + +use ibc_relayer::config::dynamic_gas::DynamicGasPrice; +use ibc_relayer::config::ChainConfig; +use ibc_relayer::config::GasPrice; +use ibc_test_framework::prelude::*; + +#[test] +fn test_dynamic_gas_transfer() -> Result<(), Error> { + run_binary_channel_test(&DynamicGasTest { + dynamic_gas_enabled: true, + }) +} + +#[test] +fn test_static_gas_transfer() -> Result<(), Error> { + run_binary_channel_test(&DynamicGasTest { + dynamic_gas_enabled: false, + }) +} + +const MEMO_CHAR: &str = "a"; +const MEMO_SIZE: usize = 10000; + +pub struct DynamicGasTest { + dynamic_gas_enabled: bool, +} + +impl TestOverrides for DynamicGasTest { + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.clients.misbehaviour = false; + config.mode.clients.refresh = false; + config.mode.packets.clear_interval = 0; + + match &mut config.chains[0] { + ChainConfig::CosmosSdk(chain_config_a) => { + chain_config_a.gas_price = + GasPrice::new(0.1, chain_config_a.gas_price.denom.clone()); + chain_config_a.dynamic_gas_price = DynamicGasPrice::unsafe_new(false, 1.1, 0.6); + } + } + + match &mut config.chains[1] { + ChainConfig::CosmosSdk(chain_config_b) => { + chain_config_b.gas_price = + GasPrice::new(0.1, chain_config_b.gas_price.denom.clone()); + chain_config_b.dynamic_gas_price = + DynamicGasPrice::unsafe_new(self.dynamic_gas_enabled, 1.1, 0.6); + } + } + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +impl BinaryChannelTest for DynamicGasTest { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channel: ConnectedChannel, + ) -> Result<(), Error> { + let denom_a = chains.node_a.denom(); + let wallet_a = chains.node_a.wallets().user1().cloned(); + let wallet_b = chains.node_b.wallets().user1().cloned(); + + let a_to_b_amount = 12345u64; + + let denom_a_to_b = derive_ibc_denom( + &channel.port_b.as_ref(), + &channel.channel_id_b.as_ref(), + &denom_a, + )?; + + let gas_denom_a: MonoTagged = + MonoTagged::new(Denom::Base("stake".to_owned())); + let gas_denom_b: MonoTagged = + MonoTagged::new(Denom::Base("stake".to_owned())); + + let balance_relayer_b_before = chains.node_b.chain_driver().query_balance( + &chains.node_b.wallets().relayer().address(), + &gas_denom_b.as_ref(), + )?; + + let memo: String = MEMO_CHAR.repeat(MEMO_SIZE); + + chains + .node_a + .chain_driver() + .ibc_transfer_token_with_memo_and_timeout( + &channel.port_a.as_ref(), + &channel.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + Some(memo), + None, + )?; + + // Do a simple IBC transfer with the dynamic gas configuration + let tx1_paid_gas_relayer = relayer.with_supervisor(|| { + // Assert that user on chain B received the tokens + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b.address(), + &denom_a_to_b.with_amount(a_to_b_amount).as_ref(), + )?; + + // Wait for a bit before querying the new balance + sleep(Duration::from_secs(5)); + + let balance_relayer_b_after = chains.node_b.chain_driver().query_balance( + &chains.node_b.wallets().relayer().address(), + &gas_denom_b.as_ref(), + )?; + + let paid_fees_relayer_b = balance_relayer_b_before + .amount() + .checked_sub(balance_relayer_b_after.amount()); + + assert!( + paid_fees_relayer_b.is_some(), + "subtraction between queried amounts for relayer should be Some" + ); + + info!("IBC transfer with memo was successful"); + + Ok(paid_fees_relayer_b.unwrap()) + })?; + + let b_to_a_amount = 23456u64; + let denom_b = chains.node_b.denom(); + + let denom_b_to_a = derive_ibc_denom( + &channel.port_a.as_ref(), + &channel.channel_id_a.as_ref(), + &denom_b, + )?; + + let balance_relayer_a_before = chains.node_a.chain_driver().query_balance( + &chains.node_a.wallets().relayer().address(), + &gas_denom_a.as_ref(), + )?; + + chains.node_b.chain_driver().ibc_transfer_token( + &channel.port_b.as_ref(), + &channel.channel_id_b.as_ref(), + &chains.node_b.wallets().user1(), + &chains.node_a.wallets().user1().address(), + &denom_b.with_amount(b_to_a_amount).as_ref(), + )?; + + let tx2_paid_gas_relayer = relayer.with_supervisor(|| { + // Assert that user on chain B received the tokens + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &chains.node_a.wallets().user1().address(), + &denom_b_to_a.with_amount(b_to_a_amount).as_ref(), + )?; + + // Wait for a bit before querying the new balance + sleep(Duration::from_secs(5)); + + let balance_relayer_a_after = chains.node_a.chain_driver().query_balance( + &chains.node_a.wallets().relayer().address(), + &gas_denom_a.as_ref(), + )?; + + let paid_fees_relayer_a = balance_relayer_a_before + .amount() + .checked_sub(balance_relayer_a_after.amount()); + + assert!( + paid_fees_relayer_a.is_some(), + "subtraction between queried amounts for relayer should be Some" + ); + + info!("IBC transfer without memo was successful"); + + Ok(paid_fees_relayer_a.unwrap()) + })?; + + info!("paid gas fees for Tx with memo `{tx1_paid_gas_relayer}`, without memo `{tx2_paid_gas_relayer}`"); + + if self.dynamic_gas_enabled { + assert!( + tx1_paid_gas_relayer < tx2_paid_gas_relayer, + "with dynamic gas enabled, gas paid for the first TX should be lower" + ); + } else { + assert!( + tx1_paid_gas_relayer > tx2_paid_gas_relayer, + "with dynamic gas disabled, gas paid for the second TX should be lower" + ); + } + + Ok(()) + } +} diff --git a/tools/integration-test/src/tests/mod.rs b/tools/integration-test/src/tests/mod.rs index b56c22b49d..373cf4d276 100644 --- a/tools/integration-test/src/tests/mod.rs +++ b/tools/integration-test/src/tests/mod.rs @@ -63,3 +63,6 @@ pub mod fee_grant; #[cfg(any(doc, feature = "interchain-security"))] pub mod interchain_security; + +#[cfg(any(doc, feature = "dynamic-gas-fee"))] +pub mod dynamic_gas_fee; diff --git a/tools/test-framework/src/relayer/tx.rs b/tools/test-framework/src/relayer/tx.rs index 94a8d8cf80..a2d4e41393 100644 --- a/tools/test-framework/src/relayer/tx.rs +++ b/tools/test-framework/src/relayer/tx.rs @@ -7,6 +7,7 @@ use ibc_proto::cosmos::tx::v1beta1::Fee; use ibc_relayer::chain::cosmos::gas::calculate_fee; use ibc_relayer::chain::cosmos::types::config::TxConfig; use ibc_relayer::chain::cosmos::types::gas::GasConfig; +use ibc_relayer::config::dynamic_gas::DynamicGasPrice; use ibc_relayer::config::{AddressType, GasPrice}; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use tendermint_rpc::Url; @@ -43,6 +44,11 @@ pub fn gas_config_for_test(native_token: String) -> GasConfig { gas_price, max_fee, fee_granter, + dynamic_gas_price: DynamicGasPrice { + enabled: false, + multiplier: 1.0, + max: 0.6, + }, } } diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index 4fbc20b938..9d4e7ea280 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -9,6 +9,7 @@ use eyre::Report as Error; use ibc_relayer::chain::cosmos::config::CosmosSdkConfig; use ibc_relayer::config; use ibc_relayer::config::compat_mode::CompatMode; +use ibc_relayer::config::dynamic_gas::DynamicGasPrice; use ibc_relayer::config::gas_multiplier::GasMultiplier; use ibc_relayer::keyring::Store; use ibc_relayer_types::core::ics24_host::identifier::ChainId; @@ -174,6 +175,7 @@ impl FullNode { max_gas: Some(3000000), gas_adjustment: None, gas_multiplier: Some(GasMultiplier::unsafe_new(1.5)), + dynamic_gas_price: DynamicGasPrice::default(), fee_granter: None, max_msg_num: Default::default(), max_tx_size: Default::default(), From 39036d1af7f3828974c16b258cd8885d70ebeaa5 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 23 Jan 2024 16:20:03 +0100 Subject: [PATCH 011/200] Release Hermes v1.8.0 (#3802) * WIP: setup v1.8.0 release * Update changelog after merge * Update Cargo.lock * Update changelog summary and re-order changelog entries * Update release date * Remove links from sections in changelog --------- Co-authored-by: Romain Ruetschi --- .../breaking-changes/3688-msrv.md | 0 .../3455-async-icq-test.md | 0 .../3778-ordered-channel-timeout.md | 0 .../ibc-relayer-cli/3402-lc-refresh.md | 0 .../ibc-relayer-cli/3672-clears-packet-seq.md | 0 .../3696-new-chain-upgrade-flag.md | 0 .../3743-query_packets_chunk_size.md | 0 .../ibc-relayer/3696-new-upgrade-proposal.md | 0 .../ibc-relayer/3738-dynamic-gas-fees.md | 0 .../3766-max-memo-receiver-config.md | 0 .../3738-dynamic-gas-fees-metrics.md | 0 .../3794-memo-receiver-filter-metric.md | 0 .../ibc-relayer-cli/3745-compat-0.50.md | 0 .changelog/v1.8.0/summary.md | 19 + CHANGELOG.md | 93 +++ Cargo.lock | 545 ++++++++---------- crates/chain-registry/Cargo.toml | 4 +- crates/relayer-cli/Cargo.toml | 12 +- crates/relayer-rest/Cargo.toml | 6 +- crates/relayer-rest/tests/mock.rs | 2 +- crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 8 +- crates/relayer/src/lib.rs | 2 +- crates/telemetry/Cargo.toml | 4 +- guide/README.md | 2 +- guide/src/SUMMARY.md | 2 +- guide/src/templates/hermes-version.md | 2 +- tools/integration-test/Cargo.toml | 2 +- tools/test-framework/Cargo.toml | 8 +- 29 files changed, 396 insertions(+), 317 deletions(-) rename .changelog/{unreleased => v1.8.0}/breaking-changes/3688-msrv.md (100%) rename .changelog/{unreleased => v1.8.0}/features/ibc-integration-test/3455-async-icq-test.md (100%) rename .changelog/{unreleased => v1.8.0}/features/ibc-integration-test/3778-ordered-channel-timeout.md (100%) rename .changelog/{unreleased => v1.8.0}/features/ibc-relayer-cli/3402-lc-refresh.md (100%) rename .changelog/{unreleased => v1.8.0}/features/ibc-relayer-cli/3672-clears-packet-seq.md (100%) rename .changelog/{unreleased => v1.8.0}/features/ibc-relayer-cli/3696-new-chain-upgrade-flag.md (100%) rename .changelog/{unreleased => v1.8.0}/features/ibc-relayer-cli/3743-query_packets_chunk_size.md (100%) rename .changelog/{unreleased => v1.8.0}/features/ibc-relayer/3696-new-upgrade-proposal.md (100%) rename .changelog/{unreleased => v1.8.0}/features/ibc-relayer/3738-dynamic-gas-fees.md (100%) rename .changelog/{unreleased => v1.8.0}/features/ibc-relayer/3766-max-memo-receiver-config.md (100%) rename .changelog/{unreleased => v1.8.0}/features/ibc-telemetry/3738-dynamic-gas-fees-metrics.md (100%) rename .changelog/{unreleased => v1.8.0}/features/ibc-telemetry/3794-memo-receiver-filter-metric.md (100%) rename .changelog/{unreleased => v1.8.0}/improvements/ibc-relayer-cli/3745-compat-0.50.md (100%) create mode 100644 .changelog/v1.8.0/summary.md diff --git a/.changelog/unreleased/breaking-changes/3688-msrv.md b/.changelog/v1.8.0/breaking-changes/3688-msrv.md similarity index 100% rename from .changelog/unreleased/breaking-changes/3688-msrv.md rename to .changelog/v1.8.0/breaking-changes/3688-msrv.md diff --git a/.changelog/unreleased/features/ibc-integration-test/3455-async-icq-test.md b/.changelog/v1.8.0/features/ibc-integration-test/3455-async-icq-test.md similarity index 100% rename from .changelog/unreleased/features/ibc-integration-test/3455-async-icq-test.md rename to .changelog/v1.8.0/features/ibc-integration-test/3455-async-icq-test.md diff --git a/.changelog/unreleased/features/ibc-integration-test/3778-ordered-channel-timeout.md b/.changelog/v1.8.0/features/ibc-integration-test/3778-ordered-channel-timeout.md similarity index 100% rename from .changelog/unreleased/features/ibc-integration-test/3778-ordered-channel-timeout.md rename to .changelog/v1.8.0/features/ibc-integration-test/3778-ordered-channel-timeout.md diff --git a/.changelog/unreleased/features/ibc-relayer-cli/3402-lc-refresh.md b/.changelog/v1.8.0/features/ibc-relayer-cli/3402-lc-refresh.md similarity index 100% rename from .changelog/unreleased/features/ibc-relayer-cli/3402-lc-refresh.md rename to .changelog/v1.8.0/features/ibc-relayer-cli/3402-lc-refresh.md diff --git a/.changelog/unreleased/features/ibc-relayer-cli/3672-clears-packet-seq.md b/.changelog/v1.8.0/features/ibc-relayer-cli/3672-clears-packet-seq.md similarity index 100% rename from .changelog/unreleased/features/ibc-relayer-cli/3672-clears-packet-seq.md rename to .changelog/v1.8.0/features/ibc-relayer-cli/3672-clears-packet-seq.md diff --git a/.changelog/unreleased/features/ibc-relayer-cli/3696-new-chain-upgrade-flag.md b/.changelog/v1.8.0/features/ibc-relayer-cli/3696-new-chain-upgrade-flag.md similarity index 100% rename from .changelog/unreleased/features/ibc-relayer-cli/3696-new-chain-upgrade-flag.md rename to .changelog/v1.8.0/features/ibc-relayer-cli/3696-new-chain-upgrade-flag.md diff --git a/.changelog/unreleased/features/ibc-relayer-cli/3743-query_packets_chunk_size.md b/.changelog/v1.8.0/features/ibc-relayer-cli/3743-query_packets_chunk_size.md similarity index 100% rename from .changelog/unreleased/features/ibc-relayer-cli/3743-query_packets_chunk_size.md rename to .changelog/v1.8.0/features/ibc-relayer-cli/3743-query_packets_chunk_size.md diff --git a/.changelog/unreleased/features/ibc-relayer/3696-new-upgrade-proposal.md b/.changelog/v1.8.0/features/ibc-relayer/3696-new-upgrade-proposal.md similarity index 100% rename from .changelog/unreleased/features/ibc-relayer/3696-new-upgrade-proposal.md rename to .changelog/v1.8.0/features/ibc-relayer/3696-new-upgrade-proposal.md diff --git a/.changelog/unreleased/features/ibc-relayer/3738-dynamic-gas-fees.md b/.changelog/v1.8.0/features/ibc-relayer/3738-dynamic-gas-fees.md similarity index 100% rename from .changelog/unreleased/features/ibc-relayer/3738-dynamic-gas-fees.md rename to .changelog/v1.8.0/features/ibc-relayer/3738-dynamic-gas-fees.md diff --git a/.changelog/unreleased/features/ibc-relayer/3766-max-memo-receiver-config.md b/.changelog/v1.8.0/features/ibc-relayer/3766-max-memo-receiver-config.md similarity index 100% rename from .changelog/unreleased/features/ibc-relayer/3766-max-memo-receiver-config.md rename to .changelog/v1.8.0/features/ibc-relayer/3766-max-memo-receiver-config.md diff --git a/.changelog/unreleased/features/ibc-telemetry/3738-dynamic-gas-fees-metrics.md b/.changelog/v1.8.0/features/ibc-telemetry/3738-dynamic-gas-fees-metrics.md similarity index 100% rename from .changelog/unreleased/features/ibc-telemetry/3738-dynamic-gas-fees-metrics.md rename to .changelog/v1.8.0/features/ibc-telemetry/3738-dynamic-gas-fees-metrics.md diff --git a/.changelog/unreleased/features/ibc-telemetry/3794-memo-receiver-filter-metric.md b/.changelog/v1.8.0/features/ibc-telemetry/3794-memo-receiver-filter-metric.md similarity index 100% rename from .changelog/unreleased/features/ibc-telemetry/3794-memo-receiver-filter-metric.md rename to .changelog/v1.8.0/features/ibc-telemetry/3794-memo-receiver-filter-metric.md diff --git a/.changelog/unreleased/improvements/ibc-relayer-cli/3745-compat-0.50.md b/.changelog/v1.8.0/improvements/ibc-relayer-cli/3745-compat-0.50.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer-cli/3745-compat-0.50.md rename to .changelog/v1.8.0/improvements/ibc-relayer-cli/3745-compat-0.50.md diff --git a/.changelog/v1.8.0/summary.md b/.changelog/v1.8.0/summary.md new file mode 100644 index 0000000000..7ea70c84de --- /dev/null +++ b/.changelog/v1.8.0/summary.md @@ -0,0 +1,19 @@ +*January 23rd, 2024* + +This v1.8.0 release introduces new features and improvements to Hermes. + +One key feature is that Hermes is now compatible with both the legacy `UpgradeProposal` and the newer `MsgIbcSoftwareUpgrade` message when upgrading a chain. +This allows Hermes to be compatible with ibc-go v8.0.0. The compatibility check that Hermes performs on startup has been updated to reflect this. + +Additional configuration settings have been added: + +- The new global settings `ics20_max_memo_size` and `ics20_max_receiver_size` allow users to specify a limit for the size of the memo and receiver fields for ICS20 packets. Any packet with either field having a size exceeding the configured values will not be relayed. +- The new per-chain setting `query_packets_chunk_size` allows users to specify how many packets are queried at once from the chain when clearing pending packets. This is useful to tweak when there are many large pending packets and the RPC endpoints times out or refuses to answer the pending packets query. +- The new per-chain setting `client_refresh_rate` can be use to specify how often the clients referencing this chain should be refreshed. The rate is expressed as a fraction of the trusting period. +- The new per-chain setting `dynamic_gas_price` can be enabled to have the relayer query for and use a dynamic gas price instead of using the static `gas_price` specified in the config. This should only be used for chains which have a [EIP-1559][eip-1559]-like fee market enabled and support the `osmosis.txfees.v1beta1.Query/GetEipBaseFee` gRPC query. + +Telemetry now features new metrics: +- Monitoring the ICS20 packets filtered due to the memo and/or receiver field size exceeding the configured limits. +- Monitoring the distribution of dynamic gas fees queried from the chain, if enabled. + +[eip-1559]: https://metamask.io/1559/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 08dad0afd3..e9328dfc7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,98 @@ # CHANGELOG +## v1.8.0 + +*January 23rd, 2024* + +This v1.8.0 release introduces new features and improvements to Hermes. + +One key feature is that Hermes is now compatible with both the legacy `UpgradeProposal` and the newer `MsgIbcSoftwareUpgrade` message when upgrading a chain. +This allows Hermes to be compatible with ibc-go v8.0.0. The compatibility check that Hermes performs on startup has been updated to reflect this. + +Additional configuration settings have been added: + +- The new global settings `ics20_max_memo_size` and `ics20_max_receiver_size` allow users to specify a limit for the size of the memo and receiver fields for ICS20 packets. Any packet with either field having a size exceeding the configured values will not be relayed. +- The new per-chain setting `query_packets_chunk_size` allows users to specify how many packets are queried at once from the chain when clearing pending packets. This is useful to tweak when there are many large pending packets and the RPC endpoints times out or refuses to answer the pending packets query. +- The new per-chain setting `client_refresh_rate` can be use to specify how often the clients referencing this chain should be refreshed. The rate is expressed as a fraction of the trusting period. +- The new per-chain setting `dynamic_gas_price` can be enabled to have the relayer query for and use a dynamic gas price instead of using the static `gas_price` specified in the config. This should only be used for chains which have a [EIP-1559][eip-1559]-like fee market enabled and support the `osmosis.txfees.v1beta1.Query/GetEipBaseFee` gRPC query. + +Telemetry now features new metrics: +- Monitoring the ICS20 packets filtered due to the memo and/or receiver field size exceeding the configured limits. +- Monitoring the distribution of dynamic gas fees queried from the chain, if enabled. + +[eip-1559]: https://metamask.io/1559/ + +### BREAKING CHANGES + +- Bump MSRV to 1.71 ([\#3688](https://github.com/informalsystems/hermes/issues/3688)) + +### FEATURES + +- Relayer + - Use legacy `UpgradeProposal` or newer `MsgIbcSoftwareUpgrade` message when upgrading + a chain depending on whether the chain is running IBC-Go v8 or older. + ([\#3696](https://github.com/informalsystems/hermes/issues/3696)) + - Add a new per-chain configuration table `dynamic_gas_price` which enables + querying the current gas price from the chain instead of the static `gas_price`, + when the chain has [EIP-1559][eip]-like dynamic gas price. + The new configuration setting can be configured per-chain as follows: + ```toml + dynamic_gas_price = { enabled = true, multiplier = 1.1, max = 0.6 } + ``` + At the moment, only chains which support the `osmosis.txfees.v1beta1.Query/GetEipBaseFee` + query can be used with dynamic gas price enabled. + ([\#3738](https://github.com/informalsystems/hermes/issues/3738)) + + [eip]: https://metamask.io/1559/ + - Add two new packet configurations: + * `ics20_max_memo_size` which filters ICS20 packets with memo field bigger than the configured value + * `ics20_max_receiver_size` which filters ICS20 packets with receiver field bigger than the configured value + ([\#3766](https://github.com/informalsystems/hermes/issues/3766)) + - Add a `client_refresh_rate` setting to specify the rate at which to refresh clients referencing this chain, relative to its trusting period. + ([\#3402](https://github.com/informalsystems/hermes/issues/3402)) + - Add a `--packet-sequences` flag to the `clear packets`, `tx packet-recv`, and `tx packet-ack` commands. + When this flag is specified, these commands will only clear the packets with the specified sequence numbers + on the given chain. If not provided, all pending packets will be cleared on both chains, as before. + ([\#3672](https://github.com/informalsystems/hermes/issues/3672)) + + This flag takes either a single sequence number or a range of sequences numbers. + Each element of the comma-separated list must be either a single sequence number or + a range of sequence numbers. + + Examples: + - `10` will clear a single packet with sequence number `10` + - `1,2,3` will clear packets with sequence numbers `1, 2, 3` + - `1..5` will clear packets with sequence numbers `1, 2, 3, 4, 5` + - `..5` will clear packets with sequence numbers `1, 2, 3, 4, 5` + - `5..` will clear packets with sequence numbers greater than or equal to `5` + - `..5,10..20,25,30..` will clear packets with sequence numbers `1, 2, 3, 4, 5, 10, 11, ..., 20, 25, 30, 31, ...` + - `..5,10..20,25,30..` will clear packets with sequence numbers `1, 2, 3, 4, 5, 10, 11, ..., 20, 25, 30, 31, ...` + - Add a `--gov-account` option to `hermes tx upgrade-chain` to specify the authority account used to sign upgrade proposal for chains running IBC-Go v8+. + ([\#3696](https://github.com/informalsystems/hermes/issues/3696)) + - Add a `query_packets_chunk_size` config option and a `--query-packets-chunk-size` flag to the `clear packets` CLI to configure how + many packets to query at once from the chain when clearing pending packets. Lower this setting if one or more of packets you are + trying to clear are huge and make the packet query time out or fail. + ([\#3743](https://github.com/informalsystems/hermes/issues/3743)) +- Telemetry & Metrics + - Add three metrics related to EIP gas price: + - `dynamic_gas_queried_fees` contains data on the queried values before applying any filter + - `dynamic_gas_queried_success_fees` contains data on the queried values if the query was successful and before applying any filter + - `dynamic_gas_paid_fees` contains data on the queried values after applying the `max` filter + ([\#3738](https://github.com/informalsystems/hermes/issues/3738)) + - Add a new metric `filtered_packets` which counts the number of packets filtered due to having a memo or receiver field too big + ([\#3794](https://github.com/informalsystems/hermes/issues/3794)) +- Integration Test Framework + - Add a test for asynchronous Interchain Query relaying + ([\#3455](https://github.com/informalsystems/hermes/issues/3455)) + - Add an ICA test to assert a channel correctly closes after a packet time-outs + ([\#3778](https://github.com/informalsystems/hermes/issues/3778)) + +### IMPROVEMENTS + +- Relayer CLI + - Update compatibility check to allow IBC-Go 4.1.1 to 8.x and SDK 0.45.x to 0.50.x. + ([\#3745](https://github.com/informalsystems/hermes/issues/3745)) + ## v1.7.4 *December 15th, 2023* diff --git a/Cargo.lock b/Cargo.lock index b8ab401cbc..d4cf9183bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,9 +67,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "arc-swap" @@ -101,9 +101,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", @@ -221,9 +221,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64ct" @@ -286,9 +286,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block-buffer" @@ -371,9 +371,9 @@ checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" [[package]] name = "cargo-platform" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12024c4645c97566567129c204f65d5815a8c9aecf30fcbe682b2fe034996d36" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" dependencies = [ "serde", ] @@ -477,9 +477,9 @@ dependencies = [ [[package]] name = "color-spantrace" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba75b3d9449ecdccb27ecbc479fdc0b87fa2dd43d2f8298f9bf0e59aacc8dce" +checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" dependencies = [ "once_cell", "owo-colors", @@ -489,22 +489,22 @@ dependencies = [ [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "contracts" @@ -519,9 +519,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -529,15 +529,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -563,15 +563,11 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if 1.0.0", "crossbeam-utils 0.8.19", - "memoffset", - "scopeguard", ] [[package]] @@ -599,9 +595,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28f85c3514d2a6e64160359b45a3918c3b4178bcbf4ae5d03ab2d02e521c479a" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", "rand_core", @@ -667,7 +663,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if 1.0.0", - "hashbrown 0.14.2", + "hashbrown 0.14.3", "lock_api", "once_cell", "parking_lot_core", @@ -675,9 +671,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "der" @@ -691,9 +687,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -771,9 +767,9 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.16.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", "digest 0.10.7", @@ -842,9 +838,9 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" -version = "0.13.7" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9775b22bc152ad86a0cf23f0f348b884b26add12bf741e7ffc4d4ab2ab4d205" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", @@ -876,9 +872,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -895,12 +891,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -914,9 +910,9 @@ dependencies = [ [[package]] name = "eyre" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +checksum = "b6267a1fa6f59179ea4afc8e50fd8612a3cc60bc858f786ff877a4a8cb042799" dependencies = [ "indenter", "once_cell", @@ -940,9 +936,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a56f0780318174bad1c127063fd0c5fdfb35398e3cd79ffaab931a6c79df80" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" [[package]] name = "fixed-hash" @@ -972,27 +968,27 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "fs-err" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5fd9bcbe8b1087cbd395b51498c01bc997cef73e778a80b77a811af5e2d29f" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" dependencies = [ "autocfg", ] [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1005,9 +1001,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1015,15 +1011,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1032,15 +1028,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", @@ -1049,21 +1045,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1090,9 +1086,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -1103,9 +1099,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -1177,9 +1173,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "hdpath" @@ -1207,9 +1203,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -1251,9 +1247,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -1290,9 +1286,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -1305,7 +1301,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2", "tokio", "tower-service", "tracing", @@ -1340,7 +1336,7 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.26.4" +version = "0.27.0" dependencies = [ "async-trait", "flex-error", @@ -1359,7 +1355,7 @@ dependencies = [ [[package]] name = "ibc-integration-test" -version = "0.26.4" +version = "0.27.0" dependencies = [ "byte-unit", "http", @@ -1379,11 +1375,11 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.39.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b5aca9ca863246a2b358e0a1845759780860673e54c0a76335faccc504981c" +checksum = "c8a8b1356652b9f160f5a010dd6b084675b8a28e163bf2b41ca5abecf27d9701" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "bytes", "flex-error", "ics23", @@ -1396,7 +1392,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.26.4" +version = "0.27.0" dependencies = [ "anyhow", "async-stream", @@ -1465,7 +1461,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "1.7.4" +version = "1.8.0" dependencies = [ "abscissa_core", "clap", @@ -1506,7 +1502,7 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.26.4" +version = "0.27.0" dependencies = [ "axum", "crossbeam-channel 0.5.11", @@ -1521,7 +1517,7 @@ dependencies = [ [[package]] name = "ibc-relayer-types" -version = "0.26.4" +version = "0.27.0" dependencies = [ "bytes", "derive_more", @@ -1552,7 +1548,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.26.4" +version = "0.27.0" dependencies = [ "axum", "dashmap", @@ -1571,7 +1567,7 @@ dependencies = [ [[package]] name = "ibc-test-framework" -version = "0.26.4" +version = "0.27.0" dependencies = [ "color-eyre", "crossbeam-channel 0.5.11", @@ -1627,9 +1623,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1667,7 +1663,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", ] [[package]] @@ -1688,13 +1684,13 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi 0.3.4", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1717,24 +1713,24 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] [[package]] name = "k256" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f01b677d82ef7a676aa37e099defd83a28e15687112cafdd112d60236b6115b" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ "cfg-if 1.0.0", "ecdsa", @@ -1744,9 +1740,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] @@ -1759,9 +1755,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libredox" @@ -1769,16 +1765,16 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall", ] [[package]] name = "linux-raw-sys" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -1796,15 +1792,6 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -[[package]] -name = "mach2" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" -dependencies = [ - "libc", -] - [[package]] name = "matchers" version = "0.1.0" @@ -1828,18 +1815,9 @@ checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" [[package]] name = "memchr" -version = "2.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mime" @@ -1858,9 +1836,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", @@ -1869,9 +1847,9 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.1" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8017ec3548ffe7d4cef7ac0e12b044c01164a74c0f3119420faeaf13490ad8b" +checksum = "ad9dc9808102655926a6086abd0b9965ebefd4a39ef0d184f074c34ba5049ec6" dependencies = [ "crossbeam-channel 0.5.11", "crossbeam-epoch", @@ -1959,15 +1937,15 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi 0.3.4", "libc", ] [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -2141,9 +2119,9 @@ checksum = "c719dcf55f09a3a7e764c6649ab594c18a177e3599c467983cdf644bfc0a4088" [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" @@ -2189,9 +2167,9 @@ dependencies = [ [[package]] name = "platforms" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" [[package]] name = "powerfmt" @@ -2242,9 +2220,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -2266,9 +2244,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ "bytes", "prost-derive", @@ -2276,9 +2254,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", "itertools 0.11.0", @@ -2289,9 +2267,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" dependencies = [ "prost", ] @@ -2315,13 +2293,12 @@ dependencies = [ [[package]] name = "quanta" -version = "0.11.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" +checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" dependencies = [ "crossbeam-utils 0.8.19", "libc", - "mach2", "once_cell", "raw-cpuid", "wasi", @@ -2370,11 +2347,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "10.7.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", ] [[package]] @@ -2399,13 +2376,13 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", + "regex-automata 0.4.4", "regex-syntax 0.8.2", ] @@ -2420,9 +2397,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" dependencies = [ "aho-corasick", "memchr", @@ -2443,11 +2420,11 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -2499,9 +2476,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.5" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", "getrandom", @@ -2543,22 +2520,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.24" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad981d6c340a49cdc40a1028d9c6084ec7e9fa33fcb839cab656a267071e234" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.8" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring", @@ -2584,7 +2561,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.5", + "base64 0.21.7", ] [[package]] @@ -2605,9 +2582,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -2620,11 +2597,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2731,9 +2708,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.12" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" dependencies = [ "serde", ] @@ -2772,9 +2749,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" dependencies = [ "itoa", "serde", @@ -2782,9 +2759,9 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", @@ -2793,9 +2770,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -2814,9 +2791,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.27" +version = "0.9.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc7a1570e38322cfe4154732e5110f887ea57e22b76f4bfd32b5bdd3368666c" +checksum = "b1bf28c79a99f70ee1f1d83d10c875d2e70618417fda01ad1785e027579d9d38" dependencies = [ "indexmap 2.1.0", "itoa", @@ -2931,9 +2908,9 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", "rand_core", @@ -2971,19 +2948,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" - -[[package]] -name = "socket2" -version = "0.4.10" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" @@ -3003,9 +2970,9 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -3135,15 +3102,15 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tempfile" -version = "3.8.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if 1.0.0", "fastrand", "redox_syscall", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3322,9 +3289,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -3389,9 +3356,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "powerfmt", @@ -3408,9 +3375,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -3460,9 +3427,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -3472,7 +3439,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -3585,7 +3552,7 @@ dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.21.5", + "base64 0.21.7", "bytes", "h2", "http", @@ -3737,15 +3704,15 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee8098afad3fb0c54a9007aab6804558410503ad676d4633f9c2559a00ac0f" +checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" @@ -3796,9 +3763,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -3841,9 +3808,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -3864,9 +3831,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8-width" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" +checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" [[package]] name = "uuid" @@ -3931,9 +3898,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -3941,9 +3908,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -3956,9 +3923,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -3968,9 +3935,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3978,9 +3945,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -3991,15 +3958,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -4036,15 +4003,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -4055,18 +4013,12 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.42.2" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.52.0", ] [[package]] @@ -4085,10 +4037,19 @@ dependencies = [ ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" +name = "windows-targets" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] [[package]] name = "windows_aarch64_gnullvm" @@ -4097,10 +4058,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" +name = "windows_aarch64_gnullvm" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" @@ -4109,10 +4070,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] -name = "windows_i686_gnu" -version = "0.42.2" +name = "windows_aarch64_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" @@ -4121,10 +4082,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] -name = "windows_i686_msvc" -version = "0.42.2" +name = "windows_i686_gnu" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" @@ -4133,10 +4094,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" +name = "windows_i686_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" @@ -4145,10 +4106,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" +name = "windows_x86_64_gnu" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -4157,10 +4118,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" +name = "windows_x86_64_gnullvm" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" @@ -4168,11 +4129,17 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" dependencies = [ "memchr", ] @@ -4189,9 +4156,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12a3946ecfc929b583800f4629b6c25b88ac6e92a40ea5670f77112a85d40a8b" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index b28dc1de05..ab3a0135c8 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-chain-registry" -version = "0.26.4" +version = "0.27.0" edition = "2021" license = "Apache-2.0" keywords = ["cosmos", "ibc", "relayer", "chain", "registry"] @@ -12,7 +12,7 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.26.4", path = "../relayer-types" } +ibc-relayer-types = { version = "0.27.0", path = "../relayer-types" } ibc-proto = { version = "0.39.0", features = ["serde"] } tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index f7532782af..32d8cd3154 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-cli" -version = "1.7.4" +version = "1.8.0" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -25,11 +25,11 @@ telemetry = ["ibc-relayer/telemetry", "ibc-telemetry"] rest-server = ["ibc-relayer-rest"] [dependencies] -ibc-relayer-types = { version = "0.26.4", path = "../relayer-types" } -ibc-relayer = { version = "0.26.4", path = "../relayer" } -ibc-telemetry = { version = "0.26.4", path = "../telemetry", optional = true } -ibc-relayer-rest = { version = "0.26.4", path = "../relayer-rest", optional = true } -ibc-chain-registry = { version = "0.26.4" , path = "../chain-registry" } +ibc-relayer-types = { version = "0.27.0", path = "../relayer-types" } +ibc-relayer = { version = "0.27.0", path = "../relayer" } +ibc-telemetry = { version = "0.27.0", path = "../telemetry", optional = true } +ibc-relayer-rest = { version = "0.27.0", path = "../relayer-rest", optional = true } +ibc-chain-registry = { version = "0.27.0" , path = "../chain-registry" } clap = { version = "3.2", features = ["cargo"] } clap_complete = "3.2" diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index a5e7066646..1f891a77ef 100644 --- a/crates/relayer-rest/Cargo.toml +++ b/crates/relayer-rest/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-rest" -version = "0.26.4" +version = "0.27.0" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" @@ -14,8 +14,8 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.26.4", path = "../relayer-types" } -ibc-relayer = { version = "0.26.4", path = "../relayer" } +ibc-relayer-types = { version = "0.27.0", path = "../relayer-types" } +ibc-relayer = { version = "0.27.0", path = "../relayer" } crossbeam-channel = "0.5" serde = "1.0" diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index a108e619ac..9b1b1e530a 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -64,7 +64,7 @@ async fn version() { let rest_api_version = VersionInfo { name: "ibc-relayer-rest".to_string(), - version: "0.26.4".to_string(), + version: "0.27.0".to_string(), }; let result: JsonResult<_, ()> = JsonResult::Success(vec![version.clone(), rest_api_version]); diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 8ca2f9f7f2..9a78267c2f 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-types" -version = "0.26.4" +version = "0.27.0" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index faf0d93c7c..840546fe77 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer" -version = "0.26.4" +version = "0.27.0" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -21,8 +21,8 @@ telemetry = ["ibc-telemetry"] [dependencies] ibc-proto = { version = "0.39.0", features = ["serde"] } -ibc-telemetry = { version = "0.26.4", path = "../telemetry", optional = true } -ibc-relayer-types = { version = "0.26.4", path = "../relayer-types", features = ["mocks"] } +ibc-telemetry = { version = "0.27.0", path = "../telemetry", optional = true } +ibc-relayer-types = { version = "0.27.0", path = "../relayer-types", features = ["mocks"] } subtle-encoding = "0.5" humantime-serde = "1.1.1" @@ -110,7 +110,7 @@ version = "0.34.0" default-features = false [dev-dependencies] -ibc-relayer-types = { version = "0.26.4", path = "../relayer-types", features = ["mocks"] } +ibc-relayer-types = { version = "0.27.0", path = "../relayer-types", features = ["mocks"] } serial_test = "2.0.0" env_logger = "0.10.0" test-log = { version = "0.2.14", features = ["trace"] } diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index 16744ad6aa..64173df993 100644 --- a/crates/relayer/src/lib.rs +++ b/crates/relayer/src/lib.rs @@ -15,7 +15,7 @@ //! //! For the IBC relayer binary, please see [Hermes] (`ibc-relayer-cli` crate). //! -//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.7.4/ +//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.8.0/ extern crate alloc; diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index b70652ea9d..60d3357d71 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-telemetry" -version = "0.26.4" +version = "0.27.0" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -13,7 +13,7 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.26.4", path = "../relayer-types" } +ibc-relayer-types = { version = "0.27.0", path = "../relayer-types" } once_cell = "1.19.0" opentelemetry = { version = "0.19.0", features = ["metrics"] } diff --git a/guide/README.md b/guide/README.md index 119ddbdef2..0c2a7bf993 100644 --- a/guide/README.md +++ b/guide/README.md @@ -10,7 +10,7 @@ mdBook is a utility to create modern online books from Markdown files. This guide should be permanently deployed at its latest stable version at [hermes.informal.systems](https://hermes.informal.systems). -Current version: `v1.7.4`. +Current version: `v1.8.0`. The version of this guide is aligned with the [versioning of the ibc crates](../README.md). diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index fbef9c31b3..86b06ace7e 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -1,6 +1,6 @@ # Summary -# Hermes v1.7.4 +# Hermes v1.8.0 --- - [Introduction](./index.md) diff --git a/guide/src/templates/hermes-version.md b/guide/src/templates/hermes-version.md index a9bbd79f98..804a616da1 100644 --- a/guide/src/templates/hermes-version.md +++ b/guide/src/templates/hermes-version.md @@ -1 +1 @@ -v1.7.4 +v1.8.0 diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 640b0871a9..9580ba24bf 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-integration-test" -version = "0.26.4" +version = "0.27.0" edition = "2021" rust-version = "1.71" license = "Apache-2.0" diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index be30a1302b..1f8fecd2a0 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-test-framework" -version = "0.26.4" +version = "0.27.0" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -14,9 +14,9 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "=0.26.4", path = "../../crates/relayer-types" } -ibc-relayer = { version = "=0.26.4", path = "../../crates/relayer" } -ibc-relayer-cli = { version = "=1.7.4", path = "../../crates/relayer-cli" } +ibc-relayer-types = { version = "=0.27.0", path = "../../crates/relayer-types" } +ibc-relayer = { version = "=0.27.0", path = "../../crates/relayer" } +ibc-relayer-cli = { version = "=1.8.0", path = "../../crates/relayer-cli" } ibc-proto = { version = "0.39.0", features = ["serde"] } tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } From 8a8f1eb2e14779f0fc1ecaaf4f51f85f41433929 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 23 Jan 2024 17:19:48 +0100 Subject: [PATCH 012/200] Publish release automatically when pushing version tag (#3809) --- .github/workflows/publish-dry-run.yml | 21 +++++++++++++++++++++ .github/workflows/publish.yml | 13 +++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/publish-dry-run.yml diff --git a/.github/workflows/publish-dry-run.yml b/.github/workflows/publish-dry-run.yml new file mode 100644 index 0000000000..9689c0d1f0 --- /dev/null +++ b/.github/workflows/publish-dry-run.yml @@ -0,0 +1,21 @@ +name: Publish (dry-run) + +on: + push: + branches: + - 'release/*' + +jobs: + publish_dry_run: + name: Publish (dry-run) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - uses: katyo/publish-crates@v2 + with: + dry-run: true + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cbcbc6f39a..29b0e03d40 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,13 +1,13 @@ -name: Publish (dry-run) +name: Publish on: push: - branches: - - 'release/*' + tags: + - v[0-9]+.* jobs: - publish: - name: Publish (dry-run) + publish_dry_run: + name: Publish to crates.io runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -17,5 +17,6 @@ jobs: override: true - uses: katyo/publish-crates@v2 with: - dry-run: true + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} + From 37e83e685542b9d98485cb0842745d684d8d2e3f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 13:01:39 +0100 Subject: [PATCH 013/200] Bump lycheeverse/lychee-action from 1.9.1 to 1.9.3 (#3826) Bumps [lycheeverse/lychee-action](https://github.com/lycheeverse/lychee-action) from 1.9.1 to 1.9.3. - [Release notes](https://github.com/lycheeverse/lychee-action/releases) - [Commits](https://github.com/lycheeverse/lychee-action/compare/v1.9.1...v1.9.3) --- updated-dependencies: - dependency-name: lycheeverse/lychee-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/markdown-link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/markdown-link-check.yml b/.github/workflows/markdown-link-check.yml index 9dbaba343b..f5da1e2a04 100644 --- a/.github/workflows/markdown-link-check.yml +++ b/.github/workflows/markdown-link-check.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Link Checker id: lychee - uses: lycheeverse/lychee-action@v1.9.1 + uses: lycheeverse/lychee-action@v1.9.3 with: args: --verbose --no-progress --max-concurrency 16 './**/*.md' token: ${{ secrets.GITHUB_TOKEN }} From 6f0864c28668aaad67df4c8c6cd86133f1cea791 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 13:02:12 +0100 Subject: [PATCH 014/200] Bump ibc-proto from 0.39.1 to 0.41.0 (#3825) Bumps [ibc-proto](https://github.com/cosmos/ibc-proto-rs) from 0.39.1 to 0.41.0. - [Release notes](https://github.com/cosmos/ibc-proto-rs/releases) - [Changelog](https://github.com/cosmos/ibc-proto-rs/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/ibc-proto-rs/compare/v0.39.1...v0.41.0) --- updated-dependencies: - dependency-name: ibc-proto dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 17 ++++++++++++++--- crates/chain-registry/Cargo.toml | 2 +- crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 2 +- tools/test-framework/Cargo.toml | 2 +- 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4cf9183bd..636a01dfdb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1375,14 +1375,15 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.39.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8a8b1356652b9f160f5a010dd6b084675b8a28e163bf2b41ca5abecf27d9701" +checksum = "dd4ee32b22d3b06f31529b956f4928e5c9a068d71e46cf6abfa19c31ca550553" dependencies = [ "base64 0.21.7", "bytes", "flex-error", "ics23", + "informalsystems-pbjson 0.7.0", "prost", "serde", "subtle-encoding", @@ -1607,7 +1608,7 @@ dependencies = [ "anyhow", "bytes", "hex", - "informalsystems-pbjson", + "informalsystems-pbjson 0.6.0", "prost", "ripemd", "serde", @@ -1676,6 +1677,16 @@ dependencies = [ "serde", ] +[[package]] +name = "informalsystems-pbjson" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aa4a0980c8379295100d70854354e78df2ee1c6ca0f96ffe89afeb3140e3a3d" +dependencies = [ + "base64 0.21.7", + "serde", +] + [[package]] name = "ipnet" version = "2.9.0" diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index ab3a0135c8..d64dcf5f9e 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -13,7 +13,7 @@ description = """ [dependencies] ibc-relayer-types = { version = "0.27.0", path = "../relayer-types" } -ibc-proto = { version = "0.39.0", features = ["serde"] } +ibc-proto = { version = "0.41.0", features = ["serde"] } tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } async-trait = "0.1.72" diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 9a78267c2f..a2f230d8ba 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -24,7 +24,7 @@ mocks = ["tendermint-testgen", "clock"] [dependencies] # Proto definitions for all IBC-related interfaces, e.g., connections or channels. -ibc-proto = { version = "0.39.0", features = ["serde"] } +ibc-proto = { version = "0.41.0", features = ["serde"] } ics23 = { version = "0.11.0", features = ["std", "host-functions"] } time = { version = "0.3" } serde_derive = { version = "1.0.104" } diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 840546fe77..2006bd0c4e 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -20,7 +20,7 @@ default = ["flex-error/std", "flex-error/eyre_tracer"] telemetry = ["ibc-telemetry"] [dependencies] -ibc-proto = { version = "0.39.0", features = ["serde"] } +ibc-proto = { version = "0.41.0", features = ["serde"] } ibc-telemetry = { version = "0.27.0", path = "../telemetry", optional = true } ibc-relayer-types = { version = "0.27.0", path = "../relayer-types", features = ["mocks"] } diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 1f8fecd2a0..751473726a 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -17,7 +17,7 @@ description = """ ibc-relayer-types = { version = "=0.27.0", path = "../../crates/relayer-types" } ibc-relayer = { version = "=0.27.0", path = "../../crates/relayer" } ibc-relayer-cli = { version = "=1.8.0", path = "../../crates/relayer-cli" } -ibc-proto = { version = "0.39.0", features = ["serde"] } +ibc-proto = { version = "0.41.0", features = ["serde"] } tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } http = "0.2.9" From a5a59f763106c585af925e55d3f36567e2bb84ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 13:02:43 +0100 Subject: [PATCH 015/200] Bump serde_yaml from 0.9.30 to 0.9.31 (#3824) Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.9.30 to 0.9.31. - [Release notes](https://github.com/dtolnay/serde-yaml/releases) - [Commits](https://github.com/dtolnay/serde-yaml/compare/0.9.30...0.9.31) --- updated-dependencies: - dependency-name: serde_yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 14 +++++++------- tools/test-framework/Cargo.toml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 636a01dfdb..57294da7a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1152,7 +1152,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.1.0", + "indexmap 2.2.1", "slab", "tokio", "tokio-util", @@ -1659,9 +1659,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -2802,11 +2802,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.30" +version = "0.9.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1bf28c79a99f70ee1f1d83d10c875d2e70618417fda01ad1785e027579d9d38" +checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.1", "itoa", "ryu", "serde", @@ -3547,7 +3547,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.1", "serde", "serde_spanned", "toml_datetime", diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 751473726a..a33bbf74d4 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -30,7 +30,7 @@ rand = "0.8.5" hex = "0.4.3" serde = "1.0" serde_json = "1" -serde_yaml = "0.9.16" +serde_yaml = "0.9.31" itertools = "0.10" toml = "0.8" subtle-encoding = "0.5.1" From 0c9d878499dc1f7716b2bc5ffbb50fa55fc24d4e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 13:04:05 +0100 Subject: [PATCH 016/200] Bump env_logger from 0.10.2 to 0.11.1 (#3821) Bumps [env_logger](https://github.com/rust-cli/env_logger) from 0.10.2 to 0.11.1. - [Release notes](https://github.com/rust-cli/env_logger/releases) - [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-cli/env_logger/compare/v0.10.2...v0.11.1) --- updated-dependencies: - dependency-name: env_logger dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 102 ++++++++++++++++++++++++++------ crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 2 +- 3 files changed, 87 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57294da7a6..edacc67ab7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,6 +65,54 @@ dependencies = [ "memchr", ] +[[package]] +name = "anstream" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + +[[package]] +name = "anstyle-parse" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.79" @@ -487,6 +535,12 @@ dependencies = [ "tracing-error", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "console" version = "0.15.8" @@ -870,17 +924,36 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", +] + [[package]] name = "env_logger" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ + "log", +] + +[[package]] +name = "env_logger" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8" +dependencies = [ + "anstream", + "anstyle", + "env_filter", "humantime", - "is-terminal", "log", - "regex", - "termcolor", ] [[package]] @@ -1408,7 +1481,7 @@ dependencies = [ "ed25519", "ed25519-dalek", "ed25519-dalek-bip32", - "env_logger", + "env_logger 0.11.1", "flex-error", "futures", "generic-array", @@ -1522,7 +1595,7 @@ version = "0.27.0" dependencies = [ "bytes", "derive_more", - "env_logger", + "env_logger 0.11.1", "flex-error", "ibc-proto", "ics23", @@ -1693,17 +1766,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" -[[package]] -name = "is-terminal" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" -dependencies = [ - "hermit-abi 0.3.4", - "rustix", - "windows-sys 0.52.0", -] - [[package]] name = "itertools" version = "0.10.5" @@ -3313,7 +3375,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6159ab4116165c99fc88cce31f99fa2c9dbe08d3691cb38da02fc3b45f357d2b" dependencies = [ - "env_logger", + "env_logger 0.10.2", "test-log-macros", "tracing-subscriber", ] @@ -3846,6 +3908,12 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "0.8.2" diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index a2f230d8ba..38cb6d710e 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -57,7 +57,7 @@ version = "0.34.0" optional = true [dev-dependencies] -env_logger = "0.10.0" +env_logger = "0.11.1" tracing = { version = "0.1.36", default-features = false } tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"] } test-log = { version = "0.2.14", features = ["trace"] } diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 2006bd0c4e..000d7d1760 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -112,7 +112,7 @@ default-features = false [dev-dependencies] ibc-relayer-types = { version = "0.27.0", path = "../relayer-types", features = ["mocks"] } serial_test = "2.0.0" -env_logger = "0.10.0" +env_logger = "0.11.1" test-log = { version = "0.2.14", features = ["trace"] } # Needed for generating (synthetic) light blocks. From e05bd2e18940f4187488675d3b390ff0c5f0af41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 13:04:11 +0100 Subject: [PATCH 017/200] Bump dialoguer from 0.10.4 to 0.11.0 (#3822) Bumps [dialoguer](https://github.com/console-rs/dialoguer) from 0.10.4 to 0.11.0. - [Changelog](https://github.com/console-rs/dialoguer/blob/master/CHANGELOG.md) - [Commits](https://github.com/console-rs/dialoguer/compare/v0.10.4...v0.11.0) --- updated-dependencies: - dependency-name: dialoguer dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 5 +++-- crates/relayer-cli/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index edacc67ab7..ce17ddbc35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -767,13 +767,14 @@ dependencies = [ [[package]] name = "dialoguer" -version = "0.10.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" dependencies = [ "console", "shell-words", "tempfile", + "thiserror", "zeroize", ] diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index 32d8cd3154..a9aa83a758 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -36,7 +36,7 @@ clap_complete = "3.2" color-eyre = "0.6" console = "0.15.5" crossbeam-channel = "0.5.11" -dialoguer = "0.10.3" +dialoguer = "0.11.0" dirs-next = "2.0.0" eyre = "0.6.8" flex-error = { version = "0.4.4", default-features = false, features = ["std", "eyre_tracer"] } From 670a92cf0d24275c7039fb448addde52de1aa994 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 14:58:36 +0100 Subject: [PATCH 018/200] Bump serial_test from 2.0.0 to 3.0.0 (#3823) Bumps [serial_test](https://github.com/palfrey/serial_test) from 2.0.0 to 3.0.0. - [Release notes](https://github.com/palfrey/serial_test/releases) - [Commits](https://github.com/palfrey/serial_test/compare/v2.0.0...v3.0.0) --- updated-dependencies: - dependency-name: serial_test dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/relayer-cli/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ce17ddbc35..6d40be1bc6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2878,9 +2878,9 @@ dependencies = [ [[package]] name = "serial_test" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d" +checksum = "953ad9342b3aaca7cb43c45c097dd008d4907070394bd0751a0aa8817e5a018d" dependencies = [ "dashmap", "futures", @@ -2892,9 +2892,9 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" +checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212" dependencies = [ "proc-macro2", "quote", diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index a9aa83a758..8087507ffb 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -74,4 +74,4 @@ features = ["options"] abscissa_core = { version = "=0.6.0", features = ["testing"] } once_cell = "1.19" regex = "1.9" -serial_test = "2.0.0" +serial_test = "3.0.0" diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 000d7d1760..5ed88c5893 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -111,7 +111,7 @@ default-features = false [dev-dependencies] ibc-relayer-types = { version = "0.27.0", path = "../relayer-types", features = ["mocks"] } -serial_test = "2.0.0" +serial_test = "3.0.0" env_logger = "0.11.1" test-log = { version = "0.2.14", features = ["trace"] } From 446731b5f2cf0f32ab5ca80d8e9de6c8c615c210 Mon Sep 17 00:00:00 2001 From: Adi Seredinschi Date: Wed, 31 Jan 2024 08:58:09 +0100 Subject: [PATCH 019/200] Update release-template.md to include a workflow with the comms team (#3827) --- .github/ISSUE_TEMPLATE/release-template.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/ISSUE_TEMPLATE/release-template.md b/.github/ISSUE_TEMPLATE/release-template.md index 1a80ba309f..b0904f59e9 100644 --- a/.github/ISSUE_TEMPLATE/release-template.md +++ b/.github/ISSUE_TEMPLATE/release-template.md @@ -20,3 +20,4 @@ v without deliberation - [ ] Create a new release in the changelog, using [`unclog`](https://github.com/informalsystems/unclog) - If doing a release candidate (`rc`) version, then skip the `unclog release` step - [ ] Reassign unfinished issues of previous milestone to the next milestone +- [ ] Notify the comms team about the pending new release and [prepare a message](https://www.notion.so/informalsystems/Communications-pipeline-b8c0eeb71dc24203a048fa6ccf189e1a?pvs=4) to announce it From 8217d1010c862ed13ba3754196951c53412be713 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Fri, 2 Feb 2024 15:32:32 +0100 Subject: [PATCH 020/200] Update link to IBC website (#3834) --- guide/src/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guide/src/index.md b/guide/src/index.md index 0b364cd9f9..329ec05641 100644 --- a/guide/src/index.md +++ b/guide/src/index.md @@ -74,7 +74,7 @@ Hermes is actively developed and maintained by [Informal Systems](https://inform - The official GitHub repository for Hermes. - [IBC GitHub repository](https://github.com/cosmos/ics) - The official repository for the Inter-blockchain protocol (IBC). - - [IBC Protocol](https://ibcprotocol.org) + - [IBC Protocol](https://www.ibcprotocol.dev) - The official IBC protocol page. ## Contact From fae51327fb2fbaacc10d1f67a6489b47aabf3488 Mon Sep 17 00:00:00 2001 From: Anca Zamfir Date: Fri, 2 Feb 2024 16:09:32 +0100 Subject: [PATCH 021/200] fix: use the consensus state at client latest height in status CLI (#3829) * Use the consensus state at client latest height in status CLI * Add changelog --- .../3814-status-use-client-latest-height.md | 3 +++ crates/relayer-cli/src/commands/query/client.rs | 17 +---------------- 2 files changed, 4 insertions(+), 16 deletions(-) create mode 100644 .changelog/unreleased/improvements/3814-status-use-client-latest-height.md diff --git a/.changelog/unreleased/improvements/3814-status-use-client-latest-height.md b/.changelog/unreleased/improvements/3814-status-use-client-latest-height.md new file mode 100644 index 0000000000..bf06bc6f8d --- /dev/null +++ b/.changelog/unreleased/improvements/3814-status-use-client-latest-height.md @@ -0,0 +1,3 @@ +- Use the consensus state at client latest height in status CLI ([#3814]) + +[#3814]: https://github.com/informalsystems/ibc-rs/issues/3814 diff --git a/crates/relayer-cli/src/commands/query/client.rs b/crates/relayer-cli/src/commands/query/client.rs index cd613df4df..30c0ba0cfc 100644 --- a/crates/relayer-cli/src/commands/query/client.rs +++ b/crates/relayer-cli/src/commands/query/client.rs @@ -1,6 +1,5 @@ use abscissa_core::clap::Parser; use abscissa_core::{Command, Runnable}; -use color_eyre::eyre::eyre; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::requests::{ @@ -318,24 +317,10 @@ fn client_status( return Ok(Status::Frozen); } - let consensus_state_heights = - chain.query_consensus_state_heights(QueryConsensusStateHeightsRequest { - client_id: client_id.clone(), - pagination: Some(PageRequest::all()), - })?; - - let latest_consensus_height = consensus_state_heights.last().copied().ok_or_else(|| { - eyre!( - "no consensus state found for client '{}' on chain '{}'", - client_id, - chain.id() - ) - })?; - let (latest_consensus_state, _) = chain.query_consensus_state( QueryConsensusStateRequest { client_id: client_id.clone(), - consensus_height: latest_consensus_height, + consensus_height: client_state.latest_height(), query_height: QueryHeight::Latest, }, IncludeProof::No, From 6a8d2d762c90a01d0de74df3d52eea3c936643fb Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Fri, 2 Feb 2024 16:09:56 +0100 Subject: [PATCH 022/200] Index fetched data by the given chain name to account for mismatch between name in chain registry and chain identifier (#3808) * Index fetched data by the given chain name to account for mismatch between name in chain registry and chain identifier * Show output when fetching chain data --- crates/chain-registry/src/asset_list.rs | 2 + crates/chain-registry/src/chain.rs | 2 + crates/chain-registry/src/fetchable.rs | 2 + crates/chain-registry/src/paths.rs | 2 + crates/relayer-cli/src/chain_registry.rs | 111 +++++++++++------- .../relayer-cli/src/commands/config/auto.rs | 29 +++-- 6 files changed, 94 insertions(+), 54 deletions(-) diff --git a/crates/chain-registry/src/asset_list.rs b/crates/chain-registry/src/asset_list.rs index a4edc40a8c..af0f513f03 100644 --- a/crates/chain-registry/src/asset_list.rs +++ b/crates/chain-registry/src/asset_list.rs @@ -45,6 +45,8 @@ pub struct LogoURIs { } impl Fetchable for AssetList { + const DESC: &'static str = "asset list"; + fn path(resource: &str) -> PathBuf { [resource, "assetlist.json"].iter().collect() } diff --git a/crates/chain-registry/src/chain.rs b/crates/chain-registry/src/chain.rs index 48434c404d..72c654160e 100644 --- a/crates/chain-registry/src/chain.rs +++ b/crates/chain-registry/src/chain.rs @@ -152,6 +152,8 @@ pub struct Grpc { } impl Fetchable for ChainData { + const DESC: &'static str = "chain data"; + fn path(resource: &str) -> PathBuf { [resource, "chain.json"].iter().collect() } diff --git a/crates/chain-registry/src/fetchable.rs b/crates/chain-registry/src/fetchable.rs index 4085849a36..bf66dedb6f 100644 --- a/crates/chain-registry/src/fetchable.rs +++ b/crates/chain-registry/src/fetchable.rs @@ -15,6 +15,8 @@ pub trait Fetchable where Self: DeserializeOwned, { + const DESC: &'static str; + /// The path of the fetchable resource. fn path(resource: &str) -> PathBuf; diff --git a/crates/chain-registry/src/paths.rs b/crates/chain-registry/src/paths.rs index 83f15e387e..e7cf1bc918 100644 --- a/crates/chain-registry/src/paths.rs +++ b/crates/chain-registry/src/paths.rs @@ -58,6 +58,8 @@ pub enum Tag { } impl Fetchable for IBCPath { + const DESC: &'static str = "IBC path"; + fn path(resource: &str) -> PathBuf { ["_IBC", resource].iter().collect() } diff --git a/crates/relayer-cli/src/chain_registry.rs b/crates/relayer-cli/src/chain_registry.rs index cbaae53590..04b28f21c6 100644 --- a/crates/relayer-cli/src/chain_registry.rs +++ b/crates/relayer-cli/src/chain_registry.rs @@ -8,7 +8,7 @@ use futures::future::join_all; use http::Uri; use ibc_relayer::config::dynamic_gas::DynamicGasPrice; use tokio::task::{JoinError, JoinHandle}; -use tracing::trace; +use tracing::{error, trace}; use ibc_chain_registry::asset_list::AssetList; use ibc_chain_registry::chain::ChainData; @@ -213,15 +213,21 @@ where /// Returns a vector of handles that need to be awaited in order to access the fetched data, or the /// error that occurred while fetching. async fn get_handles( - resources: &[String], + chain_ids: &[String], commit: &Option, -) -> Vec>> { - let handles = resources +) -> Vec<(String, JoinHandle>)> { + let handles = chain_ids .iter() - .map(|resource| { - let resource = resource.to_string(); + .map(|chain_id| { let commit = commit.clone(); - tokio::spawn(async move { T::fetch(resource, commit).await }) + let handle = { + let chain_id = chain_id.to_string(); + tokio::spawn(async move { + tracing::info!("{chain_id}: Fetching {}...", T::DESC); + T::fetch(chain_id, commit).await + }) + }; + (chain_id.to_string(), handle) }) .collect(); handles @@ -230,14 +236,18 @@ async fn get_handles( /// Given a vector of handles, awaits them and returns a vector of results. Any errors /// that occurred are mapped to a `RegistryError`. async fn get_data_from_handles( - handles: Vec>>, + handles: Vec<(String, JoinHandle>)>, error_task: &str, -) -> Result>, RegistryError> { - join_all(handles) +) -> Result)>, RegistryError> { + let (names, tasks): (Vec<_>, Vec<_>) = handles.into_iter().unzip(); + + let results = join_all(tasks) .await .into_iter() .collect::, JoinError>>() - .map_err(|e| RegistryError::join_error(error_task.to_string(), e)) + .map_err(|e| RegistryError::join_error(error_task.to_string(), e))?; + + Ok(names.into_iter().zip(results).collect()) } /// Fetches a list of ChainConfigs specified by the given slice of chain names. These @@ -260,17 +270,17 @@ async fn get_data_from_handles( pub async fn get_configs( chains: &[String], commit: Option, -) -> Result>, RegistryError> { - let n = chains.len(); - - if n == 0 { - return Ok(Vec::new()); +) -> Result>, RegistryError> { + if chains.is_empty() { + return Ok(HashMap::new()); } // Spawn tasks to fetch data from the chain-registry let chain_data_handle = get_handles::(chains, &commit).await; let asset_lists_handle = get_handles::(chains, &commit).await; + let n = chains.len(); + let mut path_handles = Vec::with_capacity(n * (n - 1) / 2); for i in 0..n { @@ -290,43 +300,65 @@ pub async fn get_configs( let asset_list_results = get_data_from_handles::(asset_lists_handle, "asset_handle_join").await?; - let chain_data_array: Vec = chain_data_results + let chain_data_array: Vec<(String, ChainData)> = chain_data_results .into_iter() - .filter_map(|chain_data| chain_data.ok()) + .filter_map(|(name, data)| match data { + Ok(data) => Some((name, data)), + Err(e) => { + error!("Error while fetching chain data for chain {name}: {e}"); + None + } + }) .collect(); - let asset_lists: Vec = asset_list_results + + let asset_lists: Vec<(String, AssetList)> = asset_list_results .into_iter() - .filter_map(|asset_list| asset_list.ok()) + .filter_map(|(name, assets)| match assets { + Ok(assets) => Some((name, assets)), + Err(e) => { + error!("Error while fetching asset list for chain {name}: {e}"); + None + } + }) .collect(); let path_data: Result, JoinError> = join_all(path_handles).await.into_iter().collect(); - let path_data: Vec = path_data + let path_data: Vec<_> = path_data .map_err(|e| RegistryError::join_error("path_handle_join".to_string(), e))? .into_iter() - .filter_map(|path| path.ok()) + .filter_map(|path| match path { + Ok(path) => Some(path), + Err(e) => { + error!("Error while fetching path data: {e}"); + None + } + }) .collect(); let mut packet_filters = construct_packet_filters(path_data); // Construct ChainConfig - let config_handles: Vec>> = chain_data_array + let config_handles: Vec<_> = chain_data_array .into_iter() .zip(asset_lists.into_iter()) - .zip(chains.iter()) - .map(|((chain_data, assets), chain_name)| { - let packet_filter = packet_filters.remove(chain_name); - tokio::spawn(async move { - hermes_config::< - GrpcHealthCheckQuerier, - SimpleHermesRpcQuerier, - SimpleGrpcFormatter, - >(chain_data, assets, packet_filter) - .await - }) + .map(|((chain_name, chain_data), (_, assets))| { + let packet_filter = packet_filters.remove(&chain_name); + let handle = tokio::spawn(hermes_config::< + GrpcHealthCheckQuerier, + SimpleHermesRpcQuerier, + SimpleGrpcFormatter, + >(chain_data, assets, packet_filter)); + + (chain_name, handle) }) .collect(); - get_data_from_handles::(config_handles, "config_handle_join").await + let result = get_data_from_handles::(config_handles, "config_handle_join") + .await? + .into_iter() + .collect(); + + Ok(result) } /// Concurrent RPC and GRPC queries are likely to fail. @@ -350,7 +382,7 @@ mod tests { async fn should_have_no_filter(test_chains: &[String]) -> Result<(), RegistryError> { let configs = get_configs(test_chains, Some(TEST_COMMIT.to_owned())).await?; - for config in configs { + for (_name, config) in configs { match config { Ok(config) => { assert_eq!( @@ -358,10 +390,7 @@ mod tests { ChannelPolicy::AllowAll ); } - Err(e) => panic!( - "Encountered an unexpected error in chain registry test: {}", - e - ), + Err(e) => panic!("Encountered an unexpected error in chain registry test: {e}"), } } @@ -380,7 +409,7 @@ mod tests { let configs = get_configs(test_chains, Some(TEST_COMMIT.to_owned())).await?; - for config in configs { + for (_name, config) in configs { match config { Ok(config) => match &config.packet_filter().channel_policy { ChannelPolicy::Allow(channel_filter) => { diff --git a/crates/relayer-cli/src/commands/config/auto.rs b/crates/relayer-cli/src/commands/config/auto.rs index 64241d030d..3c866ec304 100644 --- a/crates/relayer-cli/src/commands/config/auto.rs +++ b/crates/relayer-cli/src/commands/config/auto.rs @@ -81,18 +81,17 @@ impl Runnable for AutoCmd { // Extract keys and sort chains by name let names_and_keys = extract_chains_and_keys(&self.chain_names); - let sorted_names = names_and_keys + + let chain_names = names_and_keys .iter() - .map(|n| &n.0) + .map(|(n, _)| n) .cloned() .collect::>(); - let sorted_names_set: HashSet = HashSet::from_iter(sorted_names.iter().cloned()); - let commit = self.commit.clone(); // Fetch chain configs from the chain registry - let config_results = runtime.block_on(get_configs(&sorted_names, commit)); + let config_results = runtime.block_on(get_configs(&chain_names, commit)); if let Err(e) = config_results { let config = Config::default(); @@ -113,22 +112,26 @@ impl Runnable for AutoCmd { } }; - let mut chain_configs: Vec = config_results + let mut chain_configs: Vec<(String, ChainConfig)> = config_results .unwrap() .into_iter() - .filter_map(|r| r.ok()) + .filter_map(|(name, config)| config.ok().map(|c| (name, c))) .collect(); // Determine which chains were not fetched - let fetched_chains_set = HashSet::from_iter(chain_configs.iter().map(|c| c.id().name())); - let missing_chains_set: HashSet<_> = - sorted_names_set.difference(&fetched_chains_set).collect(); + let fetched_chains_set: HashSet<_> = + HashSet::from_iter(chain_configs.iter().map(|(name, _)| name).cloned()); + let expected_chains_set: HashSet<_> = HashSet::from_iter(chain_names.iter().cloned()); + + let missing_chains_set: HashSet<_> = expected_chains_set + .difference(&fetched_chains_set) + .collect(); let configs_and_keys = chain_configs .iter_mut() - .zip(names_and_keys.iter().map(|n| &n.1).cloned()); + .zip(names_and_keys.iter().map(|(_, keys)| keys).cloned()); - for (chain_config, key_option) in configs_and_keys { + for ((_name, chain_config), key_option) in configs_and_keys { // If a key is provided, use it if let Some(key_name) = key_option { info!("{}: uses key \"{}\"", &chain_config.id(), &key_name); @@ -148,7 +151,7 @@ impl Runnable for AutoCmd { } let config = Config { - chains: chain_configs, + chains: chain_configs.into_iter().map(|(_, c)| c).collect(), ..Config::default() }; From afc46a752c5a1a366e15df87def2a875167d97c4 Mon Sep 17 00:00:00 2001 From: Anca Zamfir Date: Fri, 2 Feb 2024 16:10:25 +0100 Subject: [PATCH 023/200] fix: add syncing check for gRPC node (#3833) * Add syncing check for gRPC node. * Fix comment. * Add changelog --- .../improvements/3814-grpc-syncing.md | 3 + crates/relayer/src/chain/cosmos.rs | 81 ++++++++++++++++++- 2 files changed, 80 insertions(+), 4 deletions(-) create mode 100644 .changelog/unreleased/improvements/3814-grpc-syncing.md diff --git a/.changelog/unreleased/improvements/3814-grpc-syncing.md b/.changelog/unreleased/improvements/3814-grpc-syncing.md new file mode 100644 index 0000000000..877555aa43 --- /dev/null +++ b/.changelog/unreleased/improvements/3814-grpc-syncing.md @@ -0,0 +1,3 @@ +- Add syncing check for gRPC node ([#3814]) + +[#3814]: https://github.com/informalsystems/ibc-rs/issues/3814 diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index d5ccc13242..f681ce1ee7 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -16,6 +16,8 @@ use tonic::metadata::AsciiMetadataValue; use tracing::{debug, error, info, instrument, trace, warn}; use ibc_proto::cosmos::base::node::v1beta1::ConfigResponse; +use ibc_proto::cosmos::base::tendermint::v1beta1::service_client::ServiceClient; +use ibc_proto::cosmos::base::tendermint::v1beta1::{GetSyncingRequest, GetSyncingResponse}; use ibc_proto::cosmos::staking::v1beta1::Params as StakingParams; use ibc_proto::ibc::apps::fee::v1::{ QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, @@ -628,27 +630,98 @@ impl CosmosSdkChain { /// /// Returns an error if the node is still syncing and has not caught up, /// ie. if `sync_info.catching_up` is `true`. - fn chain_status(&self) -> Result { + fn chain_rpc_status(&self) -> Result { crate::time!( - "chain_status", + "chain_rpc_status", { "src_chain": self.config().id.to_string(), } ); - crate::telemetry!(query, self.id(), "status"); + crate::telemetry!(query, self.id(), "rpc_status"); let status = self .block_on(self.rpc_client.status()) .map_err(|e| Error::rpc(self.config.rpc_addr.clone(), e))?; if status.sync_info.catching_up { + Err(Error::chain_not_caught_up( + self.config.rpc_addr.to_string(), + self.config().id.clone(), + )) + } else { + Ok(status) + } + } + + /// Query the chain syncing status via a gRPC query. + /// + /// Returns an error if the node is still syncing and has not caught up, + /// ie. if `sync_info.syncing` is `true`. + fn chain_grpc_status(&self) -> Result { + crate::time!( + "chain_grpc_status", + { + "src_chain": self.config().id.to_string(), + } + ); + crate::telemetry!(query, self.id(), "grpc_status"); + + let grpc_addr = self.grpc_addr.clone(); + let grpc_addr_string = grpc_addr.to_string(); + + let mut client = self + .block_on(ServiceClient::connect(grpc_addr.clone())) + .map_err(Error::grpc_transport) + .unwrap(); + + let request = tonic::Request::new(GetSyncingRequest {}); + + let sync_info = self + .block_on(client.get_syncing(request)) + .map_err(|e| Error::grpc_status(e, "get_syncing".to_string()))? + .into_inner(); + + if sync_info.syncing { + Err(Error::chain_not_caught_up( + grpc_addr_string, + self.config().id.clone(), + )) + } else { + Ok(sync_info) + } + } + + /// Query the chain status of the RPC and gRPC nodes. + /// + /// Returns an error if any of the node is still syncing and has not caught up. + fn chain_status(&self) -> Result { + crate::time!( + "chain_status", + { + "src_chain": self.config().id.to_string(), + } + ); + crate::telemetry!(query, self.id(), "status"); + + let rpc_status = self.chain_rpc_status()?; + + if rpc_status.sync_info.catching_up { return Err(Error::chain_not_caught_up( self.config.rpc_addr.to_string(), self.config().id.clone(), )); } - Ok(status) + let grpc_status = self.chain_grpc_status()?; + + if grpc_status.syncing { + return Err(Error::chain_not_caught_up( + self.config.grpc_addr.to_string(), + self.config().id.clone(), + )); + } + + Ok(rpc_status) } /// Query the chain's latest height From fe80bdfcd8cb736c253a0741395d54734fd1759f Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 6 Feb 2024 17:40:33 +0100 Subject: [PATCH 024/200] Use cosmos.nix S3 cache on CI (#3842) --- .github/workflows/integration.yaml | 105 +++++++++++----------------- .github/workflows/misbehaviour.yml | 52 ++++++-------- .github/workflows/multi-chains.yaml | 15 ++-- 3 files changed, 68 insertions(+), 104 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index bc9f4a5427..188878792b 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -98,15 +98,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v25 - with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install - install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - extra_nix_config: | - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v14 - with: - name: cosmos + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -137,15 +134,12 @@ jobs: timeout-minutes: 60 steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v25 - with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install - install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - extra_nix_config: | - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v14 - with: - name: cosmos + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -181,15 +175,12 @@ jobs: account_prefix: cosmos,neutron steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v25 - with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install - install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - extra_nix_config: | - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v14 - with: - name: cosmos + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -227,15 +218,12 @@ jobs: account_prefix: cosmos,stride steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v25 - with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install - install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - extra_nix_config: | - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v14 - with: - name: cosmos + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -273,15 +261,12 @@ jobs: account_prefix: cosmos,stride steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v25 - with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install - install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - extra_nix_config: | - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v14 - with: - name: cosmos + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -320,15 +305,12 @@ jobs: native_token: utia,stake steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v25 - with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install - install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - extra_nix_config: | - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v14 - with: - name: cosmos + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - uses: actions-rs/toolchain@v1 with: toolchain: stable @@ -362,15 +344,12 @@ jobs: - gaia6 steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v25 - with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install - install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - extra_nix_config: | - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v14 - with: - name: cosmos + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - uses: actions-rs/toolchain@v1 with: toolchain: stable diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index 629ce08faf..724e55b93f 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -49,14 +49,11 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v25 - with: - extra_nix_config: | - experimental-features = nix-command flakes - - name: Use cachix cache - uses: cachix/cachix-action@v14 - with: - name: cosmos + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - name: Install sconfig uses: jaxxstorm/action-install-gh-release@v1.10.0 with: @@ -103,14 +100,11 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v25 - with: - extra_nix_config: | - experimental-features = nix-command flakes - - name: Use cachix cache - uses: cachix/cachix-action@v14 - with: - name: cosmos + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - name: Install sconfig uses: jaxxstorm/action-install-gh-release@v1.10.0 with: @@ -157,14 +151,11 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v25 - with: - extra_nix_config: | - experimental-features = nix-command flakes - - name: Use cachix cache - uses: cachix/cachix-action@v14 - with: - name: cosmos + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - name: Install sconfig uses: jaxxstorm/action-install-gh-release@v1.10.0 with: @@ -212,14 +203,11 @@ jobs: steps: - uses: actions/checkout@v4 - name: Install Nix - uses: cachix/install-nix-action@v25 - with: - extra_nix_config: | - experimental-features = nix-command flakes - - name: Use cachix cache - uses: cachix/cachix-action@v14 - with: - name: cosmos + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - name: Install sconfig uses: jaxxstorm/action-install-gh-release@v1.10.0 with: diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index 63edbede02..0b8a026495 100644 --- a/.github/workflows/multi-chains.yaml +++ b/.github/workflows/multi-chains.yaml @@ -83,15 +83,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: cachix/install-nix-action@v25 - with: - install_url: https://nixos-nix-install-tests.cachix.org/serve/vij683ly7sl95nnhb67bdjjfabclr85m/install - install_options: '--tarball-url-prefix https://nixos-nix-install-tests.cachix.org/serve' - extra_nix_config: | - experimental-features = nix-command flakes - - uses: cachix/cachix-action@v14 - with: - name: cosmos + - name: Install Nix + uses: DeterminateSystems/nix-installer-action@main + with: + extra-conf: | + substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - uses: actions-rs/toolchain@v1 with: toolchain: stable From 53071518fe5b286846384a4a46bf078a51beeccf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 7 Feb 2024 10:21:39 +0100 Subject: [PATCH 025/200] Bump ics23 from 0.11.0 to 0.11.1 (#3839) Bumps [ics23](https://github.com/cosmos/ics23) from 0.11.0 to 0.11.1. - [Release notes](https://github.com/cosmos/ics23/releases) - [Changelog](https://github.com/cosmos/ics23/blob/master/CHANGELOG.md) - [Commits](https://github.com/cosmos/ics23/compare/rust/v0.11.0...rust/v0.11.1) --- updated-dependencies: - dependency-name: ics23 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 76 ++++++++++++++++++++++----------- crates/relayer-types/Cargo.toml | 2 +- 2 files changed, 52 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6d40be1bc6..c1634b1cb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -125,6 +125,18 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "async-stream" version = "0.3.5" @@ -261,12 +273,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -338,6 +344,28 @@ version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "blake3" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if 1.0.0", + "constant_time_eq", +] + [[package]] name = "block-buffer" version = "0.9.0" @@ -560,6 +588,12 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + [[package]] name = "contracts" version = "0.6.3" @@ -1453,11 +1487,11 @@ version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd4ee32b22d3b06f31529b956f4928e5c9a068d71e46cf6abfa19c31ca550553" dependencies = [ - "base64 0.21.7", + "base64", "bytes", "flex-error", "ics23", - "informalsystems-pbjson 0.7.0", + "informalsystems-pbjson", "prost", "serde", "subtle-encoding", @@ -1675,14 +1709,16 @@ dependencies = [ [[package]] name = "ics23" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "661e2d6f79952a65bc92b1c81f639ebd37228dae6ff412a5aba7d474bdc4b957" +checksum = "dc3b8be84e7285c73b88effdc3294b552277d6b0ec728ee016c861b7b9a2c19c" dependencies = [ "anyhow", + "blake2", + "blake3", "bytes", "hex", - "informalsystems-pbjson 0.6.0", + "informalsystems-pbjson", "prost", "ripemd", "serde", @@ -1741,23 +1777,13 @@ dependencies = [ "hashbrown 0.14.3", ] -[[package]] -name = "informalsystems-pbjson" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eecd90f87bea412eac91c6ef94f6b1e390128290898cbe14f2b926787ae1fb" -dependencies = [ - "base64 0.13.1", - "serde", -] - [[package]] name = "informalsystems-pbjson" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aa4a0980c8379295100d70854354e78df2ee1c6ca0f96ffe89afeb3140e3a3d" dependencies = [ - "base64 0.21.7", + "base64", "serde", ] @@ -2498,7 +2524,7 @@ version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ - "base64 0.21.7", + "base64", "bytes", "encoding_rs", "futures-core", @@ -2635,7 +2661,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.7", + "base64", ] [[package]] @@ -3626,7 +3652,7 @@ dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.21.7", + "base64", "bytes", "h2", "http", diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 38cb6d710e..4814ef7b87 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -25,7 +25,7 @@ mocks = ["tendermint-testgen", "clock"] [dependencies] # Proto definitions for all IBC-related interfaces, e.g., connections or channels. ibc-proto = { version = "0.41.0", features = ["serde"] } -ics23 = { version = "0.11.0", features = ["std", "host-functions"] } +ics23 = { version = "0.11.1", features = ["std", "host-functions"] } time = { version = "0.3" } serde_derive = { version = "1.0.104" } serde = { version = "1.0" } From 7cfb234408da28961464d1634c4a556c38212e0d Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 8 Feb 2024 11:58:41 +0100 Subject: [PATCH 026/200] Build multi-platform image on macOS runner to speed up build (#3843) --- .github/workflows/docker.yml | 93 ++++++++---------------------------- 1 file changed, 19 insertions(+), 74 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5b3ac9891e..14e6875d8a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,15 +13,9 @@ env: jobs: docker-build: - runs-on: ubuntu-latest + runs-on: macos-14 strategy: fail-fast: false - matrix: - platform: - - id: linux/amd64 - name: amd64 - - id: linux/arm64 - name: arm64 steps: - name: Checkout uses: actions/checkout@v4 @@ -31,13 +25,15 @@ jobs: uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY_IMAGE }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + tags: | + type=ref,event=tag + type=ref,event=workflow_dispatch - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 + with: + platforms: linux/amd64,linux/arm64 - name: Login to Docker Hub uses: docker/login-action@v3 @@ -45,78 +41,27 @@ jobs: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - name: Build and push by digest + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push id: build uses: docker/build-push-action@v5 with: context: . file: ./ci/release/hermes.Dockerfile - platforms: ${{ matrix.platform.id }} - labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true + platforms: linux/amd64,linux/arm64 + push: true cache-from: type=gha cache-to: type=gha,mode=max - - - name: Export digest - run: | - mkdir -p /tmp/digests - digest="${{ steps.build.outputs.digest }}" - touch "/tmp/digests/${digest#sha256:}" - - - name: Upload digest - uses: actions/upload-artifact@v4 - with: - name: digests-${{ matrix.platform.name }} - path: /tmp/digests/* - if-no-files-found: error - retention-days: 1 - - docker-merge: - runs-on: ubuntu-latest - needs: - - docker-build - steps: - - name: Download digests - uses: actions/download-artifact@v4 - with: - pattern: digests-* - merge-multiple: true - path: /tmp/digests - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY_IMAGE }} - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - - name: Create manifest list and push - working-directory: /tmp/digests - run: | - docker buildx imagetools create --tag ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} \ - $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) + tags: | + ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} + ghcr.io/${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} - name: Inspect image run: | docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Push image to GHCR - run: | - docker buildx imagetools create \ - --tag ghcr.io/${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} \ - ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} From 5cde31baf4cac5c0480d38238ca3661a6878b187 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 8 Feb 2024 15:29:35 +0100 Subject: [PATCH 027/200] Remove assumption that ICS-04 packet data is a valid UTF-8 string (#3768) * Do not assume JSON-encoded packet data by using the `packet_data_hex` attribute instead of deprecated `packet_data` Relying on the `packet_data` attribute enforces a UTF-8 encoded payload (eg. JSON), disallowing Protobuf-encoded payloads which we are starting to see in the wild. The `packet_data` atttribute has been deprecated in favor of `packet_data_hex` since IBC-Go v1.0.0. [0] [0]: https://github.com/cosmos/ibc-go/blob/fadf8f2b0ab184798d021d220d877e00c7634e26/CHANGELOG.md?plain=1#L1417 * Ensure packet data is encoded to/decoded from lowercase hex * Refactor conversion from `RawObject` to `Packet` * Revert change in JSON serialization of packet data case as hex * Decode packets from `packet_data_hex` in NewBlock events as well * Bump ibc-proto to v0.41.0 * Use branch of ibc-proto with support for invalid UTF-8 event attributes * Update ibc-proto to v0.42.0 to finalize fix for non-UTF-8 packet data (#3844) * Add legacy message to register ICA account for ibc-go versions prior to v8.1.0 --------- Co-authored-by: Luca Joss --- .../ibc-relayer/3770-non-utf8-packet-data.md | 6 ++ Cargo.lock | 4 +- crates/chain-registry/Cargo.toml | 2 +- crates/relayer-types/Cargo.toml | 2 +- .../src/applications/ics27_ica/error.rs | 8 ++- .../applications/ics27_ica/msgs/register.rs | 63 +++++++++++++++++++ .../src/core/ics04_channel/channel.rs | 13 +++- .../src/core/ics04_channel/error.rs | 8 +++ .../src/core/ics04_channel/events.rs | 5 +- .../ics04_channel/msgs/chan_close_confirm.rs | 5 ++ .../ics04_channel/msgs/timeout_on_close.rs | 5 ++ crates/relayer-types/src/events.rs | 6 +- crates/relayer-types/src/mock/client_state.rs | 2 + crates/relayer/Cargo.toml | 2 +- .../relayer/src/chain/cosmos/query/custom.rs | 2 +- .../src/chain/cosmos/types/events/channel.rs | 26 +++++--- crates/relayer/src/channel.rs | 4 ++ crates/relayer/src/event.rs | 10 ++- .../src/event/source/websocket/extract.rs | 2 +- crates/relayer/src/link/relay_path.rs | 1 + tools/test-framework/Cargo.toml | 2 +- tools/test-framework/src/chain/ext/ica.rs | 4 +- 22 files changed, 150 insertions(+), 32 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer/3770-non-utf8-packet-data.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/3770-non-utf8-packet-data.md b/.changelog/unreleased/bug-fixes/ibc-relayer/3770-non-utf8-packet-data.md new file mode 100644 index 0000000000..ab7a573fcb --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer/3770-non-utf8-packet-data.md @@ -0,0 +1,6 @@ +- Allow relaying ICS-04 packets with non-UTF-8 payloads ([\#3770](https://github.com/informalsystems/hermes/issues/3770)) + Hermes does not assume anymore that an ICS-04 packet data is valid UTF-8, + by using the `packet_data_hex` attribute when assembling a packet from events, instead of the deprecated `packet_data` attribute. + Relying on the `packet_data` attribute enforces a UTF-8 encoded payload (eg. JSON), disallowing eg. Protobuf-encoded payloads. + The `packet_data` atttribute [has been deprecated][0] in favor of `packet_data_hex` since IBC-Go v1.0.0. + [0]: https://github.com/cosmos/ibc-go/blob/fadf8f2b0ab184798d021d220d877e00c7634e26/CHANGELOG.md?plain=1#L1417 diff --git a/Cargo.lock b/Cargo.lock index c1634b1cb7..bdb2899b5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1483,9 +1483,9 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4ee32b22d3b06f31529b956f4928e5c9a068d71e46cf6abfa19c31ca550553" +checksum = "80701a1b0e0ade6f28071d7d2d6412e01869f22bb7039f52722161ecdeb083e0" dependencies = [ "base64", "bytes", diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index d64dcf5f9e..e90d844b40 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -13,7 +13,7 @@ description = """ [dependencies] ibc-relayer-types = { version = "0.27.0", path = "../relayer-types" } -ibc-proto = { version = "0.41.0", features = ["serde"] } +ibc-proto = { version = "0.42.0", features = ["serde"] } tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } async-trait = "0.1.72" diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 4814ef7b87..2248b01dba 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -24,7 +24,7 @@ mocks = ["tendermint-testgen", "clock"] [dependencies] # Proto definitions for all IBC-related interfaces, e.g., connections or channels. -ibc-proto = { version = "0.41.0", features = ["serde"] } +ibc-proto = { version = "0.42.0", features = ["serde"] } ics23 = { version = "0.11.1", features = ["std", "host-functions"] } time = { version = "0.3" } serde_derive = { version = "1.0.104" } diff --git a/crates/relayer-types/src/applications/ics27_ica/error.rs b/crates/relayer-types/src/applications/ics27_ica/error.rs index 52f2027496..4143b2467f 100644 --- a/crates/relayer-types/src/applications/ics27_ica/error.rs +++ b/crates/relayer-types/src/applications/ics27_ica/error.rs @@ -8,11 +8,15 @@ define_error! { Error { Owner [ SignerError ] - | _ | { "failed to parse owner" }, + | _ | { "failed to parse owner" }, InvalidConnectionIdentifier [ ValidationError ] - | _ | { "connection identifier error" }, + | _ | { "connection identifier error" }, + + InvalidOrdering + { ordering: i32 } + | e | { format_args!("invalid ordering: {}", e.ordering) }, InvalidPacketData | _ | { "packet data is None" }, diff --git a/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs b/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs index 9c73c9de93..082cae11ed 100644 --- a/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs +++ b/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs @@ -4,6 +4,7 @@ use ibc_proto::ibc::applications::interchain_accounts::controller::v1::MsgRegist use ibc_proto::Protobuf; use crate::applications::ics27_ica::error::Error; +use crate::core::ics04_channel::channel::Ordering; use crate::core::ics04_channel::version::Version; use crate::core::ics24_host::error::ValidationError; use crate::core::ics24_host::identifier::ConnectionId; @@ -18,6 +19,7 @@ pub struct MsgRegisterInterchainAccount { pub owner: Signer, pub connection_id: ConnectionId, pub version: Version, + pub ordering: Ordering, } impl Msg for MsgRegisterInterchainAccount { @@ -46,6 +48,8 @@ impl TryFrom for MsgRegisterInterchainAccount { .parse() .map_err(Error::invalid_connection_identifier)?, version: value.version.into(), + ordering: Ordering::from_i32(value.ordering) + .map_err(|_| Error::invalid_ordering(value.ordering))?, }) } } @@ -56,6 +60,65 @@ impl From for RawMsgRegisterInterchainAccount { owner: value.owner.to_string(), connection_id: value.connection_id.to_string(), version: value.version.to_string(), + ordering: value.ordering as i32, + } + } +} + +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct LegacyRawMsgRegisterInterchainAccount { + #[prost(string, tag = "1")] + pub owner: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub connection_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub version: ::prost::alloc::string::String, +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub struct LegacyMsgRegisterInterchainAccount { + pub owner: Signer, + pub connection_id: ConnectionId, + pub version: Version, +} + +impl Msg for LegacyMsgRegisterInterchainAccount { + type ValidationError = ValidationError; + type Raw = LegacyRawMsgRegisterInterchainAccount; + + fn route(&self) -> String { + crate::keys::ROUTER_KEY.to_string() + } + + fn type_url(&self) -> String { + TYPE_URL.to_string() + } +} + +impl Protobuf for LegacyMsgRegisterInterchainAccount {} + +impl TryFrom for LegacyMsgRegisterInterchainAccount { + type Error = Error; + + fn try_from(value: LegacyRawMsgRegisterInterchainAccount) -> Result { + Ok(LegacyMsgRegisterInterchainAccount { + owner: value.owner.parse().map_err(Error::owner)?, + connection_id: value + .connection_id + .parse() + .map_err(Error::invalid_connection_identifier)?, + version: value.version.into(), + }) + } +} + +impl From for LegacyRawMsgRegisterInterchainAccount { + fn from(value: LegacyMsgRegisterInterchainAccount) -> Self { + LegacyRawMsgRegisterInterchainAccount { + owner: value.owner.to_string(), + connection_id: value.connection_id.to_string(), + version: value.version.to_string(), } } } diff --git a/crates/relayer-types/src/core/ics04_channel/channel.rs b/crates/relayer-types/src/core/ics04_channel/channel.rs index 0205e2998a..fa975a90e8 100644 --- a/crates/relayer-types/src/core/ics04_channel/channel.rs +++ b/crates/relayer-types/src/core/ics04_channel/channel.rs @@ -43,6 +43,7 @@ impl TryFrom for IdentifiedChannelEnd { counterparty: value.counterparty, connection_hops: value.connection_hops, version: value.version, + upgrade_sequence: value.upgrade_sequence, }; Ok(IdentifiedChannelEnd { @@ -68,6 +69,7 @@ impl From for RawIdentifiedChannel { version: value.channel_end.version.to_string(), port_id: value.port_id.to_string(), channel_id: value.channel_id.to_string(), + upgrade_sequence: value.channel_end.upgrade_sequence, } } } @@ -79,14 +81,15 @@ pub struct ChannelEnd { pub remote: Counterparty, pub connection_hops: Vec, pub version: Version, + pub upgrade_sequence: u64, } impl Display for ChannelEnd { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!( f, - "ChannelEnd {{ state: {}, ordering: {}, remote: {}, connection_hops: {}, version: {} }}", - self.state, self.ordering, self.remote, PrettySlice(&self.connection_hops), self.version + "ChannelEnd {{ state: {}, ordering: {}, remote: {}, connection_hops: {}, version: {}, upgrade_sequence: {} }}", + self.state, self.ordering, self.remote, PrettySlice(&self.connection_hops), self.version, self.upgrade_sequence ) } } @@ -99,6 +102,7 @@ impl Default for ChannelEnd { remote: Counterparty::default(), connection_hops: Vec::new(), version: Version::default(), + upgrade_sequence: 0, } } } @@ -139,6 +143,7 @@ impl TryFrom for ChannelEnd { remote, connection_hops, version, + value.upgrade_sequence, )) } } @@ -155,6 +160,7 @@ impl From for RawChannel { .map(|v| v.as_str().to_string()) .collect(), version: value.version.to_string(), + upgrade_sequence: value.upgrade_sequence, } } } @@ -167,6 +173,7 @@ impl ChannelEnd { remote: Counterparty, connection_hops: Vec, version: Version, + upgrade_sequence: u64, ) -> Self { Self { state, @@ -174,6 +181,7 @@ impl ChannelEnd { remote, connection_hops, version, + upgrade_sequence, } } @@ -459,6 +467,7 @@ pub mod test_util { counterparty: Some(get_dummy_raw_counterparty()), connection_hops: vec![ConnectionId::default().to_string()], version: "ics20".to_string(), // The version is not validated. + upgrade_sequence: 0, } } } diff --git a/crates/relayer-types/src/core/ics04_channel/error.rs b/crates/relayer-types/src/core/ics04_channel/error.rs index 817f0337f8..49fe8c77e9 100644 --- a/crates/relayer-types/src/core/ics04_channel/error.rs +++ b/crates/relayer-types/src/core/ics04_channel/error.rs @@ -191,6 +191,14 @@ define_error! { e.given_sequence, e.next_sequence) }, + InvalidPacketData + { + data: String, + } + | e | { + format_args!("Invalid packet data, not a valid hex-encoded string: {}", e.data) + }, + LowPacketHeight { chain_height: Height, diff --git a/crates/relayer-types/src/core/ics04_channel/events.rs b/crates/relayer-types/src/core/ics04_channel/events.rs index 3f6d7c4382..24dd66dceb 100644 --- a/crates/relayer-types/src/core/ics04_channel/events.rs +++ b/crates/relayer-types/src/core/ics04_channel/events.rs @@ -1,8 +1,9 @@ //! Types for the IBC events emitted from Tendermint Websocket by the channels module. -use serde_derive::{Deserialize, Serialize}; use std::fmt::{Display, Error as FmtError, Formatter}; use std::str; + +use serde_derive::{Deserialize, Serialize}; use tendermint::abci; use crate::core::ics04_channel::error::Error; @@ -21,7 +22,7 @@ pub const COUNTERPARTY_PORT_ID_ATTRIBUTE_KEY: &str = "counterparty_port_id"; /// Packet event attribute keys pub const PKT_SEQ_ATTRIBUTE_KEY: &str = "packet_sequence"; -pub const PKT_DATA_ATTRIBUTE_KEY: &str = "packet_data"; +pub const PKT_DATA_ATTRIBUTE_KEY: &str = "packet_data_hex"; pub const PKT_SRC_PORT_ATTRIBUTE_KEY: &str = "packet_src_port"; pub const PKT_SRC_CHANNEL_ATTRIBUTE_KEY: &str = "packet_src_channel"; pub const PKT_DST_PORT_ATTRIBUTE_KEY: &str = "packet_dst_port"; diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs index e29872320d..33b4873899 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs @@ -20,6 +20,7 @@ pub struct MsgChannelCloseConfirm { pub channel_id: ChannelId, pub proofs: Proofs, pub signer: Signer, + pub counterparty_upgrade_sequence: u64, } impl MsgChannelCloseConfirm { @@ -29,6 +30,7 @@ impl MsgChannelCloseConfirm { channel_id, proofs, signer, + counterparty_upgrade_sequence: 0, } } } @@ -73,6 +75,7 @@ impl TryFrom for MsgChannelCloseConfirm { channel_id: raw_msg.channel_id.parse().map_err(Error::identifier)?, proofs, signer: raw_msg.signer.parse().map_err(Error::signer)?, + counterparty_upgrade_sequence: raw_msg.counterparty_upgrade_sequence, }) } } @@ -85,6 +88,7 @@ impl From for RawMsgChannelCloseConfirm { proof_init: domain_msg.proofs.object_proof().clone().into(), proof_height: Some(domain_msg.proofs.height().into()), signer: domain_msg.signer.to_string(), + counterparty_upgrade_sequence: domain_msg.counterparty_upgrade_sequence, } } } @@ -109,6 +113,7 @@ pub mod test_util { revision_height: proof_height, }), signer: get_dummy_bech32_account(), + counterparty_upgrade_sequence: 0, } } } diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs b/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs index 8d6fc5e970..57e1cdacae 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs @@ -18,6 +18,7 @@ pub struct MsgTimeoutOnClose { pub next_sequence_recv: Sequence, pub proofs: Proofs, pub signer: Signer, + pub counterparty_upgrade_sequence: u64, } impl MsgTimeoutOnClose { @@ -32,6 +33,7 @@ impl MsgTimeoutOnClose { next_sequence_recv, proofs, signer, + counterparty_upgrade_sequence: 0, } } } @@ -86,6 +88,7 @@ impl TryFrom for MsgTimeoutOnClose { next_sequence_recv: Sequence::from(raw_msg.next_sequence_recv), signer: raw_msg.signer.parse().map_err(Error::signer)?, proofs, + counterparty_upgrade_sequence: raw_msg.counterparty_upgrade_sequence, }) } } @@ -102,6 +105,7 @@ impl From for RawMsgTimeoutOnClose { proof_height: Some(domain_msg.proofs.height().into()), next_sequence_recv: domain_msg.next_sequence_recv.into(), signer: domain_msg.signer.to_string(), + counterparty_upgrade_sequence: domain_msg.counterparty_upgrade_sequence, } } } @@ -217,6 +221,7 @@ pub mod test_util { }), next_sequence_recv: 1, signer: get_dummy_bech32_account(), + counterparty_upgrade_sequence: 0, } } } diff --git a/crates/relayer-types/src/events.rs b/crates/relayer-types/src/events.rs index d1f85ea7fb..9f05e3aecd 100644 --- a/crates/relayer-types/src/events.rs +++ b/crates/relayer-types/src/events.rs @@ -66,9 +66,9 @@ define_error! { [ TraceError ] | _ | { "error decoding protobuf" }, - SubtleEncoding - [ TraceError ] - | _ | { "error decoding hex" }, + InvalidPacketData + { data: String } + | e | { format_args!("error decoding hex-encoded packet data: {}", e.data) }, MissingActionString | _ | { "missing action string" }, diff --git a/crates/relayer-types/src/mock/client_state.rs b/crates/relayer-types/src/mock/client_state.rs index c4081ab3bf..98917b0ef0 100644 --- a/crates/relayer-types/src/mock/client_state.rs +++ b/crates/relayer-types/src/mock/client_state.rs @@ -57,6 +57,8 @@ impl From for RawMockClientState { height: Some(value.header.height().into()), timestamp: value.header.timestamp.nanoseconds(), }), + frozen: false, + trusting_period: 14 * 24 * 60 * 60, } } } diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 5ed88c5893..91dfc52d99 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -20,7 +20,7 @@ default = ["flex-error/std", "flex-error/eyre_tracer"] telemetry = ["ibc-telemetry"] [dependencies] -ibc-proto = { version = "0.41.0", features = ["serde"] } +ibc-proto = { version = "0.42.0", features = ["serde"] } ibc-telemetry = { version = "0.27.0", path = "../telemetry", optional = true } ibc-relayer-types = { version = "0.27.0", path = "../relayer-types", features = ["mocks"] } diff --git a/crates/relayer/src/chain/cosmos/query/custom.rs b/crates/relayer/src/chain/cosmos/query/custom.rs index e842510b1b..80740aa0dd 100644 --- a/crates/relayer/src/chain/cosmos/query/custom.rs +++ b/crates/relayer/src/chain/cosmos/query/custom.rs @@ -10,7 +10,7 @@ pub async fn cross_chain_query_via_rpc( client: &HttpClient, cross_chain_query_request: CrossChainQueryRequest, ) -> Result { - let hex_decoded_request = hex::decode(cross_chain_query_request.request) + let hex_decoded_request = hex::decode(cross_chain_query_request.request.to_lowercase()) .map_err(|_| Error::ics31(CrossChainQueryError::parse()))?; let response = client diff --git a/crates/relayer/src/chain/cosmos/types/events/channel.rs b/crates/relayer/src/chain/cosmos/types/events/channel.rs index fa09493913..442d73a21d 100644 --- a/crates/relayer/src/chain/cosmos/types/events/channel.rs +++ b/crates/relayer/src/chain/cosmos/types/events/channel.rs @@ -66,11 +66,7 @@ macro_rules! impl_try_from_raw_obj_for_packet { type Error = EventError; fn try_from(obj: RawObject<'_>) -> Result { - let data_str: String = extract_attribute(&obj, &format!("{}.{}", obj.action, PKT_DATA_ATTRIBUTE_KEY))?; - - let mut packet = Packet::try_from(obj)?; - packet.data = Vec::from(data_str.as_str().as_bytes()); - + let packet = Packet::try_from(obj)?; Ok(Self { packet }) } })+ @@ -89,13 +85,10 @@ impl TryFrom> for WriteAcknowledgement { type Error = EventError; fn try_from(obj: RawObject<'_>) -> Result { - let data_str: String = - extract_attribute(&obj, &format!("{}.{}", obj.action, PKT_DATA_ATTRIBUTE_KEY))?; let ack = extract_attribute(&obj, &format!("{}.{}", obj.action, PKT_ACK_ATTRIBUTE_KEY))? .into_bytes(); - let mut packet = Packet::try_from(obj)?; - packet.data = Vec::from(data_str.as_bytes()); + let packet = Packet::try_from(obj)?; Ok(Self { packet, ack }) } @@ -117,7 +110,14 @@ pub fn parse_timeout_height(s: &str) -> Result { impl TryFrom> for Packet { type Error = EventError; + fn try_from(obj: RawObject<'_>) -> Result { + let data_str = + extract_attribute(&obj, &format!("{}.{}", obj.action, PKT_DATA_ATTRIBUTE_KEY))?; + + let data = hex::decode(data_str.to_lowercase()) + .map_err(|_| EventError::invalid_packet_data(data_str))?; + Ok(Packet { sequence: extract_attribute( &obj, @@ -125,31 +125,37 @@ impl TryFrom> for Packet { )? .parse() .map_err(EventError::channel)?, + source_port: extract_attribute( &obj, &format!("{}.{}", obj.action, PKT_SRC_PORT_ATTRIBUTE_KEY), )? .parse() .map_err(EventError::parse)?, + source_channel: extract_attribute( &obj, &format!("{}.{}", obj.action, PKT_SRC_CHANNEL_ATTRIBUTE_KEY), )? .parse() .map_err(EventError::parse)?, + destination_port: extract_attribute( &obj, &format!("{}.{}", obj.action, PKT_DST_PORT_ATTRIBUTE_KEY), )? .parse() .map_err(EventError::parse)?, + destination_channel: extract_attribute( &obj, &format!("{}.{}", obj.action, PKT_DST_CHANNEL_ATTRIBUTE_KEY), )? .parse() .map_err(EventError::parse)?, - data: vec![], + + data, + timeout_height: { let timeout_height_str = extract_attribute( &obj, diff --git a/crates/relayer/src/channel.rs b/crates/relayer/src/channel.rs index c2a9880262..c0ee15083f 100644 --- a/crates/relayer/src/channel.rs +++ b/crates/relayer/src/channel.rs @@ -859,6 +859,7 @@ impl Channel { counterparty, vec![self.dst_connection_id().clone()], version, + 0, ); // Build the domain type message @@ -938,6 +939,7 @@ impl Channel { counterparty, vec![self.dst_connection_id().clone()], Version::empty(), + 0, ); // Retrieve existing channel @@ -1029,6 +1031,7 @@ impl Channel { counterparty, vec![self.dst_connection_id().clone()], version, + 0, ); // Get signer @@ -1428,6 +1431,7 @@ impl Channel { channel_id: dst_channel_id.clone(), proofs, signer, + counterparty_upgrade_sequence: 0, }; msgs.push(new_msg.to_any()); diff --git a/crates/relayer/src/event.rs b/crates/relayer/src/event.rs index 401a2b5ecd..2c347b1505 100644 --- a/crates/relayer/src/event.rs +++ b/crates/relayer/src/event.rs @@ -1,5 +1,6 @@ use core::fmt::{Display, Error as FmtError, Formatter}; use serde::Serialize; +use subtle_encoding::hex; use tendermint::abci::Event as AbciEvent; use ibc_relayer_types::{ @@ -328,8 +329,8 @@ fn client_extract_attributes_from_tx(event: &AbciEvent) -> Result Result { for tag in &event.attributes { if tag.key == HEADER_ATTRIBUTE_KEY { - let header_bytes = - hex::decode(&tag.value).map_err(|_| ClientError::malformed_header())?; + let header_bytes = hex::decode(tag.value.to_lowercase()) + .map_err(|_| ClientError::malformed_header())?; return decode_header(&header_bytes); } } @@ -402,9 +403,11 @@ pub fn extract_packet_and_write_ack_from_tx( ) -> Result<(Packet, Vec), ChannelError> { let mut packet = Packet::default(); let mut write_ack: Vec = Vec::new(); + for tag in &event.attributes { let key = tag.key.as_str(); let value = tag.value.as_str(); + match key { channel_events::PKT_SRC_PORT_ATTRIBUTE_KEY => { packet.source_port = value.parse().map_err(ChannelError::identifier)?; @@ -431,7 +434,8 @@ pub fn extract_packet_and_write_ack_from_tx( packet.timeout_timestamp = value.parse().unwrap(); } channel_events::PKT_DATA_ATTRIBUTE_KEY => { - packet.data = Vec::from(value.as_bytes()); + packet.data = hex::decode(value.to_lowercase()) + .map_err(|_| ChannelError::invalid_packet_data(value.to_string()))?; } channel_events::PKT_ACK_ATTRIBUTE_KEY => { write_ack = Vec::from(value.as_bytes()); diff --git a/crates/relayer/src/event/source/websocket/extract.rs b/crates/relayer/src/event/source/websocket/extract.rs index 18f6bfa07a..f2213e6acd 100644 --- a/crates/relayer/src/event/source/websocket/extract.rs +++ b/crates/relayer/src/event/source/websocket/extract.rs @@ -316,7 +316,7 @@ fn extract_block_events( ); append_events::( &mut events, - extract_events(height, block_events, "send_packet", "packet_data"), + extract_events(height, block_events, "send_packet", "packet_data_hex"), height, ); append_events::( diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index 6abdd59620..5fcaa47b13 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -369,6 +369,7 @@ impl RelayPath { channel_id: self.dst_channel_id().clone(), proofs, signer: self.dst_signer()?, + counterparty_upgrade_sequence: 0, }; Ok(Some(new_msg.to_any())) diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index a33bbf74d4..119b857a15 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -17,7 +17,7 @@ description = """ ibc-relayer-types = { version = "=0.27.0", path = "../../crates/relayer-types" } ibc-relayer = { version = "=0.27.0", path = "../../crates/relayer" } ibc-relayer-cli = { version = "=1.8.0", path = "../../crates/relayer-cli" } -ibc-proto = { version = "0.41.0", features = ["serde"] } +ibc-proto = { version = "0.42.0", features = ["serde"] } tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } http = "0.2.9" diff --git a/tools/test-framework/src/chain/ext/ica.rs b/tools/test-framework/src/chain/ext/ica.rs index 766f03e1e1..bd5b142fd2 100644 --- a/tools/test-framework/src/chain/ext/ica.rs +++ b/tools/test-framework/src/chain/ext/ica.rs @@ -1,6 +1,6 @@ use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::tracking::TrackedMsgs; -use ibc_relayer_types::applications::ics27_ica::msgs::register::MsgRegisterInterchainAccount; +use ibc_relayer_types::applications::ics27_ica::msgs::register::LegacyMsgRegisterInterchainAccount; use ibc_relayer_types::core::ics04_channel::version::Version; use ibc_relayer_types::events::IbcEvent; use ibc_relayer_types::tx_msg::Msg; @@ -80,7 +80,7 @@ pub fn register_interchain_account Date: Thu, 8 Feb 2024 15:54:06 +0100 Subject: [PATCH 028/200] Fix clippy warnings --- crates/relayer/src/util/profiling.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/relayer/src/util/profiling.rs b/crates/relayer/src/util/profiling.rs index c6310f95fc..a6371e53fe 100644 --- a/crates/relayer/src/util/profiling.rs +++ b/crates/relayer/src/util/profiling.rs @@ -98,7 +98,6 @@ impl Drop for Timer { pub fn open_or_create_profile_file(file_name: &Path) { let file = OpenOptions::new() - .write(true) .append(true) .create(true) .open(file_name) From f986dc82cff5aafef11befee44b1d2eb8d179ad9 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi <106849+romac@users.noreply.github.com> Date: Thu, 8 Feb 2024 16:35:56 +0100 Subject: [PATCH 029/200] Use latest nightly to run cargo-doc --- .github/workflows/cargo-doc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo-doc.yaml b/.github/workflows/cargo-doc.yaml index ebc03618b6..55bcfe0330 100644 --- a/.github/workflows/cargo-doc.yaml +++ b/.github/workflows/cargo-doc.yaml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly-2023-07-13 + toolchain: nightly override: true - name: Build API documentation From 91306416122a1a404bb371e4293b669c465d7da2 Mon Sep 17 00:00:00 2001 From: Adi Seredinschi Date: Tue, 20 Feb 2024 11:13:53 +0100 Subject: [PATCH 030/200] Include banner in README.md (#3854) The banner is similar to the rest of the IBC ecosystem repositories, eg [ibc-go](https://github.com/cosmos/ibc-go/blob/main/README.md) Signed-off-by: Adi Seredinschi --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index b816b659e0..98adbc745a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Hermes IBC relayer +![hermes-banner](https://github.com/informalsystems/hermes/assets/1757002/0878ab2a-1c6f-4137-a089-66352f948407) + [![Cosmos ecosystem][cosmos-shield]][cosmos-link] [![Build Status][build-image]][build-link] From 17b218b4f511fc90f2f93bedcdca38ba1befd9c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 11:15:17 +0100 Subject: [PATCH 031/200] Bump jaxxstorm/action-install-gh-release from 1.10.0 to 1.11.0 (#3848) Bumps [jaxxstorm/action-install-gh-release](https://github.com/jaxxstorm/action-install-gh-release) from 1.10.0 to 1.11.0. - [Release notes](https://github.com/jaxxstorm/action-install-gh-release/releases) - [Commits](https://github.com/jaxxstorm/action-install-gh-release/compare/v1.10.0...v1.11.0) --- updated-dependencies: - dependency-name: jaxxstorm/action-install-gh-release dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/misbehaviour.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index 724e55b93f..c3adff0afc 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -55,7 +55,7 @@ jobs: substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - name: Install sconfig - uses: jaxxstorm/action-install-gh-release@v1.10.0 + uses: jaxxstorm/action-install-gh-release@v1.11.0 with: repo: freshautomations/sconfig platform: linux @@ -64,7 +64,7 @@ jobs: rename-to: sconfig chmod: 0755 - name: Install stoml - uses: jaxxstorm/action-install-gh-release@v1.10.0 + uses: jaxxstorm/action-install-gh-release@v1.11.0 with: repo: freshautomations/stoml platform: linux @@ -106,7 +106,7 @@ jobs: substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - name: Install sconfig - uses: jaxxstorm/action-install-gh-release@v1.10.0 + uses: jaxxstorm/action-install-gh-release@v1.11.0 with: repo: freshautomations/sconfig platform: linux @@ -115,7 +115,7 @@ jobs: rename-to: sconfig chmod: 0755 - name: Install stoml - uses: jaxxstorm/action-install-gh-release@v1.10.0 + uses: jaxxstorm/action-install-gh-release@v1.11.0 with: repo: freshautomations/stoml platform: linux @@ -157,7 +157,7 @@ jobs: substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - name: Install sconfig - uses: jaxxstorm/action-install-gh-release@v1.10.0 + uses: jaxxstorm/action-install-gh-release@v1.11.0 with: repo: freshautomations/sconfig platform: linux @@ -166,7 +166,7 @@ jobs: rename-to: sconfig chmod: 0755 - name: Install stoml - uses: jaxxstorm/action-install-gh-release@v1.10.0 + uses: jaxxstorm/action-install-gh-release@v1.11.0 with: repo: freshautomations/stoml platform: linux @@ -209,7 +209,7 @@ jobs: substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - name: Install sconfig - uses: jaxxstorm/action-install-gh-release@v1.10.0 + uses: jaxxstorm/action-install-gh-release@v1.11.0 with: repo: freshautomations/sconfig platform: linux @@ -218,7 +218,7 @@ jobs: rename-to: sconfig chmod: 0755 - name: Install stoml - uses: jaxxstorm/action-install-gh-release@v1.10.0 + uses: jaxxstorm/action-install-gh-release@v1.11.0 with: repo: freshautomations/stoml platform: linux From 6b41efa736516b9b906d0eeef4478bcd3b6851ce Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 20 Feb 2024 12:29:28 +0100 Subject: [PATCH 032/200] Update `curve25519-dalek` to its latest version to fix `cargo doc` job on nightly (#3855) --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bdb2899b5f..f436ae3860 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -705,9 +705,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ "cfg-if 1.0.0", "cpufeatures", From ea44c82607dbb7d45d471da0554a9f74dcb8f7c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:29:38 +0100 Subject: [PATCH 033/200] Bump eyre from 0.6.11 to 0.6.12 (#3851) --- Cargo.lock | 4 ++-- crates/relayer-cli/Cargo.toml | 2 +- tools/test-framework/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f436ae3860..8563576783 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1018,9 +1018,9 @@ dependencies = [ [[package]] name = "eyre" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6267a1fa6f59179ea4afc8e50fd8612a3cc60bc858f786ff877a4a8cb042799" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" dependencies = [ "indenter", "once_cell", diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index 8087507ffb..82303a33ff 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -38,7 +38,7 @@ console = "0.15.5" crossbeam-channel = "0.5.11" dialoguer = "0.11.0" dirs-next = "2.0.0" -eyre = "0.6.8" +eyre = "0.6.12" flex-error = { version = "0.4.4", default-features = false, features = ["std", "eyre_tracer"] } futures = "0.3.27" hdpath = "0.6.3" diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 119b857a15..21616613ca 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -24,7 +24,7 @@ http = "0.2.9" tokio = { version = "1.0", features = ["full"] } tracing = "0.1.36" tracing-subscriber = "0.3.14" -eyre = "0.6.8" +eyre = "0.6.12" color-eyre = "0.6" rand = "0.8.5" hex = "0.4.3" From 8736bbad937b0a766c61ce99fd0a31d1d2c66d9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 12:29:45 +0100 Subject: [PATCH 034/200] Bump moka from 0.12.4 to 0.12.5 (#3849) --- Cargo.lock | 4 ++-- crates/relayer/Cargo.toml | 2 +- crates/telemetry/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8563576783..44b17094f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1947,9 +1947,9 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad9dc9808102655926a6086abd0b9965ebefd4a39ef0d184f074c34ba5049ec6" +checksum = "b1911e88d5831f748a4097a43862d129e3c6fca831eecac9b8db6d01d93c9de2" dependencies = [ "crossbeam-channel 0.5.11", "crossbeam-epoch", diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 91dfc52d99..dfe603fc25 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -58,7 +58,7 @@ anyhow = "1.0" semver = "1.0" humantime = "2.1.0" regex = "1" -moka = { version = "0.12.0", features = ["sync"] } +moka = { version = "0.12.5", features = ["sync"] } uuid = { version = "1.7.0", features = ["v4"] } bs58 = "0.5.0" digest = "0.10.6" diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index 60d3357d71..16706aea52 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -19,7 +19,7 @@ once_cell = "1.19.0" opentelemetry = { version = "0.19.0", features = ["metrics"] } opentelemetry-prometheus = "0.12.0" prometheus = "0.13.2" -moka = { version = "0.12.0", features = ["sync"] } +moka = { version = "0.12.5", features = ["sync"] } dashmap = "5.4.0" serde_json = "1.0.111" serde = "1.0.195" From 5512d177f0ec4e7cd4d2109eeadd098dac110bd3 Mon Sep 17 00:00:00 2001 From: Sergey <83376337+freak12techno@users.noreply.github.com> Date: Wed, 21 Feb 2024 23:54:51 +0300 Subject: [PATCH 035/200] feat: add simulate errors metrics (#3846) * feat: add simulate errors metrics * feat: add error message * chore: add docs * chore: add unclog entry * chore: cargo fmt * Update .changelog/unreleased/features/3845-add-simulate-errors-metric.md Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Signed-off-by: Sergey <83376337+freak12techno@users.noreply.github.com> * chore: renamed unreleased file * Update changelog entry --------- Signed-off-by: Sergey <83376337+freak12techno@users.noreply.github.com> Co-authored-by: Romain Ruetschi Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> --- .../3845-add-simulate-errors-metric.md | 11 +++++++ crates/relayer/src/chain/cosmos/estimate.rs | 30 ++++++++++++++++++- crates/telemetry/src/state.rs | 24 +++++++++++++++ .../src/documentation/telemetry/operators.md | 1 + 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .changelog/unreleased/features/ibc-telemetry/3845-add-simulate-errors-metric.md diff --git a/.changelog/unreleased/features/ibc-telemetry/3845-add-simulate-errors-metric.md b/.changelog/unreleased/features/ibc-telemetry/3845-add-simulate-errors-metric.md new file mode 100644 index 0000000000..7e83a36b32 --- /dev/null +++ b/.changelog/unreleased/features/ibc-telemetry/3845-add-simulate-errors-metric.md @@ -0,0 +1,11 @@ +- Added a new Prometheus metric `simulate_errors` for tracking when a transaction simulation fails, with the following labels: + * `recoverable` (can the execution continue if this happened?) + * `account` (account from which the tx was sent) + * `error_description` (description of the error) + ([\#3845](https://github.com/informalsystems/hermes/issues/3845)) + + ``` + # HELP simulate_errors_total Number of errors observed by Hermes when simulating a Tx + # TYPE simulate_errors_total counter + simulate_errors_total{account="osmo17ndx5qfku28ymxgmq6zq4a6d02dvpfjjul0hyh",error_description="Unknown error",recoverable="false",service_name="unknown_service",otel_scope_name="hermes",otel_scope_version=""} 4 + ``` diff --git a/crates/relayer/src/chain/cosmos/estimate.rs b/crates/relayer/src/chain/cosmos/estimate.rs index 87a18a26b4..79772e92c8 100644 --- a/crates/relayer/src/chain/cosmos/estimate.rs +++ b/crates/relayer/src/chain/cosmos/estimate.rs @@ -14,6 +14,7 @@ use crate::chain::cosmos::types::gas::GasConfig; use crate::config::types::Memo; use crate::error::Error; use crate::keyring::Secp256k1KeyPair; +use crate::telemetry; use crate::util::pretty::PrettyFee; pub async fn estimate_tx_fees( @@ -51,6 +52,7 @@ pub async fn estimate_tx_fees( &config.rpc_address, &config.chain_id, tx, + account, ) .await?; @@ -63,6 +65,7 @@ async fn estimate_fee_with_tx( rpc_address: &Url, chain_id: &ChainId, tx: Tx, + account: &Account, ) -> Result { let estimated_gas = { crate::time!( @@ -72,7 +75,7 @@ async fn estimate_fee_with_tx( } ); - estimate_gas_with_tx(gas_config, grpc_address, tx).await + estimate_gas_with_tx(gas_config, grpc_address, tx, account).await }?; if estimated_gas > gas_config.max_gas { @@ -112,6 +115,7 @@ async fn estimate_gas_with_tx( gas_config: &GasConfig, grpc_address: &Uri, tx: Tx, + account: &Account, ) -> Result { let simulated_gas = send_tx_simulate(grpc_address, tx) .await @@ -147,6 +151,13 @@ async fn estimate_gas_with_tx( e.detail() ); + telemetry!( + simulate_errors, + &account.address.to_string(), + true, + get_error_text(&e), + ); + Ok(gas_config.default_gas) } @@ -155,6 +166,14 @@ async fn estimate_gas_with_tx( "failed to simulate tx. propagating error to caller: {}", e.detail() ); + + telemetry!( + simulate_errors, + &account.address.to_string(), + false, + get_error_text(&e), + ); + // Propagate the error, the retrying mechanism at caller may catch & retry. Err(e) } @@ -175,3 +194,12 @@ fn can_recover_from_simulation_failure(e: &Error) -> bool { _ => false, } } + +fn get_error_text(e: &Error) -> String { + use crate::error::ErrorDetail::*; + + match e.detail() { + GrpcStatus(detail) => detail.status.code().to_string(), + detail => detail.to_string(), + } +} diff --git a/crates/telemetry/src/state.rs b/crates/telemetry/src/state.rs index bf48381d1f..465a367044 100644 --- a/crates/telemetry/src/state.rs +++ b/crates/telemetry/src/state.rs @@ -201,6 +201,9 @@ pub struct TelemetryState { /// Number of errors observed by Hermes when broadcasting a Tx broadcast_errors: Counter, + /// Number of errors observed by Hermes when simulating a Tx + simulate_errors: Counter, + /// The EIP-1559 base fee queried dynamic_gas_queried_fees: ObservableGauge, @@ -394,6 +397,13 @@ impl TelemetryState { ) .init(), + simulate_errors: meter + .u64_counter("simulate_errors") + .with_description( + "Number of errors observed by Hermes when simulating a Tx", + ) + .init(), + dynamic_gas_queried_fees: meter .f64_observable_gauge("dynamic_gas_queried_fees") .with_description("The EIP-1559 base fee queried") @@ -1160,6 +1170,20 @@ impl TelemetryState { self.broadcast_errors.add(&cx, 1, labels); } + /// Add an error and its description to the list of errors observed after simulating + /// a Tx with a specific account. + pub fn simulate_errors(&self, address: &String, recoverable: bool, error_description: String) { + let cx = Context::current(); + + let labels = &[ + KeyValue::new("account", address.to_string()), + KeyValue::new("recoverable", recoverable.to_string()), + KeyValue::new("error_description", error_description.to_owned()), + ]; + + self.simulate_errors.add(&cx, 1, labels); + } + pub fn dynamic_gas_queried_fees(&self, chain_id: &ChainId, amount: f64) { let cx = Context::current(); diff --git a/guide/src/documentation/telemetry/operators.md b/guide/src/documentation/telemetry/operators.md index 2496b6e91a..dd0d137d2e 100644 --- a/guide/src/documentation/telemetry/operators.md +++ b/guide/src/documentation/telemetry/operators.md @@ -142,6 +142,7 @@ If this metric is increasing, it signals that the packet queue is increasing and | `cleared_send_packet_count_total`  | Number of SendPacket events received during the initial and periodic clearing, per chain, counterparty chain, channel and port | `u64` Counter | Packet workers enabled, and periodic packet clearing or clear on start enabled | | `cleared_acknowledgment_count_total` | Number of WriteAcknowledgement events received during the initial and periodic clearing, per chain, counterparty chain, channel and port | `u64` Counter | Packet workers enabled, and periodic packet clearing or clear on start enabled | | `broadcast_errors_total` | Number of errors observed by Hermes when broadcasting a Tx, per error type and account | `u64` Counter | Packet workers enabled | +| `simulate_errors_total` | Number of errors observed by Hermes when simulating a Tx, per error type, account and whether the error is recoverable or not | `u64` Counter | Packet workers enabled | | `filtered_packets` | Number of ICS-20 packets filtered because the memo and/or the receiver fields were exceeding the configured limits | `u64` Counter | Packet workers enabled, and `ics20_max_memo_size` and/or `ics20_max_receiver_size` enabled | Notes: From dab1cc946237dc4bc2c9bd499326943d11f6976b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Feb 2024 09:55:29 +0100 Subject: [PATCH 036/200] Bump tendermint-proto from 0.34.0 to 0.34.1 (#3861) Bumps [tendermint-proto](https://github.com/informalsystems/tendermint-rs) from 0.34.0 to 0.34.1. - [Release notes](https://github.com/informalsystems/tendermint-rs/releases) - [Changelog](https://github.com/informalsystems/tendermint-rs/blob/v0.34.1/CHANGELOG.md) - [Commits](https://github.com/informalsystems/tendermint-rs/compare/v0.34.0...v0.34.1) --- updated-dependencies: - dependency-name: tendermint-proto dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44b17094f9..e917c96f54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3322,9 +3322,9 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.34.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc728a4f9e891d71adf66af6ecaece146f9c7a11312288a3107b3e1d6979aaf" +checksum = "b797dd3d2beaaee91d2f065e7bdf239dc8d80bba4a183a288bc1279dd5a69a1e" dependencies = [ "bytes", "flex-error", diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 2248b01dba..6b3b283183 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -46,7 +46,7 @@ version = "0.34.0" features = ["clock"] [dependencies.tendermint-proto] -version = "0.34.0" +version = "0.34.1" [dependencies.tendermint-light-client-verifier] version = "0.34.0" diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index dfe603fc25..bdbfbcffb4 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -90,7 +90,7 @@ version = "0.34.0" features = ["secp256k1"] [dependencies.tendermint-proto] -version = "0.34.0" +version = "0.34.1" [dependencies.tendermint-rpc] version = "0.34.0" From 5154f01f08aba7328335928c62b2aa74be644e65 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Wed, 28 Feb 2024 12:30:55 +0100 Subject: [PATCH 037/200] Improve reliability of compatibility check (#3835) --- .../ibc-relayer/3831-better-compat-check.md | 2 + crates/relayer/src/chain/cosmos.rs | 18 ++--- .../relayer/src/chain/cosmos/compatibility.rs | 44 ++++++++----- crates/relayer/src/chain/cosmos/version.rs | 65 +++++-------------- crates/relayer/src/error.rs | 4 +- crates/relayer/src/upgrade_chain.rs | 19 ++++-- 6 files changed, 72 insertions(+), 80 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer/3831-better-compat-check.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/3831-better-compat-check.md b/.changelog/unreleased/bug-fixes/ibc-relayer/3831-better-compat-check.md new file mode 100644 index 0000000000..b533e98fe6 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer/3831-better-compat-check.md @@ -0,0 +1,2 @@ +- Improve reliability of compatibility check and fix parsing of expected modules + versions ([\#3831](https://github.com/informalsystems/hermes/issues/3831)) \ No newline at end of file diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index f681ce1ee7..aa3954f1b2 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -1064,17 +1064,17 @@ impl ChainEndpoint for CosmosSdkChain { /// further checks. fn health_check(&mut self) -> Result { if let Err(e) = do_health_check(self) { - warn!("Health checkup for chain '{}' failed", self.id()); - warn!(" Reason: {}", e.detail()); - warn!(" Some Hermes features may not work in this mode!"); + warn!("health check failed for chain '{}'", self.id()); + warn!("reason: {}", e.detail()); + warn!("some Hermes features may not work in this mode!"); return Ok(HealthCheck::Unhealthy(Box::new(e))); } if let Err(e) = self.validate_params() { - warn!("Hermes might be misconfigured for chain '{}'", self.id()); - warn!(" Reason: {}", e.detail()); - warn!(" Some Hermes features may not work in this mode!"); + warn!("found potential misconfiguration for chain '{}'", self.id()); + warn!("reason: {}", e.detail()); + warn!("some Hermes features may not work in this mode!"); return Ok(HealthCheck::Unhealthy(Box::new(e))); } @@ -2473,7 +2473,7 @@ fn do_health_check(chain: &CosmosSdkChain) -> Result<(), Error> { if !found_matching_denom { warn!( - "Chain '{}' has no minimum gas price of denomination '{}' \ + "chain '{}' has no minimum gas price of denomination '{}' \ that is strictly less than the `gas_price` specified for \ that chain in the Hermes configuration. \ This is usually a sign of misconfiguration, please check your chain and Hermes configurations", @@ -2482,7 +2482,7 @@ fn do_health_check(chain: &CosmosSdkChain) -> Result<(), Error> { } } else { warn!( - "Chain '{}' has no minimum gas price value configured for denomination '{}'. \ + "chain '{}' has no minimum gas price value configured for denomination '{}'. \ This is usually a sign of misconfiguration, please check your chain and \ relayer configurations", chain_id, relayer_gas_price.denom @@ -2492,7 +2492,7 @@ fn do_health_check(chain: &CosmosSdkChain) -> Result<(), Error> { let version_specs = chain.block_on(fetch_version_specs(&chain.config.id, &chain.grpc_addr))?; if let Err(diagnostic) = compatibility::run_diagnostic(&version_specs) { - return Err(Error::sdk_module_version( + return Err(Error::compat_check_failed( chain_id.clone(), grpc_address, diagnostic.to_string(), diff --git a/crates/relayer/src/chain/cosmos/compatibility.rs b/crates/relayer/src/chain/cosmos/compatibility.rs index 990fc0b60a..f997081d92 100644 --- a/crates/relayer/src/chain/cosmos/compatibility.rs +++ b/crates/relayer/src/chain/cosmos/compatibility.rs @@ -24,12 +24,18 @@ const IBC_GO_MODULE_VERSION_REQ: &str = ">=4.1.1, <9"; #[derive(Error, Debug)] pub enum Diagnostic { + #[error("SDK module version not found, required {requirements}")] + MissingSdkModuleVersion { requirements: String }, + + #[error("IBC-Go module version not found, required {requirements}")] + MissingIbcGoModuleVersion { requirements: String }, + #[error( "SDK module at version '{found}' does not meet compatibility requirements {requirements}" )] MismatchingSdkModuleVersion { requirements: String, found: String }, - #[error("Ibc-Go module at version '{found}' does not meet compatibility requirements {requirements}")] + #[error("IBC-Go module at version '{found}' does not meet compatibility requirements {requirements}")] MismatchingIbcGoModuleVersion { requirements: String, found: String }, } @@ -44,40 +50,44 @@ pub enum Diagnostic { /// Sdk module by name, as well as the constants /// [`SDK_MODULE_VERSION_REQ`] and [`IBC_GO_MODULE_VERSION_REQ`] /// for establishing compatibility requirements. -pub(crate) fn run_diagnostic(v: &version::Specs) -> Result<(), Diagnostic> { - debug!("running diagnostic on version info {}", v); +pub(crate) fn run_diagnostic(specs: &version::Specs) -> Result<(), Diagnostic> { + debug!("running diagnostic on version specs: {specs}"); - sdk_diagnostic(&v.cosmos_sdk)?; - ibc_go_diagnostic(v.ibc_go.as_ref())?; + sdk_diagnostic(specs.cosmos_sdk.as_ref())?; + ibc_go_diagnostic(specs.ibc_go.as_ref())?; Ok(()) } -fn sdk_diagnostic(version: &semver::Version) -> Result<(), Diagnostic> { +fn sdk_diagnostic(version: Option<&semver::Version>) -> Result<(), Diagnostic> { // Parse the SDK requirements into a semver let sdk_reqs = semver::VersionReq::parse(SDK_MODULE_VERSION_REQ) .expect("parsing the SDK module requirements into semver"); - // Finally, check the version requirements - match sdk_reqs.matches(version) { - true => Ok(()), - false => Err(Diagnostic::MismatchingSdkModuleVersion { + match version { + None => Err(Diagnostic::MissingSdkModuleVersion { requirements: SDK_MODULE_VERSION_REQ.to_string(), - found: version.to_string(), }), + + Some(version) => match sdk_reqs.matches(version) { + true => Ok(()), + false => Err(Diagnostic::MismatchingSdkModuleVersion { + requirements: SDK_MODULE_VERSION_REQ.to_string(), + found: version.to_string(), + }), + }, } } -fn ibc_go_diagnostic(version_info: Option<&semver::Version>) -> Result<(), Diagnostic> { +fn ibc_go_diagnostic(version: Option<&semver::Version>) -> Result<(), Diagnostic> { // Parse the IBC-go module requirements into a semver let ibc_reqs = semver::VersionReq::parse(IBC_GO_MODULE_VERSION_REQ) .expect("parsing the IBC-Go module requirements into semver"); - // Find the Ibc-Go module - match version_info { - // If binary lacks the ibc-go dependency it is _not_ an error, - // we support chains without the standalone ibc-go module. - None => Ok(()), + match version { + None => Err(Diagnostic::MissingIbcGoModuleVersion { + requirements: IBC_GO_MODULE_VERSION_REQ.to_string(), + }), Some(version) => match ibc_reqs.matches(version) { true => Ok(()), false => Err(Diagnostic::MismatchingIbcGoModuleVersion { diff --git a/crates/relayer/src/chain/cosmos/version.rs b/crates/relayer/src/chain/cosmos/version.rs index e6987eebb5..a75c4ed822 100644 --- a/crates/relayer/src/chain/cosmos/version.rs +++ b/crates/relayer/src/chain/cosmos/version.rs @@ -22,20 +22,15 @@ use ibc_proto::cosmos::base::tendermint::v1beta1::VersionInfo; /// sum: "h1:yaD4PyOx0LnyfiWasC5egg1U76lT83GRxjJjupPo7Gk=", /// }, /// ``` -const SDK_MODULE_NAME: &str = "cosmos/cosmos-sdk"; -const IBC_GO_MODULE_NAME: &str = "cosmos/ibc-go"; -const TENDERMINT_MODULE_NAME: &str = "tendermint/tendermint"; -const COMET_MODULE_NAME: &str = "cometbft/cometbft"; +const SDK_MODULE_NAME: &str = "github.com/cosmos/cosmos-sdk"; +const IBC_GO_MODULE_NAME: &str = "github.com/cosmos/ibc-go"; +const TENDERMINT_MODULE_NAME: &str = "github.com/tendermint/tendermint"; +const COMET_MODULE_NAME: &str = "github.com/cometbft/cometbft"; -/// Captures the version(s) specification of different -/// modules of a network. -/// -/// Assumes that the network runs on Cosmos SDK. -/// Stores both the SDK version as well as -/// the IBC-go module version (if existing). +/// Captures the version(s) specification of different modules of a network. #[derive(Debug)] pub struct Specs { - pub cosmos_sdk: semver::Version, + pub cosmos_sdk: Option, pub ibc_go: Option, pub tendermint: Option, pub comet: Option, @@ -43,6 +38,12 @@ pub struct Specs { impl Display for Specs { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + let cosmos_sdk = self + .cosmos_sdk + .as_ref() + .map(|v| v.to_string()) + .unwrap_or_else(|| "UNKNOWN".to_string()); + let ibc_go = self .ibc_go .as_ref() @@ -64,20 +65,13 @@ impl Display for Specs { write!( f, "Cosmos SDK {}, IBC-Go {}, Tendermint {}, CometBFT {}", - self.cosmos_sdk, ibc_go, tendermint, comet + cosmos_sdk, ibc_go, tendermint, comet ) } } define_error! { Error { - SdkModuleNotFound - { - address: String, - app: AppInfo, - } - |e| { format!("failed to find the SDK module dependency ('{}') for application {}", e.address, e.app) }, - ConsensusModuleNotFound { tendermint: String, @@ -121,7 +115,7 @@ impl TryFrom for Specs { application = %raw_version.app_name, version = %raw_version.version, git_commit = %raw_version.git_commit, - sdk_version = %sdk_version, + sdk_version = ?sdk_version, ibc_go_status = ?ibc_go_version, tendermint_version = ?tendermint_version, comet_version = ?comet_version, @@ -137,33 +131,8 @@ impl TryFrom for Specs { } } -fn parse_sdk_version(version_info: &VersionInfo) -> Result { - let module = version_info - .build_deps - .iter() - .find(|&m| m.path.contains(SDK_MODULE_NAME)) - .ok_or_else(|| { - Error::sdk_module_not_found(SDK_MODULE_NAME.to_string(), AppInfo::from(version_info)) - })?; - - // The raw version number has a leading 'v', trim it out; - let plain_version = module.version.trim_start_matches('v'); - - // Parse the module version - let mut version = semver::Version::parse(plain_version).map_err(|e| { - Error::version_parsing_failed( - module.path.clone(), - module.version.clone(), - e.to_string(), - AppInfo::from(version_info), - ) - })?; - - // Remove the pre-release version to ensure we treat pre-releases of the SDK - // as their normal version, eg. 0.42.0-rc2 should satisfy >=0.41.3, <= 0.42.6. - version.pre = semver::Prerelease::EMPTY; - - Ok(version) +fn parse_sdk_version(version_info: &VersionInfo) -> Result, Error> { + parse_optional_version(version_info, SDK_MODULE_NAME) } fn parse_ibc_go_version(version_info: &VersionInfo) -> Result, Error> { @@ -185,7 +154,7 @@ fn parse_optional_version( match version_info .build_deps .iter() - .find(|&m| m.path.contains(module_name)) + .find(|&m| m.path == module_name) { None => Ok(None), Some(module) => { diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index 2f3a964547..301e344e6a 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -494,14 +494,14 @@ define_error! { format!("semantic config validation failed for option `gas_multiplier` of chain '{}', reason: gas multiplier ({}) is smaller than `1.1`, which could trigger gas fee errors in production", e.chain_id, e.gas_multiplier) }, - SdkModuleVersion + CompatCheckFailed { chain_id: ChainId, address: String, cause: String } |e| { - format!("Hermes health check failed while verifying the application compatibility for chain {0}:{1}; caused by: {2}", + format!("compatibility check failed for chain '{0}' at '{1}': {2}", e.chain_id, e.address, e.cause) }, diff --git a/crates/relayer/src/upgrade_chain.rs b/crates/relayer/src/upgrade_chain.rs index 3c6b407f5c..81ec1bc579 100644 --- a/crates/relayer/src/upgrade_chain.rs +++ b/crates/relayer/src/upgrade_chain.rs @@ -17,6 +17,7 @@ use ibc_relayer_types::clients::ics07_tendermint::client_state::UpgradeOptions; use ibc_relayer_types::core::ics02_client::client_state::ClientState; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use ibc_relayer_types::{downcast, Height}; +use tracing::warn; use crate::chain::handle::ChainHandle; use crate::chain::requests::{IncludeProof, QueryClientStateRequest, QueryHeight}; @@ -96,22 +97,32 @@ pub fn build_and_send_ibc_upgrade_proposal( /// Looks at the ibc-go version to determine if the legacy `UpgradeProposal` message /// or if the newer `MsgIBCSoftwareUpdate` message should be used to upgrade the chain. /// If the ibc-go version returned isn't reliable, a deprecated version, then the version -/// of Cosmos SDK is used. +/// of Cosmos SDK is used, if any. If there is no SDK version, we assume that the legacy upgrade is required. pub fn requires_legacy_upgrade_proposal(dst_chain: impl ChainHandle) -> bool { - let version_specs = dst_chain.version_specs().unwrap(); + let Ok(version_specs) = dst_chain.version_specs() else { + warn!("failed to get version specs, assuming legacy upgrade proposal is required"); + return true; + }; + + let sdk_before_50 = version_specs + .cosmos_sdk + .as_ref() + .map(|s| s.minor < 50) + .unwrap_or(true); + match version_specs.ibc_go { + None => sdk_before_50, Some(ibc_version) => { // Some ibc-go simapps return unreliable ibc-go versions, such as simapp v8.0.0 // returns version v1.0.0. So if the ibc-go version matches which is not maintained // anymore, use the Cosmos SDK version to determine if the legacy upgrade proposal // has to be used if ibc_version.major < 4 { - version_specs.cosmos_sdk.minor < 50 + sdk_before_50 } else { ibc_version.major < 8 } } - None => version_specs.cosmos_sdk.minor < 50, } } From c453676f1e3935c5802441cb50f6f5ee9d8ec074 Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Wed, 28 Feb 2024 10:32:31 -0600 Subject: [PATCH 038/200] Make ordered channels more resilient in the face of failing packets (#3610) * Start scaffolding ica_ordered_channel test * Disable packet clearing * Add ica_ordered_channel test * Move some imports around * Clean up imports * Add sleep calls in between supervisor runs * Formatting * Fix compilation issues * Emphasize wording in documentation * Fill in code from discussion * Rename TrakingId::ClearId to TrackingId::PacketClearing * Compile ica ordered channel test under the ica feature flag * Cargo fmt * Move interchain_send_tx fn to test-framework crate * Cargo fmt * Update relayer config for consumer chain * Move ica_ordered_channel test under the ica feature * Move ica_transfer test under ica feature * Check that ICA channel is eventually established using the supervisor * Fix clippy warnings * Improve logs * Add changelog entry * Fix compilation of ICA tests * Add `force_disable_clear_on_start` config option, only available in test code * Cleanup * Check whether packet clear is needed instead of reacting to error when it fails * Force disable clear on start in ICA ordered channel test * Update changelog entry * Improve ICA ordered channel test asserts --------- Signed-off-by: Sean Chen Co-authored-by: Romain Ruetschi <106849+romac@users.noreply.github.com> Co-authored-by: Romain Ruetschi Co-authored-by: Luca Joss --- .../3540-ordered-channels-resilience.md | 6 + crates/relayer/src/chain/tracking.rs | 13 +- crates/relayer/src/config.rs | 4 + crates/relayer/src/link/error.rs | 2 +- crates/relayer/src/link/relay_path.rs | 10 +- crates/relayer/src/link/relay_sender.rs | 5 +- crates/relayer/src/worker.rs | 10 +- crates/relayer/src/worker/packet.rs | 49 ++++ tools/integration-test/src/tests/ica.rs | 28 +-- .../ica_ordered_channel.rs | 226 ++++++++++++++++++ .../tests/interchain_security/ica_transfer.rs | 29 +-- .../src/tests/interchain_security/mod.rs | 2 + .../src/util/interchain_security.rs | 36 ++- 13 files changed, 352 insertions(+), 68 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/3540-ordered-channels-resilience.md create mode 100644 tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs diff --git a/.changelog/unreleased/improvements/ibc-relayer/3540-ordered-channels-resilience.md b/.changelog/unreleased/improvements/ibc-relayer/3540-ordered-channels-resilience.md new file mode 100644 index 0000000000..88899c96f5 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/3540-ordered-channels-resilience.md @@ -0,0 +1,6 @@ +- Improve resilience when relaying on ordered channels. + When relaying packets on an ordered channel, Hermes will now attempt + to detect whether the next message to send has the sequence number + expected on that channel. If there is a mismatch, then Hermes will trigger a packet + clear on the channel to unblock it before resuming operations on that channel. + ([\#3540](https://github.com/informalsystems/hermes/issues/3540)) diff --git a/crates/relayer/src/chain/tracking.rs b/crates/relayer/src/chain/tracking.rs index 62f89ca096..589ad305f2 100644 --- a/crates/relayer/src/chain/tracking.rs +++ b/crates/relayer/src/chain/tracking.rs @@ -15,7 +15,7 @@ pub enum TrackingId { /// the CLI or during packet clearing. Static(&'static str), /// Random identifier used to track latency of packet clearing. - ClearedUuid(Uuid), + PacketClearing(Uuid), } impl TrackingId { @@ -29,8 +29,13 @@ impl TrackingId { Self::Static(s) } - pub fn new_cleared_uuid() -> Self { - Self::ClearedUuid(Uuid::new_v4()) + pub fn new_packet_clearing() -> Self { + Self::PacketClearing(Uuid::new_v4()) + } + + /// Indicates whether a packet clearing process is currently in-progress. + pub fn is_clearing(&self) -> bool { + matches!(self, Self::PacketClearing(_)) } } @@ -43,7 +48,7 @@ impl Display for TrackingId { s.fmt(f) } TrackingId::Static(s) => s.fmt(f), - TrackingId::ClearedUuid(u) => { + TrackingId::PacketClearing(u) => { let mut uuid = "cleared/".to_owned(); let mut s = u.to_string(); s.truncate(8); diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index 2f335e13d0..ec0afdaf34 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -414,6 +414,9 @@ pub struct Packets { pub ics20_max_memo_size: Ics20FieldSizeLimit, #[serde(default = "default::ics20_max_receiver_size")] pub ics20_max_receiver_size: Ics20FieldSizeLimit, + + #[serde(skip)] + pub force_disable_clear_on_start: bool, } impl Default for Packets { @@ -426,6 +429,7 @@ impl Default for Packets { auto_register_counterparty_payee: default::auto_register_counterparty_payee(), ics20_max_memo_size: default::ics20_max_memo_size(), ics20_max_receiver_size: default::ics20_max_receiver_size(), + force_disable_clear_on_start: false, } } } diff --git a/crates/relayer/src/link/error.rs b/crates/relayer/src/link/error.rs index adf8142ec8..694bc22f70 100644 --- a/crates/relayer/src/link/error.rs +++ b/crates/relayer/src/link/error.rs @@ -73,7 +73,7 @@ define_error! { Send { event: IbcEvent } |e| { - format!("chain error when sending messages: {0}", e.event) + format!("failed to send message: {0}", e.event) }, MissingChannelId diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index 5fcaa47b13..9dd3c570c0 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -427,7 +427,7 @@ impl RelayPath { fn relay_pending_packets(&self, height: Option) -> Result<(), LinkError> { let _span = span!(Level::ERROR, "relay_pending_packets", ?height).entered(); - let tracking_id = TrackingId::new_cleared_uuid(); + let tracking_id = TrackingId::new_packet_clearing(); telemetry!(received_event_batch, tracking_id); let src_config = self.src_chain().config().map_err(LinkError::relayer)?; @@ -710,12 +710,12 @@ impl RelayPath { return Ok(reply); } - Err(LinkError(error::LinkErrorDetail::Send(e), _)) => { - // This error means we could retry - error!("error {}", e.event); + Err(LinkError(error::LinkErrorDetail::Send(_), _)) => { if i + 1 == MAX_RETRIES { - error!("{}/{} retries exhausted. giving up", i + 1, MAX_RETRIES) + error!("{}/{} retries exhausted, giving up", i + 1, MAX_RETRIES) } else { + debug!("{}/{} retries exhausted, retrying with newly-generated operational data", i + 1, MAX_RETRIES); + // If we haven't exhausted all retries, regenerate the op. data & retry match self.regenerate_operational_data(odata.clone()) { None => return Ok(S::Reply::empty()), // Nothing to retry diff --git a/crates/relayer/src/link/relay_sender.rs b/crates/relayer/src/link/relay_sender.rs index c4d29fe91a..a8c70cb9f0 100644 --- a/crates/relayer/src/link/relay_sender.rs +++ b/crates/relayer/src/link/relay_sender.rs @@ -95,10 +95,11 @@ impl Submit for AsyncSender { type Reply = AsyncReply; fn submit(target: &impl ChainHandle, msgs: TrackedMsgs) -> Result { - let a = target + let responses = target .send_messages_and_wait_check_tx(msgs) .map_err(LinkError::relayer)?; - let reply = AsyncReply { responses: a }; + + let reply = AsyncReply { responses }; // Note: There may be errors in the reply, for example: // `Response { code: Err(11), data: Data([]), log: Log("Too much gas wanted: 35000000, maximum is 25000000: out of gas")` diff --git a/crates/relayer/src/worker.rs b/crates/relayer/src/worker.rs index 400ff811af..40f73b67de 100644 --- a/crates/relayer/src/worker.rs +++ b/crates/relayer/src/worker.rs @@ -128,7 +128,7 @@ pub fn spawn_worker_tasks( Ok(link) => { let channel_ordering = link.a_to_b.channel().ordering; let should_clear_on_start = - packets_config.clear_on_start || channel_ordering == Ordering::Ordered; + should_clear_on_start(&packets_config, channel_ordering); let (cmd_tx, cmd_rx) = crossbeam_channel::unbounded(); let link = Arc::new(Mutex::new(link)); @@ -217,3 +217,11 @@ pub fn spawn_worker_tasks( WorkerHandle::new(id, object, data, cmd_tx, task_handles) } + +fn should_clear_on_start(config: &crate::config::Packets, channel_ordering: Ordering) -> bool { + if config.force_disable_clear_on_start { + false + } else { + config.clear_on_start || channel_ordering == Ordering::Ordered + } +} diff --git a/crates/relayer/src/worker/packet.rs b/crates/relayer/src/worker/packet.rs index 2eb85f633c..5daf122466 100644 --- a/crates/relayer/src/worker/packet.rs +++ b/crates/relayer/src/worker/packet.rs @@ -17,14 +17,17 @@ use ibc_proto::ibc::apps::fee::v1::{IdentifiedPacketFees, QueryIncentivizedPacke use ibc_proto::ibc::core::channel::v1::PacketId; use ibc_relayer_types::applications::ics29_fee::events::IncentivizedPacket; use ibc_relayer_types::applications::transfer::{Amount, Coin, RawCoin}; +use ibc_relayer_types::core::ics04_channel::channel::Ordering; use ibc_relayer_types::core::ics04_channel::events::WriteAcknowledgement; use ibc_relayer_types::core::ics04_channel::packet::Sequence; use ibc_relayer_types::events::{IbcEvent, IbcEventType}; use ibc_relayer_types::Height; use crate::chain::handle::ChainHandle; +use crate::chain::requests::QueryHeight; use crate::config::filter::FeePolicy; use crate::event::source::EventBatch; +use crate::event::IbcEventWithHeight; use crate::foreign_client::HasExpiredOrFrozenError; use crate::link::Resubmit; use crate::link::{error::LinkError, Link}; @@ -204,6 +207,24 @@ fn handle_packet_cmd( ) -> Result<(), TaskError> { // Handle packet clearing which is triggered from a command let (do_clear, maybe_height) = match &cmd { + WorkerCmd::IbcEvents { batch } if link.a_to_b.channel().ordering == Ordering::Ordered => { + let lowest_sequence = lowest_sequence(&batch.events); + + let next_sequence = query_next_sequence_receive( + link.a_to_b.dst_chain(), + link.a_to_b.dst_port_id(), + link.a_to_b.dst_channel_id(), + QueryHeight::Specific(batch.height), + ) + .ok(); + + if *should_clear_on_start || next_sequence < lowest_sequence { + (true, Some(batch.height)) + } else { + (false, None) + } + } + WorkerCmd::IbcEvents { batch } => { if *should_clear_on_start { (true, Some(batch.height)) @@ -439,6 +460,34 @@ fn handle_execute_schedule( Ok(()) } +fn query_next_sequence_receive( + chain: &Chain, + port_id: &PortId, + channel_id: &ChannelId, + height: QueryHeight, +) -> Result { + use crate::chain::requests::{IncludeProof, QueryNextSequenceReceiveRequest}; + + chain + .query_next_sequence_receive( + QueryNextSequenceReceiveRequest { + port_id: port_id.clone(), + channel_id: channel_id.clone(), + height, + }, + IncludeProof::No, + ) + .map(|(seq, _height)| seq) + .map_err(|e| LinkError::query(chain.id(), e)) +} + +fn lowest_sequence(events: &[IbcEventWithHeight]) -> Option { + events + .iter() + .flat_map(|event| event.event.packet().map(|p| p.sequence)) + .min() +} + #[cfg(feature = "telemetry")] use crate::link::RelaySummary; diff --git a/tools/integration-test/src/tests/ica.rs b/tools/integration-test/src/tests/ica.rs index 03d367b675..024e82a4d9 100644 --- a/tools/integration-test/src/tests/ica.rs +++ b/tools/integration-test/src/tests/ica.rs @@ -2,13 +2,10 @@ use std::collections::HashMap; use std::str::FromStr; use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::tracking::TrackedMsgs; use ibc_relayer::config::{ filter::{ChannelFilters, ChannelPolicy, FilterPattern}, ChainConfig, PacketFilter, }; -use ibc_relayer::event::IbcEventWithHeight; -use ibc_relayer_types::applications::ics27_ica::msgs::send_tx::MsgSendTx; use ibc_relayer_types::applications::ics27_ica::packet_data::InterchainAccountPacketData; use ibc_relayer_types::applications::{ ics27_ica::cosmos_tx::CosmosTx, @@ -26,6 +23,7 @@ use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::{ assert_eventually_channel_closed, assert_eventually_channel_established, query_channel_end, }; +use ibc_test_framework::util::interchain_security::interchain_send_tx; #[test] fn test_ica_filter_default() -> Result<(), Error> { @@ -187,6 +185,7 @@ impl BinaryConnectionTest for IcaFilterTestAllow { Ok(()) } } + pub struct IcaFilterTestDeny; impl TestOverrides for IcaFilterTestDeny { @@ -373,26 +372,3 @@ impl BinaryConnectionTest for ICACloseChannelTest { }) } } - -fn interchain_send_tx( - chain: &ChainA, - from: &Signer, - connection: &ConnectionId, - msg: InterchainAccountPacketData, - relative_timeout: Timestamp, -) -> Result, Error> { - let msg = MsgSendTx { - owner: from.clone(), - connection_id: connection.clone(), - packet_data: msg, - relative_timeout, - }; - - let msg_any = msg.to_any(); - - let tm = TrackedMsgs::new_static(vec![msg_any], "SendTx"); - - chain - .send_messages_and_wait_commit(tm) - .map_err(Error::relayer) -} diff --git a/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs b/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs new file mode 100644 index 0000000000..56a0075ff3 --- /dev/null +++ b/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs @@ -0,0 +1,226 @@ +//! Verifies the behaviour of ordered channels with Interchain Accounts. +//! +//! In order to ensure that ordered channels correctly clear packets on ICA +//! channels, this test sends some sequential packets with the supervisor enabled, +//! sends the next packet *without* the supervisor enabled, then sends additional +//! packets with the supervisor enabled again. The pending packet that was sent +//! without the supervisor enabled should be relayed in order along with the +//! other packets, as expected of ordered channel behaviour. + +use std::str::FromStr; + +use ibc_relayer_types::applications::ics27_ica::cosmos_tx::CosmosTx; +use ibc_relayer_types::applications::ics27_ica::packet_data::InterchainAccountPacketData; +use ibc_relayer_types::applications::transfer::msgs::send::MsgSend; +use ibc_relayer_types::applications::transfer::{Amount, Coin}; +use ibc_relayer_types::bigint::U256; +use ibc_relayer_types::signer::Signer; +use ibc_relayer_types::timestamp::Timestamp; +use ibc_relayer_types::tx_msg::Msg; +use ibc_test_framework::chain::ext::ica::register_interchain_account; +use ibc_test_framework::framework::binary::channel::run_binary_interchain_security_channel_test; +use ibc_test_framework::prelude::*; +use ibc_test_framework::relayer::channel::assert_eventually_channel_established; +use ibc_test_framework::relayer::channel::query_channel_end; +use ibc_test_framework::util::interchain_security::{ + interchain_send_tx, update_genesis_for_consumer_chain, update_relayer_config_for_consumer_chain, +}; + +#[test] +fn test_ica_ordered_channel() -> Result<(), Error> { + run_binary_interchain_security_channel_test(&IcaOrderedChannelTest) +} + +struct IcaOrderedChannelTest; + +impl TestOverrides for IcaOrderedChannelTest { + fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { + use serde_json::Value; + + // Allow MsgSend messages over ICA + let allow_messages = genesis + .get_mut("app_state") + .and_then(|app_state| app_state.get_mut("interchainaccounts")) + .and_then(|ica| ica.get_mut("host_genesis_state")) + .and_then(|state| state.get_mut("params")) + .and_then(|params| params.get_mut("allow_messages")) + .and_then(|allow_messages| allow_messages.as_array_mut()); + + if let Some(allow_messages) = allow_messages { + allow_messages.push(Value::String("/cosmos.bank.v1beta1.MsgSend".to_string())); + } else { + return Err(Error::generic(eyre!("failed to update genesis file"))); + } + + update_genesis_for_consumer_chain(genesis)?; + + Ok(()) + } + + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.clients.misbehaviour = false; + + config.mode.channels.enabled = true; + + // Disable packet clearing so that packets sent without the supervisor + // enabled enter a pending state. + config.mode.packets.enabled = true; + config.mode.packets.clear_on_start = false; + config.mode.packets.clear_interval = 0; + // This is needed for ordered channels + config.mode.packets.force_disable_clear_on_start = true; + + update_relayer_config_for_consumer_chain(config); + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +impl BinaryChannelTest for IcaOrderedChannelTest { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channel: ConnectedChannel, + ) -> Result<(), Error> { + let connection_b_to_a = channel.connection.clone().flip(); + let (wallet, channel_id, port_id) = + register_interchain_account(&chains.node_b, chains.handle_b(), &connection_b_to_a)?; + + relayer.with_supervisor(|| { + // Check that the corresponding ICA channel is eventually established. + let _counterparty_channel_id = assert_eventually_channel_established( + chains.handle_b(), + chains.handle_a(), + &channel_id.as_ref(), + &port_id.as_ref(), + )?; + + Ok(()) + })?; + + // Assert that the channel returned by `register_interchain_account` is an ordered channel + let channel_end = + query_channel_end(chains.handle_b(), &channel_id.as_ref(), &port_id.as_ref())?; + + assert_eq!(channel_end.value().ordering(), &Ordering::Ordered); + + // Query the controller chain for the address of the ICA wallet on the host chain. + let ica_address = chains.node_b.chain_driver().query_interchain_account( + &wallet.address(), + &channel.connection.connection_id_b.as_ref(), + )?; + + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &ica_address.as_ref(), + &stake_denom.with_amount(0u64).as_ref(), + )?; + + // Send funds to the interchain account. + let ica_fund = 42000u64; + + chains.node_a.chain_driver().local_transfer_token( + &chains.node_a.wallets().user1(), + &ica_address.as_ref(), + &stake_denom.with_amount(ica_fund).as_ref(), + )?; + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &ica_address.as_ref(), + &stake_denom.with_amount(ica_fund).as_ref(), + )?; + + let amount = 1200; + + let msg = MsgSend { + from_address: ica_address.to_string(), + to_address: chains.node_a.wallets().user2().address().to_string(), + amount: vec![Coin { + denom: stake_denom.to_string(), + amount: Amount(U256::from(amount)), + }], + }; + + let raw_msg = msg.to_any(); + + let cosmos_tx = CosmosTx { + messages: vec![raw_msg], + }; + + let raw_cosmos_tx = cosmos_tx.to_any(); + + let interchain_account_packet_data = InterchainAccountPacketData::new(raw_cosmos_tx.value); + + let signer = Signer::from_str(&wallet.address().to_string()).unwrap(); + + let user2_balance = chains.node_a.chain_driver().query_balance( + &chains.node_a.wallets().user2().address(), + &stake_denom.as_ref(), + )?; + + relayer.with_supervisor(|| { + let ica_events = interchain_send_tx( + chains.handle_b(), + &signer, + &channel.connection.connection_id_b.0, + interchain_account_packet_data.clone(), + Timestamp::from_nanoseconds(120000000000).unwrap(), + )?; + + // Check that the ICA account's balance has been debited the sent amount. + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &ica_address.as_ref(), + &stake_denom.with_amount(ica_fund - amount).as_ref(), + )?; + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &chains.node_a.wallets().user2().address(), + &(user2_balance.clone() + amount).as_ref(), + )?; + + info!("First ICA transfer made with supervisor: {ica_events:#?}"); + + Ok(()) + })?; + + let ica_events = interchain_send_tx( + chains.handle_b(), + &signer, + &channel.connection.connection_id_b.0, + interchain_account_packet_data.clone(), + Timestamp::from_nanoseconds(120000000000).unwrap(), + )?; + + info!("Second ICA transfer made without supervisor: {ica_events:#?}"); + + relayer.with_supervisor(|| { + let ica_events = interchain_send_tx( + chains.handle_b(), + &signer, + &channel.connection.connection_id_b.0, + interchain_account_packet_data, + Timestamp::from_nanoseconds(120000000000).unwrap(), + )?; + + // Check that the ICA account's balance has been debited the sent amount. + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &ica_address.as_ref(), + &stake_denom.with_amount(ica_fund - 3 * amount).as_ref(), + )?; + + info!("Third ICA transfer made with supervisor: {ica_events:#?}"); + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &chains.node_a.wallets().user2().address(), + &(user2_balance + (3 * amount)).as_ref(), + )?; + + Ok(()) + }) + } +} diff --git a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs index fc44ff7fd2..5377f206da 100644 --- a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs +++ b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs @@ -3,10 +3,7 @@ //! the second chain a Consumer chain. use std::str::FromStr; -use ibc_relayer::chain::tracking::TrackedMsgs; -use ibc_relayer::event::IbcEventWithHeight; use ibc_relayer_types::applications::ics27_ica::cosmos_tx::CosmosTx; -use ibc_relayer_types::applications::ics27_ica::msgs::send_tx::MsgSendTx; use ibc_relayer_types::applications::ics27_ica::packet_data::InterchainAccountPacketData; use ibc_relayer_types::applications::transfer::msgs::send::MsgSend; use ibc_relayer_types::applications::transfer::{Amount, Coin}; @@ -19,7 +16,7 @@ use ibc_test_framework::framework::binary::channel::run_binary_interchain_securi use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::assert_eventually_channel_established; use ibc_test_framework::util::interchain_security::{ - update_genesis_for_consumer_chain, update_relayer_config_for_consumer_chain, + interchain_send_tx, update_genesis_for_consumer_chain, update_relayer_config_for_consumer_chain, }; #[test] @@ -151,29 +148,7 @@ impl BinaryChannelTest for InterchainSecurityIcaTransferTest { &ica_address.as_ref(), &stake_denom.with_amount(ica_fund - amount).as_ref(), )?; + Ok(()) } } - -fn interchain_send_tx( - chain: &ChainA, - from: &Signer, - connection: &ConnectionId, - msg: InterchainAccountPacketData, - relative_timeout: Timestamp, -) -> Result, Error> { - let msg = MsgSendTx { - owner: from.clone(), - connection_id: connection.clone(), - packet_data: msg, - relative_timeout, - }; - - let msg_any = msg.to_any(); - - let tm = TrackedMsgs::new_static(vec![msg_any], "SendTx"); - - chain - .send_messages_and_wait_commit(tm) - .map_err(Error::relayer) -} diff --git a/tools/integration-test/src/tests/interchain_security/mod.rs b/tools/integration-test/src/tests/interchain_security/mod.rs index a2acc74d92..0772d733db 100644 --- a/tools/integration-test/src/tests/interchain_security/mod.rs +++ b/tools/integration-test/src/tests/interchain_security/mod.rs @@ -1,4 +1,6 @@ #[cfg(any(doc, feature = "ica"))] +pub mod ica_ordered_channel; +#[cfg(any(doc, feature = "ica"))] pub mod ica_transfer; #[cfg(any(doc, feature = "ics31"))] pub mod icq; diff --git a/tools/test-framework/src/util/interchain_security.rs b/tools/test-framework/src/util/interchain_security.rs index 035efb3c84..ea66e12f4f 100644 --- a/tools/test-framework/src/util/interchain_security.rs +++ b/tools/test-framework/src/util/interchain_security.rs @@ -1,8 +1,15 @@ -use ibc_relayer::config::ChainConfig; - use crate::chain::config::set_voting_period; use crate::prelude::*; +use ibc_relayer::chain::tracking::TrackedMsgs; +use ibc_relayer::config::ChainConfig; +use ibc_relayer::event::IbcEventWithHeight; +use ibc_relayer_types::applications::ics27_ica::msgs::send_tx::MsgSendTx; +use ibc_relayer_types::applications::ics27_ica::packet_data::InterchainAccountPacketData; +use ibc_relayer_types::signer::Signer; +use ibc_relayer_types::timestamp::Timestamp; +use ibc_relayer_types::tx_msg::Msg; + pub fn update_genesis_for_consumer_chain(genesis: &mut serde_json::Value) -> Result<(), Error> { // Consumer chain doesn't have a gov key. if genesis @@ -32,3 +39,28 @@ pub fn update_relayer_config_for_consumer_chain(config: &mut Config) { } } } + +/// Sends a message containing `InterchainAccountPacketData` from the `Signer` +/// to the `Chain`. +pub fn interchain_send_tx( + chain: &ChainA, + from: &Signer, + connection: &ConnectionId, + msg: InterchainAccountPacketData, + relative_timeout: Timestamp, +) -> Result, Error> { + let msg = MsgSendTx { + owner: from.clone(), + connection_id: connection.clone(), + packet_data: msg, + relative_timeout, + }; + + let msg_any = msg.to_any(); + + let tm = TrackedMsgs::new_static(vec![msg_any], "SendTx"); + + chain + .send_messages_and_wait_commit(tm) + .map_err(Error::relayer) +} From df6cd29b5dfddfe376bb4d0106644efc8dd20c5b Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Thu, 29 Feb 2024 15:42:29 +0100 Subject: [PATCH 039/200] Add `memo_overwrite` configuration (#3863) * Add configuration to overwrite relayer memo * Add test for memo override * Add 'memo_overwrite' config documentation * Add changelog entry --- .../3811-relayer-memo-overwrite.md | 3 + config.toml | 7 ++ crates/relayer-cli/src/chain_registry.rs | 1 + crates/relayer-cli/src/commands.rs | 6 +- crates/relayer/src/chain/cosmos/config.rs | 3 + tools/integration-test/src/tests/memo.rs | 73 +++++++++++++++++++ tools/test-framework/src/types/single/node.rs | 1 + 7 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 .changelog/unreleased/features/ibc-relayer/3811-relayer-memo-overwrite.md diff --git a/.changelog/unreleased/features/ibc-relayer/3811-relayer-memo-overwrite.md b/.changelog/unreleased/features/ibc-relayer/3811-relayer-memo-overwrite.md new file mode 100644 index 0000000000..fcd1a840d3 --- /dev/null +++ b/.changelog/unreleased/features/ibc-relayer/3811-relayer-memo-overwrite.md @@ -0,0 +1,3 @@ +- Add a per-chain configuration `memo_overwrite` allowing users + to overwite the relayer memo used for each transaction + ([\#3811](https://github.com/informalsystems/hermes/issues/3811)) \ No newline at end of file diff --git a/config.toml b/config.toml index f45e2289cf..63c5881060 100644 --- a/config.toml +++ b/config.toml @@ -369,6 +369,13 @@ trust_threshold = '2/3' # operational debugging information, e.g., relayer build version. memo_prefix = '' +# If this is set to a string, it will overwrite the memo used by Hermes for each transaction +# it submits to this chain. +# Default: not set. +# This is used for chains which have a very small character limit for the memo, +# and the additional information appended by Hermes would overflow that limit. +# memo_overwrite = '' + # This section specifies the filters for policy based relaying. # # Default: no policy / filters, allow all packets on all channels. diff --git a/crates/relayer-cli/src/chain_registry.rs b/crates/relayer-cli/src/chain_registry.rs index 04b28f21c6..93f68821b1 100644 --- a/crates/relayer-cli/src/chain_registry.rs +++ b/crates/relayer-cli/src/chain_registry.rs @@ -160,6 +160,7 @@ where client_refresh_rate: default::client_refresh_rate(), ccv_consumer_chain: false, memo_prefix: Memo::default(), + memo_overwrite: None, proof_specs: Default::default(), trust_threshold: TrustThreshold::default(), gas_price: GasPrice { diff --git a/crates/relayer-cli/src/commands.rs b/crates/relayer-cli/src/commands.rs index 60879018f5..e922061029 100644 --- a/crates/relayer-cli/src/commands.rs +++ b/crates/relayer-cli/src/commands.rs @@ -151,7 +151,11 @@ impl Configurable for CliCmd { for ccfg in config.chains.iter_mut() { #[allow(irrefutable_let_patterns)] if let ChainConfig::CosmosSdk(ref mut cosmos_ccfg) = ccfg { - cosmos_ccfg.memo_prefix.apply_suffix(&suffix); + if let Some(memo) = &cosmos_ccfg.memo_overwrite { + cosmos_ccfg.memo_prefix = memo.clone(); + } else { + cosmos_ccfg.memo_prefix.apply_suffix(&suffix); + } } } diff --git a/crates/relayer/src/chain/cosmos/config.rs b/crates/relayer/src/chain/cosmos/config.rs index 57314bccf5..a81ede704a 100644 --- a/crates/relayer/src/chain/cosmos/config.rs +++ b/crates/relayer/src/chain/cosmos/config.rs @@ -106,6 +106,9 @@ pub struct CosmosSdkConfig { #[serde(default)] pub memo_prefix: Memo, + #[serde(default)] + pub memo_overwrite: Option, + // This is an undocumented and hidden config to make the relayer wait for // DeliverTX before sending the next transaction when sending messages in // multiple batches. We will instruct relayer operators to turn this on diff --git a/tools/integration-test/src/tests/memo.rs b/tools/integration-test/src/tests/memo.rs index 2b44b90d48..52de0c5602 100644 --- a/tools/integration-test/src/tests/memo.rs +++ b/tools/integration-test/src/tests/memo.rs @@ -12,6 +12,8 @@ use ibc_test_framework::ibc::denom::derive_ibc_denom; use ibc_test_framework::prelude::*; use ibc_test_framework::util::random::{random_string, random_u128_range}; +const OVERWRITE_MEMO: &str = "Overwritten memo"; + #[test] fn test_memo() -> Result<(), Error> { let memo = Memo::new(random_string()).unwrap(); @@ -19,6 +21,13 @@ fn test_memo() -> Result<(), Error> { run_binary_channel_test(&test) } +#[test] +fn test_memo_overwrite() -> Result<(), Error> { + let memo = Memo::new(random_string()).unwrap(); + let test = MemoTest { memo }; + run_binary_channel_test(&test) +} + pub struct MemoTest { memo: Memo, } @@ -82,6 +91,70 @@ impl BinaryChannelTest for MemoTest { } } +pub struct MemoOverwriteTest { + memo: Memo, +} + +impl TestOverrides for MemoOverwriteTest { + fn modify_relayer_config(&self, config: &mut Config) { + for chain in config.chains.iter_mut() { + match chain { + ChainConfig::CosmosSdk(chain_config) => { + chain_config.memo_prefix = self.memo.clone(); + chain_config.memo_overwrite = Some(Memo::new(OVERWRITE_MEMO).unwrap()) + } + } + } + } +} + +impl BinaryChannelTest for MemoOverwriteTest { + fn run( + &self, + _config: &TestConfig, + _relayer: RelayerDriver, + chains: ConnectedChains, + channel: ConnectedChannel, + ) -> Result<(), Error> { + info!( + "testing IBC transfer with memo configured: \"{}\"", + self.memo + ); + + let denom_a = chains.node_a.denom(); + + let a_to_b_amount = random_u128_range(1000, 5000); + + chains.node_a.chain_driver().ibc_transfer_token( + &channel.port_a.as_ref(), + &channel.channel_id_a.as_ref(), + &chains.node_a.wallets().user1(), + &chains.node_b.wallets().user1().address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + )?; + + let denom_b = derive_ibc_denom( + &channel.port_b.as_ref(), + &channel.channel_id_b.as_ref(), + &denom_a, + )?; + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &chains.node_b.wallets().user1().address(), + &denom_b.with_amount(a_to_b_amount).as_ref(), + )?; + + let tx_info = chains + .node_b + .chain_driver() + .query_recipient_transactions(&chains.node_b.wallets().user1().address())?; + + assert_tx_memo_equals(&tx_info, OVERWRITE_MEMO)?; + + Ok(()) + } +} + fn assert_tx_memo_equals(tx_info: &json::Value, expected_memo: &str) -> Result<(), Error> { debug!("comparing memo field from json value {}", tx_info); diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index 9d4e7ea280..c898322da0 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -191,6 +191,7 @@ impl FullNode { packet_filter: Default::default(), address_type: chain_type.address_type(), memo_prefix: Default::default(), + memo_overwrite: None, proof_specs: Default::default(), extension_options: Default::default(), sequential_batch_tx: false, From df29acc3f83923e04a4f2bd3a4ade7a9c1ef5046 Mon Sep 17 00:00:00 2001 From: Martin Dyring-Andersen Date: Mon, 4 Mar 2024 15:20:04 +0100 Subject: [PATCH 040/200] Recover from gas simulation failures on legacy chains (#3793) Closes: #3792 Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> --- .../ibc-relayer-cli/3792-legacy-simulation.md | 2 ++ crates/relayer/src/chain/cosmos/estimate.rs | 1 + crates/relayer/src/error.rs | 8 ++++++++ 3 files changed, 11 insertions(+) create mode 100644 .changelog/unreleased/improvements/ibc-relayer-cli/3792-legacy-simulation.md diff --git a/.changelog/unreleased/improvements/ibc-relayer-cli/3792-legacy-simulation.md b/.changelog/unreleased/improvements/ibc-relayer-cli/3792-legacy-simulation.md new file mode 100644 index 0000000000..f09d5088c1 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer-cli/3792-legacy-simulation.md @@ -0,0 +1,2 @@ +- Recover from gas simulation failures on legacy chains. + ([\#3792](https://github.com/informalsystems/hermes/issues/3792)) diff --git a/crates/relayer/src/chain/cosmos/estimate.rs b/crates/relayer/src/chain/cosmos/estimate.rs index 79772e92c8..461ab6ae14 100644 --- a/crates/relayer/src/chain/cosmos/estimate.rs +++ b/crates/relayer/src/chain/cosmos/estimate.rs @@ -190,6 +190,7 @@ fn can_recover_from_simulation_failure(e: &Error) -> bool { detail.is_client_state_height_too_low() || detail.is_account_sequence_mismatch_that_can_be_ignored() || detail.is_out_of_order_packet_sequence_error() + || detail.is_empty_tx_error() } _ => false, } diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index 301e344e6a..4dcde924d4 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -709,6 +709,14 @@ impl GrpcStatusSubdetail { Some((expected, got)) => expected < got, } } + + /// Check whether this gRPC error message contains the string "invalid empty tx". + /// + /// ## Note + /// This error may happen for older chains that does not properly support simulation. + pub fn is_empty_tx_error(&self) -> bool { + self.status.message().contains("invalid empty tx") + } } /// Assumes that the cosmos-sdk account sequence mismatch error message, that may be seen From 0b29b589e30713c16c68fd50a1a694ae261e932e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 08:58:25 +0000 Subject: [PATCH 041/200] Bump tempfile from 3.9.0 to 3.10.1 (#3870) --- Cargo.lock | 9 ++++----- tools/integration-test/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e917c96f54..91939e9017 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2620,9 +2620,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.30" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ "bitflags 2.4.2", "errno", @@ -3202,13 +3202,12 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if 1.0.0", "fastrand", - "redox_syscall", "rustix", "windows-sys 0.52.0", ] diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 9580ba24bf..e483593209 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -49,7 +49,7 @@ name = "test_setup_with_binary_channel" doc = true [dev-dependencies] -tempfile = "3.6.0" +tempfile = "3.10.1" [dependencies.tendermint] version = "0.34.0" From 8c1b1ff8e63f4591586f41e2df611d80abae73c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 09:00:42 +0000 Subject: [PATCH 042/200] Bump secp256k1 from 0.28.1 to 0.28.2 (#3869) --- Cargo.lock | 4 ++-- crates/relayer/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 91939e9017..77e2334023 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2736,9 +2736,9 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.1" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f622567e3b4b38154fb8190bcf6b160d7a4301d70595a49195b48c116007a27" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ "bitcoin_hashes", "rand", diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index bdbfbcffb4..b38ec1ec2e 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -66,7 +66,7 @@ ed25519 = "2.2.2" ed25519-dalek = { version = "2.0.0", features = ["serde"] } ed25519-dalek-bip32 = "0.3.0" generic-array = "0.14.7" -secp256k1 = { version = "0.28.1", features = ["rand-std"] } +secp256k1 = { version = "0.28.2", features = ["rand-std"] } strum = { version = "0.25", features = ["derive"] } tokio-stream = "0.1.14" once_cell = "1.19.0" From 9c641ae3bbd8002912cf9feaefaa096ac2295bb1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 09:03:55 +0000 Subject: [PATCH 043/200] Bump anyhow from 1.0.79 to 1.0.80 (#3868) --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77e2334023..6ca934a4f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,9 +115,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "arc-swap" From 2f9fdb575fc227f27a1cad763c4430385cf4e075 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 09:59:28 +0000 Subject: [PATCH 044/200] Bump thiserror from 1.0.56 to 1.0.57 (#3866) --- Cargo.lock | 8 ++++---- crates/relayer/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ca934a4f1..5c1142f9b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3425,18 +3425,18 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index b38ec1ec2e..1dbe5efd62 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -28,7 +28,7 @@ subtle-encoding = "0.5" humantime-serde = "1.1.1" serde = "1.0" serde_derive = "1.0" -thiserror = "1.0.56" +thiserror = "1.0.57" toml = "0.8" tracing = "0.1.36" tokio = { version = "1.0", features = ["rt-multi-thread", "time", "sync"] } From 40d74f6cac8a19b1b4cbaa3ea4742c7c028097f9 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Wed, 6 Mar 2024 13:57:21 +0100 Subject: [PATCH 045/200] Fix Rust toolchain nightly version to 2024-03-03 for cargo-doc CI job (#3875) --- .github/workflows/cargo-doc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo-doc.yaml b/.github/workflows/cargo-doc.yaml index 55bcfe0330..1cb9f346a6 100644 --- a/.github/workflows/cargo-doc.yaml +++ b/.github/workflows/cargo-doc.yaml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: - toolchain: nightly + toolchain: nightly-2024-03-03 override: true - name: Build API documentation From 0f690a086b2e657f0df4777e260b4c2788b1416e Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:08:11 +0100 Subject: [PATCH 046/200] Add configuration to skip packet sequences when clearing (#3862) * Implement packet clearing filtering logic * Add tests for packet clearing filter * Add documentation * Add changelog entry * Add excluded sequences to `LinkParameters` struct * Fix sequence filter by adding setting it to be per-channel * Skip sequence filter test with Celestia due to the token filter module * Small refactor * Small cleanup --------- Co-authored-by: Romain Ruetschi --- .../3754-filter-packet-clearing.md | 5 + config.toml | 12 + crates/relayer-cli/src/chain_registry.rs | 9 +- crates/relayer-cli/src/commands/clear.rs | 58 +- crates/relayer-cli/src/commands/tx/packet.rs | 8 + crates/relayer/src/chain/cosmos.rs | 18 +- crates/relayer/src/chain/cosmos/config.rs | 6 +- crates/relayer/src/config.rs | 12 + crates/relayer/src/link.rs | 29 +- crates/relayer/src/link/relay_path.rs | 16 + crates/relayer/src/worker.rs | 7 + .../configuration/packet-clearing.md | 19 +- .../src/tests/clear_packet.rs | 20 +- .../src/tests/execute_schedule.rs | 1 + tools/integration-test/src/tests/mod.rs | 2 + .../src/tests/ordered_channel_clear.rs | 3 + .../src/tests/query_packet.rs | 22 +- .../src/tests/sequence_filter.rs | 569 ++++++++++++++++++ tools/test-framework/src/types/single/node.rs | 2 + 19 files changed, 771 insertions(+), 47 deletions(-) create mode 100644 .changelog/unreleased/features/ibc-relayer/3754-filter-packet-clearing.md create mode 100644 tools/integration-test/src/tests/sequence_filter.rs diff --git a/.changelog/unreleased/features/ibc-relayer/3754-filter-packet-clearing.md b/.changelog/unreleased/features/ibc-relayer/3754-filter-packet-clearing.md new file mode 100644 index 0000000000..bdf29e069e --- /dev/null +++ b/.changelog/unreleased/features/ibc-relayer/3754-filter-packet-clearing.md @@ -0,0 +1,5 @@ +- Add a per-chain configuration `excluded_sequences` allowing + users to specify a list of packet sequences which will not be + cleared. + This configuration has no impact on standard packet relaying. + ([\#3754](https://github.com/informalsystems/hermes/issues/3754)) \ No newline at end of file diff --git a/config.toml b/config.toml index 63c5881060..11c8110ea5 100644 --- a/config.toml +++ b/config.toml @@ -440,6 +440,18 @@ memo_prefix = '' # This will override the global clear interval for this chain only, allowing different intervals for each chain. # clear_interval = 50 +# Specify packet sequences which should not be cleared, per channel. +# +# For each channel, specify a list of sequences which should not be cleared, eg. +# +# excluded_sequences = [ +# ['channel-0', [1, 2, 3]], +# ['channel-1', [4, 5, 6]] +# ] +# +# Default: No filter +# excluded_sequences = [] + [[chains]] id = 'ibc-1' rpc_addr = 'http://127.0.0.1:26557' diff --git a/crates/relayer-cli/src/chain_registry.rs b/crates/relayer-cli/src/chain_registry.rs index 93f68821b1..717bf10bae 100644 --- a/crates/relayer-cli/src/chain_registry.rs +++ b/crates/relayer-cli/src/chain_registry.rs @@ -1,12 +1,12 @@ //! Contains functions to generate a relayer config for a given chain -use std::collections::HashMap; -use std::fmt::Display; -use std::marker::Send; - use futures::future::join_all; use http::Uri; use ibc_relayer::config::dynamic_gas::DynamicGasPrice; +use std::collections::BTreeMap; +use std::collections::HashMap; +use std::fmt::Display; +use std::marker::Send; use tokio::task::{JoinError, JoinHandle}; use tracing::{error, trace}; @@ -173,6 +173,7 @@ where extension_options: Vec::new(), compat_mode: None, clear_interval: None, + excluded_sequences: BTreeMap::new(), })) } diff --git a/crates/relayer-cli/src/commands/clear.rs b/crates/relayer-cli/src/commands/clear.rs index 7535614312..2f95d28c6e 100644 --- a/crates/relayer-cli/src/commands/clear.rs +++ b/crates/relayer-cli/src/commands/clear.rs @@ -5,6 +5,7 @@ use abscissa_core::config::Override; use abscissa_core::{Command, FrameworkErrorKind, Runnable}; use ibc_relayer::chain::handle::{BaseChainHandle, ChainHandle}; +use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeight}; use ibc_relayer::config::Config; use ibc_relayer::link::error::LinkError; use ibc_relayer::link::{Link, LinkParameters}; @@ -146,27 +147,74 @@ impl Runnable for ClearPacketsCmd { } } - let mut ev_list = vec![]; + let (channel, _) = match chains.src.query_channel( + QueryChannelRequest { + port_id: self.port_id.clone(), + channel_id: self.channel_id.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) { + Ok(channel) => channel, + Err(e) => Output::error(e).exit(), + }; + + let exclude_src_sequences = config + .find_chain(&chains.src.id()) + .map(|chain_config| chain_config.excluded_sequences(&self.channel_id).to_vec()) + .unwrap_or_default(); + + let exclude_dst_sequences = + if let Some(counterparty_channel_id) = channel.counterparty().channel_id() { + config + .find_chain(&chains.dst.id()) + .map(|chain_config| { + chain_config + .excluded_sequences(counterparty_channel_id) + .to_vec() + }) + .unwrap_or_default() + } else { + Vec::new() + }; // Construct links in both directions. - let opts = LinkParameters { + let fwd_opts = LinkParameters { src_port_id: self.port_id.clone(), src_channel_id: self.channel_id.clone(), max_memo_size: config.mode.packets.ics20_max_memo_size, max_receiver_size: config.mode.packets.ics20_max_receiver_size, + exclude_src_sequences, }; - let fwd_link = match Link::new_from_opts(chains.src.clone(), chains.dst, opts, false, false) - { + // Construct links in both directions. + let reverse_opts = LinkParameters { + src_port_id: self.port_id.clone(), + src_channel_id: self.channel_id.clone(), + max_memo_size: config.mode.packets.ics20_max_memo_size, + max_receiver_size: config.mode.packets.ics20_max_receiver_size, + exclude_src_sequences: exclude_dst_sequences, + }; + + let fwd_link = match Link::new_from_opts( + chains.src.clone(), + chains.dst.clone(), + fwd_opts, + false, + false, + ) { Ok(link) => link, Err(e) => Output::error(e).exit(), }; - let rev_link = match fwd_link.reverse(false, false) { + let rev_link = match Link::new_from_opts(chains.dst, chains.src, reverse_opts, false, false) + { Ok(link) => link, Err(e) => Output::error(e).exit(), }; + let mut ev_list = vec![]; + // Schedule RecvPacket messages for pending packets in both directions or, // if packet sequences are provided, only on the specified chain. // This may produce pending acks which will be processed in the next phase. diff --git a/crates/relayer-cli/src/commands/tx/packet.rs b/crates/relayer-cli/src/commands/tx/packet.rs index 9a81666b37..898f4e5832 100644 --- a/crates/relayer-cli/src/commands/tx/packet.rs +++ b/crates/relayer-cli/src/commands/tx/packet.rs @@ -88,7 +88,11 @@ impl Runnable for TxPacketRecvCmd { src_channel_id: self.src_channel_id.clone(), max_memo_size: config.mode.packets.ics20_max_memo_size, max_receiver_size: config.mode.packets.ics20_max_receiver_size, + + // Packets are only excluded when clearing + exclude_src_sequences: vec![], }; + let link = match Link::new_from_opts(chains.src, chains.dst, opts, false, false) { Ok(link) => link, Err(e) => Output::error(e).exit(), @@ -185,7 +189,11 @@ impl Runnable for TxPacketAckCmd { src_channel_id: self.src_channel_id.clone(), max_memo_size: config.mode.packets.ics20_max_memo_size, max_receiver_size: config.mode.packets.ics20_max_receiver_size, + + // Packets are only excluded when clearing + exclude_src_sequences: vec![], }; + let link = match Link::new_from_opts(chains.src, chains.dst, opts, false, false) { Ok(link) => link, Err(e) => Output::error(e).exit(), diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index aa3954f1b2..8b2ccb0b7e 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -63,6 +63,7 @@ use tendermint_rpc::endpoint::status; use tendermint_rpc::{Client, HttpClient, Order}; use crate::account::Balance; +use crate::chain::client::ClientSettings; use crate::chain::cosmos::batch::{ send_batched_messages_and_wait_check_tx, send_batched_messages_and_wait_commit, sequential_send_batched_messages_and_wait_commit, @@ -91,6 +92,7 @@ use crate::chain::handle::Subscription; use crate::chain::requests::*; use crate::chain::tracking::TrackedMsgs; use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; +use crate::config::Error as ConfigError; use crate::config::{parse_gas_prices, ChainConfig, GasPrice}; use crate::consensus_state::AnyConsensusState; use crate::denom::DenomTrace; @@ -102,10 +104,10 @@ use crate::light_client::tendermint::LightClient as TmLightClient; use crate::light_client::{LightClient, Verified}; use crate::misbehaviour::MisbehaviourEvidence; use crate::util::compat_mode::compat_mode_from_version; +use crate::util::pretty::PrettySlice; use crate::util::pretty::{ PrettyIdentifiedChannel, PrettyIdentifiedClientState, PrettyIdentifiedConnection, }; -use crate::{chain::client::ClientSettings, config::Error as ConfigError}; use self::gas::dynamic_gas_price; use self::types::app_state::GenesisAppState; @@ -671,8 +673,7 @@ impl CosmosSdkChain { let mut client = self .block_on(ServiceClient::connect(grpc_addr.clone())) - .map_err(Error::grpc_transport) - .unwrap(); + .map_err(Error::grpc_transport)?; let request = tonic::Request::new(GetSyncingRequest {}); @@ -2430,6 +2431,17 @@ fn do_health_check(chain: &CosmosSdkChain) -> Result<(), Error> { let grpc_address = chain.grpc_addr.to_string(); let rpc_address = chain.config.rpc_addr.to_string(); + if !chain.config.excluded_sequences.is_empty() { + for (channel_id, seqs) in chain.config.excluded_sequences.iter() { + if !seqs.is_empty() { + warn!( + "chain '{chain_id}' will not clear packets on channel '{channel_id}' with sequences: {}. \ + Ignore this warning if this configuration is correct.", PrettySlice(seqs) + ); + } + } + } + chain.block_on(chain.rpc_client.health()).map_err(|e| { Error::health_check_json_rpc( chain_id.clone(), diff --git a/crates/relayer/src/chain/cosmos/config.rs b/crates/relayer/src/chain/cosmos/config.rs index a81ede704a..dab51398e6 100644 --- a/crates/relayer/src/chain/cosmos/config.rs +++ b/crates/relayer/src/chain/cosmos/config.rs @@ -1,12 +1,14 @@ use core::time::Duration; +use std::collections::BTreeMap; use std::path::PathBuf; use byte_unit::Byte; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; use serde_derive::{Deserialize, Serialize}; use tendermint_rpc::Url; use ibc_relayer_types::core::ics23_commitment::specs::ProofSpecs; -use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId}; use crate::chain::cosmos::config::error::Error as ConfigError; use crate::config::compat_mode::CompatMode; @@ -146,6 +148,8 @@ pub struct CosmosSdkConfig { pub extension_options: Vec, pub compat_mode: Option, pub clear_interval: Option, + #[serde(default)] + pub excluded_sequences: BTreeMap>, } impl CosmosSdkConfig { diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index ec0afdaf34..c7fb2a2e70 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -14,6 +14,8 @@ use core::cmp::Ordering; use core::fmt::{Display, Error as FmtError, Formatter}; use core::str::FromStr; use core::time::Duration; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use std::borrow::Cow; use std::{fs, fs::File, io::Write, ops::Range, path::Path}; use byte_unit::Byte; @@ -703,6 +705,16 @@ impl ChainConfig { Self::CosmosSdk(config) => config.query_packets_chunk_size = query_packets_chunk_size, } } + + pub fn excluded_sequences(&self, channel_id: &ChannelId) -> Cow<'_, [Sequence]> { + match self { + Self::CosmosSdk(config) => config + .excluded_sequences + .get(channel_id) + .map(|seqs| Cow::Borrowed(seqs.as_slice())) + .unwrap_or_else(|| Cow::Owned(Vec::new())), + } + } } // /!\ Update me when adding a new chain type! diff --git a/crates/relayer/src/link.rs b/crates/relayer/src/link.rs index 4c0fc849b2..bc4cf282fb 100644 --- a/crates/relayer/src/link.rs +++ b/crates/relayer/src/link.rs @@ -1,6 +1,7 @@ use ibc_relayer_types::core::{ ics03_connection::connection::State as ConnectionState, ics04_channel::channel::State as ChannelState, + ics04_channel::packet::Sequence, ics24_host::identifier::{ChannelId, PortChannelId, PortId}, }; use tracing::info; @@ -38,6 +39,7 @@ pub struct LinkParameters { pub src_channel_id: ChannelId, pub max_memo_size: Ics20FieldSizeLimit, pub max_receiver_size: Ics20FieldSizeLimit, + pub exclude_src_sequences: Vec, } pub struct Link { @@ -177,31 +179,4 @@ impl Link { Link::new(channel, with_tx_confirmation, opts) } - - /// Constructs a link around the channel that is reverse to the channel - /// in this link. - pub fn reverse( - &self, - with_tx_confirmation: bool, - auto_register_counterparty_payee: bool, - ) -> Result, LinkError> { - let opts = LinkParameters { - src_port_id: self.a_to_b.dst_port_id().clone(), - src_channel_id: self.a_to_b.dst_channel_id().clone(), - max_memo_size: self.a_to_b.max_memo_size, - max_receiver_size: self.a_to_b.max_receiver_size, - }; - let chain_b = self.a_to_b.dst_chain().clone(); - let chain_a = self.a_to_b.src_chain().clone(); - - // Some of the checks and initializations may be redundant; - // going slowly, but reliably. - Link::new_from_opts( - chain_b, - chain_a, - opts, - with_tx_confirmation, - auto_register_counterparty_payee, - ) - } } diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index 9dd3c570c0..a1372b8bbf 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -1,5 +1,6 @@ use alloc::collections::BTreeMap as HashMap; use alloc::collections::VecDeque; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; use std::ops::Sub; use std::time::{Duration, Instant}; @@ -115,6 +116,7 @@ pub struct RelayPath { pub max_memo_size: Ics20FieldSizeLimit, pub max_receiver_size: Ics20FieldSizeLimit, + pub exclude_src_sequences: Vec, } impl RelayPath { @@ -163,6 +165,8 @@ impl RelayPath { max_memo_size: link_parameters.max_memo_size, max_receiver_size: link_parameters.max_receiver_size, + + exclude_src_sequences: link_parameters.exclude_src_sequences, }) } @@ -1155,6 +1159,12 @@ impl RelayPath { return Ok(()); } + // Retain only sequences which should not be filtered out + let sequences: Vec = sequences + .into_iter() + .filter(|sequence| !self.exclude_src_sequences.contains(sequence)) + .collect(); + debug!( dst_chain = %self.dst_chain().id(), src_chain = %self.src_chain().id(), @@ -1219,6 +1229,12 @@ impl RelayPath { return Ok(()); } + // Retain only sequences which should not be filtered out + let sequences: Vec = sequences + .into_iter() + .filter(|sequence| !self.exclude_src_sequences.contains(sequence)) + .collect(); + debug!( dst_chain = %self.dst_chain().id(), src_chain = %self.src_chain().id(), diff --git a/crates/relayer/src/worker.rs b/crates/relayer/src/worker.rs index 40f73b67de..4315c05581 100644 --- a/crates/relayer/src/worker.rs +++ b/crates/relayer/src/worker.rs @@ -110,6 +110,12 @@ pub fn spawn_worker_tasks( (Some(cmd_tx), None) } Object::Packet(path) => { + let exclude_src_sequences = config + .find_chain(&chains.a.id()) + .map(|chain_config| chain_config.excluded_sequences(&path.src_channel_id)) + .unwrap_or_default() + .to_vec(); + let packets_config = config.mode.packets; let link_res = Link::new_from_opts( chains.a.clone(), @@ -119,6 +125,7 @@ pub fn spawn_worker_tasks( src_channel_id: path.src_channel_id.clone(), max_memo_size: packets_config.ics20_max_memo_size, max_receiver_size: packets_config.ics20_max_receiver_size, + exclude_src_sequences, }, packets_config.tx_confirmation, packets_config.auto_register_counterparty_payee, diff --git a/guide/src/documentation/configuration/packet-clearing.md b/guide/src/documentation/configuration/packet-clearing.md index b12dd4d27d..805c061b31 100644 --- a/guide/src/documentation/configuration/packet-clearing.md +++ b/guide/src/documentation/configuration/packet-clearing.md @@ -2,7 +2,7 @@ Hermes can be configured in order to clear packets which haven't been relayed. This can happen if there wasn't a relayer instance running when the packet event was submitted or if there was an issue relaying the packet. -There are three different configurations to determine when Hermes will clear packets. +There are four different configurations to determine when Hermes will clear packets. ## Global configurations @@ -32,7 +32,7 @@ This configuration defines how often Hermes will verify if there are pending pac ## Chain specific configuration -The third configuration is specific for each chain. +The third and fourth configurations are specific for each chain. ### 3. `clear_interval` @@ -42,4 +42,17 @@ The third configuration is specific for each chain. clear_interval = 50 ``` -An additional `clear_interval` can be specified for each chain, this value is also in number of blocks. This configuration will override the clear interval value for the specific chain and can be used if chains need to have different clear values. This configuration is optional, if it is not set the global value will be used. \ No newline at end of file +An additional `clear_interval` can be specified for each chain, this value is also in number of blocks. This configuration will override the clear interval value for the specific chain and can be used if chains need to have different clear values. This configuration is optional, if it is not set the global value will be used. + +### 4. `excluded_sequences` + +```toml +[[chains]] +... +excluded_sequences = [ + ['channel-0', [1, 2, 3]], + ['channel-1', [4, 5, 6]] +] +``` + +It is possible to specify which packet sequences should be ignored when clearing packets for specific channels. This can be used when there are stuck packets which need to be handled in a specific way, but it is still required to clear the other stuck packets. This configuration will only filter packet when clearing, standard relaying will not filter the sequences configured in `excluded_sequences`. \ No newline at end of file diff --git a/tools/integration-test/src/tests/clear_packet.rs b/tools/integration-test/src/tests/clear_packet.rs index 6da6147806..ce9a94ada9 100644 --- a/tools/integration-test/src/tests/clear_packet.rs +++ b/tools/integration-test/src/tests/clear_packet.rs @@ -487,6 +487,15 @@ impl BinaryChannelTest for ClearPacketSequencesTest { src_channel_id: channel.channel_id_a.clone().into_value(), max_memo_size: packet_config.ics20_max_memo_size, max_receiver_size: packet_config.ics20_max_receiver_size, + exclude_src_sequences: vec![], + }; + + let rev_opts = LinkParameters { + src_port_id: channel.port_b.clone().into_value(), + src_channel_id: channel.channel_id_b.clone().into_value(), + max_memo_size: packet_config.ics20_max_memo_size, + max_receiver_size: packet_config.ics20_max_receiver_size, + exclude_src_sequences: vec![], }; // Clear all even packets @@ -532,8 +541,15 @@ impl BinaryChannelTest for ClearPacketSequencesTest { info!("Clearing all unreceived ack packets ({})", to_clear.len()); - let rev_link = link.reverse(false, false).unwrap(); - rev_link.relay_ack_packet_messages(to_clear).unwrap(); + let rev_link = Link::new_from_opts( + chains.handle_b().clone(), + chains.handle_a().clone(), + rev_opts, + false, + false, + )?; + + rev_link.relay_ack_packet_messages(to_clear)?; let pending_packets_a = pending_packet_summary(chains.handle_a(), chains.handle_b(), channel_end_a.value())?; diff --git a/tools/integration-test/src/tests/execute_schedule.rs b/tools/integration-test/src/tests/execute_schedule.rs index cd14968f33..e74c70822e 100644 --- a/tools/integration-test/src/tests/execute_schedule.rs +++ b/tools/integration-test/src/tests/execute_schedule.rs @@ -49,6 +49,7 @@ impl BinaryChannelTest for ExecuteScheduleTest { src_channel_id: channel.channel_id_a.clone().into_value(), max_memo_size: packet_config.ics20_max_memo_size, max_receiver_size: packet_config.ics20_max_receiver_size, + exclude_src_sequences: vec![], }; let chain_a_link = Link::new_from_opts( diff --git a/tools/integration-test/src/tests/mod.rs b/tools/integration-test/src/tests/mod.rs index 373cf4d276..b6bff318ab 100644 --- a/tools/integration-test/src/tests/mod.rs +++ b/tools/integration-test/src/tests/mod.rs @@ -22,6 +22,8 @@ pub mod ics20_filter; pub mod memo; pub mod python; pub mod query_packet; +#[cfg(not(feature = "celestia"))] +pub mod sequence_filter; pub mod supervisor; pub mod tendermint; #[cfg(not(feature = "celestia"))] diff --git a/tools/integration-test/src/tests/ordered_channel_clear.rs b/tools/integration-test/src/tests/ordered_channel_clear.rs index a005df8f62..acc9f0bee1 100644 --- a/tools/integration-test/src/tests/ordered_channel_clear.rs +++ b/tools/integration-test/src/tests/ordered_channel_clear.rs @@ -121,6 +121,7 @@ impl BinaryChannelTest for OrderedChannelClearTest { src_channel_id: channel.channel_id_a.clone().into_value(), max_memo_size: packet_config.ics20_max_memo_size, max_receiver_size: packet_config.ics20_max_receiver_size, + exclude_src_sequences: vec![], }; let chain_a_link = Link::new_from_opts( @@ -136,6 +137,7 @@ impl BinaryChannelTest for OrderedChannelClearTest { src_channel_id: channel.channel_id_b.clone().into_value(), max_memo_size: packet_config.ics20_max_memo_size, max_receiver_size: packet_config.ics20_max_receiver_size, + exclude_src_sequences: vec![], }; let chain_b_link = Link::new_from_opts( @@ -272,6 +274,7 @@ impl BinaryChannelTest for OrderedChannelClearEqualCLITest { src_channel_id: channel.channel_id_a.into_value(), max_memo_size: packet_config.ics20_max_memo_size, max_receiver_size: packet_config.ics20_max_receiver_size, + exclude_src_sequences: vec![], }; let chain_a_link = Link::new_from_opts( diff --git a/tools/integration-test/src/tests/query_packet.rs b/tools/integration-test/src/tests/query_packet.rs index 4ae21ac725..08a2f90870 100644 --- a/tools/integration-test/src/tests/query_packet.rs +++ b/tools/integration-test/src/tests/query_packet.rs @@ -62,7 +62,17 @@ impl BinaryChannelTest for QueryPacketPendingTest { src_channel_id: channel.channel_id_a.clone().into_value(), max_memo_size: packet_config.ics20_max_memo_size, max_receiver_size: packet_config.ics20_max_receiver_size, + exclude_src_sequences: vec![], }; + + let rev_opts = LinkParameters { + src_port_id: channel.port_b.clone().into_value(), + src_channel_id: channel.channel_id_b.clone().into_value(), + max_memo_size: packet_config.ics20_max_memo_size, + max_receiver_size: packet_config.ics20_max_receiver_size, + exclude_src_sequences: vec![], + }; + let link = Link::new_from_opts( chains.handle_a().clone(), chains.handle_b().clone(), @@ -93,8 +103,16 @@ impl BinaryChannelTest for QueryPacketPendingTest { assert_eq!(summary.unreceived_acks, [1.into()]); // Acknowledge the packet on the source chain - let link = link.reverse(false, false)?; - link.relay_ack_packet_messages(vec![])?; + + let rev_link = Link::new_from_opts( + chains.handle_b().clone(), + chains.handle_a().clone(), + rev_opts, + false, + false, + )?; + + rev_link.relay_ack_packet_messages(vec![])?; let summary = pending_packet_summary(chains.handle_a(), chains.handle_b(), channel_end.value())?; diff --git a/tools/integration-test/src/tests/sequence_filter.rs b/tools/integration-test/src/tests/sequence_filter.rs new file mode 100644 index 0000000000..177773bf4a --- /dev/null +++ b/tools/integration-test/src/tests/sequence_filter.rs @@ -0,0 +1,569 @@ +//! This tests different scenarios for the packet sequence filter. +//! The purpose of this filter is to only filter out packets when clearing, +//! standard relaying should not be affected by this configuration. +//! +//! `FilterClearOnStartTest` tests that the packets sequences configured in +//! `excluded_sequences` are not relayed when clearing packet on start. +//! +//! `FilterClearIntervalTest` tests that the packet sequences configured in +//! `excluded_sequences` are not relayed when the clear interval is triggered. +//! +//! `ClearNoFilterTest` tests that packets are correctly cleared if there is no +//! packet sequence configured in `excluded_sequences`. +//! +//! `StandardRelayingNoFilterTest` tests that even if a packet sequence is +//! configured in the `excluded_sequences` it will be relayed by the running +//! instance. + +use std::collections::BTreeMap; + +use ibc_relayer::config::ChainConfig; +use ibc_test_framework::{ + prelude::*, + relayer::channel::{assert_eventually_channel_established, init_channel}, +}; + +#[test] +fn test_filter_clear_on_start() -> Result<(), Error> { + run_binary_channel_test(&FilterClearOnStartTest) +} + +#[test] +fn test_filter_clear_interval() -> Result<(), Error> { + run_binary_channel_test(&FilterClearIntervalTest) +} + +#[test] +fn test_clear_no_filter() -> Result<(), Error> { + run_binary_channel_test(&ClearNoFilterTest) +} + +#[test] +fn test_no_filter_standard_relaying() -> Result<(), Error> { + run_binary_channel_test(&StandardRelayingNoFilterTest) +} + +pub struct FilterClearOnStartTest; + +impl TestOverrides for FilterClearOnStartTest { + fn modify_relayer_config(&self, config: &mut Config) { + let mut excluded_sequences = BTreeMap::new(); + excluded_sequences.insert(ChannelId::new(2), vec![2.into()]); + let chain_a = &mut config.chains[0]; + match chain_a { + ChainConfig::CosmosSdk(chain_config) => { + chain_config.excluded_sequences = excluded_sequences; + } + } + config.mode.channels.enabled = true; + + config.mode.packets.clear_on_start = true; + config.mode.packets.clear_interval = 0; + + config.mode.clients.misbehaviour = false; + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +impl BinaryChannelTest for FilterClearOnStartTest { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + run_sequence_filter_test(relayer, chains, channels) + } +} + +pub struct FilterClearIntervalTest; + +impl TestOverrides for FilterClearIntervalTest { + fn modify_relayer_config(&self, config: &mut Config) { + let mut excluded_sequences = BTreeMap::new(); + excluded_sequences.insert(ChannelId::new(2), vec![2.into()]); + let chain_a = &mut config.chains[0]; + match chain_a { + ChainConfig::CosmosSdk(chain_config) => { + chain_config.excluded_sequences = excluded_sequences; + } + } + config.mode.channels.enabled = true; + + config.mode.packets.clear_on_start = false; + config.mode.packets.clear_interval = 10; + + config.mode.clients.misbehaviour = false; + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +impl BinaryChannelTest for FilterClearIntervalTest { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + run_sequence_filter_test(relayer, chains, channels) + } +} + +pub struct ClearNoFilterTest; + +impl TestOverrides for ClearNoFilterTest { + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.channels.enabled = true; + + config.mode.packets.clear_on_start = true; + config.mode.packets.clear_interval = 0; + + config.mode.clients.misbehaviour = false; + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +impl BinaryChannelTest for ClearNoFilterTest { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + let denom_a = chains.node_a.denom(); + let denom_a_to_b = derive_ibc_denom( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &denom_a, + )?; + let denom_b = chains.node_b.denom(); + let denom_b_to_a = derive_ibc_denom( + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &denom_b, + )?; + + let wallet_a = chains.node_a.wallets().user1().cloned(); + let wallet_b = chains.node_b.wallets().user1().cloned(); + + let a_to_b_amount = 12345u64; + let b_to_a_amount = 54321u64; + + let balance_a = chains + .node_a + .chain_driver() + .query_balance(&wallet_a.address(), &denom_a)?; + + let balance_b = chains + .node_b + .chain_driver() + .query_balance(&wallet_b.address(), &denom_b)?; + + // Create a pending transfer from A to B with sequence 1 + chains.node_a.chain_driver().ibc_transfer_token( + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + )?; + + // Create a pending transfer from A to B with sequence 2 + chains.node_a.chain_driver().ibc_transfer_token( + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + )?; + + // Create a pending transfer from B to A with sequence 1 + chains.node_b.chain_driver().ibc_transfer_token( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &wallet_b.as_ref(), + &wallet_a.address(), + &denom_b.with_amount(b_to_a_amount).as_ref(), + )?; + + // Create a pending transfer from B to A with sequence 2 + chains.node_b.chain_driver().ibc_transfer_token( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &wallet_b.as_ref(), + &wallet_a.address(), + &denom_b.with_amount(b_to_a_amount).as_ref(), + )?; + + relayer.with_supervisor(|| { + info!("Assert that the send from A escrowed tokens for both transfers"); + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &wallet_a.address(), + &(balance_a - 2 * a_to_b_amount).as_ref(), + )?; + + info!("Assert that only the first transfer A to B was cleared"); + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b.address(), + &denom_a_to_b.with_amount(2 * a_to_b_amount).as_ref(), + )?; + info!("Assert that the sender from B escrowed tokens for both transfers"); + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b.address(), + &(balance_b - 2 * b_to_a_amount).as_ref(), + )?; + + info!("Assert that both transfers from B to A were cleared"); + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &wallet_a.address(), + &denom_b_to_a.with_amount(2 * b_to_a_amount).as_ref(), + )?; + Ok(()) + }) + } +} + +pub struct StandardRelayingNoFilterTest; + +impl TestOverrides for StandardRelayingNoFilterTest { + fn modify_relayer_config(&self, config: &mut Config) { + let mut excluded_sequences = BTreeMap::new(); + excluded_sequences.insert(ChannelId::new(2), vec![2.into()]); + let chain_a = &mut config.chains[0]; + match chain_a { + ChainConfig::CosmosSdk(chain_config) => { + chain_config.excluded_sequences = excluded_sequences; + } + } + config.mode.packets.clear_on_start = true; + config.mode.packets.clear_interval = 0; + } + + fn should_spawn_supervisor(&self) -> bool { + true + } +} + +impl BinaryChannelTest for StandardRelayingNoFilterTest { + fn run( + &self, + _config: &TestConfig, + _relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + let denom_a = chains.node_a.denom(); + let denom_a_to_b = derive_ibc_denom( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &denom_a, + )?; + let denom_b = chains.node_b.denom(); + let denom_b_to_a = derive_ibc_denom( + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &denom_b, + )?; + + let wallet_a = chains.node_a.wallets().user1().cloned(); + let wallet_b = chains.node_b.wallets().user1().cloned(); + + let a_to_b_amount = 12345u64; + let b_to_a_amount = 54321u64; + + let balance_a = chains + .node_a + .chain_driver() + .query_balance(&wallet_a.address(), &denom_a)?; + + let balance_b = chains + .node_b + .chain_driver() + .query_balance(&wallet_b.address(), &denom_b)?; + + // Create a pending transfer from A to B with sequence 1 + chains.node_a.chain_driver().ibc_transfer_token( + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + )?; + + // Create a pending transfer from A to B with sequence 2 + chains.node_a.chain_driver().ibc_transfer_token( + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + )?; + + // Create a pending transfer from B to A with sequence 1 + chains.node_b.chain_driver().ibc_transfer_token( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &wallet_b.as_ref(), + &wallet_a.address(), + &denom_b.with_amount(b_to_a_amount).as_ref(), + )?; + + // Create a pending transfer from B to A with sequence 2 + chains.node_b.chain_driver().ibc_transfer_token( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &wallet_b.as_ref(), + &wallet_a.address(), + &denom_b.with_amount(b_to_a_amount).as_ref(), + )?; + + info!("Assert that the send from A escrowed tokens for both transfers"); + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &wallet_a.address(), + &(balance_a - 2 * a_to_b_amount).as_ref(), + )?; + + info!("Assert that only the first transfer A to B was cleared"); + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b.address(), + &denom_a_to_b.with_amount(2 * a_to_b_amount).as_ref(), + )?; + info!("Assert that the sender from B escrowed tokens for both transfers"); + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b.address(), + &(balance_b - 2 * b_to_a_amount).as_ref(), + )?; + + info!("Assert that both transfers from B to A were cleared"); + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &wallet_a.address(), + &denom_b_to_a.with_amount(2 * b_to_a_amount).as_ref(), + )?; + Ok(()) + } +} + +fn run_sequence_filter_test( + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, +) -> Result<(), Error> { + let (channel_id_a_2, channel_id_b_2, channel_b_2) = relayer.with_supervisor(|| { + // During test bootstrap channel padding initialises a channel with ID 0. + // Before creating the new channel with sequence filter, complete the handshake of + // the pad channel in order to insure that the retrieved channel IDs `channel_id_a_2` and + // `channel_id_b_2` are `channel-2` + let pad_channel_id = DualTagged::new(ChannelId::new(0)); + let _ = assert_eventually_channel_established( + chains.handle_b(), + chains.handle_a(), + &pad_channel_id.as_ref(), + &channels.port_b.as_ref(), + )?; + let (channel_id_b_2, channel_b_2) = init_channel( + chains.handle_a(), + chains.handle_b(), + &chains.client_id_a(), + &chains.client_id_b(), + &channels.connection.connection_id_a.as_ref(), + &channels.connection.connection_id_b.as_ref(), + &channels.port_a.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_id_a_2 = assert_eventually_channel_established( + chains.handle_b(), + chains.handle_a(), + &channel_id_b_2.as_ref(), + &channels.port_b.as_ref(), + )?; + Ok((channel_id_a_2, channel_id_b_2, channel_b_2)) + })?; + + let denom_a = chains.node_a.denom(); + let denom_a_to_b_1 = derive_ibc_denom( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &denom_a, + )?; + let denom_a_to_b_2 = derive_ibc_denom( + &channels.port_b.as_ref(), + &channel_id_b_2.as_ref(), + &denom_a, + )?; + let denom_b = chains.node_b.denom(); + let denom_b_to_a_1 = derive_ibc_denom( + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &denom_b, + )?; + let denom_b_to_a_2 = derive_ibc_denom( + &channels.port_a.as_ref(), + &channel_id_a_2.as_ref(), + &denom_b, + )?; + + let wallet_a_1 = chains.node_a.wallets().user1().cloned(); + let wallet_a_2 = chains.node_a.wallets().user2().cloned(); + let wallet_b_1 = chains.node_b.wallets().user1().cloned(); + let wallet_b_2 = chains.node_b.wallets().user2().cloned(); + + let a_to_b_amount = 12345u64; + let b_to_a_amount = 54321u64; + + let balance_a_1 = chains + .node_a + .chain_driver() + .query_balance(&wallet_a_1.address(), &denom_a)?; + + let balance_b_1 = chains + .node_b + .chain_driver() + .query_balance(&wallet_b_1.address(), &denom_b)?; + + let balance_a_2 = chains + .node_a + .chain_driver() + .query_balance(&wallet_a_2.address(), &denom_a)?; + + let balance_b_2 = chains + .node_b + .chain_driver() + .query_balance(&wallet_b_2.address(), &denom_b)?; + + // Double transfer from A to B on channel with filter + double_transfer( + chains.node_a.chain_driver(), + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &wallet_a_1.as_ref(), + &wallet_b_1.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + )?; + + let port_b_2: DualTagged = + DualTagged::new(channel_b_2.a_side.port_id()); + let port_a_2: DualTagged = + DualTagged::new(channel_b_2.clone().flipped().a_side.port_id().clone()); + + // Double transfer from A to B on channel without filter + double_transfer( + chains.node_a.chain_driver(), + &port_a_2.as_ref(), + &channel_id_a_2.as_ref(), + &wallet_a_2.as_ref(), + &wallet_b_2.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + )?; + + // Double transfer from B to A on channel with filter + double_transfer( + chains.node_b.chain_driver(), + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &wallet_b_1.as_ref(), + &wallet_a_1.address(), + &denom_b.with_amount(b_to_a_amount).as_ref(), + )?; + + // Double transfer from B to A on channel without filter + double_transfer( + chains.node_b.chain_driver(), + &port_b_2, + &channel_id_b_2.as_ref(), + &wallet_b_2.as_ref(), + &wallet_a_2.address(), + &denom_b.with_amount(b_to_a_amount).as_ref(), + )?; + + relayer.with_supervisor(|| { + info!("Assert that the send from A escrowed tokens for both transfers"); + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &wallet_a_1.address(), + &(balance_a_1 - 2 * a_to_b_amount).as_ref(), + )?; + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &wallet_a_2.address(), + &(balance_a_2 - 2 * a_to_b_amount).as_ref(), + )?; + + info!("Assert that only the first transfer A to B was cleared on channel with filter"); + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b_2.address(), + &denom_a_to_b_2.with_amount(a_to_b_amount).as_ref(), + )?; + + info!("Assert that both transfer A to B were cleared on channel without filter"); + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b_1.address(), + &denom_a_to_b_1.with_amount(2 * a_to_b_amount).as_ref(), + )?; + + info!("Assert that the sender from B escrowed tokens for both transfers on both channels"); + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b_1.address(), + &(balance_b_1 - 2 * b_to_a_amount).as_ref(), + )?; + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b_2.address(), + &(balance_b_2 - 2 * b_to_a_amount).as_ref(), + )?; + + info!("Assert that both transfers from B to A were cleared on both channels"); + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &wallet_a_1.address(), + &denom_b_to_a_1.with_amount(2 * b_to_a_amount).as_ref(), + )?; + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &wallet_a_2.address(), + &denom_b_to_a_2.with_amount(2 * b_to_a_amount).as_ref(), + )?; + + Ok(()) + }) +} + +fn double_transfer( + chain_driver: MonoTagged, + port_id: &TaggedPortIdRef, + channel_id: &TaggedChannelIdRef, + sender: &MonoTagged, + recipient: &MonoTagged, + token: &TaggedTokenRef, +) -> Result<(), Error> { + // Create a pending transfer from B to A with sequence 1 + chain_driver.ibc_transfer_token(port_id, channel_id, sender, recipient, token)?; + + // Create a pending transfer from B to A with sequence 2 + chain_driver.ibc_transfer_token(port_id, channel_id, sender, recipient, token)?; + + Ok(()) +} diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index c898322da0..b6241c0ade 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -13,6 +13,7 @@ use ibc_relayer::config::dynamic_gas::DynamicGasPrice; use ibc_relayer::config::gas_multiplier::GasMultiplier; use ibc_relayer::keyring::Store; use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use std::collections::BTreeMap; use std::sync::{Arc, RwLock}; use tendermint_rpc::Url; use tendermint_rpc::WebSocketClientUrl; @@ -197,6 +198,7 @@ impl FullNode { sequential_batch_tx: false, compat_mode, clear_interval: None, + excluded_sequences: BTreeMap::new(), })) } From cac00ee6e3231c594e62bd35a657b78e168ddbeb Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:47:52 +0100 Subject: [PATCH 047/200] Improve out of gas error log (#3874) * Add additional information for out of gas error * Add guide entry for troubleshooting gas errors * Add changelog entry * Apply suggestions from code review Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi --- .../ibc-relayer/3530-out-of-gas-error-log.md | 4 ++ crates/relayer/src/chain/cosmos/estimate.rs | 44 +++++++++++------ crates/relayer/src/chain/cosmos/retry.rs | 11 +++-- crates/relayer/src/chain/cosmos/tx.rs | 14 ++++-- crates/relayer/src/sdk_error.rs | 19 ++++++-- guide/src/SUMMARY.md | 1 + .../advanced/troubleshooting/gas-errors.md | 48 +++++++++++++++++++ 7 files changed, 113 insertions(+), 28 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/3530-out-of-gas-error-log.md create mode 100644 guide/src/advanced/troubleshooting/gas-errors.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/3530-out-of-gas-error-log.md b/.changelog/unreleased/improvements/ibc-relayer/3530-out-of-gas-error-log.md new file mode 100644 index 0000000000..f1742da3ed --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/3530-out-of-gas-error-log.md @@ -0,0 +1,4 @@ +- Improve the log diagnostic when an out of gas error is thrown. + And a new entry related to gas error has been added to the Hermes + guide. + ([\#3530](https://github.com/informalsystems/hermes/issues/3530)) \ No newline at end of file diff --git a/crates/relayer/src/chain/cosmos/estimate.rs b/crates/relayer/src/chain/cosmos/estimate.rs index 461ab6ae14..4223e39068 100644 --- a/crates/relayer/src/chain/cosmos/estimate.rs +++ b/crates/relayer/src/chain/cosmos/estimate.rs @@ -17,13 +17,26 @@ use crate::keyring::Secp256k1KeyPair; use crate::telemetry; use crate::util::pretty::PrettyFee; +pub enum EstimatedGas { + Simulated(u64), + Default(u64), +} + +impl EstimatedGas { + pub fn get_amount(&self) -> u64 { + match self { + Self::Simulated(amount) | Self::Default(amount) => *amount, + } + } +} + pub async fn estimate_tx_fees( config: &TxConfig, key_pair: &Secp256k1KeyPair, account: &Account, tx_memo: &Memo, messages: &[Any], -) -> Result { +) -> Result<(Fee, EstimatedGas), Error> { let gas_config = &config.gas_config; debug!( @@ -46,7 +59,7 @@ pub async fn estimate_tx_fees( signatures: signed_tx.signatures, }; - let estimated_fee = estimate_fee_with_tx( + let estimated_fee_and_gas = estimate_fee_with_tx( gas_config, &config.grpc_address, &config.rpc_address, @@ -56,7 +69,7 @@ pub async fn estimate_tx_fees( ) .await?; - Ok(estimated_fee) + Ok(estimated_fee_and_gas) } async fn estimate_fee_with_tx( @@ -66,7 +79,7 @@ async fn estimate_fee_with_tx( chain_id: &ChainId, tx: Tx, account: &Account, -) -> Result { +) -> Result<(Fee, EstimatedGas), Error> { let estimated_gas = { crate::time!( "estimate_gas_with_tx", @@ -78,29 +91,32 @@ async fn estimate_fee_with_tx( estimate_gas_with_tx(gas_config, grpc_address, tx, account).await }?; - if estimated_gas > gas_config.max_gas { + let estimated_gas_amount = estimated_gas.get_amount(); + + if estimated_gas_amount > gas_config.max_gas { debug!( - id = %chain_id, estimated = ?estimated_gas, max = ?gas_config.max_gas, + id = %chain_id, estimated = ?estimated_gas_amount, max = ?gas_config.max_gas, "send_tx: estimated gas is higher than max gas" ); return Err(Error::tx_simulate_gas_estimate_exceeded( chain_id.clone(), - estimated_gas, + estimated_gas_amount, gas_config.max_gas, )); } - let adjusted_fee = gas_amount_to_fee(gas_config, estimated_gas, chain_id, rpc_address).await; + let adjusted_fee = + gas_amount_to_fee(gas_config, estimated_gas_amount, chain_id, rpc_address).await; debug!( id = %chain_id, "send_tx: using {} gas, fee {}", - estimated_gas, + estimated_gas_amount, PrettyFee(&adjusted_fee) ); - Ok(adjusted_fee) + Ok((adjusted_fee, estimated_gas)) } /// Try to simulate the given tx in order to estimate how much gas will be needed to submit it. @@ -116,7 +132,7 @@ async fn estimate_gas_with_tx( grpc_address: &Uri, tx: Tx, account: &Account, -) -> Result { +) -> Result { let simulated_gas = send_tx_simulate(grpc_address, tx) .await .map(|sr| sr.gas_info); @@ -130,7 +146,7 @@ async fn estimate_gas_with_tx( gas_info.gas_used ); - Ok(gas_info.gas_used) + Ok(EstimatedGas::Simulated(gas_info.gas_used)) } Ok(None) => { @@ -139,7 +155,7 @@ async fn estimate_gas_with_tx( gas_config.default_gas ); - Ok(gas_config.default_gas) + Ok(EstimatedGas::Default(gas_config.default_gas)) } // If there is a chance that the tx will be accepted once actually submitted, we fall @@ -158,7 +174,7 @@ async fn estimate_gas_with_tx( get_error_text(&e), ); - Ok(gas_config.default_gas) + Ok(EstimatedGas::Default(gas_config.default_gas)) } Err(e) => { diff --git a/crates/relayer/src/chain/cosmos/retry.rs b/crates/relayer/src/chain/cosmos/retry.rs index 305edf3d92..725af8e14a 100644 --- a/crates/relayer/src/chain/cosmos/retry.rs +++ b/crates/relayer/src/chain/cosmos/retry.rs @@ -103,7 +103,7 @@ async fn do_send_tx_with_account_sequence_retry( // NOTE: The error code could potentially overlap between Cosmos SDK and Ibc-go channel // error codes. This is currently not the case of incorrect account sequence error //which is the Cosmos SDK code 32 and Ibc-go channel errors only go up to 25. - Ok(ref response) if response.code == Code::from(INCORRECT_ACCOUNT_SEQUENCE_ERR) => { + Ok((ref response, _)) if response.code == Code::from(INCORRECT_ACCOUNT_SEQUENCE_ERR) => { warn!( ?response, "failed to broadcast tx because of a mismatched account sequence number, \ @@ -125,7 +125,7 @@ async fn do_send_tx_with_account_sequence_retry( // Gas estimation succeeded and broadcast_tx_sync was either successful or has failed with // an unrecoverable error. - Ok(response) => { + Ok((response, estimated_gas)) => { debug!("gas estimation succeeded"); // Gas estimation and broadcast_tx_sync were successful. @@ -155,7 +155,7 @@ async fn do_send_tx_with_account_sequence_retry( // Log the error. error!( ?response, - diagnostic = ?sdk_error_from_tx_sync_error_code(code.into()), + diagnostic = ?sdk_error_from_tx_sync_error_code(code.into(), estimated_gas), "failed to broadcast tx with unrecoverable error" ); @@ -195,7 +195,10 @@ async fn refresh_account_and_retry_send_tx_with_account_sequence( // Retry after delay thread::sleep(Duration::from_millis(ACCOUNT_SEQUENCE_RETRY_DELAY)); - estimate_fee_and_send_tx(rpc_client, config, key_pair, account, tx_memo, messages).await + let (estimate_result, _) = + estimate_fee_and_send_tx(rpc_client, config, key_pair, account, tx_memo, messages).await?; + + Ok(estimate_result) } /// Determine whether the given error yielded by `tx_simulate` diff --git a/crates/relayer/src/chain/cosmos/tx.rs b/crates/relayer/src/chain/cosmos/tx.rs index 65f6230a17..2d4bcfb71d 100644 --- a/crates/relayer/src/chain/cosmos/tx.rs +++ b/crates/relayer/src/chain/cosmos/tx.rs @@ -17,6 +17,7 @@ use crate::event::IbcEventWithHeight; use crate::keyring::{Secp256k1KeyPair, SigningKeyPair}; use super::batch::send_batched_messages_and_wait_commit; +use super::estimate::EstimatedGas; pub async fn estimate_fee_and_send_tx( rpc_client: &HttpClient, @@ -25,13 +26,16 @@ pub async fn estimate_fee_and_send_tx( account: &Account, tx_memo: &Memo, messages: &[Any], -) -> Result { - let fee = estimate_tx_fees(config, key_pair, account, tx_memo, messages).await?; +) -> Result<(Response, EstimatedGas), Error> { + let (fee, estimated_gas) = + estimate_tx_fees(config, key_pair, account, tx_memo, messages).await?; - send_tx_with_fee( + let tx_result = send_tx_with_fee( rpc_client, config, key_pair, account, tx_memo, messages, &fee, ) - .await + .await?; + + Ok((tx_result, estimated_gas)) } async fn send_tx_with_fee( @@ -87,7 +91,7 @@ pub async fn simple_send_tx( .await? .into(); - let response = estimate_fee_and_send_tx( + let (response, _) = estimate_fee_and_send_tx( rpc_client, config, key_pair, diff --git a/crates/relayer/src/sdk_error.rs b/crates/relayer/src/sdk_error.rs index ef48c06be9..327404b2e9 100644 --- a/crates/relayer/src/sdk_error.rs +++ b/crates/relayer/src/sdk_error.rs @@ -1,6 +1,8 @@ use flex_error::define_error; use tendermint::abci::Code; +use crate::chain::cosmos::estimate::EstimatedGas; + // Provides mapping for errors returned from ibc-go and cosmos-sdk define_error! { SdkError { @@ -24,9 +26,13 @@ define_error! { { code: u32 } | e | { format_args!("unknown TX sync response error: {}", e.code) }, - OutOfGas - { code: u32 } - |_| { "the gas requirement is higher than the configured maximum gas! please check the Hermes config.toml".to_string() }, + OutOfGasDefault + { code: u32, amount: u64 } + |e| { format_args!("due to the Tx simulation failing, the configured default gas was used. Please check the Hermes config.toml and increase the configured `default_gas`. Current value is `{}`", e.amount) }, + + OutOfGasSimulated + { code: u32, amount: u64 } + |e| { format_args!("the issue might have been caused by the configured max gas which binds the gas used. Please check the Hermes config.toml and increase the configured `max_gas`. Curerent value is `{}`", e.amount) }, InsufficientFee { code: u32 } @@ -186,12 +192,15 @@ pub fn sdk_error_from_tx_result(code: Code, codespace: &str) -> SdkError { /// into IBC relayer domain-type errors. /// See [`tendermint_rpc::endpoint::broadcast::tx_sync::Response`]. /// Cf: -pub fn sdk_error_from_tx_sync_error_code(code: u32) -> SdkError { +pub fn sdk_error_from_tx_sync_error_code(code: u32, estimated_gas: EstimatedGas) -> SdkError { match code { // The primary reason (we know of) causing broadcast_tx_sync to fail // is due to "out of gas" errors. These are unrecoverable at the moment // on Hermes side. We'll inform the user to check for misconfiguration. - 11 => SdkError::out_of_gas(code), + 11 => match estimated_gas { + EstimatedGas::Default(amount) => SdkError::out_of_gas_default(code, amount), + EstimatedGas::Simulated(amount) => SdkError::out_of_gas_simulated(code, amount), + }, 13 => SdkError::insufficient_fee(code), _ => SdkError::unknown_tx_sync(code), } diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index 86b06ace7e..cf9b2de8c5 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -53,6 +53,7 @@ - [Cross Stack Misconfiguration](./advanced/troubleshooting/cross-comp-config.md) - [Genesis restart without IBC upgrade proposal](./advanced/troubleshooting/genesis-restart.md) - [Handling Clock Drift](./advanced/troubleshooting/clock-drift.md) + - [Gas Errors](./advanced/troubleshooting/gas-errors.md) - [Commands Reference](./documentation/commands/index.md) - [Global options and JSON output](./documentation/commands/global.md) diff --git a/guide/src/advanced/troubleshooting/gas-errors.md b/guide/src/advanced/troubleshooting/gas-errors.md new file mode 100644 index 0000000000..220e0f8d0d --- /dev/null +++ b/guide/src/advanced/troubleshooting/gas-errors.md @@ -0,0 +1,48 @@ +# Gas errors + +This section will expand on the out of gas error which can happen when simulating or sending Txs. The related configurations are: + +```toml +default_gas = 100000 +max_gas = 4000000 +gas_multiplier = 1.1 +``` + +Before sending a transaction, Hermes will retrieve an estimation of the gas required with the simulation capability of the chain. After retrieving the gas amount from the simulation, the `gas_multiplier` will be applied since the simulation might be slightly lower than the required amount of gas. +Since the `max_gas` is applied after the gas_multiplier, it can happen that the value `simulated_gas * gas_multiplier > max_gas`, in which case the `max_gas` value is used. + +Note that if the simulation fails with a recoverable error, Hermes will use the configured `default_gas`. + +## Simulating Tx + +The first instance where an error can happen is when the tracasction simulation succeeds but the gas amount retrieved exceeds the configured `max_gas`, Hermes will throw an unrecoverable error: + +``` + gas estimate from simulated Tx exceeds the maximum configured +``` + +This can be fixed by increasing the configured `max_gas`. + +## Broadcasting Tx + +> __NOTE__: This issue will only arise with Cosmos chains as this is a Cosmos SDK error. + +The second instance when an error can happen is when sending the transaction. If the gas included for the transaction is not enough Hermes will throw an error: + +``` +out of gas in location: ; gasWanted: , gasUsed: : out of gas +``` + +Two cases need to be verified in order to fix this issue. + +### Caused by max_gas + +If simulated gas is close to the `max_gas` configured, after multiplying the value with the `gas_multiplier`, it can be the case that the `max_gas` is used instead. And since the simulated gas might be slightly lower than the required gas, this can cause an out of gas error. +This can be fixed by increasing the configured `max_gas`. + +### Caused by default_gas + +When the transaction simulation fails with a recoverable error, the `default_gas` will be used. If the `default_gas` is too low an out of gas error will be thrown. This can be fixed by increasing the `default_gas`. +But there can also be a case similar to the one explained in the previous section [Caused by max_gas](./gas-errors.md#caused-by-max_gas). + +If the `default_gas` is too close to the `max_gas`, the `max_gas` will be used instead of `default_gas * gas_multiplier`, causing an out of gas error. In this situation both `max_gas` and `default_gas` need to be verified, and one or both need to be increased. \ No newline at end of file From 79d10c5a135a583fe2b4996dd53ba1673a3174fd Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Thu, 7 Mar 2024 11:16:52 +0100 Subject: [PATCH 048/200] Release Hermes v1.8.1 (#3876) * Build release changelog * Bump version number * Fix typos * Update CHANGELOG.md Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * Update changelog --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi --- .../ibc-relayer/3770-non-utf8-packet-data.md | 2 +- .../ibc-relayer/3831-better-compat-check.md | 0 .../3754-filter-packet-clearing.md | 0 .../3811-relayer-memo-overwrite.md | 2 +- .../3845-add-simulate-errors-metric.md | 0 .../improvements/3814-grpc-syncing.md | 0 .../3814-status-use-client-latest-height.md | 0 .../ibc-relayer/3530-out-of-gas-error-log.md | 0 .../3540-ordered-channels-resilience.md | 0 .../ibc-relayer}/3792-legacy-simulation.md | 0 .changelog/v1.8.1/summary.md | 19 +++++ CHANGELOG.md | 71 +++++++++++++++++++ Cargo.lock | 16 ++--- crates/chain-registry/Cargo.toml | 4 +- crates/relayer-cli/Cargo.toml | 12 ++-- crates/relayer-rest/Cargo.toml | 6 +- crates/relayer-rest/tests/mock.rs | 2 +- crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 8 +-- crates/relayer/src/lib.rs | 2 +- crates/telemetry/Cargo.toml | 4 +- guide/README.md | 2 +- tools/integration-test/Cargo.toml | 2 +- tools/test-framework/Cargo.toml | 8 +-- 24 files changed, 126 insertions(+), 36 deletions(-) rename .changelog/{unreleased => v1.8.1}/bug-fixes/ibc-relayer/3770-non-utf8-packet-data.md (84%) rename .changelog/{unreleased => v1.8.1}/bug-fixes/ibc-relayer/3831-better-compat-check.md (100%) rename .changelog/{unreleased => v1.8.1}/features/ibc-relayer/3754-filter-packet-clearing.md (100%) rename .changelog/{unreleased => v1.8.1}/features/ibc-relayer/3811-relayer-memo-overwrite.md (69%) rename .changelog/{unreleased => v1.8.1}/features/ibc-telemetry/3845-add-simulate-errors-metric.md (100%) rename .changelog/{unreleased => v1.8.1}/improvements/3814-grpc-syncing.md (100%) rename .changelog/{unreleased => v1.8.1}/improvements/3814-status-use-client-latest-height.md (100%) rename .changelog/{unreleased => v1.8.1}/improvements/ibc-relayer/3530-out-of-gas-error-log.md (100%) rename .changelog/{unreleased => v1.8.1}/improvements/ibc-relayer/3540-ordered-channels-resilience.md (100%) rename .changelog/{unreleased/improvements/ibc-relayer-cli => v1.8.1/improvements/ibc-relayer}/3792-legacy-simulation.md (100%) create mode 100644 .changelog/v1.8.1/summary.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/3770-non-utf8-packet-data.md b/.changelog/v1.8.1/bug-fixes/ibc-relayer/3770-non-utf8-packet-data.md similarity index 84% rename from .changelog/unreleased/bug-fixes/ibc-relayer/3770-non-utf8-packet-data.md rename to .changelog/v1.8.1/bug-fixes/ibc-relayer/3770-non-utf8-packet-data.md index ab7a573fcb..eae49f1583 100644 --- a/.changelog/unreleased/bug-fixes/ibc-relayer/3770-non-utf8-packet-data.md +++ b/.changelog/v1.8.1/bug-fixes/ibc-relayer/3770-non-utf8-packet-data.md @@ -2,5 +2,5 @@ Hermes does not assume anymore that an ICS-04 packet data is valid UTF-8, by using the `packet_data_hex` attribute when assembling a packet from events, instead of the deprecated `packet_data` attribute. Relying on the `packet_data` attribute enforces a UTF-8 encoded payload (eg. JSON), disallowing eg. Protobuf-encoded payloads. - The `packet_data` atttribute [has been deprecated][0] in favor of `packet_data_hex` since IBC-Go v1.0.0. + The `packet_data` attribute [has been deprecated][0] in favor of `packet_data_hex` since IBC-Go v1.0.0. [0]: https://github.com/cosmos/ibc-go/blob/fadf8f2b0ab184798d021d220d877e00c7634e26/CHANGELOG.md?plain=1#L1417 diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/3831-better-compat-check.md b/.changelog/v1.8.1/bug-fixes/ibc-relayer/3831-better-compat-check.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer/3831-better-compat-check.md rename to .changelog/v1.8.1/bug-fixes/ibc-relayer/3831-better-compat-check.md diff --git a/.changelog/unreleased/features/ibc-relayer/3754-filter-packet-clearing.md b/.changelog/v1.8.1/features/ibc-relayer/3754-filter-packet-clearing.md similarity index 100% rename from .changelog/unreleased/features/ibc-relayer/3754-filter-packet-clearing.md rename to .changelog/v1.8.1/features/ibc-relayer/3754-filter-packet-clearing.md diff --git a/.changelog/unreleased/features/ibc-relayer/3811-relayer-memo-overwrite.md b/.changelog/v1.8.1/features/ibc-relayer/3811-relayer-memo-overwrite.md similarity index 69% rename from .changelog/unreleased/features/ibc-relayer/3811-relayer-memo-overwrite.md rename to .changelog/v1.8.1/features/ibc-relayer/3811-relayer-memo-overwrite.md index fcd1a840d3..6a3a649a9e 100644 --- a/.changelog/unreleased/features/ibc-relayer/3811-relayer-memo-overwrite.md +++ b/.changelog/v1.8.1/features/ibc-relayer/3811-relayer-memo-overwrite.md @@ -1,3 +1,3 @@ - Add a per-chain configuration `memo_overwrite` allowing users - to overwite the relayer memo used for each transaction + to overwrite the relayer memo used for each transaction ([\#3811](https://github.com/informalsystems/hermes/issues/3811)) \ No newline at end of file diff --git a/.changelog/unreleased/features/ibc-telemetry/3845-add-simulate-errors-metric.md b/.changelog/v1.8.1/features/ibc-telemetry/3845-add-simulate-errors-metric.md similarity index 100% rename from .changelog/unreleased/features/ibc-telemetry/3845-add-simulate-errors-metric.md rename to .changelog/v1.8.1/features/ibc-telemetry/3845-add-simulate-errors-metric.md diff --git a/.changelog/unreleased/improvements/3814-grpc-syncing.md b/.changelog/v1.8.1/improvements/3814-grpc-syncing.md similarity index 100% rename from .changelog/unreleased/improvements/3814-grpc-syncing.md rename to .changelog/v1.8.1/improvements/3814-grpc-syncing.md diff --git a/.changelog/unreleased/improvements/3814-status-use-client-latest-height.md b/.changelog/v1.8.1/improvements/3814-status-use-client-latest-height.md similarity index 100% rename from .changelog/unreleased/improvements/3814-status-use-client-latest-height.md rename to .changelog/v1.8.1/improvements/3814-status-use-client-latest-height.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/3530-out-of-gas-error-log.md b/.changelog/v1.8.1/improvements/ibc-relayer/3530-out-of-gas-error-log.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/3530-out-of-gas-error-log.md rename to .changelog/v1.8.1/improvements/ibc-relayer/3530-out-of-gas-error-log.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/3540-ordered-channels-resilience.md b/.changelog/v1.8.1/improvements/ibc-relayer/3540-ordered-channels-resilience.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/3540-ordered-channels-resilience.md rename to .changelog/v1.8.1/improvements/ibc-relayer/3540-ordered-channels-resilience.md diff --git a/.changelog/unreleased/improvements/ibc-relayer-cli/3792-legacy-simulation.md b/.changelog/v1.8.1/improvements/ibc-relayer/3792-legacy-simulation.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer-cli/3792-legacy-simulation.md rename to .changelog/v1.8.1/improvements/ibc-relayer/3792-legacy-simulation.md diff --git a/.changelog/v1.8.1/summary.md b/.changelog/v1.8.1/summary.md new file mode 100644 index 0000000000..40908d602b --- /dev/null +++ b/.changelog/v1.8.1/summary.md @@ -0,0 +1,19 @@ +*March 6th, 2024* + +This release improves reliability when relaying, more enhanced configuration and improved monitoring. + +Reliability has been improved: +* It is now possible to relay ICS-04 packets with non-UTF-8 payloads +* Packet sequences are now verified for ordered channels before trying to relay + +Additional per-chain configurations have been added: +* `excluded_sequences` used to skip problematic packets when clearing +* `memo_overwrite` allowing users to overwrite the relayer memo when chains have a +strict limit for the size of the memo + +Monitoring issues improvements: +* A new metric `simulate_errors` which counts the number of failed simulated transactions +* Out of gas error diagnostic gives more information and a dedicated entry to the guide has been added +* Failed gas simulation will not be considered as unrecoverable for legacy chains +* The compatibility check during the health-check has been improved will assess more correctly the versions + for Ibc-Go and Cosmos SDK diff --git a/CHANGELOG.md b/CHANGELOG.md index e9328dfc7d..ca6754dbcc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,76 @@ # CHANGELOG +## v1.8.1 + +*March 7th, 2024* + +This v1.8.1 release brings better reliability when relaying, more enhanced configuration and improved monitoring. + +Reliability has been improved: +* It is now possible to relay ICS-04 packets with non-UTF-8 payloads +* Packet sequences are now verified for ordered channels before trying to relay + +Additional per-chain configurations have been added: +* `excluded_sequences` used to skip problematic packets when clearing +* `memo_overwrite` allowing users to overwrite the relayer memo when chains have a strict limit for the size of the memo. + +Monitoring issues improvements: +* A new metric `simulate_errors` which counts the number of failed simulated transactions +* Out of gas error diagnostic gives more information and a dedicated entry to the guide has been added +* Failed gas simulation will not be considered as unrecoverable for legacy chains. +* The compatibility check during the health-check has been improved will assess more correctly the versions for Ibc-Go and Cosmos SDK + +Special thanks to our contributors for their valuable additions to this release: + +* Sergey (@freak12techno) for adding the `simulate_errors` metric ([#3845]) +* Martin Dyring-Andersen (@mdyring) for adding recovery from failed gas simulation for legacy chains ([#3792]) + +### BUG FIXES + +- Allow relaying ICS-04 packets with non-UTF-8 payloads ([\#3770](https://github.com/informalsystems/hermes/issues/3770)) + Hermes does not assume anymore that an ICS-04 packet data is valid UTF-8, + by using the `packet_data_hex` attribute when assembling a packet from events, instead of the deprecated `packet_data` attribute. + Relying on the `packet_data` attribute enforces a UTF-8 encoded payload (eg. JSON), disallowing eg. Protobuf-encoded payloads. + The `packet_data` attribute [has been deprecated][0] in favor of `packet_data_hex` since IBC-Go v1.0.0. +- Improve reliability of compatibility check and fix parsing of expected modules versions ([\#3831](https://github.com/informalsystems/hermes/issues/3831)) + +[0]: https://github.com/cosmos/ibc-go/blob/fadf8f2b0ab184798d021d220d877e00c7634e26/CHANGELOG.md?plain=1#L1417 + +### FEATURES + +- Add a per-chain configuration `excluded_sequences` allowing users to specify a list of packet sequences which will not be cleared. + This configuration has no impact on standard packet relaying. + ([\#3754](https://github.com/informalsystems/hermes/issues/3754)) +- Add a per-chain configuration `memo_overwrite` allowing users to overwrite the relayer memo used for each transaction + ([\#3811](https://github.com/informalsystems/hermes/issues/3811)) +- Added a new Prometheus metric `simulate_errors` for tracking when a transaction simulation fails, with the following labels: + ([\#3845](https://github.com/informalsystems/hermes/issues/3845)) + * `recoverable` (can the execution continue if this happened?) + * `account` (account from which the tx was sent) + * `error_description` (description of the error) + + ``` + # HELP simulate_errors_total Number of errors observed by Hermes when simulating a Tx + # TYPE simulate_errors_total counter + simulate_errors_total{account="osmo17ndx5qfku28ymxgmq6zq4a6d02dvpfjjul0hyh",error_description="Unknown error",recoverable="false",service_name="unknown_service",otel_scope_name="hermes",otel_scope_version=""} 4 + ``` + +### IMPROVEMENTS + +- Use the consensus state at client latest height in status CLI ([#3814](https://github.com/informalsystems/ibc-rs/issues/3814)) +- Add syncing check for gRPC node ([#3814](https://github.com/informalsystems/ibc-rs/issues/3814)) +- Improve the log diagnostic when an out of gas error is thrown. + And a new entry related to gas error has been added to the Hermes guide. + ([\#3530](https://github.com/informalsystems/hermes/issues/3530)) +- Improve resilience when relaying on ordered channels. + When relaying packets on an ordered channel, Hermes will now attempt + to detect whether the next message to send has the sequence number + expected on that channel. If there is a mismatch, then Hermes will trigger a packet + clear on the channel to unblock it before resuming operations on that channel. + ([\#3540](https://github.com/informalsystems/hermes/issues/3540)) +- Recover from gas simulation failures on legacy chains. + ([\#3792](https://github.com/informalsystems/hermes/issues/3792)) + ## v1.8.0 *January 23rd, 2024* diff --git a/Cargo.lock b/Cargo.lock index 5c1142f9b4..cd401a873d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1444,7 +1444,7 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.27.0" +version = "0.27.1" dependencies = [ "async-trait", "flex-error", @@ -1463,7 +1463,7 @@ dependencies = [ [[package]] name = "ibc-integration-test" -version = "0.27.0" +version = "0.27.1" dependencies = [ "byte-unit", "http", @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.27.0" +version = "0.27.1" dependencies = [ "anyhow", "async-stream", @@ -1570,7 +1570,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "1.8.0" +version = "1.8.1" dependencies = [ "abscissa_core", "clap", @@ -1611,7 +1611,7 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.27.0" +version = "0.27.1" dependencies = [ "axum", "crossbeam-channel 0.5.11", @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "ibc-relayer-types" -version = "0.27.0" +version = "0.27.1" dependencies = [ "bytes", "derive_more", @@ -1657,7 +1657,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.27.0" +version = "0.27.1" dependencies = [ "axum", "dashmap", @@ -1676,7 +1676,7 @@ dependencies = [ [[package]] name = "ibc-test-framework" -version = "0.27.0" +version = "0.27.1" dependencies = [ "color-eyre", "crossbeam-channel 0.5.11", diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index e90d844b40..47806997b7 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-chain-registry" -version = "0.27.0" +version = "0.27.1" edition = "2021" license = "Apache-2.0" keywords = ["cosmos", "ibc", "relayer", "chain", "registry"] @@ -12,7 +12,7 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.27.0", path = "../relayer-types" } +ibc-relayer-types = { version = "0.27.1", path = "../relayer-types" } ibc-proto = { version = "0.42.0", features = ["serde"] } tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index 82303a33ff..b673a30e81 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-cli" -version = "1.8.0" +version = "1.8.1" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -25,11 +25,11 @@ telemetry = ["ibc-relayer/telemetry", "ibc-telemetry"] rest-server = ["ibc-relayer-rest"] [dependencies] -ibc-relayer-types = { version = "0.27.0", path = "../relayer-types" } -ibc-relayer = { version = "0.27.0", path = "../relayer" } -ibc-telemetry = { version = "0.27.0", path = "../telemetry", optional = true } -ibc-relayer-rest = { version = "0.27.0", path = "../relayer-rest", optional = true } -ibc-chain-registry = { version = "0.27.0" , path = "../chain-registry" } +ibc-relayer-types = { version = "0.27.1", path = "../relayer-types" } +ibc-relayer = { version = "0.27.1", path = "../relayer" } +ibc-telemetry = { version = "0.27.1", path = "../telemetry", optional = true } +ibc-relayer-rest = { version = "0.27.1", path = "../relayer-rest", optional = true } +ibc-chain-registry = { version = "0.27.1" , path = "../chain-registry" } clap = { version = "3.2", features = ["cargo"] } clap_complete = "3.2" diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index 1f891a77ef..dcfb9f0098 100644 --- a/crates/relayer-rest/Cargo.toml +++ b/crates/relayer-rest/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-rest" -version = "0.27.0" +version = "0.27.1" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" @@ -14,8 +14,8 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.27.0", path = "../relayer-types" } -ibc-relayer = { version = "0.27.0", path = "../relayer" } +ibc-relayer-types = { version = "0.27.1", path = "../relayer-types" } +ibc-relayer = { version = "0.27.1", path = "../relayer" } crossbeam-channel = "0.5" serde = "1.0" diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index 9b1b1e530a..650774c9ee 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -64,7 +64,7 @@ async fn version() { let rest_api_version = VersionInfo { name: "ibc-relayer-rest".to_string(), - version: "0.27.0".to_string(), + version: "0.27.1".to_string(), }; let result: JsonResult<_, ()> = JsonResult::Success(vec![version.clone(), rest_api_version]); diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 6b3b283183..081e1ea64e 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-types" -version = "0.27.0" +version = "0.27.1" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 1dbe5efd62..7bd502febf 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer" -version = "0.27.0" +version = "0.27.1" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -21,8 +21,8 @@ telemetry = ["ibc-telemetry"] [dependencies] ibc-proto = { version = "0.42.0", features = ["serde"] } -ibc-telemetry = { version = "0.27.0", path = "../telemetry", optional = true } -ibc-relayer-types = { version = "0.27.0", path = "../relayer-types", features = ["mocks"] } +ibc-telemetry = { version = "0.27.1", path = "../telemetry", optional = true } +ibc-relayer-types = { version = "0.27.1", path = "../relayer-types", features = ["mocks"] } subtle-encoding = "0.5" humantime-serde = "1.1.1" @@ -110,7 +110,7 @@ version = "0.34.0" default-features = false [dev-dependencies] -ibc-relayer-types = { version = "0.27.0", path = "../relayer-types", features = ["mocks"] } +ibc-relayer-types = { version = "0.27.1", path = "../relayer-types", features = ["mocks"] } serial_test = "3.0.0" env_logger = "0.11.1" test-log = { version = "0.2.14", features = ["trace"] } diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index 64173df993..a4def98be1 100644 --- a/crates/relayer/src/lib.rs +++ b/crates/relayer/src/lib.rs @@ -15,7 +15,7 @@ //! //! For the IBC relayer binary, please see [Hermes] (`ibc-relayer-cli` crate). //! -//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.8.0/ +//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.8.1/ extern crate alloc; diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index 16706aea52..cbf09f3f81 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-telemetry" -version = "0.27.0" +version = "0.27.1" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -13,7 +13,7 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.27.0", path = "../relayer-types" } +ibc-relayer-types = { version = "0.27.1", path = "../relayer-types" } once_cell = "1.19.0" opentelemetry = { version = "0.19.0", features = ["metrics"] } diff --git a/guide/README.md b/guide/README.md index 0c2a7bf993..d4234490c6 100644 --- a/guide/README.md +++ b/guide/README.md @@ -10,7 +10,7 @@ mdBook is a utility to create modern online books from Markdown files. This guide should be permanently deployed at its latest stable version at [hermes.informal.systems](https://hermes.informal.systems). -Current version: `v1.8.0`. +Current version: `v1.8.1`. The version of this guide is aligned with the [versioning of the ibc crates](../README.md). diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index e483593209..977a0112d2 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-integration-test" -version = "0.27.0" +version = "0.27.1" edition = "2021" rust-version = "1.71" license = "Apache-2.0" diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 21616613ca..384b6e3440 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-test-framework" -version = "0.27.0" +version = "0.27.1" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -14,9 +14,9 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "=0.27.0", path = "../../crates/relayer-types" } -ibc-relayer = { version = "=0.27.0", path = "../../crates/relayer" } -ibc-relayer-cli = { version = "=1.8.0", path = "../../crates/relayer-cli" } +ibc-relayer-types = { version = "=0.27.1", path = "../../crates/relayer-types" } +ibc-relayer = { version = "=0.27.1", path = "../../crates/relayer" } +ibc-relayer-cli = { version = "=1.8.1", path = "../../crates/relayer-cli" } ibc-proto = { version = "0.42.0", features = ["serde"] } tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } From 80aea8e3663f93d5aeab44ac2f5660a9f13d3b48 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 7 Mar 2024 11:31:07 +0100 Subject: [PATCH 049/200] Fix Docker image workflow --- .github/workflows/docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 14e6875d8a..5604786f18 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -27,7 +27,8 @@ jobs: images: ${{ env.REGISTRY_IMAGE }} tags: | type=ref,event=tag - type=ref,event=workflow_dispatch + type=ref,event=branch + type=semver,pattern={{version}} - name: Set up Docker Buildx id: buildx From e16dbb079c6555ff3be70d6789ea92135c25b191 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 10:02:32 +0100 Subject: [PATCH 050/200] Bump serde from 1.0.195 to 1.0.197 (#3884) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.195 to 1.0.197. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.195...v1.0.197) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/chain-registry/Cargo.toml | 2 +- crates/telemetry/Cargo.toml | 2 +- tools/integration-test/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd401a873d..bad4eb9f6f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2799,9 +2799,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] @@ -2827,9 +2827,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index 47806997b7..c94f48d8fd 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -22,7 +22,7 @@ futures = { version = "0.3.27", features = ["executor"] } http = "0.2" itertools = "0.10.5" reqwest = { version = "0.11.13", features = ["rustls-tls-native-roots", "json"], default-features = false } -serde = "1.0.195" +serde = "1.0.197" serde_json = "1" tokio = "1.17.0" tracing = "0.1.36" diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index cbf09f3f81..228b3f07fa 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -22,7 +22,7 @@ prometheus = "0.13.2" moka = { version = "0.12.5", features = ["sync"] } dashmap = "5.4.0" serde_json = "1.0.111" -serde = "1.0.195" +serde = "1.0.197" axum = "0.6.18" tokio = "1.26.0" tracing = "0.1.36" diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 977a0112d2..4773b8c93d 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -23,7 +23,7 @@ time = "0.3" toml = "0.8" prost = { version = "0.12" } tonic = { version = "0.10", features = ["tls", "tls-roots"] } -serde = "1.0.195" +serde = "1.0.197" [features] default = [] From bb9d42e30c7ebe7ebe4e9e5907e2333f1617b1e2 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 12 Mar 2024 12:33:17 +0100 Subject: [PATCH 051/200] Fix parsing of IBC-Go version in health check and improve health check reporting (#3888) --- .../ibc-relayer/3880-health-check-fix.md | 2 + crates/relayer/src/chain/cosmos.rs | 21 +- crates/relayer/src/chain/cosmos/estimate.rs | 7 +- crates/relayer/src/chain/cosmos/version.rs | 242 +++++++++++++++--- crates/relayer/src/worker/packet.rs | 8 +- 5 files changed, 228 insertions(+), 52 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer/3880-health-check-fix.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/3880-health-check-fix.md b/.changelog/unreleased/bug-fixes/ibc-relayer/3880-health-check-fix.md new file mode 100644 index 0000000000..e6106fa10a --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer/3880-health-check-fix.md @@ -0,0 +1,2 @@ +- Fix parsing of IBC-Go version in health check and improve health check + reporting ([\#3880](https://github.com/informalsystems/hermes/issues/3880)) \ No newline at end of file diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 8b2ccb0b7e..53505d2b0d 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -146,6 +146,7 @@ pub mod wait; /// /// [tm-37-max]: https://github.com/tendermint/tendermint/blob/v0.37.0-rc1/types/params.go#L79 pub const BLOCK_MAX_BYTES_MAX_FRACTION: f64 = 0.9; + pub struct CosmosSdkChain { config: config::CosmosSdkConfig, tx_config: TxConfig, @@ -292,19 +293,23 @@ impl CosmosSdkChain { )); } - // Query /genesis RPC endpoint to retrieve the `max_expected_time_per_block` value - // to use as `max_block_time`. + // Query /genesis RPC endpoint to retrieve the `max_expected_time_per_block` value to use as `max_block_time`. // If it is not found, keep the configured `max_block_time`. match self.block_on(self.rpc_client.genesis::()) { Ok(genesis_reponse) => { let old_max_block_time = self.config.max_block_time; - self.config.max_block_time = + let new_max_block_time = Duration::from_nanos(genesis_reponse.app_state.max_expected_time_per_block()); - info!( - "Updated `max_block_time` using /genesis endpoint. Old value: `{}s`, new value: `{}s`", - old_max_block_time.as_secs(), - self.config.max_block_time.as_secs() - ); + + if old_max_block_time.as_secs() != new_max_block_time.as_secs() { + self.config.max_block_time = new_max_block_time; + + info!( + "Updated `max_block_time` using /genesis endpoint. Old value: `{}s`, new value: `{}s`", + old_max_block_time.as_secs(), + self.config.max_block_time.as_secs() + ); + } } Err(e) => { warn!( diff --git a/crates/relayer/src/chain/cosmos/estimate.rs b/crates/relayer/src/chain/cosmos/estimate.rs index 4223e39068..dff1a5cdff 100644 --- a/crates/relayer/src/chain/cosmos/estimate.rs +++ b/crates/relayer/src/chain/cosmos/estimate.rs @@ -131,7 +131,7 @@ async fn estimate_gas_with_tx( gas_config: &GasConfig, grpc_address: &Uri, tx: Tx, - account: &Account, + _account: &Account, ) -> Result { let simulated_gas = send_tx_simulate(grpc_address, tx) .await @@ -169,7 +169,7 @@ async fn estimate_gas_with_tx( telemetry!( simulate_errors, - &account.address.to_string(), + &_account.address.to_string(), true, get_error_text(&e), ); @@ -185,7 +185,7 @@ async fn estimate_gas_with_tx( telemetry!( simulate_errors, - &account.address.to_string(), + &_account.address.to_string(), false, get_error_text(&e), ); @@ -212,6 +212,7 @@ fn can_recover_from_simulation_failure(e: &Error) -> bool { } } +#[cfg(feature = "telemetry")] fn get_error_text(e: &Error) -> String { use crate::error::ErrorDetail::*; diff --git a/crates/relayer/src/chain/cosmos/version.rs b/crates/relayer/src/chain/cosmos/version.rs index a75c4ed822..5db1b56961 100644 --- a/crates/relayer/src/chain/cosmos/version.rs +++ b/crates/relayer/src/chain/cosmos/version.rs @@ -7,7 +7,7 @@ use core::fmt::{Display, Error as FmtError, Formatter}; use flex_error::define_error; use tracing::trace; -use ibc_proto::cosmos::base::tendermint::v1beta1::VersionInfo; +use ibc_proto::cosmos::base::tendermint::v1beta1::{Module, VersionInfo}; /// Specifies the SDK, IBC-go, and Tendermint modules path, as expected /// to appear in the application version information of a @@ -23,17 +23,22 @@ use ibc_proto::cosmos::base::tendermint::v1beta1::VersionInfo; /// }, /// ``` const SDK_MODULE_NAME: &str = "github.com/cosmos/cosmos-sdk"; -const IBC_GO_MODULE_NAME: &str = "github.com/cosmos/ibc-go"; +const IBC_GO_MODULE_PREFIX: &str = "github.com/cosmos/ibc-go/v"; const TENDERMINT_MODULE_NAME: &str = "github.com/tendermint/tendermint"; const COMET_MODULE_NAME: &str = "github.com/cometbft/cometbft"; +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum ConsensusVersion { + Tendermint(semver::Version), + Comet(semver::Version), +} + /// Captures the version(s) specification of different modules of a network. -#[derive(Debug)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Specs { pub cosmos_sdk: Option, pub ibc_go: Option, - pub tendermint: Option, - pub comet: Option, + pub consensus: Option, } impl Display for Specs { @@ -50,22 +55,16 @@ impl Display for Specs { .map(|v| v.to_string()) .unwrap_or_else(|| "UNKNOWN".to_string()); - let tendermint = self - .tendermint - .as_ref() - .map(|v| v.to_string()) - .unwrap_or_else(|| "UNKNOWN".to_string()); - - let comet = self - .comet - .as_ref() - .map(|v| v.to_string()) - .unwrap_or_else(|| "UNKNOWN".to_string()); + let consensus = match self.consensus { + Some(ConsensusVersion::Tendermint(ref v)) => format!("Tendermint {v}"), + Some(ConsensusVersion::Comet(ref v)) => format!("CometBFT {v}"), + None => "Tendermint: UNKNOWN, CometBFT: UNKNOWN".to_string(), + }; write!( f, - "Cosmos SDK {}, IBC-Go {}, Tendermint {}, CometBFT {}", - cosmos_sdk, ibc_go, tendermint, comet + "Cosmos SDK {}, IBC-Go {}, {}", + cosmos_sdk, ibc_go, consensus ) } } @@ -78,7 +77,8 @@ define_error! { comet: String, app: AppInfo, } - |e| { format!("failed to find the Tendermint ('{}') or CometBFT ('{}') dependency for application {}", e.tendermint, e.comet, e.app) }, + |e| { format!("failed to find the Tendermint ('{}') or CometBFT ('{}') dependency for application {}", + e.tendermint, e.comet, e.app) }, VersionParsingFailed { @@ -102,8 +102,14 @@ impl TryFrom for Specs { let tendermint_version = parse_tendermint_version(&raw_version)?; let comet_version = parse_comet_version(&raw_version)?; + let consensus_version = match (tendermint_version, comet_version) { + (_, Some(comet)) => Some(ConsensusVersion::Comet(comet)), + (Some(tendermint), _) => Some(ConsensusVersion::Tendermint(tendermint)), + _ => None, + }; + // Ensure that either Tendermint or CometBFT are being used. - if tendermint_version.is_none() && comet_version.is_none() { + if consensus_version.is_none() { return Err(Error::consensus_module_not_found( TENDERMINT_MODULE_NAME.to_string(), COMET_MODULE_NAME.to_string(), @@ -117,50 +123,48 @@ impl TryFrom for Specs { git_commit = %raw_version.git_commit, sdk_version = ?sdk_version, ibc_go_status = ?ibc_go_version, - tendermint_version = ?tendermint_version, - comet_version = ?comet_version, + consensus_version = ?consensus_version, "parsed version specification" ); Ok(Self { cosmos_sdk: sdk_version, ibc_go: ibc_go_version, - tendermint: tendermint_version, - comet: comet_version, + consensus: consensus_version, }) } } fn parse_sdk_version(version_info: &VersionInfo) -> Result, Error> { - parse_optional_version(version_info, SDK_MODULE_NAME) + parse_optional_version(version_info, |m| m.path == SDK_MODULE_NAME) } fn parse_ibc_go_version(version_info: &VersionInfo) -> Result, Error> { - parse_optional_version(version_info, IBC_GO_MODULE_NAME) + parse_optional_version(version_info, |m| m.path.starts_with(IBC_GO_MODULE_PREFIX)) } fn parse_tendermint_version(version_info: &VersionInfo) -> Result, Error> { - parse_optional_version(version_info, TENDERMINT_MODULE_NAME) + parse_optional_version(version_info, |m| m.path == TENDERMINT_MODULE_NAME) } fn parse_comet_version(version_info: &VersionInfo) -> Result, Error> { - parse_optional_version(version_info, COMET_MODULE_NAME) + parse_optional_version(version_info, |m| m.path == COMET_MODULE_NAME) } fn parse_optional_version( version_info: &VersionInfo, - module_name: &str, + predicate: impl Fn(&Module) -> bool, ) -> Result, Error> { - match version_info - .build_deps - .iter() - .find(|&m| m.path == module_name) - { + let module = version_info.build_deps.iter().find(|&m| predicate(m)); + + match module { None => Ok(None), + Some(module) => { let plain_version = module.version.trim_start_matches('v'); semver::Version::parse(plain_version) + // Discard the pre-release version, if any .map(|mut version| { version.pre = semver::Prerelease::EMPTY; Some(version) @@ -179,7 +183,7 @@ fn parse_optional_version( /// Helper struct to capture all the reported information of an /// IBC application, e.g., `gaiad`. -#[derive(Clone, Debug)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct AppInfo { app_name: String, version: String, @@ -201,3 +205,171 @@ impl From<&VersionInfo> for AppInfo { } } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn cosmoshub() { + let version_info = VersionInfo { + name: "gaia".to_string(), + app_name: "gaiad".to_string(), + version: "v14.2.0".to_string(), + git_commit: "3aa6e5058b4cbb4729300b239abfabd9a5b5691f".to_string(), + build_tags: "netgo,ledger".to_string(), + go_version: "go version go1.20.3 linux/amd64".to_string(), + cosmos_sdk_version: "v0.45.16".to_string(), + build_deps: vec![ + Module { + path: "github.com/cometbft/cometbft-db".to_string(), + version: "v0.7.0".to_string(), + sum: "h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo=".to_string(), + }, + Module { + path: "github.com/confio/ics23/go".to_string(), + version: "v0.9.0".to_string(), + sum: "h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4=".to_string(), + }, + Module { + path: "github.com/cosmos/cosmos-db".to_string(), + version: "v0.0.0-20221226095112-f3c38ecb5e32".to_string(), + sum: "h1:zlCp9n3uwQieELltZWHRmwPmPaZ8+XoL2Sj+A2YJlr8=".to_string(), + }, + Module { + path: "github.com/cosmos/cosmos-proto".to_string(), + version: "v1.0.0-beta.1".to_string(), + sum: "h1:iDL5qh++NoXxG8hSy93FdYJut4XfgbShIocllGaXx/0=".to_string(), + }, + Module { + path: "github.com/cosmos/cosmos-sdk".to_string(), + version: "v0.45.16".to_string(), + sum: "".to_string(), + }, + Module { + path: "github.com/cosmos/go-bip39".to_string(), + version: "v1.0.0".to_string(), + sum: "h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY=".to_string(), + }, + Module { + path: "github.com/cosmos/iavl".to_string(), + version: "v0.19.5".to_string(), + sum: "h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY=".to_string(), + }, + Module { + path: "github.com/tendermint/tendermint".to_string(), + version: "v0.34.27".to_string(), + sum: "".to_string(), + }, + Module { + path: "github.com/cosmos/ibc-go/v4".to_string(), + version: "v4.4.2".to_string(), + sum: "h1:PG4Yy0/bw6Hvmha3RZbc53KYzaCwuB07Ot4GLyzcBvo=".to_string(), + }, + Module { + path: "github.com/cosmos/interchain-security/v2".to_string(), + version: "v2.0.0".to_string(), + sum: "".to_string(), + }, + ], + }; + + let app_info = AppInfo::from(&version_info); + + assert_eq!( + app_info, + AppInfo { + app_name: "gaiad".to_string(), + version: "v14.2.0".to_string(), + git_commit: "3aa6e5058b4cbb4729300b239abfabd9a5b5691f".to_string() + } + ); + + let specs = Specs::try_from(version_info).unwrap(); + + assert_eq!( + specs, + Specs { + cosmos_sdk: Some(semver::Version::parse("0.45.16").unwrap()), + ibc_go: Some(semver::Version::parse("4.4.2").unwrap()), + consensus: Some(ConsensusVersion::Tendermint( + semver::Version::parse("0.34.27").unwrap() + )) + } + ); + } + + #[test] + fn phoenix() { + let version_info = VersionInfo { + name: "terra".to_string(), + app_name: "terrad".to_string(), + version: "20210603".to_string(), + git_commit: "7cbb1f555b661a6ebec55231e563d2f94effc40e".to_string(), + build_tags: "netgo,ledger".to_string(), + go_version: "go version go1.20 linux/amd64".to_string(), + cosmos_sdk_version: "v0.47.5".to_string(), + build_deps: vec![ + Module { + path: "github.com/confio/ics23/go".to_string(), + version: "v0.9.0".to_string(), + sum: "h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4=".to_string(), + }, + Module { + path: "github.com/cometbft/cometbft-db".to_string(), + version: "v0.8.0".to_string(), + sum: "h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo=".to_string(), + }, + Module { + path: "github.com/cosmos/cosmos-proto".to_string(), + version: "v1.0.0-beta.3".to_string(), + sum: "h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o=".to_string(), + }, + Module { + path: "github.com/cosmos/cosmos-sdk".to_string(), + version: "v0.47.5".to_string(), + sum: "".to_string(), + }, + Module { + path: "github.com/cosmos/ibc-go/v7".to_string(), + version: "v7.3.0".to_string(), + sum: "".to_string(), + }, + Module { + path: "github.com/cosmos/ics23/go".to_string(), + version: "v0.10.0".to_string(), + sum: "h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM=".to_string(), + }, + Module { + path: "github.com/cometbft/cometbft".to_string(), + version: "v0.37.2".to_string(), + sum: "h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc=".to_string(), + }, + ], + }; + + let app_info = AppInfo::from(&version_info); + + assert_eq!( + app_info, + AppInfo { + app_name: "terrad".to_string(), + version: "20210603".to_string(), + git_commit: "7cbb1f555b661a6ebec55231e563d2f94effc40e".to_string() + } + ); + + let specs = Specs::try_from(version_info).unwrap(); + + assert_eq!( + specs, + Specs { + cosmos_sdk: Some(semver::Version::parse("0.47.5").unwrap()), + ibc_go: Some(semver::Version::parse("7.3.0").unwrap()), + consensus: Some(ConsensusVersion::Comet( + semver::Version::parse("0.37.2").unwrap() + )) + } + ); + } +} diff --git a/crates/relayer/src/worker/packet.rs b/crates/relayer/src/worker/packet.rs index 5daf122466..7439301828 100644 --- a/crates/relayer/src/worker/packet.rs +++ b/crates/relayer/src/worker/packet.rs @@ -1,9 +1,3 @@ -#[cfg(feature = "telemetry")] -use { - ibc_relayer_types::core::ics24_host::identifier::ChannelId, - ibc_relayer_types::core::ics24_host::identifier::PortId, -}; - use core::time::Duration; use std::borrow::BorrowMut; use std::sync::{Arc, Mutex}; @@ -20,6 +14,8 @@ use ibc_relayer_types::applications::transfer::{Amount, Coin, RawCoin}; use ibc_relayer_types::core::ics04_channel::channel::Ordering; use ibc_relayer_types::core::ics04_channel::events::WriteAcknowledgement; use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics24_host::identifier::ChannelId; +use ibc_relayer_types::core::ics24_host::identifier::PortId; use ibc_relayer_types::events::{IbcEvent, IbcEventType}; use ibc_relayer_types::Height; From 11ed07fb434edb3a85955bff0ec3caf6dfe779f6 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:23:34 +0100 Subject: [PATCH 052/200] Add Injective to chains running tests in CI (#3886) * Add Injective to chains running tests in CI * Add changelog and Injective to multi-chains-test * Fix ICS29 timeout fee test compatibility for ibc-go v8.1+ * Add compatibility to ICS29 tests for ibc-go v8.1+ * Fix typos --- .../3887-test-with-injective.md | 2 + .github/workflows/integration.yaml | 5 + .github/workflows/multi-chains.yaml | 3 + flake.lock | 449 ++++++++++++++++-- flake.nix | 1 + .../src/tests/fee/auto_forward_relayer.rs | 14 +- .../src/tests/fee/filter_fees.rs | 62 ++- .../src/tests/fee/forward_relayer.rs | 10 +- .../src/tests/fee/no_forward_relayer.rs | 22 +- .../src/tests/fee/pay_fee_async.rs | 41 +- .../src/tests/fee/register_payee.rs | 10 +- .../src/tests/fee/timeout_fee.rs | 4 - tools/test-framework/src/chain/chain_type.rs | 31 +- .../test-framework/src/chain/cli/bootstrap.rs | 48 +- .../test-framework/src/chain/ext/bootstrap.rs | 4 + 15 files changed, 561 insertions(+), 145 deletions(-) create mode 100644 .changelog/unreleased/features/ibc-integration-test/3887-test-with-injective.md diff --git a/.changelog/unreleased/features/ibc-integration-test/3887-test-with-injective.md b/.changelog/unreleased/features/ibc-integration-test/3887-test-with-injective.md new file mode 100644 index 0000000000..5a9981b4e5 --- /dev/null +++ b/.changelog/unreleased/features/ibc-integration-test/3887-test-with-injective.md @@ -0,0 +1,2 @@ +- Add Injective chain to the chains running the integration tests in the CI. + ([\#3887](https://github.com/informalsystems/hermes/issues/3887)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 188878792b..e28709b664 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -95,6 +95,11 @@ jobs: account_prefix: migaloo native_token: stake features: '' + - package: injective + command: injectived + account_prefix: inj + native_token: stake + features: forward-packet,fee-grant steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index 0b8a026495..d65eac0591 100644 --- a/.github/workflows/multi-chains.yaml +++ b/.github/workflows/multi-chains.yaml @@ -80,6 +80,9 @@ jobs: - package: wasmd command: wasmd account_prefix: wasm + - package: injective + command: injectived + account_prefix: inj steps: - uses: actions/checkout@v4 diff --git a/flake.lock b/flake.lock index a0dbfb5653..d676a39d15 100644 --- a/flake.lock +++ b/flake.lock @@ -17,6 +17,23 @@ "type": "github" } }, + "andromeda-src": { + "flake": false, + "locked": { + "lastModified": 1699913909, + "narHash": "sha256-8nKekKLBZR7nDNXZ1UL0J7YOMRv6HbzT7pj0W+fV+4U=", + "owner": "andromedaprotocol", + "repo": "andromedad", + "rev": "a72f010f8e3f9db183da0ddaf4ef65069b690981", + "type": "github" + }, + "original": { + "owner": "andromedaprotocol", + "ref": "andromeda-1", + "repo": "andromedad", + "type": "github" + } + }, "apalache-src": { "flake": false, "locked": { @@ -105,6 +122,7 @@ "cosmos-nix": { "inputs": { "akash-src": "akash-src", + "andromeda-src": "andromeda-src", "apalache-src": "apalache-src", "beaker-src": "beaker-src", "celestia-src": "celestia-src", @@ -131,6 +149,7 @@ "gaia9-src": "gaia9-src", "gex-src": "gex-src", "gomod2nix": "gomod2nix", + "haqq-src": "haqq-src", "hermes-src": "hermes-src", "ibc-go-v2-src": "ibc-go-v2-src", "ibc-go-v3-src": "ibc-go-v3-src", @@ -138,11 +157,11 @@ "ibc-go-v5-src": "ibc-go-v5-src", "ibc-go-v6-src": "ibc-go-v6-src", "ibc-go-v7-src": "ibc-go-v7-src", - "ibc-go-v8-channel-upgrade-src": "ibc-go-v8-channel-upgrade-src", "ibc-go-v8-src": "ibc-go-v8-src", "ibc-rs-src": "ibc-rs-src", "ica-src": "ica-src", "ignite-cli-src": "ignite-cli-src", + "injective-src": "injective-src", "interchain-security-src": "interchain-security-src", "iris-src": "iris-src", "ixo-src": "ixo-src", @@ -151,7 +170,7 @@ "namada-src": "namada-src", "neutron-src": "neutron-src", "nix-std": "nix-std", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs_3", "osmosis-src": "osmosis-src", "provenance-src": "provenance-src", "regen-src": "regen-src", @@ -161,6 +180,7 @@ "sconfig-src": "sconfig-src", "sentinel-src": "sentinel-src", "sifchain-src": "sifchain-src", + "slinky-src": "slinky-src", "stargaze-src": "stargaze-src", "stoml-src": "stoml-src", "stride-consumer-src": "stride-consumer-src", @@ -178,11 +198,11 @@ "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" }, "locked": { - "lastModified": 1705315275, - "narHash": "sha256-XnjvjdTdXkwWFWx1nRflbsDyazSBV09QOmr/aiAuZ1M=", + "lastModified": 1710159227, + "narHash": "sha256-YtGtc7e4xIou6fD2r0xAzgEbIgrklYoT8YQnDObqBgU=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "04ef5159b4262b7dd445544838468a84a1d987cf", + "rev": "3d922c4bc02a5433aa2a9343268a58790c631349", "type": "github" }, "original": { @@ -259,6 +279,31 @@ "type": "github" } }, + "devenv": { + "inputs": { + "flake-compat": "flake-compat", + "nix": "nix", + "nixpkgs": [ + "cosmos-nix", + "haqq-src", + "nixpkgs-unstable" + ], + "pre-commit-hooks": "pre-commit-hooks" + }, + "locked": { + "lastModified": 1700127701, + "narHash": "sha256-NLvhvXBmX+WuqDN9PbRbQCsA+y57yGaf+jCWuJVdaIQ=", + "owner": "cachix", + "repo": "devenv", + "rev": "0c41b86406e910a75fbde28f81ec7f6fda74f7e1", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, "dydx-src": { "flake": false, "locked": { @@ -293,6 +338,22 @@ "type": "github" } }, + "flake-compat": { + "flake": false, + "locked": { + "lastModified": 1673956053, + "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", + "owner": "edolstra", + "repo": "flake-compat", + "rev": "35bb57c0c8d8b62bbfd284272c928ceb64ddbde9", + "type": "github" + }, + "original": { + "owner": "edolstra", + "repo": "flake-compat", + "type": "github" + } + }, "flake-parts": { "inputs": { "nixpkgs-lib": "nixpkgs-lib" @@ -333,6 +394,42 @@ "inputs": { "systems": "systems_2" }, + "locked": { + "lastModified": 1685518550, + "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_4": { + "inputs": { + "systems": "systems_4" + }, "locked": { "lastModified": 1681202837, "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", @@ -347,7 +444,7 @@ "type": "github" } }, - "flake-utils_3": { + "flake-utils_5": { "locked": { "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", @@ -362,16 +459,16 @@ "type": "github" } }, - "flake-utils_4": { + "flake-utils_6": { "inputs": { - "systems": "systems_3" + "systems": "systems_5" }, "locked": { - "lastModified": 1705309234, - "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -600,6 +697,30 @@ "type": "github" } }, + "gitignore": { + "inputs": { + "nixpkgs": [ + "cosmos-nix", + "haqq-src", + "devenv", + "pre-commit-hooks", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1660459072, + "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", + "owner": "hercules-ci", + "repo": "gitignore.nix", + "rev": "a20de23b925fd8264fd7fad6454652e142fd7f73", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "gitignore.nix", + "type": "github" + } + }, "gomod2nix": { "inputs": { "flake-utils": "flake-utils", @@ -620,6 +741,57 @@ "type": "github" } }, + "gomod2nix_2": { + "inputs": { + "flake-utils": [ + "cosmos-nix", + "haqq-src", + "flake-utils" + ], + "nixpkgs": [ + "cosmos-nix", + "haqq-src", + "nixpkgs-unstable" + ] + }, + "locked": { + "lastModified": 1705314449, + "narHash": "sha256-yfQQ67dLejP0FLK76LKHbkzcQqNIrux6MFe32MMFGNQ=", + "owner": "nix-community", + "repo": "gomod2nix", + "rev": "30e3c3a9ec4ac8453282ca7f67fca9e1da12c3e6", + "type": "github" + }, + "original": { + "owner": "nix-community", + "ref": "master", + "repo": "gomod2nix", + "type": "github" + } + }, + "haqq-src": { + "inputs": { + "devenv": "devenv", + "flake-utils": "flake-utils_3", + "gomod2nix": "gomod2nix_2", + "nixpkgs": "nixpkgs_2", + "nixpkgs-unstable": "nixpkgs-unstable" + }, + "locked": { + "lastModified": 1707232493, + "narHash": "sha256-pXbLGvq6ZyZbtKYoe8GbgaxGV0SIbARrT6DkDmPwlYE=", + "owner": "haqq-network", + "repo": "haqq", + "rev": "18370cfb2f9aab35d311c4c75ab5586f50213830", + "type": "github" + }, + "original": { + "owner": "haqq-network", + "repo": "haqq", + "rev": "18370cfb2f9aab35d311c4c75ab5586f50213830", + "type": "github" + } + }, "hermes-src": { "flake": false, "locked": { @@ -739,36 +911,19 @@ "type": "github" } }, - "ibc-go-v8-channel-upgrade-src": { - "flake": false, - "locked": { - "lastModified": 1703189903, - "narHash": "sha256-vxzv+b40TKqCIN4FAkeIu+jmlPP5XRLR+P0uEIjr7AE=", - "owner": "cosmos", - "repo": "ibc-go", - "rev": "7a89e5d5b5ebb7643ce3992c34008c35373ecf34", - "type": "github" - }, - "original": { - "owner": "cosmos", - "ref": "04-channel-upgrades-rc.0", - "repo": "ibc-go", - "type": "github" - } - }, "ibc-go-v8-src": { "flake": false, "locked": { - "lastModified": 1699602904, - "narHash": "sha256-BcP3y874QviVsV+04p9CioolyvmWH82ORbb5EB2GyRI=", + "lastModified": 1706691043, + "narHash": "sha256-eS+X4bT7vp1+LyIPd0mOnAJahAONr+Syton3v3rSkGI=", "owner": "cosmos", "repo": "ibc-go", - "rev": "2551dea41cd3c512845007ca895c8402afa9b79f", + "rev": "7e01c9149149b9d4b1d871e58eb88a22f15bdb3c", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v8.0.0", + "ref": "v8.1.0", "repo": "ibc-go", "type": "github" } @@ -823,6 +978,23 @@ "type": "github" } }, + "injective-src": { + "flake": false, + "locked": { + "lastModified": 1706041278, + "narHash": "sha256-Vr/l8/wtZ47wi1OTWhsfLetKZH8c1fUFeoQaxF+QS3c=", + "owner": "OpenDeFiFoundation", + "repo": "injective-core", + "rev": "e1ab66c240524b05b872f63890fefcd4fced5f7a", + "type": "github" + }, + "original": { + "owner": "OpenDeFiFoundation", + "ref": "v1.12.1", + "repo": "injective-core", + "type": "github" + } + }, "interchain-security-src": { "flake": false, "locked": { @@ -891,6 +1063,22 @@ "type": "github" } }, + "lowdown-src": { + "flake": false, + "locked": { + "lastModified": 1633514407, + "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", + "owner": "kristapsdz", + "repo": "lowdown", + "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", + "type": "github" + }, + "original": { + "owner": "kristapsdz", + "repo": "lowdown", + "type": "github" + } + }, "migaloo-src": { "flake": false, "locked": { @@ -942,6 +1130,32 @@ "type": "github" } }, + "nix": { + "inputs": { + "lowdown-src": "lowdown-src", + "nixpkgs": [ + "cosmos-nix", + "haqq-src", + "devenv", + "nixpkgs" + ], + "nixpkgs-regression": "nixpkgs-regression" + }, + "locked": { + "lastModified": 1676545802, + "narHash": "sha256-EK4rZ+Hd5hsvXnzSzk2ikhStJnD63odF7SzsQ8CuSPU=", + "owner": "domenkozar", + "repo": "nix", + "rev": "7c91803598ffbcfe4a55c44ac6d49b2cf07a527f", + "type": "github" + }, + "original": { + "owner": "domenkozar", + "ref": "relaxed-flakes", + "repo": "nix", + "type": "github" + } + }, "nix-std": { "locked": { "lastModified": 1701658249, @@ -991,13 +1205,75 @@ "type": "github" } }, + "nixpkgs-regression": { + "locked": { + "lastModified": 1643052045, + "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + }, + "original": { + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", + "type": "github" + } + }, + "nixpkgs-stable": { + "locked": { + "lastModified": 1685801374, + "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "c37ca420157f4abc31e26f436c1145f8951ff373", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-23.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-unstable": { + "locked": { + "lastModified": 1707092692, + "narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "faf912b086576fd1a15fca610166c98d47bc667e", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nixpkgs_2": { "locked": { - "lastModified": 1701040486, - "narHash": "sha256-vawYwoHA5CwvjfqaT3A5CT9V36Eq43gxdwpux32Qkjw=", + "lastModified": 1707091808, + "narHash": "sha256-LahKBAfGbY836gtpVNnWwBTIzN7yf/uYM/S0g393r0Y=", + "rev": "9f2ee8c91ac42da3ae6c6a1d21555f283458247e", + "revCount": 555392, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2311.555392%2Brev-9f2ee8c91ac42da3ae6c6a1d21555f283458247e/018d7c73-3161-76d5-aca1-5929105b0aa0/source.tar.gz" + }, + "original": { + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.2311.%2A.tar.gz" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1706683685, + "narHash": "sha256-FtPPshEpxH/ewBOsdKBNhlsL2MLEFv1hEnQ19f/bFsQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "45827faa2132b8eade424f6bdd48d8828754341a", + "rev": "5ad9903c16126a7d949101687af0aa589b1d7d3d", "type": "github" }, "original": { @@ -1007,7 +1283,7 @@ "type": "github" } }, - "nixpkgs_3": { + "nixpkgs_4": { "locked": { "lastModified": 1681358109, "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", @@ -1023,7 +1299,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_5": { "locked": { "lastModified": 1674990008, "narHash": "sha256-4zOyp+hFW2Y7imxIpZqZGT8CEqKmDjwgfD6BzRUE0mQ=", @@ -1039,13 +1315,13 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_6": { "locked": { - "lastModified": 1705505490, - "narHash": "sha256-HS+Zg50Zm1Ehfat/OgGS2YJqU7/4ohsQhK+ClwcKmVA=", + "lastModified": 1710222005, + "narHash": "sha256-irXySffHz7b82dZIme6peyAu+8tTJr1zyxcfUPhqUrg=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f36047a5a4b5631f75210859abac7f97ba1ba7a7", + "rev": "9a9a7552431c4f1a3b2eee9398641babf7c30d0e", "type": "github" }, "original": { @@ -1072,6 +1348,38 @@ "type": "github" } }, + "pre-commit-hooks": { + "inputs": { + "flake-compat": [ + "cosmos-nix", + "haqq-src", + "devenv", + "flake-compat" + ], + "flake-utils": "flake-utils_2", + "gitignore": "gitignore", + "nixpkgs": [ + "cosmos-nix", + "haqq-src", + "devenv", + "nixpkgs" + ], + "nixpkgs-stable": "nixpkgs-stable" + }, + "locked": { + "lastModified": 1688056373, + "narHash": "sha256-2+SDlNRTKsgo3LBRiMUcoEUb6sDViRNQhzJquZ4koOI=", + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "rev": "5843cf069272d92b60c3ed9e55b7a8989c01d4c7", + "type": "github" + }, + "original": { + "owner": "cachix", + "repo": "pre-commit-hooks.nix", + "type": "github" + } + }, "provenance-src": { "flake": false, "locked": { @@ -1126,14 +1434,14 @@ "root": { "inputs": { "cosmos-nix": "cosmos-nix", - "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_5" + "flake-utils": "flake-utils_6", + "nixpkgs": "nixpkgs_6" } }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils_2", - "nixpkgs": "nixpkgs_3" + "flake-utils": "flake-utils_4", + "nixpkgs": "nixpkgs_4" }, "locked": { "lastModified": 1702347444, @@ -1151,8 +1459,8 @@ }, "sbt-derivation": { "inputs": { - "flake-utils": "flake-utils_3", - "nixpkgs": "nixpkgs_4" + "flake-utils": "flake-utils_5", + "nixpkgs": "nixpkgs_5" }, "locked": { "lastModified": 1698464090, @@ -1218,6 +1526,23 @@ "type": "github" } }, + "slinky-src": { + "flake": false, + "locked": { + "lastModified": 1706741000, + "narHash": "sha256-gto9l+zeM1WLIv/VtVlrhTpUTMLN+niQTo5zlrbkx30=", + "owner": "skip-mev", + "repo": "slinky", + "rev": "642846e3517f4aa4ffe1cd29180fef4d459bfbfe", + "type": "github" + }, + "original": { + "owner": "skip-mev", + "ref": "v0.2.0", + "repo": "slinky", + "type": "github" + } + }, "stargaze-src": { "flake": false, "locked": { @@ -1330,6 +1655,36 @@ "type": "github" } }, + "systems_4": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_5": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "umee-src": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 7e2f5756e3..9f823c4f16 100644 --- a/flake.nix +++ b/flake.nix @@ -52,6 +52,7 @@ stride-consumer-no-admin stride-consumer wasmd + injective ; python = nixpkgs.python3.withPackages (p: [ diff --git a/tools/integration-test/src/tests/fee/auto_forward_relayer.rs b/tools/integration-test/src/tests/fee/auto_forward_relayer.rs index 7d0b6bdcc3..ca120394a5 100644 --- a/tools/integration-test/src/tests/fee/auto_forward_relayer.rs +++ b/tools/integration-test/src/tests/fee/auto_forward_relayer.rs @@ -54,7 +54,7 @@ impl BinaryChannelTest for AutoForwardRelayerTest { let user_a = wallets_a.user1(); let user_b = wallets_b.user1(); - let balance_a1 = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; + let balance_a = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; let relayer_balance_a = chain_driver_a.query_balance(&relayer_a.address(), &denom_a)?; @@ -63,10 +63,6 @@ impl BinaryChannelTest for AutoForwardRelayerTest { let ack_fee = random_u128_range(200, 300); let timeout_fee = random_u128_range(100, 200); - let total_sent = send_amount + receive_fee + ack_fee + timeout_fee; - - let balance_a2 = balance_a1 - total_sent; - chain_driver_a.ibc_token_transfer_with_fee( &port_a, &channel_id_a, @@ -85,18 +81,22 @@ impl BinaryChannelTest for AutoForwardRelayerTest { &denom_a, )?; - chain_driver_a.assert_eventual_wallet_amount(&user_a.address(), &balance_a2.as_ref())?; + info!("Will assert user b received the transferred token"); chain_driver_b.assert_eventual_wallet_amount( &user_b.address(), &denom_b.with_amount(send_amount).as_ref(), )?; + info!("Will assert user a transferred the sent amount, the recv fee and ack fee"); + chain_driver_a.assert_eventual_wallet_amount( &user_a.address(), - &(balance_a2 + timeout_fee).as_ref(), + &(balance_a - send_amount - receive_fee - ack_fee).as_ref(), )?; + info!("Will assert the relayer received the recv fee and ack fee"); + chain_driver_a.assert_eventual_wallet_amount( &relayer_a.address(), &(relayer_balance_a + ack_fee + receive_fee).as_ref(), diff --git a/tools/integration-test/src/tests/fee/filter_fees.rs b/tools/integration-test/src/tests/fee/filter_fees.rs index a6cd76b37d..6113d98c1f 100644 --- a/tools/integration-test/src/tests/fee/filter_fees.rs +++ b/tools/integration-test/src/tests/fee/filter_fees.rs @@ -1,3 +1,4 @@ +use std::cmp::max; use std::collections::HashMap; use ibc_relayer::config::filter::{ChannelPolicy, FeePolicy, FilterPattern, MinFee}; @@ -77,7 +78,12 @@ impl BinaryChannelTest for FilterIncentivizedFeesRelayerTest { let total_sent_fail = send_amount + receive_fee_fail + ack_fee + timeout_fee; - let balance_a2_fail = balance_a1 - total_sent_fail; + // Before ibc-go v8.1.0 the amount escrowed for ICS29 fees is the sum of recv, ack and timeout fees + let balance_a2_fail = balance_a1.clone() - total_sent_fail; + + // From ibc-go v8.1+ the amount escrowed for ICS29 fees is the highest value between recv + ack fees or timeout fee + let balance_a2_fail2 = + balance_a1 - send_amount - max(receive_fee_fail + ack_fee, timeout_fee); chain_driver_a.ibc_token_transfer_with_fee( &port_a, @@ -99,16 +105,30 @@ impl BinaryChannelTest for FilterIncentivizedFeesRelayerTest { std::thread::sleep(Duration::from_secs(10)); - chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &balance_a2_fail.as_ref())?; + // This double check is required because ibc-go versions previous to v8.1.0 escrow recv, ack and timeout + // fees for ICS29. From ibc-go v8.1+ only the highest value between recv+ack and timeout is escrowed. + match chain_driver_a + .assert_eventual_wallet_amount(&user_a.address(), &balance_a2_fail.as_ref()) + { + Ok(()) => {} + Err(_) => chain_driver_a + .assert_eventual_wallet_amount(&user_a.address(), &balance_a2_fail2.as_ref())?, + } chain_driver_b.assert_eventual_wallet_amount( &user_b.address(), &denom_b.with_amount(0u128).as_ref(), )?; - chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &(balance_a2_fail).as_ref())?; + // This double check is required because ibc-go versions previous to v8.1.0 escrow recv, ack and timeout + // fees for ICS29. From ibc-go v8.1+ only the highest value between recv+ack and timeout is escrowed. + match chain_driver_a + .assert_eventual_wallet_amount(&user_a.address(), &(balance_a2_fail).as_ref()) + { + Ok(()) => {} + Err(_) => chain_driver_a + .assert_eventual_wallet_amount(&user_a.address(), &balance_a2_fail2.as_ref())?, + } chain_driver_a.assert_eventual_wallet_amount( &relayer_a.address(), @@ -118,7 +138,7 @@ impl BinaryChannelTest for FilterIncentivizedFeesRelayerTest { { info!("Verify that packet with enough fees is relayed"); - let balance_a1 = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; + let balance_a = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; let relayer_balance_a = chain_driver_a.query_balance(&relayer_a.address(), &denom_a)?; let send_amount = random_u128_range(1000, 2000); @@ -126,10 +146,6 @@ impl BinaryChannelTest for FilterIncentivizedFeesRelayerTest { let ack_fee = random_u128_range(200, 300); let timeout_fee = random_u128_range(100, 200); - let total_sent_success = send_amount + receive_fee_success + ack_fee + timeout_fee; - - let balance_a2_success = balance_a1 - total_sent_success; - chain_driver_a.ibc_token_transfer_with_fee( &port_a, &channel_id_a, @@ -148,9 +164,6 @@ impl BinaryChannelTest for FilterIncentivizedFeesRelayerTest { &denom_a, )?; - chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &balance_a2_success.as_ref())?; - chain_driver_b.assert_eventual_wallet_amount( &user_b.address(), &denom_b.with_amount(send_amount).as_ref(), @@ -160,6 +173,11 @@ impl BinaryChannelTest for FilterIncentivizedFeesRelayerTest { &relayer_a.address(), &(relayer_balance_a + receive_fee_success + ack_fee).as_ref(), )?; + + chain_driver_a.assert_eventual_wallet_amount( + &user_a.address(), + &(balance_a - send_amount - receive_fee_success - ack_fee).as_ref(), + )?; } Ok(()) @@ -226,7 +244,11 @@ impl BinaryChannelTest for FilterByChannelIncentivizedFeesRelayerTest { let total_sent = send_amount + receive_fee + ack_fee + timeout_fee; - let balance_a2 = balance_a1 - total_sent; + // Before ibc-go v8.1.0 the amount escrowed for ICS29 fees is the sum of recv, ack and timeout fees + let balance_a2_legacy = balance_a1.clone() - total_sent; + + // From ibc-go v8.1+ the amount escrowed for ICS29 fees is the highest value between recv + ack fees or timeout fee + let balance_a2 = balance_a1.clone() - send_amount - max(receive_fee + ack_fee, timeout_fee); let denom_b = derive_ibc_denom( &channel.port_b.as_ref(), @@ -248,7 +270,15 @@ impl BinaryChannelTest for FilterByChannelIncentivizedFeesRelayerTest { Duration::from_secs(60), )?; - chain_driver_a.assert_eventual_wallet_amount(&user_a.address(), &balance_a2.as_ref())?; + // This double check is required because ibc-go versions previous to v8.1.0 escrow recv, ack and timeout + // fees for ICS29. From ibc-go v8.1+ only the highest value between recv+ack and timeout is escrowed. + match chain_driver_a + .assert_eventual_wallet_amount(&user_a.address(), &balance_a2_legacy.as_ref()) + { + Ok(()) => {} + Err(_) => chain_driver_a + .assert_eventual_wallet_amount(&user_a.address(), &balance_a2.as_ref())?, + } chain_driver_b.assert_eventual_wallet_amount( &user_b.address(), @@ -257,7 +287,7 @@ impl BinaryChannelTest for FilterByChannelIncentivizedFeesRelayerTest { chain_driver_a.assert_eventual_wallet_amount( &user_a.address(), - &(balance_a2 + timeout_fee).as_ref(), + &(balance_a1 - send_amount - receive_fee - ack_fee).as_ref(), )?; chain_driver_a.assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/fee/forward_relayer.rs b/tools/integration-test/src/tests/fee/forward_relayer.rs index f5dc0695fc..daa5bcf317 100644 --- a/tools/integration-test/src/tests/fee/forward_relayer.rs +++ b/tools/integration-test/src/tests/fee/forward_relayer.rs @@ -93,7 +93,7 @@ impl BinaryChannelTest for ForwardRelayerTest { let user_a = wallets_a.user1(); let user_b = wallets_b.user1(); - let balance_a1 = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; + let balance_a = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; let relayer_balance_a = chain_driver_a.query_balance(&relayer_a.address(), &denom_a)?; @@ -102,10 +102,6 @@ impl BinaryChannelTest for ForwardRelayerTest { let ack_fee = random_u128_range(200, 300); let timeout_fee = random_u128_range(100, 200); - let total_sent = send_amount + receive_fee + ack_fee + timeout_fee; - - let balance_a2 = balance_a1 - total_sent; - chain_driver_a.ibc_token_transfer_with_fee( &port_a, &channel_id_a, @@ -124,8 +120,6 @@ impl BinaryChannelTest for ForwardRelayerTest { &denom_a, )?; - chain_driver_a.assert_eventual_wallet_amount(&user_a.address(), &balance_a2.as_ref())?; - chain_driver_b.assert_eventual_wallet_amount( &user_b.address(), &denom_b.with_amount(send_amount).as_ref(), @@ -133,7 +127,7 @@ impl BinaryChannelTest for ForwardRelayerTest { chain_driver_a.assert_eventual_wallet_amount( &user_a.address(), - &(balance_a2 + timeout_fee).as_ref(), + &(balance_a - send_amount - receive_fee - ack_fee).as_ref(), )?; chain_driver_a.assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/fee/no_forward_relayer.rs b/tools/integration-test/src/tests/fee/no_forward_relayer.rs index f623126b55..8b840640e8 100644 --- a/tools/integration-test/src/tests/fee/no_forward_relayer.rs +++ b/tools/integration-test/src/tests/fee/no_forward_relayer.rs @@ -71,7 +71,7 @@ impl BinaryChannelTest for NoForwardRelayerTest { let user_a = wallets_a.user1(); let user_b = wallets_b.user1(); - let balance_a1 = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; + let balance_a = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; let relayer_balance_a = chain_driver_a.query_balance(&relayer_a.address(), &denom_a)?; @@ -80,10 +80,6 @@ impl BinaryChannelTest for NoForwardRelayerTest { let ack_fee = random_u128_range(200, 300); let timeout_fee = random_u128_range(100, 200); - let total_sent = send_amount + receive_fee + ack_fee + timeout_fee; - - let balance_a2 = balance_a1 - total_sent; - chain_driver_a.ibc_token_transfer_with_fee( &port_a, &channel_id_a, @@ -102,8 +98,6 @@ impl BinaryChannelTest for NoForwardRelayerTest { &denom_a, )?; - chain_driver_a.assert_eventual_wallet_amount(&user_a.address(), &balance_a2.as_ref())?; - chain_driver_b.assert_eventual_wallet_amount( &user_b.address(), &denom_b.with_amount(send_amount).as_ref(), @@ -113,7 +107,7 @@ impl BinaryChannelTest for NoForwardRelayerTest { // as there is no counterparty address registered. chain_driver_a.assert_eventual_wallet_amount( &user_a.address(), - &(balance_a2 + receive_fee + timeout_fee).as_ref(), + &(balance_a - send_amount - ack_fee).as_ref(), )?; chain_driver_a.assert_eventual_wallet_amount( @@ -153,7 +147,7 @@ impl BinaryChannelTest for InvalidForwardRelayerTest { let user_a = wallets_a.user1(); let user_b = wallets_b.user1(); - let balance_a1 = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; + let balance_a = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; let relayer_balance_a = chain_driver_a.query_balance(&relayer_a.address(), &denom_a)?; @@ -162,10 +156,6 @@ impl BinaryChannelTest for InvalidForwardRelayerTest { let ack_fee = random_u128_range(200, 300); let timeout_fee = random_u128_range(100, 200); - let total_sent = send_amount + receive_fee + ack_fee + timeout_fee; - - let balance_a2 = balance_a1 - total_sent; - let invalid_address = MonoTagged::new(WalletAddress("a very long and invalid address".to_string())); @@ -194,18 +184,16 @@ impl BinaryChannelTest for InvalidForwardRelayerTest { &denom_a, )?; - chain_driver_a.assert_eventual_wallet_amount(&user_a.address(), &balance_a2.as_ref())?; - chain_driver_b.assert_eventual_wallet_amount( &user_b.address(), &denom_b.with_amount(send_amount).as_ref(), )?; // receive fee and timeout fee should be refunded, - // as thecounterparty address registered is invalid. + // as the counterparty address registered is invalid. chain_driver_a.assert_eventual_wallet_amount( &user_a.address(), - &(balance_a2 + receive_fee + timeout_fee).as_ref(), + &(balance_a - send_amount - ack_fee).as_ref(), )?; chain_driver_a.assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/fee/pay_fee_async.rs b/tools/integration-test/src/tests/fee/pay_fee_async.rs index f62d089ff1..37c486c07d 100644 --- a/tools/integration-test/src/tests/fee/pay_fee_async.rs +++ b/tools/integration-test/src/tests/fee/pay_fee_async.rs @@ -18,6 +18,8 @@ //! Finally, the test initializes the supervisor in order to relay the pending packets so that the //! balances on the two chains can be asserted. +use std::cmp::max; + use ibc_relayer_types::core::ics04_channel::version::Version; use ibc_relayer_types::events::IbcEvent; use ibc_test_framework::prelude::*; @@ -105,13 +107,26 @@ impl BinaryChannelTest for PayPacketFeeAsyncTest { &denom_a.with_amount(receive_fee).as_ref(), &denom_a.with_amount(ack_fee).as_ref(), &denom_a.with_amount(timeout_fee).as_ref(), - Duration::from_secs(60), + Duration::from_secs(300), )?; let total_sent = send_amount + receive_fee + ack_fee + timeout_fee; - let balance_a2 = balance_a1 - total_sent; - chain_driver_a.assert_eventual_wallet_amount(&user_a.address(), &balance_a2.as_ref())?; + // Before ibc-go v8.1.0 the amount escrowed for ICS29 fees is the sum of recv, ack and timeout fees + let balance_a2_legacy = balance_a1.clone() - total_sent; + + // From ibc-go v8.1+ the amount escrowed for ICS29 fees is the highest value between recv + ack fees or timeout fee + let balance_a2 = balance_a1.clone() - send_amount - max(receive_fee + ack_fee, timeout_fee); + + // This double check is required because ibc-go versions previous to v8.1.0 escrow recv, ack and timeout + // fees for ICS29. From ibc-go v8.1+ only the highest value between recv+ack and timeout is escrowed. + match chain_driver_a + .assert_eventual_wallet_amount(&user_a.address(), &balance_a2_legacy.as_ref()) + { + Ok(()) => {} + Err(_) => chain_driver_a + .assert_eventual_wallet_amount(&user_a.address(), &balance_a2.as_ref())?, + } let sequence = { let send_packet_event = events @@ -208,9 +223,22 @@ impl BinaryChannelTest for PayPacketFeeAsyncTest { )?; let total_sent_2 = receive_fee_2 + ack_fee_2 + timeout_fee_2; - let balance_a3 = balance_a2 - total_sent_2; - chain_driver_a.assert_eventual_wallet_amount(&user_a.address(), &balance_a3.as_ref())?; + // Before ibc-go v8.1.0 the amount escrowed for ICS29 fees is the sum of recv, ack and timeout fees + let balance_a3_legacy = balance_a2_legacy - total_sent_2; + + // From ibc-go v8.1+ the amount escrowed for ICS29 fees is the highest value between recv + ack fees or timeout fee + let balance_a3 = balance_a2 - max(receive_fee_2 + ack_fee_2, timeout_fee_2); + + // This double check is required because ibc-go versions previous to v8.1.0 escrow recv, ack and timeout + // fees for ICS29. From ibc-go v8.1+ only the highest value between recv+ack and timeout is escrowed. + match chain_driver_a + .assert_eventual_wallet_amount(&user_a.address(), &balance_a3_legacy.as_ref()) + { + Ok(()) => {} + Err(_) => chain_driver_a + .assert_eventual_wallet_amount(&user_a.address(), &balance_a3.as_ref())?, + } { let event = events2 @@ -259,7 +287,8 @@ impl BinaryChannelTest for PayPacketFeeAsyncTest { chain_driver_a.assert_eventual_wallet_amount( &user_a.address(), - &(balance_a3 + timeout_fee + timeout_fee_2).as_ref(), + &(balance_a1 - send_amount - receive_fee - receive_fee_2 - ack_fee - ack_fee_2) + .as_ref(), )?; chain_driver_a.assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/fee/register_payee.rs b/tools/integration-test/src/tests/fee/register_payee.rs index 0e92dfe4b3..638800c846 100644 --- a/tools/integration-test/src/tests/fee/register_payee.rs +++ b/tools/integration-test/src/tests/fee/register_payee.rs @@ -107,7 +107,7 @@ impl BinaryChannelTest for ForwardRelayerTest { let user_a = wallets_a.user1(); let user_b = wallets_b.user1(); - let balance_a1 = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; + let balance_a = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; let relayer_balance_a = chain_driver_a.query_balance(&relayer_a.address(), &denom_a)?; let payee_balance_a = chain_driver_a.query_balance(&payee_a.address(), &denom_a)?; @@ -117,10 +117,6 @@ impl BinaryChannelTest for ForwardRelayerTest { let ack_fee = random_u128_range(200, 300); let timeout_fee = random_u128_range(100, 200); - let total_sent = send_amount + receive_fee + ack_fee + timeout_fee; - - let balance_a2 = balance_a1 - total_sent; - chain_driver_a.ibc_token_transfer_with_fee( &port_a, &channel_id_a, @@ -139,8 +135,6 @@ impl BinaryChannelTest for ForwardRelayerTest { &denom_a, )?; - chain_driver_a.assert_eventual_wallet_amount(&user_a.address(), &balance_a2.as_ref())?; - chain_driver_b.assert_eventual_wallet_amount( &user_b.address(), &denom_b.with_amount(send_amount).as_ref(), @@ -148,7 +142,7 @@ impl BinaryChannelTest for ForwardRelayerTest { chain_driver_a.assert_eventual_wallet_amount( &user_a.address(), - &(balance_a2 + timeout_fee).as_ref(), + &(balance_a - send_amount - receive_fee - ack_fee).as_ref(), )?; chain_driver_a.assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/fee/timeout_fee.rs b/tools/integration-test/src/tests/fee/timeout_fee.rs index 1d6131ed89..1d3068db01 100644 --- a/tools/integration-test/src/tests/fee/timeout_fee.rs +++ b/tools/integration-test/src/tests/fee/timeout_fee.rs @@ -72,10 +72,6 @@ impl BinaryChannelTest for TimeoutFeeTest { Duration::from_secs(5), )?; - info!("Expect user A's balance after transfer: {}", balance_a2); - - chain_driver_a.assert_eventual_wallet_amount(&user_a.address(), &balance_a2.as_ref())?; - // Sleep to wait for IBC packet to timeout before start relaying thread::sleep(Duration::from_secs(6)); diff --git a/tools/test-framework/src/chain/chain_type.rs b/tools/test-framework/src/chain/chain_type.rs index 5d5e6bfd08..d66ecd7511 100644 --- a/tools/test-framework/src/chain/chain_type.rs +++ b/tools/test-framework/src/chain/chain_type.rs @@ -14,13 +14,14 @@ pub enum ChainType { Cosmos, Evmos, Provenance, + Injective, } impl ChainType { pub fn hd_path(&self) -> &str { match self { Self::Cosmos => COSMOS_HD_PATH, - Self::Evmos => EVMOS_HD_PATH, + Self::Evmos | Self::Injective => EVMOS_HD_PATH, Self::Provenance => PROVENANCE_HD_PATH, } } @@ -34,6 +35,7 @@ impl ChainType { ChainId::from_string(&format!("ibc{prefix}")) } } + Self::Injective => ChainId::from_string(&format!("injective-{prefix}")), Self::Evmos => ChainId::from_string(&format!("evmos_9000-{prefix}")), Self::Provenance => ChainId::from_string(&format!("pio-mainnet-{prefix}")), } @@ -44,23 +46,37 @@ impl ChainType { let mut res = vec![]; let json_rpc_port = random_unused_tcp_port(); match self { - Self::Cosmos => {} + Self::Cosmos | Self::Injective | Self::Provenance => {} Self::Evmos => { res.push("--json-rpc.address".to_owned()); res.push(format!("localhost:{json_rpc_port}")); } - Self::Provenance => {} + } + res + } + + // Extra arguments required to run ` add-genesis-account` + pub fn extra_add_genesis_account_args(&self, chain_id: &ChainId) -> Vec { + let mut res = vec![]; + match self { + Self::Cosmos | Self::Evmos | Self::Provenance => {} + Self::Injective => { + res.push("--chain-id".to_owned()); + res.push(format!("{chain_id}")); + } } res } pub fn address_type(&self) -> AddressType { match self { - Self::Cosmos => AddressType::default(), + Self::Cosmos | Self::Provenance => AddressType::default(), Self::Evmos => AddressType::Ethermint { pk_type: "/ethermint.crypto.v1.ethsecp256k1.PubKey".to_string(), }, - Self::Provenance => AddressType::default(), + Self::Injective => AddressType::Ethermint { + pk_type: "/injective.crypto.v1beta1.ethsecp256k1.PubKey".to_string(), + }, } } } @@ -70,11 +86,8 @@ impl FromStr for ChainType { fn from_str(s: &str) -> Result { match s { - name if name.contains("gaiad") => Ok(ChainType::Cosmos), - name if name.contains("simd") => Ok(ChainType::Cosmos), - name if name.contains("wasmd") => Ok(ChainType::Cosmos), - name if name.contains("icad") => Ok(ChainType::Cosmos), name if name.contains("evmosd") => Ok(ChainType::Evmos), + name if name.contains("injectived") => Ok(ChainType::Injective), name if name.contains("provenanced") => Ok(ChainType::Provenance), _ => Ok(ChainType::Cosmos), } diff --git a/tools/test-framework/src/chain/cli/bootstrap.rs b/tools/test-framework/src/chain/cli/bootstrap.rs index 65dc1e9ed4..fbe530e2ff 100644 --- a/tools/test-framework/src/chain/cli/bootstrap.rs +++ b/tools/test-framework/src/chain/cli/bootstrap.rs @@ -62,35 +62,37 @@ pub fn add_genesis_account( home_path: &str, wallet_address: &str, amounts: &[String], + extra_start_args: &[&str], ) -> Result<(), Error> { let amounts_str = itertools::join(amounts, ","); + + let legacy_base_args = [ + "--home", + home_path, + "add-genesis-account", + wallet_address, + &amounts_str, + ]; + let mut legacy_args: Vec<&str> = legacy_base_args.to_vec(); + legacy_args.extend(extra_start_args.iter()); + + let base_args = [ + "--home", + home_path, + "genesis", + "add-genesis-account", + wallet_address, + &amounts_str, + ]; + let mut args: Vec<&str> = base_args.to_vec(); + args.extend(extra_start_args.iter()); + // Cosmos SDK v0.47.0 introduced the `genesis` subcommand, this match is required to // support pre and post SDK v0.47.0. https://github.com/cosmos/cosmos-sdk/pull/14149 - match simple_exec( - chain_id, - command_path, - &[ - "--home", - home_path, - "genesis", - "add-genesis-account", - wallet_address, - &amounts_str, - ], - ) { + match simple_exec(chain_id, command_path, &args) { Ok(_) => Ok(()), Err(_) => { - simple_exec( - chain_id, - command_path, - &[ - "--home", - home_path, - "add-genesis-account", - wallet_address, - &amounts_str, - ], - )?; + simple_exec(chain_id, command_path, &legacy_args)?; Ok(()) } } diff --git a/tools/test-framework/src/chain/ext/bootstrap.rs b/tools/test-framework/src/chain/ext/bootstrap.rs index 37f7818d75..9eb374d6d0 100644 --- a/tools/test-framework/src/chain/ext/bootstrap.rs +++ b/tools/test-framework/src/chain/ext/bootstrap.rs @@ -231,6 +231,9 @@ impl ChainBootstrapMethodsExt for ChainDriver { fn add_genesis_account(&self, wallet: &WalletAddress, amounts: &[&Token]) -> Result<(), Error> { let amounts_str = amounts.iter().map(|t| t.to_string()).collect::>(); + let extra_args = self + .chain_type + .extra_add_genesis_account_args(&self.chain_id); add_genesis_account( self.chain_id.as_str(), @@ -238,6 +241,7 @@ impl ChainBootstrapMethodsExt for ChainDriver { &self.home_path, &wallet.0, &amounts_str, + &extra_args.iter().map(|s| s.as_ref()).collect::>(), ) } From e4aea2ad18fd1e4b6797e4285f817def93083724 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:29:50 +0100 Subject: [PATCH 053/200] Fix `clear packets` CLI bug where `counterparty_channel_id` cannot be found (#3890) * Use correct counterparty channel and port id when creating reverse link in packet clearing CLI * Add changelog --- .../ibc-relayer-cli/3889-clear-packet-cli-fix.md | 3 +++ crates/relayer-cli/src/commands/clear.rs | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer-cli/3889-clear-packet-cli-fix.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3889-clear-packet-cli-fix.md b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3889-clear-packet-cli-fix.md new file mode 100644 index 0000000000..6470abd610 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3889-clear-packet-cli-fix.md @@ -0,0 +1,3 @@ +- Correctly use the counterparty channel and port IDs when clearing the packets + from the destination chain to the source chain in the `packet clear` command + ([\#3889](https://github.com/informalsystems/hermes/issues/3889)) \ No newline at end of file diff --git a/crates/relayer-cli/src/commands/clear.rs b/crates/relayer-cli/src/commands/clear.rs index 2f95d28c6e..14868011a2 100644 --- a/crates/relayer-cli/src/commands/clear.rs +++ b/crates/relayer-cli/src/commands/clear.rs @@ -1,3 +1,4 @@ +use eyre::eyre; use std::ops::RangeInclusive; use abscissa_core::clap::Parser; @@ -187,10 +188,20 @@ impl Runnable for ClearPacketsCmd { exclude_src_sequences, }; + let counterparty_channel_id = match channel.counterparty().channel_id() { + Some(channel_id) => channel_id.clone(), + None => Output::error(eyre!( + "Channel `{}` and port `{}` does not have a counterparty channel id", + self.channel_id, + self.port_id + )) + .exit(), + }; + // Construct links in both directions. let reverse_opts = LinkParameters { - src_port_id: self.port_id.clone(), - src_channel_id: self.channel_id.clone(), + src_port_id: channel.counterparty().port_id().clone(), + src_channel_id: counterparty_channel_id, max_memo_size: config.mode.packets.ics20_max_memo_size, max_receiver_size: config.mode.packets.ics20_max_receiver_size, exclude_src_sequences: exclude_dst_sequences, From bff1ee9293003103087742f18f3f476b55265b6b Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 12 Mar 2024 14:30:05 +0100 Subject: [PATCH 054/200] Change connection and handshake retry strategy to retry max 10 times over two blocks (5 times per block) (#3864) * Change connection and handshake retry strategy to retry max 10 times over two blocks (5 times per block) * Add changelog entry * Update 3864-handshake-retry.md Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Signed-off-by: Romain Ruetschi --- .../ibc-relayer/3864-handshake-retry.md | 3 +++ crates/relayer/src/channel.rs | 24 +++++++++---------- crates/relayer/src/connection.rs | 24 +++++++++---------- 3 files changed, 27 insertions(+), 24 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/3864-handshake-retry.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/3864-handshake-retry.md b/.changelog/unreleased/improvements/ibc-relayer/3864-handshake-retry.md new file mode 100644 index 0000000000..45f5e18c86 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/3864-handshake-retry.md @@ -0,0 +1,3 @@ +- Change connection and channel handshake retry strategy + to retry at most 10 times (5 times per block max) + ([\#3864](https://github.com/informalsystems/hermes/issues/3864)) \ No newline at end of file diff --git a/crates/relayer/src/channel.rs b/crates/relayer/src/channel.rs index c0ee15083f..a2075baa78 100644 --- a/crates/relayer/src/channel.rs +++ b/crates/relayer/src/channel.rs @@ -47,29 +47,29 @@ pub mod channel_handshake_retry { //! for the channel handshake algorithm. use crate::channel::ChannelError; - use crate::util::retry::{clamp_total, ConstantGrowth}; + use crate::util::retry::{clamp, ConstantGrowth}; use core::time::Duration; /// Approximate number of retries per block. - const PER_BLOCK_RETRIES: u32 = 10; + const PER_BLOCK_RETRIES: u32 = 5; /// Defines the increment in delay between subsequent retries. /// A value of `0` will make the retry delay constant. - const DELAY_INCREMENT: u64 = 0; + const DELAY_INCREMENT: Duration = Duration::from_secs(1); - /// Maximum retry delay expressed in number of blocks - const BLOCK_NUMBER_DELAY: u32 = 10; + /// Maximum number of retries + const MAX_RETRIES: u32 = 10; /// The default retry strategy. - /// We retry with a constant backoff strategy. The strategy is parametrized by the + /// We retry with a growing backoff strategy. The strategy is parametrized by the /// maximum block time expressed as a `Duration`. - pub fn default_strategy(max_block_times: Duration) -> impl Iterator { - let retry_delay = max_block_times / PER_BLOCK_RETRIES; + pub fn default_strategy(max_block_time: Duration) -> impl Iterator { + let retry_delay = max_block_time / PER_BLOCK_RETRIES; - clamp_total( - ConstantGrowth::new(retry_delay, Duration::from_secs(DELAY_INCREMENT)), - retry_delay, - max_block_times * BLOCK_NUMBER_DELAY, + clamp( + ConstantGrowth::new(retry_delay, DELAY_INCREMENT), + retry_delay + DELAY_INCREMENT * MAX_RETRIES, + MAX_RETRIES as usize, ) } diff --git a/crates/relayer/src/connection.rs b/crates/relayer/src/connection.rs index 5e1ee140be..5b3ce0c084 100644 --- a/crates/relayer/src/connection.rs +++ b/crates/relayer/src/connection.rs @@ -42,29 +42,29 @@ mod handshake_retry { //! for the connection handshake algorithm. use crate::connection::ConnectionError; - use crate::util::retry::{clamp_total, ConstantGrowth}; + use crate::util::retry::{clamp, ConstantGrowth}; use core::time::Duration; /// Approximate number of retries per block. - const PER_BLOCK_RETRIES: u32 = 10; + const PER_BLOCK_RETRIES: u32 = 5; /// Defines the increment in delay between subsequent retries. /// A value of `0` will make the retry delay constant. - const DELAY_INCREMENT: u64 = 0; + const DELAY_INCREMENT: Duration = Duration::from_secs(1); - /// Maximum retry delay expressed in number of blocks - const BLOCK_NUMBER_DELAY: u32 = 10; + /// Maximum number of retries + const MAX_RETRIES: u32 = 10; /// The default retry strategy. - /// We retry with a constant backoff strategy. The strategy is parametrized by the + /// We retry with a growing backoff strategy. The strategy is parametrized by the /// maximum block time expressed as a `Duration`. - pub fn default_strategy(max_block_times: Duration) -> impl Iterator { - let retry_delay = max_block_times / PER_BLOCK_RETRIES; + pub fn default_strategy(max_block_time: Duration) -> impl Iterator { + let retry_delay = max_block_time / PER_BLOCK_RETRIES; - clamp_total( - ConstantGrowth::new(retry_delay, Duration::from_secs(DELAY_INCREMENT)), - retry_delay, - max_block_times * BLOCK_NUMBER_DELAY, + clamp( + ConstantGrowth::new(retry_delay, DELAY_INCREMENT), + retry_delay + DELAY_INCREMENT * MAX_RETRIES, + MAX_RETRIES as usize, ) } From 06dfbafb4893255a79043ec4032034a83ebd53df Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 12 Mar 2024 18:03:59 +0100 Subject: [PATCH 055/200] Release v1.8.2 (#3891) * Bump version to 1.8.2 * Fix warnings on latest nightly * Create v1.8.2 changelog * Rephrase changelog summary * Reword changelog * Update CHANGELOG.md Co-authored-by: Luca Joss Signed-off-by: Romain Ruetschi --- .../3889-clear-packet-cli-fix.md | 0 .../ibc-relayer/3880-health-check-fix.md | 0 .../3887-test-with-injective.md | 0 .../ibc-relayer/3864-handshake-retry.md | 0 .changelog/v1.8.2/summary.md | 6 ++++ CHANGELOG.md | 32 +++++++++++++++++++ Cargo.lock | 16 +++++----- crates/chain-registry/Cargo.toml | 4 +-- crates/chain-registry/src/error.rs | 7 ++-- crates/chain-registry/src/formatter.rs | 8 +++-- crates/relayer-cli/Cargo.toml | 12 +++---- crates/relayer-cli/src/application.rs | 2 +- crates/relayer-cli/src/bin/hermes/main.rs | 2 +- crates/relayer-cli/src/chain_registry.rs | 11 +++---- .../src/commands/config/validate.rs | 1 - .../src/commands/create/channel.rs | 3 +- .../src/commands/create/connection.rs | 1 - crates/relayer-cli/src/commands/evidence.rs | 1 - .../relayer-cli/src/commands/fee/transfer.rs | 4 +-- crates/relayer-cli/src/commands/health.rs | 1 - crates/relayer-cli/src/commands/listen.rs | 2 +- crates/relayer-cli/src/commands/logs/reset.rs | 1 - .../relayer-cli/src/commands/misbehaviour.rs | 2 +- .../relayer-cli/src/commands/query/channel.rs | 1 - .../src/commands/query/channel_ends.rs | 1 - .../src/commands/query/channels.rs | 1 - .../relayer-cli/src/commands/query/clients.rs | 1 - .../src/commands/query/connection.rs | 1 - .../src/commands/query/connections.rs | 1 - .../src/commands/query/packet/ack.rs | 1 - .../src/commands/query/packet/acks.rs | 1 - .../src/commands/query/packet/commitment.rs | 3 +- .../src/commands/query/packet/commitments.rs | 1 - .../src/commands/query/packet/pending.rs | 1 - .../src/commands/query/packet/pending_acks.rs | 1 - .../commands/query/packet/pending_sends.rs | 1 - crates/relayer-cli/src/commands/start.rs | 1 - crates/relayer-cli/src/commands/tx/channel.rs | 1 - .../relayer-cli/src/commands/tx/connection.rs | 1 - crates/relayer-cli/src/commands/tx/packet.rs | 1 - .../relayer-cli/src/commands/tx/transfer.rs | 2 +- crates/relayer-cli/src/commands/tx/upgrade.rs | 1 - crates/relayer-cli/src/conclude.rs | 6 ++-- crates/relayer-cli/src/entry.rs | 2 -- crates/relayer-cli/src/lib.rs | 7 +--- crates/relayer-cli/src/prelude.rs | 1 + crates/relayer-cli/tests/acceptance.rs | 8 +---- crates/relayer-rest/Cargo.toml | 6 ++-- crates/relayer-rest/tests/mock.rs | 2 +- crates/relayer-types/Cargo.toml | 2 +- .../applications/ics27_ica/msgs/register.rs | 8 ++--- .../src/applications/transfer/packet.rs | 2 -- .../clients/ics07_tendermint/client_state.rs | 1 - .../src/core/ics02_client/client_state.rs | 1 - .../src/core/ics02_client/consensus_state.rs | 1 - .../src/core/ics02_client/trust_threshold.rs | 1 - .../ics03_connection/msgs/conn_open_try.rs | 6 +--- .../src/core/ics04_channel/packet_id.rs | 1 - .../src/core/ics23_commitment/commitment.rs | 2 +- .../src/core/ics23_commitment/merkle.rs | 2 +- .../src/core/ics24_host/identifier.rs | 2 +- .../relayer-types/src/core/ics24_host/path.rs | 1 - crates/relayer-types/src/events.rs | 1 - crates/relayer-types/src/lib.rs | 4 +-- crates/relayer-types/src/mock/header.rs | 1 - crates/relayer-types/src/utils/pretty.rs | 2 +- crates/relayer/Cargo.toml | 8 ++--- crates/relayer/src/chain/cosmos.rs | 11 ++----- crates/relayer/src/chain/cosmos/encode.rs | 10 +++--- .../relayer/src/chain/cosmos/query/custom.rs | 3 +- crates/relayer/src/chain/endpoint.rs | 1 - crates/relayer/src/chain/requests.rs | 4 +-- crates/relayer/src/chain/runtime.rs | 1 - crates/relayer/src/config.rs | 2 +- crates/relayer/src/config/filter.rs | 3 -- crates/relayer/src/event.rs | 1 - crates/relayer/src/event/source/websocket.rs | 5 ++- .../src/event/source/websocket/extract.rs | 1 - crates/relayer/src/extension_options.rs | 2 +- .../src/keyring/any_signing_key_pair.rs | 2 +- crates/relayer/src/lib.rs | 3 +- crates/relayer/src/link/cli.rs | 1 - crates/relayer/src/link/pending.rs | 1 - crates/relayer/src/util/profiling.rs | 2 +- crates/relayer/src/worker/packet.rs | 2 +- crates/telemetry/Cargo.toml | 4 +-- guide/README.md | 2 +- tools/integration-test/Cargo.toml | 2 +- .../src/bin/test_setup_with_binary_channel.rs | 2 +- ...t_setup_with_fee_enabled_binary_channel.rs | 2 +- .../bin/test_setup_with_ternary_channel.rs | 2 +- tools/integration-test/src/mbt/handlers.rs | 4 --- tools/integration-test/src/mbt/utils.rs | 4 --- .../src/tests/client_expiration.rs | 6 +--- .../src/tests/client_filter.rs | 2 -- .../src/tests/client_refresh.rs | 2 -- .../src/tests/client_settings.rs | 2 -- .../src/tests/connection_delay.rs | 2 -- .../src/tests/consensus_states.rs | 2 -- .../integration-test/src/tests/denom_trace.rs | 1 - .../src/tests/forward/forward_hop_transfer.rs | 2 +- .../src/tests/forward/forward_transfer.rs | 2 +- tools/integration-test/src/tests/ica.rs | 2 -- .../src/tests/manual/simulation.rs | 3 +- tools/integration-test/src/tests/memo.rs | 3 +- .../src/tests/ordered_channel.rs | 1 - .../src/tests/ordered_channel_clear.rs | 1 - .../integration-test/src/tests/supervisor.rs | 3 +- .../src/tests/ternary_transfer.rs | 1 - tools/test-framework/Cargo.toml | 8 ++--- .../test-framework/src/bootstrap/consumer.rs | 1 - .../src/bootstrap/nary/chain.rs | 1 - .../src/bootstrap/nary/channel.rs | 1 - .../src/bootstrap/nary/connection.rs | 1 - tools/test-framework/src/bootstrap/single.rs | 1 - .../test-framework/src/chain/ext/async_icq.rs | 2 -- .../test-framework/src/chain/ext/bootstrap.rs | 1 - tools/test-framework/src/chain/ext/ica.rs | 4 --- tools/test-framework/src/error.rs | 1 - .../src/framework/binary/node.rs | 2 -- tools/test-framework/src/types/env.rs | 1 - tools/test-framework/src/types/nary/chains.rs | 1 - .../test-framework/src/types/nary/channel.rs | 1 - .../src/types/nary/connection.rs | 1 - .../src/types/nary/foreign_client.rs | 1 - tools/test-framework/src/types/tagged/dual.rs | 3 +- tools/test-framework/src/types/tagged/mono.rs | 3 +- tools/test-framework/src/util/array.rs | 1 - 128 files changed, 138 insertions(+), 225 deletions(-) rename .changelog/{unreleased => v1.8.2}/bug-fixes/ibc-relayer-cli/3889-clear-packet-cli-fix.md (100%) rename .changelog/{unreleased => v1.8.2}/bug-fixes/ibc-relayer/3880-health-check-fix.md (100%) rename .changelog/{unreleased => v1.8.2}/features/ibc-integration-test/3887-test-with-injective.md (100%) rename .changelog/{unreleased => v1.8.2}/improvements/ibc-relayer/3864-handshake-retry.md (100%) create mode 100644 .changelog/v1.8.2/summary.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3889-clear-packet-cli-fix.md b/.changelog/v1.8.2/bug-fixes/ibc-relayer-cli/3889-clear-packet-cli-fix.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer-cli/3889-clear-packet-cli-fix.md rename to .changelog/v1.8.2/bug-fixes/ibc-relayer-cli/3889-clear-packet-cli-fix.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/3880-health-check-fix.md b/.changelog/v1.8.2/bug-fixes/ibc-relayer/3880-health-check-fix.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer/3880-health-check-fix.md rename to .changelog/v1.8.2/bug-fixes/ibc-relayer/3880-health-check-fix.md diff --git a/.changelog/unreleased/features/ibc-integration-test/3887-test-with-injective.md b/.changelog/v1.8.2/features/ibc-integration-test/3887-test-with-injective.md similarity index 100% rename from .changelog/unreleased/features/ibc-integration-test/3887-test-with-injective.md rename to .changelog/v1.8.2/features/ibc-integration-test/3887-test-with-injective.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/3864-handshake-retry.md b/.changelog/v1.8.2/improvements/ibc-relayer/3864-handshake-retry.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/3864-handshake-retry.md rename to .changelog/v1.8.2/improvements/ibc-relayer/3864-handshake-retry.md diff --git a/.changelog/v1.8.2/summary.md b/.changelog/v1.8.2/summary.md new file mode 100644 index 0000000000..fba1f2ac82 --- /dev/null +++ b/.changelog/v1.8.2/summary.md @@ -0,0 +1,6 @@ +*March 12th, 2024* + +This release fixes the two following bugs and improves the connection and channel handshake retry mechanism: + +* Fix erroneous warnings for incompatible version of IBC-Go during health checks, ensuring accurate compatibility reporting +* Fix a bug in the `clear packets` command which caused packet clearing to fail with an "counterparty channel not found" error diff --git a/CHANGELOG.md b/CHANGELOG.md index ca6754dbcc..cdd396a273 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,37 @@ # CHANGELOG +## v1.8.2 + +*March 12th, 2024* + +This release fixes the two following bugs and improves the connection and channel handshake retry mechanism: + +* Fix erroneous warnings for incompatible version of IBC-Go during health checks, ensuring accurate compatibility reporting +* Fix a bug in the `clear packets` command which caused packet clearing to fail with an "counterparty channel not found" error + +### BUG FIXES + +- [Relayer CLI](relayer-cli) + - Correctly use the counterparty channel and port IDs when clearing the packets + from the destination chain to the source chain in the `packet clear` command + ([\#3889](https://github.com/informalsystems/hermes/issues/3889)) +- [Relayer](relayer) + - Fix parsing of IBC-Go version in health check and improve health check + reporting ([\#3880](https://github.com/informalsystems/hermes/issues/3880)) + +### FEATURES + +- [Integration Test Framework](tools/test-framework) + - Add Injective chain to the chains running the integration tests in the CI. + ([\#3887](https://github.com/informalsystems/hermes/issues/3887)) + +### IMPROVEMENTS + +- [Relayer](relayer) + - Change connection and channel handshake retry strategy + to retry at most 10 times (5 times per block max) + ([\#3864](https://github.com/informalsystems/hermes/issues/3864)) + ## v1.8.1 *March 7th, 2024* diff --git a/Cargo.lock b/Cargo.lock index bad4eb9f6f..11893755c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1444,7 +1444,7 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.27.1" +version = "0.27.2" dependencies = [ "async-trait", "flex-error", @@ -1463,7 +1463,7 @@ dependencies = [ [[package]] name = "ibc-integration-test" -version = "0.27.1" +version = "0.27.2" dependencies = [ "byte-unit", "http", @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.27.1" +version = "0.27.2" dependencies = [ "anyhow", "async-stream", @@ -1570,7 +1570,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "1.8.1" +version = "1.8.2" dependencies = [ "abscissa_core", "clap", @@ -1611,7 +1611,7 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.27.1" +version = "0.27.2" dependencies = [ "axum", "crossbeam-channel 0.5.11", @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "ibc-relayer-types" -version = "0.27.1" +version = "0.27.2" dependencies = [ "bytes", "derive_more", @@ -1657,7 +1657,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.27.1" +version = "0.27.2" dependencies = [ "axum", "dashmap", @@ -1676,7 +1676,7 @@ dependencies = [ [[package]] name = "ibc-test-framework" -version = "0.27.1" +version = "0.27.2" dependencies = [ "color-eyre", "crossbeam-channel 0.5.11", diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index c94f48d8fd..3207ec5c86 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-chain-registry" -version = "0.27.1" +version = "0.27.2" edition = "2021" license = "Apache-2.0" keywords = ["cosmos", "ibc", "relayer", "chain", "registry"] @@ -12,7 +12,7 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.27.1", path = "../relayer-types" } +ibc-relayer-types = { version = "0.27.2", path = "../relayer-types" } ibc-proto = { version = "0.42.0", features = ["serde"] } tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } diff --git a/crates/chain-registry/src/error.rs b/crates/chain-registry/src/error.rs index 662ce5cbab..e64f3d267c 100644 --- a/crates/chain-registry/src/error.rs +++ b/crates/chain-registry/src/error.rs @@ -1,10 +1,7 @@ +use std::path::PathBuf; + use flex_error::{define_error, TraceError}; -use http; use itertools::Itertools; -use reqwest; -use serde_json; -use std::path::PathBuf; -use tendermint_rpc; use tokio::task::JoinError; use tokio::time::error::Elapsed; diff --git a/crates/chain-registry/src/formatter.rs b/crates/chain-registry/src/formatter.rs index 88b4227f7a..5d97832703 100644 --- a/crates/chain-registry/src/formatter.rs +++ b/crates/chain-registry/src/formatter.rs @@ -2,13 +2,16 @@ //! Contains struct to build a `tendermint_rpc::Url` representing a //! WebSocket URL from a RPC URL and to parse or build a valid `http::Uri` //! from an (in)complete GRPC URL. -use crate::error::RegistryError; + +use std::str::FromStr; + use http::uri::Scheme; use http::Uri; -use std::str::FromStr; use tendermint_rpc::Url; +use crate::error::RegistryError; + /// `UriFormatter` contains the basic expectations to parse a valid URL from a `&str`. pub trait UriFormatter { /// Expected output format of the formatter. @@ -98,7 +101,6 @@ impl UriFormatter for SimpleGrpcFormatter { mod tests { use super::*; - use std::cmp::PartialEq; use std::fmt::Debug; struct FormatterTest { diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index b673a30e81..6a90246bf7 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-cli" -version = "1.8.1" +version = "1.8.2" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -25,11 +25,11 @@ telemetry = ["ibc-relayer/telemetry", "ibc-telemetry"] rest-server = ["ibc-relayer-rest"] [dependencies] -ibc-relayer-types = { version = "0.27.1", path = "../relayer-types" } -ibc-relayer = { version = "0.27.1", path = "../relayer" } -ibc-telemetry = { version = "0.27.1", path = "../telemetry", optional = true } -ibc-relayer-rest = { version = "0.27.1", path = "../relayer-rest", optional = true } -ibc-chain-registry = { version = "0.27.1" , path = "../chain-registry" } +ibc-relayer-types = { version = "0.27.2", path = "../relayer-types" } +ibc-relayer = { version = "0.27.2", path = "../relayer" } +ibc-telemetry = { version = "0.27.2", path = "../telemetry", optional = true } +ibc-relayer-rest = { version = "0.27.2", path = "../relayer-rest", optional = true } +ibc-chain-registry = { version = "0.27.2" , path = "../chain-registry" } clap = { version = "3.2", features = ["cargo"] } clap_complete = "3.2" diff --git a/crates/relayer-cli/src/application.rs b/crates/relayer-cli/src/application.rs index e7d524bf96..a6b9c656e0 100644 --- a/crates/relayer-cli/src/application.rs +++ b/crates/relayer-cli/src/application.rs @@ -166,7 +166,7 @@ impl Application for CliApp { let terminal = Terminal::new(self.term_colors(command)); let config_path = command.config_path(); - self.config_path = config_path.clone(); + self.config_path.clone_from(&config_path); let config = config_path .map(|path| self.load_config(&path)) diff --git a/crates/relayer-cli/src/bin/hermes/main.rs b/crates/relayer-cli/src/bin/hermes/main.rs index 4cdb1744fc..214fbb6ab5 100644 --- a/crates/relayer-cli/src/bin/hermes/main.rs +++ b/crates/relayer-cli/src/bin/hermes/main.rs @@ -1,6 +1,6 @@ //! Main entry point for Cli -#![deny(warnings, missing_docs, trivial_casts, unused_qualifications)] +#![deny(warnings, missing_docs, trivial_casts)] #![forbid(unsafe_code)] use ibc_relayer_cli::application::APPLICATION; diff --git a/crates/relayer-cli/src/chain_registry.rs b/crates/relayer-cli/src/chain_registry.rs index 717bf10bae..9745312194 100644 --- a/crates/relayer-cli/src/chain_registry.rs +++ b/crates/relayer-cli/src/chain_registry.rs @@ -1,12 +1,12 @@ //! Contains functions to generate a relayer config for a given chain -use futures::future::join_all; -use http::Uri; -use ibc_relayer::config::dynamic_gas::DynamicGasPrice; use std::collections::BTreeMap; use std::collections::HashMap; use std::fmt::Display; -use std::marker::Send; + +use futures::future::join_all; +use http::Uri; +use tendermint_rpc::Url; use tokio::task::{JoinError, JoinHandle}; use tracing::{error, trace}; @@ -18,14 +18,13 @@ use ibc_chain_registry::formatter::{SimpleGrpcFormatter, UriFormatter}; use ibc_chain_registry::paths::IBCPath; use ibc_chain_registry::querier::*; use ibc_relayer::chain::cosmos::config::CosmosSdkConfig; +use ibc_relayer::config::dynamic_gas::DynamicGasPrice; use ibc_relayer::config::filter::{FilterPattern, PacketFilter}; use ibc_relayer::config::gas_multiplier::GasMultiplier; use ibc_relayer::config::types::{MaxMsgNum, MaxTxSize, Memo, TrustThreshold}; use ibc_relayer::config::{default, AddressType, ChainConfig, EventSourceMode, GasPrice}; use ibc_relayer::keyring::Store; -use tendermint_rpc::Url; - const MAX_HEALTHY_QUERY_RETRIES: u8 = 5; /// Generate packet filters from Vec and load them in a Map(chain_name -> filter). diff --git a/crates/relayer-cli/src/commands/config/validate.rs b/crates/relayer-cli/src/commands/config/validate.rs index 03efaf018c..1be5e3f78c 100644 --- a/crates/relayer-cli/src/commands/config/validate.rs +++ b/crates/relayer-cli/src/commands/config/validate.rs @@ -1,7 +1,6 @@ use std::fs; use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use crate::conclude::Output; use crate::config; diff --git a/crates/relayer-cli/src/commands/create/channel.rs b/crates/relayer-cli/src/commands/create/channel.rs index 98b8464ff3..2295d09e6c 100644 --- a/crates/relayer-cli/src/commands/create/channel.rs +++ b/crates/relayer-cli/src/commands/create/channel.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use console::style; use dialoguer::Confirm; @@ -9,6 +8,7 @@ use ibc_relayer::chain::requests::{ IncludeProof, QueryClientStateRequest, QueryConnectionRequest, QueryHeight, }; use ibc_relayer::channel::Channel; +use ibc_relayer::config::default::connection_delay; use ibc_relayer::connection::Connection; use ibc_relayer::foreign_client::ForeignClient; use ibc_relayer_types::core::ics03_connection::connection::IdentifiedConnectionEnd; @@ -19,7 +19,6 @@ use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ConnectionId, Por use crate::cli_utils::{spawn_chain_runtime, ChainHandlePair}; use crate::conclude::{exit_with_unrecoverable_error, Output}; use crate::prelude::*; -use ibc_relayer::config::default::connection_delay; static PROMPT: &str = "Are you sure you want a new connection & clients to be created? Hermes will use default security parameters."; static HINT: &str = "Consider using the default invocation\n\nhermes create channel --a-port --b-port --a-chain --a-connection \n\nto reuse a pre-existing connection."; diff --git a/crates/relayer-cli/src/commands/create/connection.rs b/crates/relayer-cli/src/commands/create/connection.rs index 052411d069..e6d5982c25 100644 --- a/crates/relayer-cli/src/commands/create/connection.rs +++ b/crates/relayer-cli/src/commands/create/connection.rs @@ -1,7 +1,6 @@ use core::time::Duration; use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::requests::{IncludeProof, QueryClientStateRequest, QueryHeight}; diff --git a/crates/relayer-cli/src/commands/evidence.rs b/crates/relayer-cli/src/commands/evidence.rs index eb3bc9afe8..c034d7318e 100644 --- a/crates/relayer-cli/src/commands/evidence.rs +++ b/crates/relayer-cli/src/commands/evidence.rs @@ -5,7 +5,6 @@ use std::thread::sleep; use std::time::Duration; use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::config::{ChainConfig, Config}; use tokio::runtime::Runtime as TokioRuntime; diff --git a/crates/relayer-cli/src/commands/fee/transfer.rs b/crates/relayer-cli/src/commands/fee/transfer.rs index 3893a2d232..2ea80d63b3 100644 --- a/crates/relayer-cli/src/commands/fee/transfer.rs +++ b/crates/relayer-cli/src/commands/fee/transfer.rs @@ -1,8 +1,6 @@ use core::time::Duration; -use abscissa_core::{ - clap::Parser, config::Override, Command, FrameworkError, FrameworkErrorKind, Runnable, -}; +use abscissa_core::{clap::Parser, config::Override, FrameworkError, FrameworkErrorKind}; use eyre::eyre; use ibc_relayer::{ diff --git a/crates/relayer-cli/src/commands/health.rs b/crates/relayer-cli/src/commands/health.rs index 8514bb087f..6ecdd588dd 100644 --- a/crates/relayer-cli/src/commands/health.rs +++ b/crates/relayer-cli/src/commands/health.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::chain::endpoint::HealthCheck::*; use ibc_relayer::chain::handle::ChainHandle; diff --git a/crates/relayer-cli/src/commands/listen.rs b/crates/relayer-cli/src/commands/listen.rs index 68bd5c22ad..485264e84e 100644 --- a/crates/relayer-cli/src/commands/listen.rs +++ b/crates/relayer-cli/src/commands/listen.rs @@ -5,8 +5,8 @@ use core::{ }; use std::thread; +use abscissa_core::application::fatal_error; use abscissa_core::clap::Parser; -use abscissa_core::{application::fatal_error, Runnable}; use eyre::eyre; use itertools::Itertools; use tendermint_rpc::{client::CompatMode, Client, HttpClient}; diff --git a/crates/relayer-cli/src/commands/logs/reset.rs b/crates/relayer-cli/src/commands/logs/reset.rs index e216af3c32..f9165b9da1 100644 --- a/crates/relayer-cli/src/commands/logs/reset.rs +++ b/crates/relayer-cli/src/commands/logs/reset.rs @@ -1,6 +1,5 @@ use abscissa_core::clap::Parser; use abscissa_core::Command; -use abscissa_core::Runnable; use crate::components::default_directive; use crate::prelude::*; diff --git a/crates/relayer-cli/src/commands/misbehaviour.rs b/crates/relayer-cli/src/commands/misbehaviour.rs index 8400d11ad9..a231c7c1bc 100644 --- a/crates/relayer-cli/src/commands/misbehaviour.rs +++ b/crates/relayer-cli/src/commands/misbehaviour.rs @@ -1,5 +1,5 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; +use abscissa_core::Command; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::requests::{IncludeProof, QueryClientStateRequest, QueryHeight}; use ibc_relayer::config::Config; diff --git a/crates/relayer-cli/src/commands/query/channel.rs b/crates/relayer-cli/src/commands/query/channel.rs index f350ea8dd6..14b402d3dc 100644 --- a/crates/relayer-cli/src/commands/query/channel.rs +++ b/crates/relayer-cli/src/commands/query/channel.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeight}; diff --git a/crates/relayer-cli/src/commands/query/channel_ends.rs b/crates/relayer-cli/src/commands/query/channel_ends.rs index aaa668beb1..bc316865ab 100644 --- a/crates/relayer-cli/src/commands/query/channel_ends.rs +++ b/crates/relayer-cli/src/commands/query/channel_ends.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use serde::{Deserialize, Serialize}; use eyre::eyre; diff --git a/crates/relayer-cli/src/commands/query/channels.rs b/crates/relayer-cli/src/commands/query/channels.rs index a516854416..88d85fe103 100644 --- a/crates/relayer-cli/src/commands/query/channels.rs +++ b/crates/relayer-cli/src/commands/query/channels.rs @@ -1,7 +1,6 @@ use core::fmt::{Debug, Error, Formatter}; use abscissa_core::clap::Parser; -use abscissa_core::Runnable; use serde::Serialize; use eyre::eyre; diff --git a/crates/relayer-cli/src/commands/query/clients.rs b/crates/relayer-cli/src/commands/query/clients.rs index 0ced719b2b..e852636801 100644 --- a/crates/relayer-cli/src/commands/query/clients.rs +++ b/crates/relayer-cli/src/commands/query/clients.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::chain::handle::ChainHandle; use serde::Serialize; diff --git a/crates/relayer-cli/src/commands/query/connection.rs b/crates/relayer-cli/src/commands/query/connection.rs index 28b044985d..0dbf675bb7 100644 --- a/crates/relayer-cli/src/commands/query/connection.rs +++ b/crates/relayer-cli/src/commands/query/connection.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::requests::{ IncludeProof, PageRequest, QueryConnectionChannelsRequest, QueryConnectionRequest, QueryHeight, diff --git a/crates/relayer-cli/src/commands/query/connections.rs b/crates/relayer-cli/src/commands/query/connections.rs index dadef9d6a2..69aa86526a 100644 --- a/crates/relayer-cli/src/commands/query/connections.rs +++ b/crates/relayer-cli/src/commands/query/connections.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::Runnable; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::requests::{ diff --git a/crates/relayer-cli/src/commands/query/packet/ack.rs b/crates/relayer-cli/src/commands/query/packet/ack.rs index 93c59d1efc..86fbb65361 100644 --- a/crates/relayer-cli/src/commands/query/packet/ack.rs +++ b/crates/relayer-cli/src/commands/query/packet/ack.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::chain::requests::{IncludeProof, QueryHeight, QueryPacketAcknowledgementRequest}; use subtle_encoding::{Encoding, Hex}; diff --git a/crates/relayer-cli/src/commands/query/packet/acks.rs b/crates/relayer-cli/src/commands/query/packet/acks.rs index f7e85156dc..9d7a0c4f2e 100644 --- a/crates/relayer-cli/src/commands/query/packet/acks.rs +++ b/crates/relayer-cli/src/commands/query/packet/acks.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::chain::counterparty::acknowledgements_on_chain; use ibc_relayer::chain::handle::BaseChainHandle; diff --git a/crates/relayer-cli/src/commands/query/packet/commitment.rs b/crates/relayer-cli/src/commands/query/packet/commitment.rs index 74779dd5a1..57a45282f1 100644 --- a/crates/relayer-cli/src/commands/query/packet/commitment.rs +++ b/crates/relayer-cli/src/commands/query/packet/commitment.rs @@ -1,10 +1,9 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; -use ibc_relayer::chain::requests::{IncludeProof, QueryHeight, QueryPacketCommitmentRequest}; use serde::Serialize; use subtle_encoding::{Encoding, Hex}; use ibc_relayer::chain::handle::ChainHandle; +use ibc_relayer::chain::requests::{IncludeProof, QueryHeight, QueryPacketCommitmentRequest}; use ibc_relayer_types::core::ics04_channel::packet::Sequence; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use ibc_relayer_types::Height; diff --git a/crates/relayer-cli/src/commands/query/packet/commitments.rs b/crates/relayer-cli/src/commands/query/packet/commitments.rs index a308e5b83d..4ab40143da 100644 --- a/crates/relayer-cli/src/commands/query/packet/commitments.rs +++ b/crates/relayer-cli/src/commands/query/packet/commitments.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::chain::counterparty::commitments_on_chain; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; diff --git a/crates/relayer-cli/src/commands/query/packet/pending.rs b/crates/relayer-cli/src/commands/query/packet/pending.rs index 73a1781b5c..188379969b 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending.rs @@ -1,7 +1,6 @@ use core::fmt; use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use serde::Serialize; use ibc_relayer::chain::counterparty::{ diff --git a/crates/relayer-cli/src/commands/query/packet/pending_acks.rs b/crates/relayer-cli/src/commands/query/packet/pending_acks.rs index ea5288dbbc..d946a32422 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending_acks.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending_acks.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::chain::counterparty::unreceived_acknowledgements; use ibc_relayer::chain::handle::BaseChainHandle; diff --git a/crates/relayer-cli/src/commands/query/packet/pending_sends.rs b/crates/relayer-cli/src/commands/query/packet/pending_sends.rs index 8d305e496e..c83576f7da 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending_sends.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending_sends.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::chain::counterparty::unreceived_packets; use ibc_relayer::chain::handle::BaseChainHandle; diff --git a/crates/relayer-cli/src/commands/start.rs b/crates/relayer-cli/src/commands/start.rs index 5f0346d211..a102e66c0c 100644 --- a/crates/relayer-cli/src/commands/start.rs +++ b/crates/relayer-cli/src/commands/start.rs @@ -4,7 +4,6 @@ use std::error::Error; use std::io; use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use crossbeam_channel::Sender; use ibc_relayer::chain::handle::{CachingChainHandle, ChainHandle}; diff --git a/crates/relayer-cli/src/commands/tx/channel.rs b/crates/relayer-cli/src/commands/tx/channel.rs index 0531c85dfe..84b93a2e49 100644 --- a/crates/relayer-cli/src/commands/tx/channel.rs +++ b/crates/relayer-cli/src/commands/tx/channel.rs @@ -1,7 +1,6 @@ #![allow(clippy::redundant_closure_call)] use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::requests::{IncludeProof, QueryConnectionRequest, QueryHeight}; diff --git a/crates/relayer-cli/src/commands/tx/connection.rs b/crates/relayer-cli/src/commands/tx/connection.rs index fb88a61d2e..20f602e5f7 100644 --- a/crates/relayer-cli/src/commands/tx/connection.rs +++ b/crates/relayer-cli/src/commands/tx/connection.rs @@ -1,7 +1,6 @@ #![allow(clippy::redundant_closure_call)] use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::connection::{Connection, ConnectionSide}; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId, ConnectionId}; diff --git a/crates/relayer-cli/src/commands/tx/packet.rs b/crates/relayer-cli/src/commands/tx/packet.rs index 898f4e5832..89fc8d6aa7 100644 --- a/crates/relayer-cli/src/commands/tx/packet.rs +++ b/crates/relayer-cli/src/commands/tx/packet.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer_types::core::ics02_client::height::Height; use std::ops::RangeInclusive; diff --git a/crates/relayer-cli/src/commands/tx/transfer.rs b/crates/relayer-cli/src/commands/tx/transfer.rs index 66b14026ae..62c3d96625 100644 --- a/crates/relayer-cli/src/commands/tx/transfer.rs +++ b/crates/relayer-cli/src/commands/tx/transfer.rs @@ -1,7 +1,7 @@ use core::time::Duration; use abscissa_core::clap::Parser; -use abscissa_core::{config::Override, Command, FrameworkErrorKind, Runnable}; +use abscissa_core::{config::Override, FrameworkErrorKind}; use eyre::eyre; use ibc_relayer::{ diff --git a/crates/relayer-cli/src/commands/tx/upgrade.rs b/crates/relayer-cli/src/commands/tx/upgrade.rs index c56a60832c..d41bf6ce1e 100644 --- a/crates/relayer-cli/src/commands/tx/upgrade.rs +++ b/crates/relayer-cli/src/commands/tx/upgrade.rs @@ -1,7 +1,6 @@ use core::time::Duration; use abscissa_core::clap::Parser; -use abscissa_core::{Command, Runnable}; use ibc_relayer::upgrade_chain::requires_legacy_upgrade_proposal; use ibc_relayer::upgrade_chain::{build_and_send_ibc_upgrade_proposal, UpgradePlanOptions}; diff --git a/crates/relayer-cli/src/conclude.rs b/crates/relayer-cli/src/conclude.rs index 41b45d8cbb..f2190ceb42 100644 --- a/crates/relayer-cli/src/conclude.rs +++ b/crates/relayer-cli/src/conclude.rs @@ -171,7 +171,7 @@ impl Output { /// Builder-style method for attaching a result to an output object. pub fn with_result(mut self, result: R) -> Self where - R: Serialize + core::fmt::Debug + 'static, + R: Serialize + fmt::Debug + 'static, { if json() { self.result = Result::Json(serialize_result(result)); @@ -192,7 +192,7 @@ impl Output { /// input `result`. pub fn success(result: R) -> Self where - R: Serialize + core::fmt::Debug + 'static, + R: Serialize + fmt::Debug + 'static, { Output::with_success().with_result(result) } @@ -236,7 +236,7 @@ impl Output { } /// Helper to serialize a result into a `serde_json::Value`. -fn serialize_result(res: impl Serialize + core::fmt::Debug) -> serde_json::Value { +fn serialize_result(res: impl Serialize + fmt::Debug) -> serde_json::Value { let last_resort = format!("{res:#?}"); match serde_json::to_value(res) { diff --git a/crates/relayer-cli/src/entry.rs b/crates/relayer-cli/src/entry.rs index 1ffa17bc3e..29fa21c0da 100644 --- a/crates/relayer-cli/src/entry.rs +++ b/crates/relayer-cli/src/entry.rs @@ -1,5 +1,3 @@ -#![allow(unused_qualifications)] // Fix for warning in `ValueEnum` generated code - //! Definition of the entrypoint for the Hermes CLI. use std::path::PathBuf; diff --git a/crates/relayer-cli/src/lib.rs b/crates/relayer-cli/src/lib.rs index ff28651be7..5185118d69 100644 --- a/crates/relayer-cli/src/lib.rs +++ b/crates/relayer-cli/src/lib.rs @@ -13,12 +13,7 @@ // Tip: Deny warnings with `RUSTFLAGS="-D warnings"` environment variable in CI #![forbid(unsafe_code)] -#![deny( - rust_2018_idioms, - trivial_casts, - unused_lifetimes, - unused_qualifications -)] +#![deny(rust_2018_idioms, trivial_casts, unused_lifetimes)] #![allow(deprecated)] extern crate alloc; diff --git a/crates/relayer-cli/src/prelude.rs b/crates/relayer-cli/src/prelude.rs index fac61533bc..8108fee094 100644 --- a/crates/relayer-cli/src/prelude.rs +++ b/crates/relayer-cli/src/prelude.rs @@ -6,6 +6,7 @@ /// Abscissa core prelude pub use abscissa_core::prelude::*; +pub use abscissa_core::Command; /// Application state accessors pub use crate::application::{app_config, app_reader}; diff --git a/crates/relayer-cli/tests/acceptance.rs b/crates/relayer-cli/tests/acceptance.rs index c50c4b0866..208164e0bf 100644 --- a/crates/relayer-cli/tests/acceptance.rs +++ b/crates/relayer-cli/tests/acceptance.rs @@ -10,13 +10,7 @@ // Tip: Deny warnings with `RUSTFLAGS="-D warnings"` environment variable in CI #![forbid(unsafe_code)] -#![warn( - missing_docs, - rust_2018_idioms, - trivial_casts, - unused_lifetimes, - unused_qualifications -)] +#![warn(missing_docs, rust_2018_idioms, trivial_casts, unused_lifetimes)] use abscissa_core::testing::prelude::*; use once_cell::sync::Lazy; diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index dcfb9f0098..1c4655b065 100644 --- a/crates/relayer-rest/Cargo.toml +++ b/crates/relayer-rest/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-rest" -version = "0.27.1" +version = "0.27.2" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" @@ -14,8 +14,8 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.27.1", path = "../relayer-types" } -ibc-relayer = { version = "0.27.1", path = "../relayer" } +ibc-relayer-types = { version = "0.27.2", path = "../relayer-types" } +ibc-relayer = { version = "0.27.2", path = "../relayer" } crossbeam-channel = "0.5" serde = "1.0" diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index 650774c9ee..c26a225215 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -64,7 +64,7 @@ async fn version() { let rest_api_version = VersionInfo { name: "ibc-relayer-rest".to_string(), - version: "0.27.1".to_string(), + version: "0.27.2".to_string(), }; let result: JsonResult<_, ()> = JsonResult::Success(vec![version.clone(), rest_api_version]); diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 081e1ea64e..5237d234bd 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-types" -version = "0.27.1" +version = "0.27.2" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs b/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs index 082cae11ed..9258c4c07f 100644 --- a/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs +++ b/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs @@ -66,14 +66,14 @@ impl From for RawMsgRegisterInterchainAccount { } #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] +#[derive(Clone, PartialEq, prost::Message)] pub struct LegacyRawMsgRegisterInterchainAccount { #[prost(string, tag = "1")] - pub owner: ::prost::alloc::string::String, + pub owner: String, #[prost(string, tag = "2")] - pub connection_id: ::prost::alloc::string::String, + pub connection_id: String, #[prost(string, tag = "3")] - pub version: ::prost::alloc::string::String, + pub version: String, } #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] diff --git a/crates/relayer-types/src/applications/transfer/packet.rs b/crates/relayer-types/src/applications/transfer/packet.rs index c467542fe4..7b13d49b1e 100644 --- a/crates/relayer-types/src/applications/transfer/packet.rs +++ b/crates/relayer-types/src/applications/transfer/packet.rs @@ -1,6 +1,4 @@ -use std::convert::TryFrom; use std::str::FromStr; -use std::string::{String, ToString}; use ibc_proto::ibc::applications::transfer::v2::FungibleTokenPacketData as RawPacketData; use serde::{Deserialize, Serialize}; diff --git a/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs b/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs index 9ca7c7e233..9e53f1e63f 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs @@ -1,4 +1,3 @@ -use std::convert::{TryFrom, TryInto}; use std::time::Duration; use prost::Message; diff --git a/crates/relayer-types/src/core/ics02_client/client_state.rs b/crates/relayer-types/src/core/ics02_client/client_state.rs index 007bc19e17..bf2d7cb706 100644 --- a/crates/relayer-types/src/core/ics02_client/client_state.rs +++ b/crates/relayer-types/src/core/ics02_client/client_state.rs @@ -1,5 +1,4 @@ use core::fmt::Debug; -use std::marker::{Send, Sync}; use std::time::Duration; use crate::core::ics02_client::client_type::ClientType; diff --git a/crates/relayer-types/src/core/ics02_client/consensus_state.rs b/crates/relayer-types/src/core/ics02_client/consensus_state.rs index fc544f800d..196f486d7e 100644 --- a/crates/relayer-types/src/core/ics02_client/consensus_state.rs +++ b/crates/relayer-types/src/core/ics02_client/consensus_state.rs @@ -1,5 +1,4 @@ use core::fmt::Debug; -use core::marker::{Send, Sync}; use crate::core::ics02_client::client_type::ClientType; use crate::core::ics23_commitment::commitment::CommitmentRoot; diff --git a/crates/relayer-types/src/core/ics02_client/trust_threshold.rs b/crates/relayer-types/src/core/ics02_client/trust_threshold.rs index 8f249b820f..55f095c4f7 100644 --- a/crates/relayer-types/src/core/ics02_client/trust_threshold.rs +++ b/crates/relayer-types/src/core/ics02_client/trust_threshold.rs @@ -2,7 +2,6 @@ //! represented as a fraction with valid values in the //! range `[0, 1)`. -use std::convert::TryFrom; use std::fmt::{Display, Error as FmtError, Formatter}; use std::str::FromStr; diff --git a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_try.rs b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_try.rs index 8cebee431b..bd7ce58751 100644 --- a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_try.rs +++ b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_try.rs @@ -1,8 +1,4 @@ -use std::{ - convert::{TryFrom, TryInto}, - str::FromStr, - time::Duration, -}; +use std::{str::FromStr, time::Duration}; use ibc_proto::google::protobuf::Any; use ibc_proto::ibc::core::connection::v1::MsgConnectionOpenTry as RawMsgConnectionOpenTry; diff --git a/crates/relayer-types/src/core/ics04_channel/packet_id.rs b/crates/relayer-types/src/core/ics04_channel/packet_id.rs index d492d0a80a..f55d2aa2cc 100644 --- a/crates/relayer-types/src/core/ics04_channel/packet_id.rs +++ b/crates/relayer-types/src/core/ics04_channel/packet_id.rs @@ -1,5 +1,4 @@ use ibc_proto::ibc::core::channel::v1::PacketId as ProtoPacketId; -use std::convert::TryFrom; use std::str::FromStr; use crate::core::ics04_channel::error::Error; diff --git a/crates/relayer-types/src/core/ics23_commitment/commitment.rs b/crates/relayer-types/src/core/ics23_commitment/commitment.rs index 978f126df0..7a6cee11e9 100644 --- a/crates/relayer-types/src/core/ics23_commitment/commitment.rs +++ b/crates/relayer-types/src/core/ics23_commitment/commitment.rs @@ -1,5 +1,5 @@ use serde::{Deserialize, Serialize}; -use std::{convert::TryFrom, fmt}; +use std::fmt; use subtle_encoding::{Encoding, Hex}; use ibc_proto::ibc::core::commitment::v1::MerkleProof as RawMerkleProof; diff --git a/crates/relayer-types/src/core/ics23_commitment/merkle.rs b/crates/relayer-types/src/core/ics23_commitment/merkle.rs index 64704c8bb2..229c8c0c7b 100644 --- a/crates/relayer-types/src/core/ics23_commitment/merkle.rs +++ b/crates/relayer-types/src/core/ics23_commitment/merkle.rs @@ -102,7 +102,7 @@ impl MerkleProof { ) { return Err(Error::verification_failure()); } - value = subroot.clone(); + value.clone_from(&subroot); } _ => return Err(Error::invalid_merkle_proof()), } diff --git a/crates/relayer-types/src/core/ics24_host/identifier.rs b/crates/relayer-types/src/core/ics24_host/identifier.rs index e96bebfb01..bba663db3f 100644 --- a/crates/relayer-types/src/core/ics24_host/identifier.rs +++ b/crates/relayer-types/src/core/ics24_host/identifier.rs @@ -1,4 +1,4 @@ -use std::convert::{From, Infallible}; +use std::convert::Infallible; use std::fmt::{Debug, Display, Error as FmtError, Formatter}; use std::str::FromStr; diff --git a/crates/relayer-types/src/core/ics24_host/path.rs b/crates/relayer-types/src/core/ics24_host/path.rs index 300982d929..321549795f 100644 --- a/crates/relayer-types/src/core/ics24_host/path.rs +++ b/crates/relayer-types/src/core/ics24_host/path.rs @@ -579,7 +579,6 @@ fn parse_upgrades(components: &[&str]) -> Option { #[cfg(test)] mod tests { use super::*; - use core::str::FromStr; #[test] fn invalid_path_doesnt_parse() { diff --git a/crates/relayer-types/src/events.rs b/crates/relayer-types/src/events.rs index 9f05e3aecd..3ec1892eb1 100644 --- a/crates/relayer-types/src/events.rs +++ b/crates/relayer-types/src/events.rs @@ -1,5 +1,4 @@ use std::borrow::Cow; -use std::convert::TryFrom; use std::fmt::{Display, Error as FmtError, Formatter}; use std::str::FromStr; diff --git a/crates/relayer-types/src/lib.rs b/crates/relayer-types/src/lib.rs index 7684e0b41a..61f3b14cbc 100644 --- a/crates/relayer-types/src/lib.rs +++ b/crates/relayer-types/src/lib.rs @@ -4,11 +4,9 @@ #![allow(clippy::large_enum_variant)] #![deny( - // warnings, trivial_casts, trivial_numeric_casts, unused_import_braces, - unused_qualifications, rust_2018_idioms )] #![forbid(unsafe_code)] @@ -60,7 +58,7 @@ pub mod utils; mod serializers; /// Re-export of ICS 002 Height domain type -pub type Height = crate::core::ics02_client::height::Height; +pub type Height = core::ics02_client::height::Height; #[cfg(test)] mod test; diff --git a/crates/relayer-types/src/mock/header.rs b/crates/relayer-types/src/mock/header.rs index 2f5c931201..cd53cd6a68 100644 --- a/crates/relayer-types/src/mock/header.rs +++ b/crates/relayer-types/src/mock/header.rs @@ -122,7 +122,6 @@ impl From for Any { #[cfg(test)] mod tests { use super::*; - use ibc_proto::Protobuf; #[test] fn encode_any() { diff --git a/crates/relayer-types/src/utils/pretty.rs b/crates/relayer-types/src/utils/pretty.rs index d2f2ab5f79..d44745b956 100644 --- a/crates/relayer-types/src/utils/pretty.rs +++ b/crates/relayer-types/src/utils/pretty.rs @@ -81,7 +81,7 @@ impl<'a, T: Display> Display for PrettySlice<'a, T> { mod tests { use super::*; - use std::{string::String, vec}; + use std::vec; #[test] fn test_pretty_duration_micros() { diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 7bd502febf..d18f04c463 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer" -version = "0.27.1" +version = "0.27.2" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -21,8 +21,8 @@ telemetry = ["ibc-telemetry"] [dependencies] ibc-proto = { version = "0.42.0", features = ["serde"] } -ibc-telemetry = { version = "0.27.1", path = "../telemetry", optional = true } -ibc-relayer-types = { version = "0.27.1", path = "../relayer-types", features = ["mocks"] } +ibc-telemetry = { version = "0.27.2", path = "../telemetry", optional = true } +ibc-relayer-types = { version = "0.27.2", path = "../relayer-types", features = ["mocks"] } subtle-encoding = "0.5" humantime-serde = "1.1.1" @@ -110,7 +110,7 @@ version = "0.34.0" default-features = false [dev-dependencies] -ibc-relayer-types = { version = "0.27.1", path = "../relayer-types", features = ["mocks"] } +ibc-relayer-types = { version = "0.27.2", path = "../relayer-types", features = ["mocks"] } serial_test = "3.0.0" env_logger = "0.11.1" test-log = { version = "0.2.14", features = ["trace"] } diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 53505d2b0d..eec3a6b7dd 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -1,15 +1,10 @@ use alloc::sync::Arc; +use core::{future::Future, str::FromStr, time::Duration}; +use std::{cmp::Ordering, thread}; + use bytes::{Buf, Bytes}; -use core::{ - convert::{TryFrom, TryInto}, - future::Future, - str::FromStr, - time::Duration, -}; use futures::future::join_all; use num_bigint::BigInt; -use std::{cmp::Ordering, thread}; - use tokio::runtime::Runtime as TokioRuntime; use tonic::codegen::http::Uri; use tonic::metadata::AsciiMetadataValue; diff --git a/crates/relayer/src/chain/cosmos/encode.rs b/crates/relayer/src/chain/cosmos/encode.rs index 3743c769f5..447785f97e 100644 --- a/crates/relayer/src/chain/cosmos/encode.rs +++ b/crates/relayer/src/chain/cosmos/encode.rs @@ -111,7 +111,7 @@ pub fn sign_tx( fn encode_key_bytes(key_pair: &Secp256k1KeyPair) -> Result, Error> { let mut pk_buf = Vec::new(); - prost::Message::encode(&key_pair.public_key.serialize().to_vec(), &mut pk_buf) + Message::encode(&key_pair.public_key.serialize().to_vec(), &mut pk_buf) .map_err(|e| Error::protobuf_encode("PublicKey".into(), e))?; Ok(pk_buf) @@ -133,7 +133,7 @@ fn encode_sign_doc( // A protobuf serialization of a SignDoc let mut signdoc_buf = Vec::new(); - prost::Message::encode(&sign_doc, &mut signdoc_buf).unwrap(); + Message::encode(&sign_doc, &mut signdoc_buf).unwrap(); let signed = key_pair.sign(&signdoc_buf).map_err(Error::key_base)?; @@ -168,7 +168,7 @@ fn encode_signer_info( fn encode_tx_raw(tx_raw: TxRaw) -> Result, Error> { let mut tx_bytes = Vec::new(); - prost::Message::encode(&tx_raw, &mut tx_bytes) + Message::encode(&tx_raw, &mut tx_bytes) .map_err(|e| Error::protobuf_encode("Transaction".to_string(), e))?; Ok(tx_bytes) @@ -196,7 +196,7 @@ fn auth_info_and_bytes(signer_info: SignerInfo, fee: Fee) -> Result<(AuthInfo, V // A protobuf serialization of a AuthInfo let mut auth_buf = Vec::new(); - prost::Message::encode(&auth_info, &mut auth_buf) + Message::encode(&auth_info, &mut auth_buf) .map_err(|e| Error::protobuf_encode(String::from("AuthInfo"), e))?; Ok((auth_info, auth_buf)) @@ -219,7 +219,7 @@ fn tx_body_and_bytes( // A protobuf serialization of a TxBody let mut body_buf = Vec::new(); - prost::Message::encode(&body, &mut body_buf) + Message::encode(&body, &mut body_buf) .map_err(|e| Error::protobuf_encode(String::from("TxBody"), e))?; Ok((body, body_buf)) diff --git a/crates/relayer/src/chain/cosmos/query/custom.rs b/crates/relayer/src/chain/cosmos/query/custom.rs index 80740aa0dd..a31c64db47 100644 --- a/crates/relayer/src/chain/cosmos/query/custom.rs +++ b/crates/relayer/src/chain/cosmos/query/custom.rs @@ -1,9 +1,10 @@ use crate::chain::requests::CrossChainQueryRequest; use crate::error::Error; -use hex; + use ibc_relayer_types::applications::ics31_icq::{ error::Error as CrossChainQueryError, response::CrossChainQueryResponse, }; + use tendermint_rpc::{Client, HttpClient}; pub async fn cross_chain_query_via_rpc( diff --git a/crates/relayer/src/chain/endpoint.rs b/crates/relayer/src/chain/endpoint.rs index 11f47a7486..a65c1a345e 100644 --- a/crates/relayer/src/chain/endpoint.rs +++ b/crates/relayer/src/chain/endpoint.rs @@ -1,5 +1,4 @@ use alloc::sync::Arc; -use core::convert::TryFrom; use tokio::runtime::Runtime as TokioRuntime; diff --git a/crates/relayer/src/chain/requests.rs b/crates/relayer/src/chain/requests.rs index cc45908172..4874d3145d 100644 --- a/crates/relayer/src/chain/requests.rs +++ b/crates/relayer/src/chain/requests.rs @@ -66,7 +66,7 @@ impl TryFrom for AsciiMetadataValue { } impl Display for QueryHeight { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { QueryHeight::Latest => write!(f, "latest height"), QueryHeight::Specific(height) => write!(f, "{height}"), @@ -93,7 +93,7 @@ pub struct PageRequest { /// key is a value returned in PageResponse.next_key to begin /// querying the next page most efficiently. Only one of offset or key /// should be set. - pub key: ::prost::alloc::vec::Vec, + pub key: Vec, /// offset is a numeric offset that can be used when key is unavailable. /// It is less efficient than using key. Only one of offset or key should /// be set. diff --git a/crates/relayer/src/chain/runtime.rs b/crates/relayer/src/chain/runtime.rs index d19fbd9cfe..f6670109d6 100644 --- a/crates/relayer/src/chain/runtime.rs +++ b/crates/relayer/src/chain/runtime.rs @@ -31,7 +31,6 @@ use ibc_relayer_types::{ use crate::{ account::Balance, - chain::requests::QueryPacketEventDataRequest, client_state::{AnyClientState, IdentifiedAnyClientState}, config::ChainConfig, connection::ConnectionMsgType, diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index c7fb2a2e70..0642af4242 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -754,7 +754,7 @@ impl<'de> Deserialize<'de> for ChainConfig { /// Attempt to load and parse the TOML config file as a `Config`. pub fn load(path: impl AsRef) -> Result { - let config_toml = std::fs::read_to_string(&path).map_err(Error::io)?; + let config_toml = fs::read_to_string(&path).map_err(Error::io)?; let config = toml::from_str::(&config_toml[..]).map_err(Error::decode)?; diff --git a/crates/relayer/src/config/filter.rs b/crates/relayer/src/config/filter.rs index 9733671b0c..f6ff932797 100644 --- a/crates/relayer/src/config/filter.rs +++ b/crates/relayer/src/config/filter.rs @@ -373,7 +373,6 @@ impl<'de> Deserialize<'de> for ChannelFilterMatch { pub(crate) mod port { use super::*; - use ibc_relayer_types::core::ics24_host::identifier::PortId; pub struct PortFilterMatchVisitor; @@ -401,7 +400,6 @@ pub(crate) mod port { pub(crate) mod channel { use super::*; - use ibc_relayer_types::core::ics24_host::identifier::ChannelId; pub struct ChannelFilterMatchVisitor; @@ -430,7 +428,6 @@ pub(crate) mod channel { #[cfg(test)] mod tests { use super::*; - use crate::config::filter::ChannelPolicy; #[test] fn deserialize_packet_filter_policy() { diff --git a/crates/relayer/src/event.rs b/crates/relayer/src/event.rs index 2c347b1505..bf58338eb7 100644 --- a/crates/relayer/src/event.rs +++ b/crates/relayer/src/event.rs @@ -468,7 +468,6 @@ mod tests { use ibc_proto::google::protobuf::Any; use ibc_proto::Protobuf; use ibc_relayer_types::clients::ics07_tendermint::header::test_util::get_dummy_ics07_header; - use ibc_relayer_types::core::ics02_client::header::{decode_header, AnyHeader}; #[test] fn extract_header() { diff --git a/crates/relayer/src/event/source/websocket.rs b/crates/relayer/src/event/source/websocket.rs index 7993440267..de5194031e 100644 --- a/crates/relayer/src/event/source/websocket.rs +++ b/crates/relayer/src/event/source/websocket.rs @@ -131,7 +131,7 @@ impl EventSource { rx_cmd, ws_url, rpc_compat, - subscriptions: Box::new(futures::stream::empty()), + subscriptions: Box::new(stream::empty()), }; Ok((source, TxEventSourceCmd(tx_cmd))) @@ -297,8 +297,7 @@ impl EventSource { async fn run_loop(&mut self) -> Next { // Take ownership of the subscriptions - let subscriptions = - core::mem::replace(&mut self.subscriptions, Box::new(futures::stream::empty())); + let subscriptions = core::mem::replace(&mut self.subscriptions, Box::new(stream::empty())); // Convert the stream of RPC events into a stream of event batches. let batches = stream_batches(subscriptions, self.chain_id.clone(), self.batch_delay); diff --git a/crates/relayer/src/event/source/websocket/extract.rs b/crates/relayer/src/event/source/websocket/extract.rs index f2213e6acd..4a183edfb8 100644 --- a/crates/relayer/src/event/source/websocket/extract.rs +++ b/crates/relayer/src/event/source/websocket/extract.rs @@ -1,5 +1,4 @@ use alloc::collections::BTreeMap as HashMap; -use core::convert::TryFrom; use ibc_relayer_types::applications::ics29_fee::events::DistributionType; use tendermint_rpc::{event::Event as RpcEvent, event::EventData as RpcEventData}; diff --git a/crates/relayer/src/extension_options.rs b/crates/relayer/src/extension_options.rs index b796a5cbbe..f5eda5c08c 100644 --- a/crates/relayer/src/extension_options.rs +++ b/crates/relayer/src/extension_options.rs @@ -9,7 +9,7 @@ use crate::error::Error; #[derive(Clone, PartialEq, Eq, Message, Serialize, Deserialize)] pub struct ExtensionOptionDynamicFeeTx { #[prost(string, tag = "1")] - pub max_priority_price: ::prost::alloc::string::String, + pub max_priority_price: String, } impl ExtensionOptionDynamicFeeTx { diff --git a/crates/relayer/src/keyring/any_signing_key_pair.rs b/crates/relayer/src/keyring/any_signing_key_pair.rs index b9dd880c10..f6aa27bd0b 100644 --- a/crates/relayer/src/keyring/any_signing_key_pair.rs +++ b/crates/relayer/src/keyring/any_signing_key_pair.rs @@ -30,7 +30,7 @@ impl AnySigningKeyPair { Self::Ed25519(key_pair) => key_pair.as_any(), } .downcast_ref::() - .map(T::clone) + .cloned() } } diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index a4def98be1..eb0ea4dd40 100644 --- a/crates/relayer/src/lib.rs +++ b/crates/relayer/src/lib.rs @@ -3,7 +3,6 @@ trivial_casts, trivial_numeric_casts, unused_import_braces, - unused_qualifications, rust_2018_idioms )] #![allow(clippy::too_many_arguments)] @@ -15,7 +14,7 @@ //! //! For the IBC relayer binary, please see [Hermes] (`ibc-relayer-cli` crate). //! -//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.8.1/ +//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.8.2/ extern crate alloc; diff --git a/crates/relayer/src/link/cli.rs b/crates/relayer/src/link/cli.rs index d5f896cc6e..f4e37bccc9 100644 --- a/crates/relayer/src/link/cli.rs +++ b/crates/relayer/src/link/cli.rs @@ -1,4 +1,3 @@ -use std::convert::TryInto; use std::ops::RangeInclusive; use std::thread; use std::time::{Duration, Instant}; diff --git a/crates/relayer/src/link/pending.rs b/crates/relayer/src/link/pending.rs index 30b3d6a9b4..8abc47bbd9 100644 --- a/crates/relayer/src/link/pending.rs +++ b/crates/relayer/src/link/pending.rs @@ -1,4 +1,3 @@ -use core::iter::Iterator; use core::time::Duration; use std::time::Instant; diff --git a/crates/relayer/src/util/profiling.rs b/crates/relayer/src/util/profiling.rs index a6371e53fe..7aabd06c75 100644 --- a/crates/relayer/src/util/profiling.rs +++ b/crates/relayer/src/util/profiling.rs @@ -8,7 +8,7 @@ use serde_derive::Serialize; use serde_json::Value; std::thread_local! { - pub static DEPTH: AtomicUsize = AtomicUsize::new(0); + pub static DEPTH: AtomicUsize = const { AtomicUsize::new(0) }; } static FILE: OnceCell> = OnceCell::new(); diff --git a/crates/relayer/src/worker/packet.rs b/crates/relayer/src/worker/packet.rs index 7439301828..841b6ada98 100644 --- a/crates/relayer/src/worker/packet.rs +++ b/crates/relayer/src/worker/packet.rs @@ -161,7 +161,7 @@ pub fn spawn_incentivized_packet_cmd_worker> = RwArc::new_lock( - moka::sync::Cache::builder() + Cache::builder() .time_to_live(INCENTIVIZED_CACHE_TTL) .max_capacity(INCENTIVIZED_CACHE_MAX_CAPACITY) .build(), diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index 228b3f07fa..5e065264c7 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-telemetry" -version = "0.27.1" +version = "0.27.2" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -13,7 +13,7 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.27.1", path = "../relayer-types" } +ibc-relayer-types = { version = "0.27.2", path = "../relayer-types" } once_cell = "1.19.0" opentelemetry = { version = "0.19.0", features = ["metrics"] } diff --git a/guide/README.md b/guide/README.md index d4234490c6..8491178669 100644 --- a/guide/README.md +++ b/guide/README.md @@ -10,7 +10,7 @@ mdBook is a utility to create modern online books from Markdown files. This guide should be permanently deployed at its latest stable version at [hermes.informal.systems](https://hermes.informal.systems). -Current version: `v1.8.1`. +Current version: `v1.8.2`. The version of this guide is aligned with the [versioning of the ibc crates](../README.md). diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 4773b8c93d..f817feefde 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-integration-test" -version = "0.27.1" +version = "0.27.2" edition = "2021" rust-version = "1.71" license = "Apache-2.0" diff --git a/tools/integration-test/src/bin/test_setup_with_binary_channel.rs b/tools/integration-test/src/bin/test_setup_with_binary_channel.rs index 336b0c1b23..44d6cb40e4 100644 --- a/tools/integration-test/src/bin/test_setup_with_binary_channel.rs +++ b/tools/integration-test/src/bin/test_setup_with_binary_channel.rs @@ -37,7 +37,7 @@ struct Test { impl TestOverrides for Test { fn modify_test_config(&self, config: &mut TestConfig) { - config.chain_store_dir = self.store_dir.clone(); + config.chain_store_dir.clone_from(&self.store_dir); } fn modify_relayer_config(&self, config: &mut Config) { diff --git a/tools/integration-test/src/bin/test_setup_with_fee_enabled_binary_channel.rs b/tools/integration-test/src/bin/test_setup_with_fee_enabled_binary_channel.rs index d7e7c5456f..ac938158d2 100644 --- a/tools/integration-test/src/bin/test_setup_with_fee_enabled_binary_channel.rs +++ b/tools/integration-test/src/bin/test_setup_with_fee_enabled_binary_channel.rs @@ -38,7 +38,7 @@ struct Test { impl TestOverrides for Test { fn modify_test_config(&self, config: &mut TestConfig) { - config.chain_store_dir = self.store_dir.clone(); + config.chain_store_dir.clone_from(&self.store_dir); } fn modify_relayer_config(&self, config: &mut Config) { diff --git a/tools/integration-test/src/bin/test_setup_with_ternary_channel.rs b/tools/integration-test/src/bin/test_setup_with_ternary_channel.rs index 050c81cdcd..1cfcd0f921 100644 --- a/tools/integration-test/src/bin/test_setup_with_ternary_channel.rs +++ b/tools/integration-test/src/bin/test_setup_with_ternary_channel.rs @@ -37,7 +37,7 @@ struct Test { impl TestOverrides for Test { fn modify_test_config(&self, config: &mut TestConfig) { - config.chain_store_dir = self.store_dir.clone(); + config.chain_store_dir.clone_from(&self.store_dir); } fn modify_relayer_config(&self, config: &mut Config) { diff --git a/tools/integration-test/src/mbt/handlers.rs b/tools/integration-test/src/mbt/handlers.rs index b9c362744e..32c445984e 100644 --- a/tools/integration-test/src/mbt/handlers.rs +++ b/tools/integration-test/src/mbt/handlers.rs @@ -3,16 +3,12 @@ use ibc_relayer::worker::client::spawn_refresh_client; use ibc_test_framework::bootstrap::binary::chain::bootstrap_foreign_client_pair; use ibc_test_framework::bootstrap::binary::connection::bootstrap_connection; -use ibc_test_framework::chain::ext::transfer::ChainTransferMethodsExt; -use ibc_test_framework::chain::tagged::TaggedChainDriverExt; -use ibc_test_framework::ibc::denom::derive_ibc_denom; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::{assert_eventually_channel_established, init_channel}; use ibc_test_framework::relayer::connection::{ assert_eventually_connection_established, init_connection, }; use ibc_test_framework::types::binary::client::ClientIdPair; -use ibc_test_framework::types::binary::connection::ConnectedConnection; use ibc_test_framework::types::tagged::mono::Tagged; use super::state::Packet; diff --git a/tools/integration-test/src/mbt/utils.rs b/tools/integration-test/src/mbt/utils.rs index 1b7d9f0e26..809eddb7e7 100644 --- a/tools/integration-test/src/mbt/utils.rs +++ b/tools/integration-test/src/mbt/utils.rs @@ -1,12 +1,8 @@ -use std::thread::sleep; -use std::time::Duration; - use ibc_relayer::chain::requests::{ QueryPacketAcknowledgementsRequest, QueryPacketCommitmentsRequest, QueryUnreceivedAcksRequest, QueryUnreceivedPacketsRequest, }; use ibc_relayer_types::core::ics04_channel::packet::Sequence; -use ibc_test_framework::ibc::denom::Denom; use ibc_test_framework::prelude::*; use ibc_test_framework::types::tagged::mono::Tagged; diff --git a/tools/integration-test/src/tests/client_expiration.rs b/tools/integration-test/src/tests/client_expiration.rs index 007ac0b459..082cacf70a 100644 --- a/tools/integration-test/src/tests/client_expiration.rs +++ b/tools/integration-test/src/tests/client_expiration.rs @@ -1,7 +1,4 @@ -use core::time::Duration; -use std::thread::sleep; - -use ibc_relayer::config::{self, ChainConfig, Config, ModeConfig}; +use ibc_relayer::config::{self, ChainConfig, ModeConfig}; use ibc_relayer_types::core::ics03_connection::connection::State as ConnectionState; use ibc_relayer_types::core::ics04_channel::channel::State as ChannelState; @@ -10,7 +7,6 @@ use ibc_test_framework::bootstrap::binary::channel::{ bootstrap_channel_with_chains, bootstrap_channel_with_connection, }; use ibc_test_framework::bootstrap::binary::connection::bootstrap_connection; -use ibc_test_framework::ibc::denom::derive_ibc_denom; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::{ assert_eventually_channel_established, init_channel, query_channel_end, diff --git a/tools/integration-test/src/tests/client_filter.rs b/tools/integration-test/src/tests/client_filter.rs index 3378bfcc14..0410a91ba4 100644 --- a/tools/integration-test/src/tests/client_filter.rs +++ b/tools/integration-test/src/tests/client_filter.rs @@ -16,8 +16,6 @@ //! is allowed through the filter. It then asserts that client workers were //! established as a result of the connection being allowed through. -use std::time::Duration; - use ibc_relayer::supervisor::client_state_filter::{FilterPolicy, Permission}; use ibc_relayer_types::core::ics02_client::trust_threshold::TrustThreshold; diff --git a/tools/integration-test/src/tests/client_refresh.rs b/tools/integration-test/src/tests/client_refresh.rs index 8871cab801..e29adbb821 100644 --- a/tools/integration-test/src/tests/client_refresh.rs +++ b/tools/integration-test/src/tests/client_refresh.rs @@ -1,5 +1,3 @@ -use std::time::Duration; - use ibc_relayer::config::gas_multiplier::GasMultiplier; use ibc_relayer::config::ChainConfig; use ibc_relayer::foreign_client::CreateOptions; diff --git a/tools/integration-test/src/tests/client_settings.rs b/tools/integration-test/src/tests/client_settings.rs index cdb7465433..0a3c7656a4 100644 --- a/tools/integration-test/src/tests/client_settings.rs +++ b/tools/integration-test/src/tests/client_settings.rs @@ -1,5 +1,3 @@ -use std::time::Duration; - use ibc_relayer::chain::requests::{IncludeProof, QueryClientStateRequest, QueryHeight}; use ibc_relayer::client_state::AnyClientState; use ibc_relayer::config::ChainConfig; diff --git a/tools/integration-test/src/tests/connection_delay.rs b/tools/integration-test/src/tests/connection_delay.rs index d39da949da..0c8ca19e57 100644 --- a/tools/integration-test/src/tests/connection_delay.rs +++ b/tools/integration-test/src/tests/connection_delay.rs @@ -1,7 +1,5 @@ -use core::time::Duration; use time::OffsetDateTime; -use ibc_test_framework::ibc::denom::derive_ibc_denom; use ibc_test_framework::prelude::*; use ibc_test_framework::util::random::random_u128_range; diff --git a/tools/integration-test/src/tests/consensus_states.rs b/tools/integration-test/src/tests/consensus_states.rs index cb7e289038..bfd0891679 100644 --- a/tools/integration-test/src/tests/consensus_states.rs +++ b/tools/integration-test/src/tests/consensus_states.rs @@ -1,5 +1,3 @@ -use std::time::Duration; - use ibc_relayer::chain::{ cosmos::query::consensus_state::query_consensus_states, requests::{PageRequest, QueryConsensusStateHeightsRequest, QueryConsensusStatesRequest}, diff --git a/tools/integration-test/src/tests/denom_trace.rs b/tools/integration-test/src/tests/denom_trace.rs index 695efe2876..3c56efbdcb 100644 --- a/tools/integration-test/src/tests/denom_trace.rs +++ b/tools/integration-test/src/tests/denom_trace.rs @@ -1,4 +1,3 @@ -use ibc_test_framework::ibc::denom::derive_ibc_denom; use ibc_test_framework::prelude::*; #[test] diff --git a/tools/integration-test/src/tests/forward/forward_hop_transfer.rs b/tools/integration-test/src/tests/forward/forward_hop_transfer.rs index 3ae0337aba..931ceddd23 100644 --- a/tools/integration-test/src/tests/forward/forward_hop_transfer.rs +++ b/tools/integration-test/src/tests/forward/forward_hop_transfer.rs @@ -6,7 +6,7 @@ //! - The `AtomicIbcForwardHopTransferTest` tests the case where the //! hop between chain C and D fails. In this case the sender is still refunded. -use ibc_relayer::config::{self, Config, ModeConfig}; +use ibc_relayer::config::{self, ModeConfig}; use ibc_test_framework::prelude::*; use crate::tests::forward::memo::HopMemoField; diff --git a/tools/integration-test/src/tests/forward/forward_transfer.rs b/tools/integration-test/src/tests/forward/forward_transfer.rs index 4830ee43b6..65827fc0d6 100644 --- a/tools/integration-test/src/tests/forward/forward_transfer.rs +++ b/tools/integration-test/src/tests/forward/forward_transfer.rs @@ -18,7 +18,7 @@ //! the memo fields are misspelled: //! - Misspelled receiver address, port or channel: The intermediary chain will refund the sender. -use ibc_relayer::config::{self, Config, ModeConfig}; +use ibc_relayer::config::{self, ModeConfig}; use ibc_test_framework::prelude::*; use crate::tests::forward::memo::{ diff --git a/tools/integration-test/src/tests/ica.rs b/tools/integration-test/src/tests/ica.rs index 024e82a4d9..f62c642d2e 100644 --- a/tools/integration-test/src/tests/ica.rs +++ b/tools/integration-test/src/tests/ica.rs @@ -1,7 +1,6 @@ use std::collections::HashMap; use std::str::FromStr; -use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::config::{ filter::{ChannelFilters, ChannelPolicy, FilterPattern}, ChainConfig, PacketFilter, @@ -18,7 +17,6 @@ use ibc_relayer_types::timestamp::Timestamp; use ibc_relayer_types::tx_msg::Msg; use ibc_test_framework::chain::ext::ica::register_interchain_account; -use ibc_test_framework::ibc::denom::Denom; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::{ assert_eventually_channel_closed, assert_eventually_channel_established, query_channel_end, diff --git a/tools/integration-test/src/tests/manual/simulation.rs b/tools/integration-test/src/tests/manual/simulation.rs index 71feb2ad6d..30c801bfcf 100644 --- a/tools/integration-test/src/tests/manual/simulation.rs +++ b/tools/integration-test/src/tests/manual/simulation.rs @@ -11,8 +11,7 @@ ``` */ -use core::time::Duration; -use ibc_relayer::config::{types::MaxMsgNum, ChainConfig, Config}; +use ibc_relayer::config::{types::MaxMsgNum, ChainConfig}; use ibc_relayer::transfer::{build_and_send_transfer_messages, TransferOptions}; use ibc_relayer_types::events::IbcEvent; use ibc_test_framework::prelude::*; diff --git a/tools/integration-test/src/tests/memo.rs b/tools/integration-test/src/tests/memo.rs index 52de0c5602..a44ee417cf 100644 --- a/tools/integration-test/src/tests/memo.rs +++ b/tools/integration-test/src/tests/memo.rs @@ -4,11 +4,10 @@ //! You can find a more thorough walkthrough of this test at //! `tools/test-framework/src/docs/walkthroughs/memo.rs`. +use ibc_relayer::config::types::Memo; use ibc_relayer::config::ChainConfig; -use ibc_relayer::config::{types::Memo, Config}; use serde_json as json; -use ibc_test_framework::ibc::denom::derive_ibc_denom; use ibc_test_framework::prelude::*; use ibc_test_framework::util::random::{random_string, random_u128_range}; diff --git a/tools/integration-test/src/tests/ordered_channel.rs b/tools/integration-test/src/tests/ordered_channel.rs index 25177b4ee8..8f36e516c8 100644 --- a/tools/integration-test/src/tests/ordered_channel.rs +++ b/tools/integration-test/src/tests/ordered_channel.rs @@ -13,7 +13,6 @@ //! A more thorough walkthrough of this test can be found at //! `tools/test-framework/src/docs/walkthroughs/ordered_channel.rs`. -use ibc_test_framework::ibc::denom::derive_ibc_denom; use ibc_test_framework::prelude::*; use ibc_test_framework::util::random::random_u128_range; diff --git a/tools/integration-test/src/tests/ordered_channel_clear.rs b/tools/integration-test/src/tests/ordered_channel_clear.rs index acc9f0bee1..85484e42d1 100644 --- a/tools/integration-test/src/tests/ordered_channel_clear.rs +++ b/tools/integration-test/src/tests/ordered_channel_clear.rs @@ -2,7 +2,6 @@ use ibc_relayer::config::{types::MaxMsgNum, ChainConfig}; use ibc_relayer::link::{Link, LinkParameters}; use ibc_relayer::transfer::{build_and_send_transfer_messages, TransferOptions}; use ibc_relayer_types::events::IbcEvent; -use ibc_test_framework::ibc::denom::derive_ibc_denom; use ibc_test_framework::prelude::*; use ibc_test_framework::util::random::random_u64_range; diff --git a/tools/integration-test/src/tests/supervisor.rs b/tools/integration-test/src/tests/supervisor.rs index 38daad74ed..fd24c71551 100644 --- a/tools/integration-test/src/tests/supervisor.rs +++ b/tools/integration-test/src/tests/supervisor.rs @@ -1,5 +1,4 @@ -use ibc_relayer::config::{self, Config, ModeConfig}; -use ibc_test_framework::ibc::denom::derive_ibc_denom; +use ibc_relayer::config::{self, ModeConfig}; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::{assert_eventually_channel_established, init_channel}; diff --git a/tools/integration-test/src/tests/ternary_transfer.rs b/tools/integration-test/src/tests/ternary_transfer.rs index 2fca34ec8b..8302c9b8bd 100644 --- a/tools/integration-test/src/tests/ternary_transfer.rs +++ b/tools/integration-test/src/tests/ternary_transfer.rs @@ -1,4 +1,3 @@ -use ibc_test_framework::ibc::denom::derive_ibc_denom; use ibc_test_framework::prelude::*; #[test] diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 384b6e3440..b36199cbde 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-test-framework" -version = "0.27.1" +version = "0.27.2" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -14,9 +14,9 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "=0.27.1", path = "../../crates/relayer-types" } -ibc-relayer = { version = "=0.27.1", path = "../../crates/relayer" } -ibc-relayer-cli = { version = "=1.8.1", path = "../../crates/relayer-cli" } +ibc-relayer-types = { version = "=0.27.2", path = "../../crates/relayer-types" } +ibc-relayer = { version = "=0.27.2", path = "../../crates/relayer" } +ibc-relayer-cli = { version = "=1.8.2", path = "../../crates/relayer-cli" } ibc-proto = { version = "0.42.0", features = ["serde"] } tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } diff --git a/tools/test-framework/src/bootstrap/consumer.rs b/tools/test-framework/src/bootstrap/consumer.rs index 1c46b7e600..bd60bcdab1 100644 --- a/tools/test-framework/src/bootstrap/consumer.rs +++ b/tools/test-framework/src/bootstrap/consumer.rs @@ -5,7 +5,6 @@ use eyre::eyre; use std::sync::{Arc, RwLock}; use std::thread; use std::time::Duration; -use toml; use tracing::info; use crate::chain::builder::ChainBuilder; diff --git a/tools/test-framework/src/bootstrap/nary/chain.rs b/tools/test-framework/src/bootstrap/nary/chain.rs index 795ec74e69..95d0f71c78 100644 --- a/tools/test-framework/src/bootstrap/nary/chain.rs +++ b/tools/test-framework/src/bootstrap/nary/chain.rs @@ -2,7 +2,6 @@ Functions for bootstrapping N-ary number of chains. */ -use core::convert::TryInto; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::config::Config; use ibc_relayer::foreign_client::ForeignClient; diff --git a/tools/test-framework/src/bootstrap/nary/channel.rs b/tools/test-framework/src/bootstrap/nary/channel.rs index a954c23ed7..5e8d49ec86 100644 --- a/tools/test-framework/src/bootstrap/nary/channel.rs +++ b/tools/test-framework/src/bootstrap/nary/channel.rs @@ -2,7 +2,6 @@ Functions for bootstrapping N-ary number of channels. */ -use core::convert::TryInto; use core::time::Duration; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer_types::core::ics04_channel::channel::Ordering; diff --git a/tools/test-framework/src/bootstrap/nary/connection.rs b/tools/test-framework/src/bootstrap/nary/connection.rs index 932f9fc9be..1be22092d3 100644 --- a/tools/test-framework/src/bootstrap/nary/connection.rs +++ b/tools/test-framework/src/bootstrap/nary/connection.rs @@ -2,7 +2,6 @@ Functions for bootstrapping N-ary number of connections. */ -use core::convert::TryInto; use core::time::Duration; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::foreign_client::ForeignClient; diff --git a/tools/test-framework/src/bootstrap/single.rs b/tools/test-framework/src/bootstrap/single.rs index 5fec701964..508d0b28ba 100644 --- a/tools/test-framework/src/bootstrap/single.rs +++ b/tools/test-framework/src/bootstrap/single.rs @@ -4,7 +4,6 @@ use core::time::Duration; use eyre::eyre; use std::sync::{Arc, RwLock}; -use toml; use tracing::info; use crate::chain::builder::ChainBuilder; diff --git a/tools/test-framework/src/chain/ext/async_icq.rs b/tools/test-framework/src/chain/ext/async_icq.rs index 60998ea5d3..407a760302 100644 --- a/tools/test-framework/src/chain/ext/async_icq.rs +++ b/tools/test-framework/src/chain/ext/async_icq.rs @@ -1,6 +1,4 @@ use crate::chain::cli::async_icq::{async_icq, update_oracle}; -use crate::chain::driver::ChainDriver; -use crate::error::Error; use crate::prelude::*; use crate::types::tagged::*; diff --git a/tools/test-framework/src/chain/ext/bootstrap.rs b/tools/test-framework/src/chain/ext/bootstrap.rs index 9eb374d6d0..a05f4dc76e 100644 --- a/tools/test-framework/src/chain/ext/bootstrap.rs +++ b/tools/test-framework/src/chain/ext/bootstrap.rs @@ -6,7 +6,6 @@ use std::fs; use std::path::PathBuf; use std::str; use std::time::Duration; -use toml; use tracing::debug; use ibc_relayer::keyring::{Secp256k1KeyPair, SigningKeyPair}; diff --git a/tools/test-framework/src/chain/ext/ica.rs b/tools/test-framework/src/chain/ext/ica.rs index bd5b142fd2..c54c252b43 100644 --- a/tools/test-framework/src/chain/ext/ica.rs +++ b/tools/test-framework/src/chain/ext/ica.rs @@ -1,4 +1,3 @@ -use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::tracking::TrackedMsgs; use ibc_relayer_types::applications::ics27_ica::msgs::register::LegacyMsgRegisterInterchainAccount; use ibc_relayer_types::core::ics04_channel::version::Version; @@ -6,11 +5,8 @@ use ibc_relayer_types::events::IbcEvent; use ibc_relayer_types::tx_msg::Msg; use crate::chain::cli::ica::{query_interchain_account, register_interchain_account_cli}; -use crate::chain::driver::ChainDriver; -use crate::error::Error; use crate::prelude::*; use crate::types::tagged::*; -use crate::types::wallet::WalletAddress; pub trait InterchainAccountMethodsExt { fn register_interchain_account_cli( diff --git a/tools/test-framework/src/error.rs b/tools/test-framework/src/error.rs index d438f88bd9..796660e731 100644 --- a/tools/test-framework/src/error.rs +++ b/tools/test-framework/src/error.rs @@ -1,6 +1,5 @@ //! Error type used for the tests. -use core::convert::{From, Into}; use std::io::{Error as IoError, ErrorKind as IoErrorKind}; use eyre::Report; diff --git a/tools/test-framework/src/framework/binary/node.rs b/tools/test-framework/src/framework/binary/node.rs index 745cf57f03..ff59b4a13e 100644 --- a/tools/test-framework/src/framework/binary/node.rs +++ b/tools/test-framework/src/framework/binary/node.rs @@ -3,8 +3,6 @@ running without setting up the relayer. */ -use toml; - use crate::bootstrap::single::bootstrap_single_node; use crate::chain::builder::ChainBuilder; use crate::error::Error; diff --git a/tools/test-framework/src/types/env.rs b/tools/test-framework/src/types/env.rs index 427d50eaa1..7028aa8b32 100644 --- a/tools/test-framework/src/types/env.rs +++ b/tools/test-framework/src/types/env.rs @@ -2,7 +2,6 @@ Types for exporting test setup information into environment variables. */ -use core::convert::AsRef; use itertools::Itertools; use std::collections::BTreeMap; use std::fs::write; diff --git a/tools/test-framework/src/types/nary/chains.rs b/tools/test-framework/src/types/nary/chains.rs index 74579e8e32..5602113446 100644 --- a/tools/test-framework/src/types/nary/chains.rs +++ b/tools/test-framework/src/types/nary/chains.rs @@ -2,7 +2,6 @@ Constructs for N-ary connected chains. */ -use core::convert::{From, TryFrom}; use eyre::eyre; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::foreign_client::ForeignClient; diff --git a/tools/test-framework/src/types/nary/channel.rs b/tools/test-framework/src/types/nary/channel.rs index 68864f4786..decb941fa1 100644 --- a/tools/test-framework/src/types/nary/channel.rs +++ b/tools/test-framework/src/types/nary/channel.rs @@ -2,7 +2,6 @@ Constructs for N-ary connected channels. */ -use core::convert::TryFrom; use eyre::eyre; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::channel::Channel; diff --git a/tools/test-framework/src/types/nary/connection.rs b/tools/test-framework/src/types/nary/connection.rs index faa01cff7b..87866f42d8 100644 --- a/tools/test-framework/src/types/nary/connection.rs +++ b/tools/test-framework/src/types/nary/connection.rs @@ -2,7 +2,6 @@ Constructs for N-ary connected connections. */ -use core::convert::TryFrom; use eyre::eyre; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer_types::core::ics24_host::identifier::ConnectionId; diff --git a/tools/test-framework/src/types/nary/foreign_client.rs b/tools/test-framework/src/types/nary/foreign_client.rs index 33080f4944..e840b1eb97 100644 --- a/tools/test-framework/src/types/nary/foreign_client.rs +++ b/tools/test-framework/src/types/nary/foreign_client.rs @@ -1,4 +1,3 @@ -use core::convert::TryFrom; use eyre::eyre; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::foreign_client::ForeignClient; diff --git a/tools/test-framework/src/types/tagged/dual.rs b/tools/test-framework/src/types/tagged/dual.rs index ffbafb3133..605f15820c 100644 --- a/tools/test-framework/src/types/tagged/dual.rs +++ b/tools/test-framework/src/types/tagged/dual.rs @@ -12,9 +12,8 @@ corresponds to a channel connected to a counterparty chain `ChainB`. */ -use core::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd}; +use core::cmp::Ordering; use core::fmt::{self, Debug, Display}; -use core::iter::{IntoIterator, Iterator}; use core::marker::PhantomData; /** diff --git a/tools/test-framework/src/types/tagged/mono.rs b/tools/test-framework/src/types/tagged/mono.rs index ef4a228b93..a1e8a1f448 100644 --- a/tools/test-framework/src/types/tagged/mono.rs +++ b/tools/test-framework/src/types/tagged/mono.rs @@ -17,9 +17,8 @@ */ -use core::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd}; +use core::cmp::Ordering; use core::fmt::{self, Debug, Display}; -use core::iter::{IntoIterator, Iterator}; use core::marker::PhantomData; use serde::{Serialize, Serializer}; diff --git a/tools/test-framework/src/util/array.rs b/tools/test-framework/src/util/array.rs index fc2a2ef88f..17aaa451fc 100644 --- a/tools/test-framework/src/util/array.rs +++ b/tools/test-framework/src/util/array.rs @@ -2,7 +2,6 @@ Helpers for manipulating fixed-sized arrays. */ -use core::convert::TryInto; use eyre::eyre; use crate::error::Error; From 6ffb295ac19823e77b06b75320ba7d3ace6eecf5 Mon Sep 17 00:00:00 2001 From: Sergey <83376337+freak12techno@users.noreply.github.com> Date: Sun, 17 Mar 2024 15:45:06 +0300 Subject: [PATCH 056/200] fix: fixed minimum-gas-prices healthcheck messages and make it more verbose/clear (#3898) * fix: fixed minimum-gas-prices healthcheck messages and make it more verbose/clear * Update changelog entry * Small refactor --------- Co-authored-by: Romain Ruetschi --- .../3893-fix-min-gas-price-healthcheck.md | 2 + crates/relayer/src/chain/cosmos.rs | 67 ++++++++++--------- 2 files changed, 38 insertions(+), 31 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer-cli/3893-fix-min-gas-price-healthcheck.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3893-fix-min-gas-price-healthcheck.md b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3893-fix-min-gas-price-healthcheck.md new file mode 100644 index 0000000000..abe83a3a1a --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3893-fix-min-gas-price-healthcheck.md @@ -0,0 +1,2 @@ +- Fixed `minimum-gas-prices` health-check messages and make it more verbose and legible + ([\#3893](https://github.com/informalsystems/hermes/issues/3893)) diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index eec3a6b7dd..42eac96933 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -481,7 +481,7 @@ impl CosmosSdkChain { } /// The minimum gas price that this node accepts - pub fn min_gas_price(&self) -> Result, Error> { + pub fn min_gas_price(&self) -> Result>, Error> { crate::time!( "min_gas_price", { @@ -489,10 +489,9 @@ impl CosmosSdkChain { } ); - let min_gas_price: Vec = - self.query_config_params()?.map_or(vec![], |cfg_response| { - parse_gas_prices(cfg_response.minimum_gas_price) - }); + let min_gas_price: Option> = self + .query_config_params()? + .map(|cfg_response| parse_gas_prices(cfg_response.minimum_gas_price)); Ok(min_gas_price) } @@ -2467,38 +2466,44 @@ fn do_health_check(chain: &CosmosSdkChain) -> Result<(), Error> { } let relayer_gas_price = &chain.config.gas_price; - let node_min_gas_prices = chain.min_gas_price()?; - - if !node_min_gas_prices.is_empty() { - let mut found_matching_denom = false; - - for price in node_min_gas_prices { - match relayer_gas_price.partial_cmp(&price) { - Some(Ordering::Less) => return Err(Error::gas_price_too_low(chain_id.clone())), - Some(_) => { - found_matching_denom = true; - break; + let node_min_gas_prices_result = chain.min_gas_price()?; + + match node_min_gas_prices_result { + Some(node_min_gas_prices) if !node_min_gas_prices.is_empty() => { + let mut found_matching_denom = false; + + for price in node_min_gas_prices { + match relayer_gas_price.partial_cmp(&price) { + Some(Ordering::Less) => return Err(Error::gas_price_too_low(chain_id.clone())), + Some(_) => { + found_matching_denom = true; + break; + } + None => continue, } - None => continue, } - } - if !found_matching_denom { - warn!( - "chain '{}' has no minimum gas price of denomination '{}' \ - that is strictly less than the `gas_price` specified for \ - that chain in the Hermes configuration. \ - This is usually a sign of misconfiguration, please check your chain and Hermes configurations", - chain_id, relayer_gas_price.denom - ); + if !found_matching_denom { + warn!( + "chain '{}' has no minimum gas price of denomination '{}' \ + that is strictly less than the `gas_price` specified for that chain in the Hermes configuration. \ + This is usually a sign of misconfiguration, please check your chain and Hermes configurations", + chain_id, relayer_gas_price.denom + ); + } } - } else { - warn!( + + Some(_) => warn!( "chain '{}' has no minimum gas price value configured for denomination '{}'. \ - This is usually a sign of misconfiguration, please check your chain and \ - relayer configurations", + This is usually a sign of misconfiguration, please check your chain and relayer configurations", chain_id, relayer_gas_price.denom - ); + ), + + None => warn!( + "chain '{}' does not implement the `cosmos.base.node.v1beta1.Service/Params` endpoint. \ + It is impossible to check whether the chain's minimum-gas-prices matches the ones specified in config", + chain_id, + ), } let version_specs = chain.block_on(fetch_version_specs(&chain.config.id, &chain.grpc_addr))?; From 97c575e0373058d015eb48a975683a9b367e5f6f Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Thu, 21 Mar 2024 22:49:42 +0900 Subject: [PATCH 057/200] Proceed to next block after a few retries if Hermes can't parse current block during event sourcing (#3906) Co-authored-by: Romain Ruetschi --- .../3894-continue-event-sourcing.md | 6 +++ config.toml | 3 +- crates/relayer-cli/src/commands/listen.rs | 6 ++- crates/relayer/src/chain/cosmos.rs | 6 ++- crates/relayer/src/config.rs | 9 ++++ crates/relayer/src/event/source.rs | 4 +- crates/relayer/src/event/source/rpc.rs | 51 +++++++++++++++---- 7 files changed, 70 insertions(+), 15 deletions(-) create mode 100644 .changelog/unreleased/features/ibc-relayer/3894-continue-event-sourcing.md diff --git a/.changelog/unreleased/features/ibc-relayer/3894-continue-event-sourcing.md b/.changelog/unreleased/features/ibc-relayer/3894-continue-event-sourcing.md new file mode 100644 index 0000000000..9fcff6427e --- /dev/null +++ b/.changelog/unreleased/features/ibc-relayer/3894-continue-event-sourcing.md @@ -0,0 +1,6 @@ +- Improve reliabily of event source in `pull` mode by proceeding to next block even if Hermes cannot parse the current block. + Add new configuration option to `event_source` setting: `max_retries` defines how many times Hermes should attempt to pull a block over RPC. + ```toml + event_source = { mode = 'pull', interval = '1s', max_retries = 4 } + ``` + ([\#3894](https://github.com/informalsystems/hermes/issues/3894)) diff --git a/config.toml b/config.toml index 11c8110ea5..897814008d 100644 --- a/config.toml +++ b/config.toml @@ -189,11 +189,12 @@ grpc_addr = 'http://127.0.0.1:9090' # b) Pull: for polling for IBC events via the `/block_results` RPC endpoint. # -# `{ mode = 'pull', interval = '1s' }` +# `{ mode = 'pull', interval = '1s', max_retries = 4 }` # # where # # - `interval` is the interval at which to poll for blocks. Default: 1s +# - `max_retries` is the maximum number of retries to collect events for each block. Default: 4 # # This mode should only be used in situations where Hermes misses events that it should be # receiving, such as when relaying for CosmWasm-enabled chains which emit IBC events without diff --git a/crates/relayer-cli/src/commands/listen.rs b/crates/relayer-cli/src/commands/listen.rs index 485264e84e..bc9400b516 100644 --- a/crates/relayer-cli/src/commands/listen.rs +++ b/crates/relayer-cli/src/commands/listen.rs @@ -156,10 +156,14 @@ fn subscribe( *batch_delay, rt, ), - EventSourceMode::Pull { interval } => EventSource::rpc( + EventSourceMode::Pull { + interval, + max_retries, + } => EventSource::rpc( chain_config.id().clone(), HttpClient::new(config.rpc_addr.clone())?, *interval, + *max_retries, rt, ), }?; diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 42eac96933..91909eb606 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -335,10 +335,14 @@ impl CosmosSdkChain { *batch_delay, self.rt.clone(), ), - Mode::Pull { interval } => EventSource::rpc( + Mode::Pull { + interval, + max_retries, + } => EventSource::rpc( self.config.id.clone(), self.rpc_client.clone(), *interval, + *max_retries, self.rt.clone(), ), } diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index 0642af4242..d1ed7c14c0 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -178,6 +178,10 @@ pub mod default { Duration::from_secs(1) } + pub fn max_retries() -> u32 { + 4 + } + pub fn batch_delay() -> Duration { Duration::from_millis(500) } @@ -622,6 +626,11 @@ pub enum EventSourceMode { /// The polling interval #[serde(default = "default::poll_interval", with = "humantime_serde")] interval: Duration, + + /// The maximum retries to collect the block results + /// before giving up and moving to the next block + #[serde(default = "default::max_retries")] + max_retries: u32, }, } diff --git a/crates/relayer/src/event/source.rs b/crates/relayer/src/event/source.rs index 49e76441e8..c114ac5e51 100644 --- a/crates/relayer/src/event/source.rs +++ b/crates/relayer/src/event/source.rs @@ -47,9 +47,11 @@ impl EventSource { chain_id: ChainId, rpc_client: HttpClient, poll_interval: Duration, + max_retries: u32, rt: Arc, ) -> Result<(Self, TxEventSourceCmd)> { - let (source, tx) = rpc::EventSource::new(chain_id, rpc_client, poll_interval, rt)?; + let (source, tx) = + rpc::EventSource::new(chain_id, rpc_client, poll_interval, max_retries, rt)?; Ok((Self::Rpc(source), tx)) } diff --git a/crates/relayer/src/event/source/rpc.rs b/crates/relayer/src/event/source/rpc.rs index b684cc6590..5aac57baef 100644 --- a/crates/relayer/src/event/source/rpc.rs +++ b/crates/relayer/src/event/source/rpc.rs @@ -23,7 +23,7 @@ use ibc_relayer_types::{ use crate::{ chain::tracking::TrackingId, - event::{bus::EventBus, source::Error, IbcEventWithHeight}, + event::{bus::EventBus, error::ErrorDetail, source::Error, IbcEventWithHeight}, telemetry, util::retry::ConstantGrowth, }; @@ -45,6 +45,9 @@ pub struct EventSource { /// Poll interval poll_interval: Duration, + /// Max retries to collect events + max_retries: u32, + /// Event bus for broadcasting events event_bus: EventBus>>, @@ -63,6 +66,7 @@ impl EventSource { chain_id: ChainId, rpc_client: HttpClient, poll_interval: Duration, + max_retries: u32, rt: Arc, ) -> Result<(Self, TxEventSourceCmd)> { let event_bus = EventBus::new(); @@ -73,6 +77,7 @@ impl EventSource { chain_id, rpc_client, poll_interval, + max_retries, event_bus, rx_cmd, last_fetched_height: BlockHeight::from(0_u32), @@ -203,19 +208,38 @@ impl EventSource { for height in heights { trace!("collecting events at height {height}"); - let result = collect_events(&self.rpc_client, &self.chain_id, height).await; + let mut attempts = 0; + let mut backoff = retries_backoff(self.max_retries); + + // NOTE: Even if we failed to collect events after max retries, + // we still need to update to move on next block + self.last_fetched_height = height; - match result { - Ok(batch) => { - self.last_fetched_height = height; + loop { + attempts += 1; - if let Some(batch) = batch { - batches.push(batch); + match collect_events(&self.rpc_client, &self.chain_id, height).await { + Ok(batch) => { + if let Some(batch) = batch { + batches.push(batch); + } + break; } - } - Err(e) => { - error!(%height, "failed to collect events: {e}"); - break; + Err(e) => match e.detail() { + ErrorDetail::Rpc(_) if attempts < self.max_retries => { + let delay = backoff.next().expect( + "backoff has attempted to make more iterates than is expected", + ); + + error!(%height, "failed to collect events: {e}, retrying in {delay:?}..."); + sleep(delay).await; + } + + _ => { + error!(%height, "failed to collect events after {attempts} attempts: {e}"); + break; + } + }, } } } @@ -244,6 +268,11 @@ fn poll_backoff(poll_interval: Duration) -> impl Iterator { .clamp(poll_interval * 5, usize::MAX) } +fn retries_backoff(collect_retries: u32) -> impl Iterator { + ConstantGrowth::new(Duration::from_secs(1), Duration::from_millis(500)) + .clamp(Duration::from_secs(4), collect_retries as usize) +} + fn dedupe(events: Vec) -> Vec { use itertools::Itertools; use std::hash::{Hash, Hasher}; From b076784c75e956fb7391a3e953646ffab8462518 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 21 Mar 2024 15:04:28 +0100 Subject: [PATCH 058/200] Use workspace dependencies (#3907) --- Cargo.lock | 1 - Cargo.toml | 99 ++ crates/chain-registry/Cargo.toml | 26 +- crates/relayer-cli/Cargo.toml | 84 +- crates/relayer-rest/Cargo.toml | 18 +- crates/relayer-types/Cargo.toml | 64 +- crates/relayer/Cargo.toml | 156 +- crates/telemetry/Cargo.toml | 29 +- tools/check-guide/Cargo.lock | 243 ++-- tools/check-guide/Cargo.toml | 4 +- tools/integration-test/Cargo.toml | 73 +- tools/query-events/Cargo.lock | 2197 +++++++++++++++++++++++++++++ tools/test-framework/Cargo.toml | 54 +- 13 files changed, 2613 insertions(+), 435 deletions(-) create mode 100644 tools/query-events/Cargo.lock diff --git a/Cargo.lock b/Cargo.lock index 11893755c4..9c6d8ab5bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1063,7 +1063,6 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c606d892c9de11507fa0dcffc116434f94e105d0bbdc4e405b61519464c49d7b" dependencies = [ - "anyhow", "eyre", "paste", ] diff --git a/Cargo.toml b/Cargo.toml index c651008bfc..2a6adc1fc9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,6 +18,105 @@ exclude = [ "tools/query-events", ] +[workspace.dependencies] +# Hermes dependencies +ibc-relayer-cli = { version = "1.8.2", path = "crates/relayer-cli" } +ibc-relayer = { version = "0.27.2", path = "crates/relayer" } +ibc-relayer-rest = { version = "0.27.2", path = "crates/relayer-rest" } +ibc-relayer-types = { version = "0.27.2", path = "crates/relayer-types" } +ibc-chain-registry = { version = "0.27.2", path = "crates/chain-registry" } +ibc-telemetry = { version = "0.27.2", path = "crates/telemetry" } +ibc-test-framework = { version = "0.27.2", path = "tools/test-framework" } +ibc-integration-test = { version = "0.27.2", path = "tools/integration-test" } + +# Tendermint dependencies +tendermint = { version = "0.34.0", default-features = false } +tendermint-light-client = { version = "0.34.0", default-features = false } +tendermint-light-client-detector = { version = "0.34.0", default-features = false } +tendermint-light-client-verifier = { version = "0.34.0", default-features = false } +tendermint-proto = "0.34.1" +tendermint-rpc = "0.34.0" +tendermint-testgen = "0.34.0" + +# Other dependencies +abscissa_core = "=0.6.0" +anyhow = "1.0" +async-stream = "0.3.5" +async-trait = "0.1.72" +axum = "0.6.18" +bech32 = "0.9.1" +bitcoin = "0.31.1" +bs58 = "0.5.0" +byte-unit = { version = "4.0.19", default-features = false } +bytes = "1.4.0" +clap = "3.2" +clap_complete = "3.2" +color-eyre = "0.6" +console = "0.15.5" +crossbeam-channel = "0.5.11" +dashmap = "5.4.0" +derive_more = { version = "0.99.17", default-features = false } +dialoguer = "0.11.0" +digest = "0.10.6" +dirs-next = "2.0.0" +ed25519 = "2.2.2" +ed25519-dalek = "2.0.0" +ed25519-dalek-bip32 = "0.3.0" +env_logger = "0.11.1" +eyre = "0.6.12" +flex-error = { version = "0.4.4", default-features = false } +futures = "0.3.27" +generic-array = "0.14.7" +hdpath = "0.6.3" +hex = "0.4.3" +http = "0.2.9" +humantime = "2.1.0" +humantime-serde = "1.1.1" +ibc-proto = "0.42.0" +ics23 = "0.11.1" +itertools = "0.10.5" +moka = "0.12.5" +num-bigint = "0.4" +num-rational = "0.4.1" +once_cell = "1.19.0" +oneline-eyre = "0.1" +opentelemetry = "0.19.0" +opentelemetry-prometheus = "0.12.0" +primitive-types = { version = "0.12.1", default-features = false } +prometheus = "0.13.2" +prost = "0.12" +rand = "0.8.5" +regex = "1.9.5" +reqwest = { version = "0.11.16", default-features = false } +retry = { version = "2.0.0", default-features = false } +ripemd = "0.1.3" +secp256k1 = "0.28.2" +semver = "1.0.21" +serde = "1.0.197" +serde_derive = "1.0.104" +serde_json = "1.0.111" +serde_yaml = "0.9.31" +serial_test = "3.0.0" +sha2 = "0.10.6" +signal-hook = "0.3.17" +signature = "2.1.0" +strum = "0.25" +subtle-encoding = "0.5.1" +tempfile = "3.10.1" +test-log = "0.2.14" +thiserror = "1.0.57" +time = "0.3" +tiny-bip39 = "1.0.0" +tiny-keccak = { version = "2.0.2", default-features = false } +tokio = "1.26.0" +tokio-stream = "0.1.14" +toml = "0.8.8" +tonic = "0.10" +tracing = { version = "0.1.36", default-features = false } +tracing-subscriber = "0.3.14" +uint = "0.9" +uuid = "1.7.0" + [profile.release] overflow-checks = true diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index 3207ec5c86..76a160ca38 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -12,17 +12,17 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.27.2", path = "../relayer-types" } -ibc-proto = { version = "0.42.0", features = ["serde"] } -tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } +ibc-relayer-types = { workspace = true } +ibc-proto = { workspace = true, features = ["serde"] } +tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } -async-trait = "0.1.72" -flex-error = { version = "0.4.4", default-features = false } -futures = { version = "0.3.27", features = ["executor"] } -http = "0.2" -itertools = "0.10.5" -reqwest = { version = "0.11.13", features = ["rustls-tls-native-roots", "json"], default-features = false } -serde = "1.0.197" -serde_json = "1" -tokio = "1.17.0" -tracing = "0.1.36" +async-trait = { workspace = true } +flex-error = { workspace = true } +futures = { workspace = true, features = ["executor"] } +http = { workspace = true } +itertools = { workspace = true } +reqwest = { workspace = true, features = ["rustls-tls-native-roots", "json"] } +serde = { workspace = true } +serde_json = { workspace = true } +tokio = { workspace = true } +tracing = { workspace = true } diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index 6a90246bf7..0648b8c889 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -25,53 +25,43 @@ telemetry = ["ibc-relayer/telemetry", "ibc-telemetry"] rest-server = ["ibc-relayer-rest"] [dependencies] -ibc-relayer-types = { version = "0.27.2", path = "../relayer-types" } -ibc-relayer = { version = "0.27.2", path = "../relayer" } -ibc-telemetry = { version = "0.27.2", path = "../telemetry", optional = true } -ibc-relayer-rest = { version = "0.27.2", path = "../relayer-rest", optional = true } -ibc-chain-registry = { version = "0.27.2" , path = "../chain-registry" } +ibc-relayer-types = { workspace = true } +ibc-relayer = { workspace = true } +ibc-telemetry = { workspace = true, optional = true } +ibc-relayer-rest = { workspace = true, optional = true } +ibc-chain-registry = { workspace = true } -clap = { version = "3.2", features = ["cargo"] } -clap_complete = "3.2" -color-eyre = "0.6" -console = "0.15.5" -crossbeam-channel = "0.5.11" -dialoguer = "0.11.0" -dirs-next = "2.0.0" -eyre = "0.6.12" -flex-error = { version = "0.4.4", default-features = false, features = ["std", "eyre_tracer"] } -futures = "0.3.27" -hdpath = "0.6.3" -http = "0.2" -humantime = "2.1" -itertools = "0.10.5" -oneline-eyre = "0.1" -regex = "1.9.5" -serde = { version = "1.0", features = ["serde_derive"] } -serde_json = "1" -signal-hook = "0.3.17" -subtle-encoding = "0.5" -tokio = { version = "1.0", features = ["full"] } -tracing = "0.1.36" -tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"]} -time = "0.3" -[dependencies.tendermint] -version = "0.34.0" -features = ["secp256k1"] - -[dependencies.tendermint-rpc] -version = "0.34.0" -features = ["http-client", "websocket-client"] - -[dependencies.tendermint-light-client-verifier] -version = "0.34.0" - -[dependencies.abscissa_core] -version = "=0.6.0" -features = ["options"] +abscissa_core = { workspace = true, features = ["options"] } +clap = { workspace = true, features = ["cargo"] } +clap_complete = { workspace = true } +color-eyre = { workspace = true } +console = { workspace = true } +crossbeam-channel = { workspace = true } +dialoguer = { workspace = true } +dirs-next = { workspace = true } +eyre = { workspace = true } +flex-error = { workspace = true, features = ["std", "eyre_tracer"] } +futures = { workspace = true } +hdpath = { workspace = true } +http = { workspace = true } +humantime = { workspace = true } +itertools = { workspace = true } +oneline-eyre = { workspace = true } +regex = { workspace = true } +serde = { workspace = true, features = ["serde_derive"] } +serde_json = { workspace = true } +signal-hook = { workspace = true } +subtle-encoding = { workspace = true } +tendermint-light-client-verifier = { workspace = true } +tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } +tendermint = { workspace = true, features = ["secp256k1"] } +time = { workspace = true } +tokio = { workspace = true, features = ["full"] } +tracing = { workspace = true } +tracing-subscriber = { workspace = true, features = ["fmt", "env-filter", "json"] } [dev-dependencies] -abscissa_core = { version = "=0.6.0", features = ["testing"] } -once_cell = "1.19" -regex = "1.9" -serial_test = "3.0.0" +abscissa_core = { workspace = true, features = ["testing"] } +once_cell = { workspace = true } +regex = { workspace = true } +serial_test = { workspace = true } diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index 1c4655b065..82480fcb4e 100644 --- a/crates/relayer-rest/Cargo.toml +++ b/crates/relayer-rest/Cargo.toml @@ -14,15 +14,15 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.27.2", path = "../relayer-types" } -ibc-relayer = { version = "0.27.2", path = "../relayer" } +ibc-relayer-types = { workspace = true } +ibc-relayer = { workspace = true } -crossbeam-channel = "0.5" -serde = "1.0" -tracing = "0.1" -axum = "0.6" -tokio = "1.26" +axum = { workspace = true } +crossbeam-channel = { workspace = true } +serde = { workspace = true } +tokio = { workspace = true } +tracing = { workspace = true } [dev-dependencies] -reqwest = { version = "0.11.16", features = ["json"], default-features = false } -toml = "0.8.8" +reqwest = { workspace = true, features = ["json"] } +toml = { workspace = true } diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 5237d234bd..58bc71f21d 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -23,43 +23,31 @@ clock = [] mocks = ["tendermint-testgen", "clock"] [dependencies] -# Proto definitions for all IBC-related interfaces, e.g., connections or channels. -ibc-proto = { version = "0.42.0", features = ["serde"] } -ics23 = { version = "0.11.1", features = ["std", "host-functions"] } -time = { version = "0.3" } -serde_derive = { version = "1.0.104" } -serde = { version = "1.0" } -serde_json = { version = "1" } -prost = { version = "0.12" } -bytes = { version = "1.4.0" } -subtle-encoding = { version = "0.5" } -flex-error = { version = "0.4.4" } -derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display"] } -uint = { version = "0.9" } -itertools = { version = "0.10.3" } -primitive-types = { version = "0.12.1", default-features = false, features = ["serde_no_std"] } -num-rational = "0.4.1" -regex = "1" - -[dependencies.tendermint] -version = "0.34.0" -features = ["clock"] - -[dependencies.tendermint-proto] -version = "0.34.1" - -[dependencies.tendermint-light-client-verifier] -version = "0.34.0" -features = ["rust-crypto"] - -[dependencies.tendermint-testgen] -version = "0.34.0" -optional = true +bytes = { workspace = true } +derive_more = { workspace = true, features = ["from", "into", "display"] } +flex-error = { workspace = true } +ibc-proto = { workspace = true, features = ["serde"] } +ics23 = { workspace = true, features = ["std", "host-functions"] } +itertools = { workspace = true } +num-rational = { workspace = true } +primitive-types = { workspace = true, features = ["serde_no_std"] } +prost = { workspace = true } +regex = { workspace = true } +serde = { workspace = true } +serde_derive = { workspace = true } +serde_json = { workspace = true } +subtle-encoding = { workspace = true } +tendermint-light-client-verifier = { workspace = true, features = ["rust-crypto"] } +tendermint-proto = { workspace = true } +tendermint-testgen = { workspace = true, optional = true } +tendermint = { workspace = true, features = ["clock"] } +time = { workspace = true } +uint = { workspace = true } [dev-dependencies] -env_logger = "0.11.1" -tracing = { version = "0.1.36", default-features = false } -tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"] } -test-log = { version = "0.2.14", features = ["trace"] } -tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } -tendermint-testgen = { version = "0.34.0" } # Needed for generating (synthetic) light blocks. +env_logger = { workspace = true } +tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } +tendermint-testgen = { workspace = true } # Needed for generating (synthetic) light blocks. +test-log = { workspace = true, features = ["trace"] } +tracing = { workspace = true } +tracing-subscriber = { workspace = true, features = ["fmt", "env-filter", "json"] } diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index d18f04c463..17d0bf9460 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -20,100 +20,72 @@ default = ["flex-error/std", "flex-error/eyre_tracer"] telemetry = ["ibc-telemetry"] [dependencies] -ibc-proto = { version = "0.42.0", features = ["serde"] } -ibc-telemetry = { version = "0.27.2", path = "../telemetry", optional = true } -ibc-relayer-types = { version = "0.27.2", path = "../relayer-types", features = ["mocks"] } +ibc-proto = { workspace = true, features = ["serde"] } +ibc-telemetry = { workspace = true, optional = true } +ibc-relayer-types = { workspace = true, features = ["clock"] } -subtle-encoding = "0.5" -humantime-serde = "1.1.1" -serde = "1.0" -serde_derive = "1.0" -thiserror = "1.0.57" -toml = "0.8" -tracing = "0.1.36" -tokio = { version = "1.0", features = ["rt-multi-thread", "time", "sync"] } -serde_json = { version = "1" } -bytes = "1.4.0" -prost = { version = "0.12" } -tonic = { version = "0.10", features = ["tls", "tls-roots"] } -futures = "0.3.27" -crossbeam-channel = "0.5.11" -hex = "0.4" -bitcoin = { version = "0.31.1", features = ["serde"] } -tiny-bip39 = "1.0.0" -hdpath = "0.6.3" -sha2 = "0.10.6" -tiny-keccak = { version = "2.0.2", features = ["keccak"], default-features = false } -ripemd = "0.1.3" -bech32 = "0.9.1" -itertools = "0.10.5" -dirs-next = "2.0.0" -retry = { version = "2.0.0", default-features = false } -async-stream = "0.3.5" -http = "0.2.9" -reqwest = { version = "0.11", features = ["rustls-tls-native-roots", "json"], default-features = false } -flex-error = { version = "0.4.4", default-features = false } -signature = "2.1.0" -anyhow = "1.0" -semver = "1.0" -humantime = "2.1.0" -regex = "1" -moka = { version = "0.12.5", features = ["sync"] } -uuid = { version = "1.7.0", features = ["v4"] } -bs58 = "0.5.0" -digest = "0.10.6" -ed25519 = "2.2.2" -ed25519-dalek = { version = "2.0.0", features = ["serde"] } -ed25519-dalek-bip32 = "0.3.0" -generic-array = "0.14.7" -secp256k1 = { version = "0.28.2", features = ["rand-std"] } -strum = { version = "0.25", features = ["derive"] } -tokio-stream = "0.1.14" -once_cell = "1.19.0" -tracing-subscriber = { version = "0.3.14", features = ["fmt", "env-filter", "json"] } - -[dependencies.byte-unit] -version = "4.0.19" -default-features = false -features = ["serde"] - -[dependencies.num-bigint] -version = "0.4" -features = ["serde"] - -[dependencies.num-rational] -version = "0.4.1" -features = ["num-bigint", "serde"] - -[dependencies.tendermint] -version = "0.34.0" -features = ["secp256k1"] - -[dependencies.tendermint-proto] -version = "0.34.1" - -[dependencies.tendermint-rpc] -version = "0.34.0" -features = ["http-client", "websocket-client"] - -[dependencies.tendermint-light-client] -version = "0.34.0" -default-features = false -features = ["rpc-client", "secp256k1", "unstable"] - -[dependencies.tendermint-light-client-detector] -version = "0.34.0" -default-features = false - -[dependencies.tendermint-light-client-verifier] -version = "0.34.0" -default-features = false +anyhow = { workspace = true } +async-stream = { workspace = true } +bech32 = { workspace = true } +bitcoin = { workspace = true, features = ["serde"] } +bs58 = { workspace = true } +byte-unit = { workspace = true, features = ["serde"] } +bytes = { workspace = true } +crossbeam-channel = { workspace = true } +digest = { workspace = true } +dirs-next = { workspace = true } +ed25519 = { workspace = true } +ed25519-dalek = { workspace = true, features = ["serde"] } +ed25519-dalek-bip32 = { workspace = true } +flex-error = { workspace = true } +futures = { workspace = true } +generic-array = { workspace = true } +hdpath = { workspace = true } +hex = { workspace = true } +http = { workspace = true } +humantime = { workspace = true } +humantime-serde = { workspace = true } +itertools = { workspace = true } +moka = { workspace = true, features = ["sync"] } +num-bigint = { workspace = true, features = ["serde"] } +num-rational = { workspace = true, features = ["num-bigint", "serde"] } +once_cell = { workspace = true } +prost = { workspace = true } +regex = { workspace = true } +reqwest = { workspace = true, features = ["rustls-tls-native-roots", "json"] } +retry = { workspace = true } +ripemd = { workspace = true } +secp256k1 = { workspace = true, features = ["rand-std"] } +semver = { workspace = true } +serde = { workspace = true } +serde_derive = { workspace = true } +serde_json = { workspace = true } +sha2 = { workspace = true } +signature = { workspace = true } +strum = { workspace = true, features = ["derive"] } +subtle-encoding = { workspace = true } +tendermint = { workspace = true, features = ["secp256k1"] } +tendermint-light-client = { workspace = true, features = ["rpc-client", "secp256k1", "unstable"] } +tendermint-light-client-detector = { workspace = true } +tendermint-light-client-verifier = { workspace = true } +tendermint-proto = { workspace = true } +tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } +thiserror = { workspace = true } +tiny-bip39 = { workspace = true } +tiny-keccak = { workspace = true, features = ["keccak"] } +tokio = { workspace = true, features = ["rt-multi-thread", "time", "sync"] } +tokio-stream = { workspace = true } +toml = { workspace = true } +tonic = { workspace = true, features = ["tls", "tls-roots"] } +tracing = { workspace = true } +tracing-subscriber = { workspace = true, features = ["fmt", "env-filter", "json"] } +uuid = { workspace = true, features = ["v4"] } [dev-dependencies] -ibc-relayer-types = { version = "0.27.2", path = "../relayer-types", features = ["mocks"] } -serial_test = "3.0.0" -env_logger = "0.11.1" -test-log = { version = "0.2.14", features = ["trace"] } +ibc-relayer-types = { workspace = true, features = ["mocks"] } +serial_test = { workspace = true } +env_logger = { workspace = true } +test-log = { workspace = true, features = ["trace"] } # Needed for generating (synthetic) light blocks. -tendermint-testgen = { version = "0.34.0" } +tendermint-testgen = { workspace = true } diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index 5e065264c7..d1be584bd6 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -13,20 +13,17 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.27.2", path = "../relayer-types" } +ibc-relayer-types = { workspace = true } -once_cell = "1.19.0" -opentelemetry = { version = "0.19.0", features = ["metrics"] } -opentelemetry-prometheus = "0.12.0" -prometheus = "0.13.2" -moka = { version = "0.12.5", features = ["sync"] } -dashmap = "5.4.0" -serde_json = "1.0.111" -serde = "1.0.197" -axum = "0.6.18" -tokio = "1.26.0" -tracing = "0.1.36" - -[dependencies.tendermint] -version = "0.34.0" -default-features = false +axum = { workspace = true } +dashmap = { workspace = true } +moka = { workspace = true, features = ["sync"] } +once_cell = { workspace = true } +opentelemetry = { workspace = true, features = ["metrics"] } +opentelemetry-prometheus = { workspace = true } +prometheus = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +tendermint = { workspace = true } +tokio = { workspace = true } +tracing = { workspace = true } diff --git a/tools/check-guide/Cargo.lock b/tools/check-guide/Cargo.lock index e5ab2c34a5..df79b8288f 100644 --- a/tools/check-guide/Cargo.lock +++ b/tools/check-guide/Cargo.lock @@ -153,6 +153,18 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "async-stream" version = "0.3.5" @@ -289,12 +301,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.4" @@ -342,7 +348,7 @@ checksum = "fd00f3c09b5f21fb357abe32d29946eb8bb7a0862bae62c0b5e4a692acbbe73c" dependencies = [ "bech32 0.10.0-beta", "bitcoin-internals", - "bitcoin_hashes 0.13.0", + "bitcoin_hashes", "hex-conservative", "hex_lit", "secp256k1", @@ -358,21 +364,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bitcoin-private" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73290177011694f38ec25e165d0387ab7ea749a4b81cd4c80dae5988229f7a57" - -[[package]] -name = "bitcoin_hashes" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7066118b13d4b20b23645932dfb3a81ce7e29f95726c2036fa33cd7b092501" -dependencies = [ - "bitcoin-private", -] - [[package]] name = "bitcoin_hashes" version = "0.13.0" @@ -396,6 +387,28 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "blake3" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if 1.0.0", + "constant_time_eq", +] + [[package]] name = "block-buffer" version = "0.9.0" @@ -690,6 +703,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +[[package]] +name = "constant_time_eq" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" + [[package]] name = "contracts" version = "0.6.3" @@ -898,13 +917,14 @@ dependencies = [ [[package]] name = "dialoguer" -version = "0.10.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c6f2989294b9a498d3ad5491a79c6deb604617378e1cdc4bfc1c1361fe2f87" +checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" dependencies = [ "console", "shell-words", "tempfile", + "thiserror", "zeroize", ] @@ -1130,9 +1150,9 @@ dependencies = [ [[package]] name = "eyre" -version = "0.6.8" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" dependencies = [ "indenter", "once_cell", @@ -1197,7 +1217,6 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c606d892c9de11507fa0dcffc116434f94e105d0bbdc4e405b61519464c49d7b" dependencies = [ - "anyhow", "eyre", "paste", ] @@ -1391,26 +1410,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "gumdrop" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc700f989d2f6f0248546222d9b4258f5b02a171a431f8285a81c08142629e3" -dependencies = [ - "gumdrop_derive", -] - -[[package]] -name = "gumdrop_derive" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729f9bd3449d77e7831a18abfb7ba2f99ee813dfd15b8c2167c9a54ba20aa99d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "h2" version = "0.3.21" @@ -1477,7 +1476,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.21.4", + "base64", "bytes", "headers-core", "http", @@ -1682,7 +1681,7 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.26.4" +version = "0.27.2" dependencies = [ "async-trait", "flex-error", @@ -1701,14 +1700,15 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.39.0" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b5aca9ca863246a2b358e0a1845759780860673e54c0a76335faccc504981c" +checksum = "c1a6f2bbf7e1d12f98d8d54d9114231b865418d0f8b619c0873180eafdee07fd" dependencies = [ - "base64 0.21.4", + "base64", "bytes", "flex-error", "ics23", + "informalsystems-pbjson", "prost", "serde", "subtle-encoding", @@ -1718,7 +1718,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.26.4" +version = "0.27.2" dependencies = [ "anyhow", "async-stream", @@ -1746,7 +1746,6 @@ dependencies = [ "ibc-telemetry", "itertools 0.10.5", "moka", - "monostate", "num-bigint", "num-rational", "once_cell", @@ -1784,7 +1783,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "1.7.4" +version = "1.8.2" dependencies = [ "abscissa_core", "clap 3.2.25", @@ -1823,7 +1822,7 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.26.4" +version = "0.27.2" dependencies = [ "axum", "crossbeam-channel 0.5.11", @@ -1836,7 +1835,7 @@ dependencies = [ [[package]] name = "ibc-relayer-types" -version = "0.26.4" +version = "0.27.2" dependencies = [ "bytes", "derive_more", @@ -1855,14 +1854,13 @@ dependencies = [ "tendermint", "tendermint-light-client-verifier", "tendermint-proto", - "tendermint-testgen", "time", "uint", ] [[package]] name = "ibc-telemetry" -version = "0.26.4" +version = "0.27.2" dependencies = [ "axum", "dashmap", @@ -1881,11 +1879,13 @@ dependencies = [ [[package]] name = "ics23" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "661e2d6f79952a65bc92b1c81f639ebd37228dae6ff412a5aba7d474bdc4b957" +checksum = "dc3b8be84e7285c73b88effdc3294b552277d6b0ec728ee016c861b7b9a2c19c" dependencies = [ "anyhow", + "blake2", + "blake3", "bytes", "hex", "informalsystems-pbjson", @@ -1966,11 +1966,11 @@ dependencies = [ [[package]] name = "informalsystems-pbjson" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eecd90f87bea412eac91c6ef94f6b1e390128290898cbe14f2b926787ae1fb" +checksum = "9aa4a0980c8379295100d70854354e78df2ee1c6ca0f96ffe89afeb3140e3a3d" dependencies = [ - "base64 0.13.1", + "base64", "serde", ] @@ -2125,15 +2125,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" -[[package]] -name = "mach2" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" -dependencies = [ - "libc", -] - [[package]] name = "maplit" version = "1.0.2" @@ -2280,9 +2271,9 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.1" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8017ec3548ffe7d4cef7ac0e12b044c01164a74c0f3119420faeaf13490ad8b" +checksum = "b1911e88d5831f748a4097a43862d129e3c6fca831eecac9b8db6d01d93c9de2" dependencies = [ "crossbeam-channel 0.5.11", "crossbeam-epoch", @@ -2299,27 +2290,6 @@ dependencies = [ "uuid 1.7.0", ] -[[package]] -name = "monostate" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "878c2a1f1c70e5724fa28f101ca787b6a7e8ad5c5e4ae4ca3b0fa4a419fa9075" -dependencies = [ - "monostate-impl", - "serde", -] - -[[package]] -name = "monostate-impl" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f686d68a09079e63b1d2c64aa305095887ce50565f00a922ebfaeeee0d9ba6ce" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "new_debug_unreachable" version = "1.0.4" @@ -2836,9 +2806,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fdd22f3b9c31b53c060df4a0613a1c7f062d4115a2b984dd15b1858f7e340d" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" dependencies = [ "bytes", "prost-derive", @@ -2846,9 +2816,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "265baba7fabd416cf5078179f7d2cbeca4ce7a9041111900675ea7c4cb8a4c32" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" dependencies = [ "anyhow", "itertools 0.11.0", @@ -2885,13 +2855,12 @@ dependencies = [ [[package]] name = "quanta" -version = "0.11.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17e662a7a8291a865152364c20c7abc5e60486ab2001e8ec10b24862de0b9ab" +checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" dependencies = [ "crossbeam-utils 0.8.19", "libc", - "mach2", "once_cell", "raw-cpuid", "wasi", @@ -2940,11 +2909,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "10.7.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", ] [[package]] @@ -3026,7 +2995,7 @@ version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "base64 0.21.4", + "base64", "bytes", "encoding_rs", "futures-core", @@ -3164,7 +3133,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.4", + "base64", ] [[package]] @@ -3245,11 +3214,11 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.1" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f622567e3b4b38154fb8190bcf6b160d7a4301d70595a49195b48c116007a27" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ - "bitcoin_hashes 0.12.0", + "bitcoin_hashes", "rand", "secp256k1-sys", "serde", @@ -3299,18 +3268,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.19" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] @@ -3336,9 +3305,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", @@ -3347,9 +3316,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -3493,12 +3462,6 @@ dependencies = [ "rand_core", ] -[[package]] -name = "simple-error" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc47a29ce97772ca5c927f75bac34866b16d64e07f330c3248e2d7226623901b" - [[package]] name = "siphasher" version = "0.3.11" @@ -3841,9 +3804,9 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.34.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc728a4f9e891d71adf66af6ecaece146f9c7a11312288a3107b3e1d6979aaf" +checksum = "b797dd3d2beaaee91d2f065e7bdf239dc8d80bba4a183a288bc1279dd5a69a1e" dependencies = [ "bytes", "flex-error", @@ -3890,22 +3853,6 @@ dependencies = [ "walkdir", ] -[[package]] -name = "tendermint-testgen" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19d4f02b7e38ce790da973fdc9edc71a0e35340ac57737bf278c8379037c1f5" -dependencies = [ - "ed25519-consensus", - "gumdrop", - "serde", - "serde_json", - "simple-error", - "tempfile", - "tendermint", - "time", -] - [[package]] name = "tendril" version = "0.4.3" @@ -3944,18 +3891,18 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", @@ -4181,7 +4128,7 @@ dependencies = [ "async-stream", "async-trait", "axum", - "base64 0.21.4", + "base64", "bytes", "h2", "http", diff --git a/tools/check-guide/Cargo.toml b/tools/check-guide/Cargo.toml index a69316ec10..4239591403 100644 --- a/tools/check-guide/Cargo.toml +++ b/tools/check-guide/Cargo.toml @@ -1,11 +1,9 @@ [package] -name = "check-guide" +name = "check-guide" version = "0.1.0" edition = "2021" publish = false -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - [dependencies] ibc-relayer-cli = { path = "../../crates/relayer-cli" } clap = "3.2" diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index f817feefde..11ab0d8961 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -13,52 +13,43 @@ description = "Integration tests for Hermes" publish = false [dependencies] -ibc-relayer-types = { path = "../../crates/relayer-types" } -ibc-relayer = { path = "../../crates/relayer" } -ibc-test-framework = { path = "../test-framework" } - -http = "0.2.9" -serde_json = "1" -time = "0.3" -toml = "0.8" -prost = { version = "0.12" } -tonic = { version = "0.10", features = ["tls", "tls-roots"] } -serde = "1.0.197" +ibc-relayer-types = { workspace = true } +ibc-relayer = { workspace = true } +ibc-test-framework = { workspace = true } + +byte-unit = { workspace = true, features = ["serde"] } +http = { workspace = true } +prost = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +tendermint-rpc = { workspace = true, features = ["http-client"] } +tendermint = { workspace = true } +time = { workspace = true } +toml = { workspace = true } +tonic = { workspace = true, features = ["tls", "tls-roots"] } [features] -default = [] -example = [] -manual = [] -ordered = [] -ica = [] -ics29-fee = [] -experimental = [] -mbt = [] -forward-packet = [] -ics31 = [] -clean-workers = [] -fee-grant = [] +default = [] +example = [] +manual = [] +ordered = [] +ica = [] +ics29-fee = [] +experimental = [] +mbt = [] +forward-packet = [] +ics31 = [] +clean-workers = [] +fee-grant = [] interchain-security = [] -celestia = [] -async-icq = [] -juno = [] -dynamic-gas-fee = [] +celestia = [] +async-icq = [] +juno = [] +dynamic-gas-fee = [] [[bin]] name = "test_setup_with_binary_channel" -doc = true +doc = true [dev-dependencies] -tempfile = "3.10.1" - -[dependencies.tendermint] -version = "0.34.0" - -[dependencies.tendermint-rpc] -version = "0.34.0" -features = ["http-client"] - -[dependencies.byte-unit] -version = "4.0.19" -default-features = false -features = ["serde"] \ No newline at end of file +tempfile = { workspace = true } diff --git a/tools/query-events/Cargo.lock b/tools/query-events/Cargo.lock new file mode 100644 index 0000000000..599a54f9b3 --- /dev/null +++ b/tools/query-events/Cargo.lock @@ -0,0 +1,2197 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.81" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" + +[[package]] +name = "async-trait" +version = "0.1.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.15.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +dependencies = [ + "serde", +] + +[[package]] +name = "cc" +version = "1.0.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "indexmap 1.9.3", + "once_cell", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek-ng" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core", + "subtle-ng", + "zeroize", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-consensus" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c8465edc8ee7436ffea81d21a019b16676ee3db267aa8d5a8d729581ecf998b" +dependencies = [ + "curve25519-dalek-ng", + "hex", + "rand_core", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" + +[[package]] +name = "encoding_rs" +version = "0.8.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "flex-error" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c606d892c9de11507fa0dcffc116434f94e105d0bbdc4e405b61519464c49d7b" +dependencies = [ + "eyre", + "paste", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "h2" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.2.5", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http", + "hyper", + "rustls", + "tokio", + "tokio-rustls", +] + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", +] + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.48.0", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "num-traits" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.9", + "libc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.48.5", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "peg" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "400bcab7d219c38abf8bd7cc2054eb9bbbd4312d66f6a5557d572a203f646f61" +dependencies = [ + "peg-macros", + "peg-runtime", +] + +[[package]] +name = "peg-macros" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46e61cce859b76d19090f62da50a9fe92bab7c2a5f09e183763559a2ac392c90" +dependencies = [ + "peg-runtime", + "proc-macro2", + "quote", +] + +[[package]] +name = "peg-runtime" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36bae92c60fa2398ce4678b98b2c4b5a7c61099961ca1fa305aec04a9ad28922" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "prost-types" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +dependencies = [ + "prost", +] + +[[package]] +name = "query-events" +version = "0.1.0" +dependencies = [ + "clap", + "futures", + "itertools 0.10.5", + "tendermint", + "tendermint-rpc", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags", +] + +[[package]] +name = "regex" +version = "1.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.6", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-rustls", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls", + "rustls-native-certs", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-rustls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "ryu" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" + +[[package]] +name = "serde" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_bytes" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.197" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "serde_json" +version = "1.0.114" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "signal-hook-registry" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" + +[[package]] +name = "socket2" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "subtle-encoding" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dcb1ed7b8330c5eed5441052651dd7a12c75e2ed88f2ec024ae1fa3a5e59945" +dependencies = [ + "zeroize", +] + +[[package]] +name = "subtle-ng" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tendermint" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15ab8f0a25d0d2ad49ac615da054d6a76aa6603ff95f7d18bafdd34450a1a04b" +dependencies = [ + "bytes", + "digest 0.10.7", + "ed25519", + "ed25519-consensus", + "flex-error", + "futures", + "num-traits", + "once_cell", + "prost", + "prost-types", + "serde", + "serde_bytes", + "serde_json", + "serde_repr", + "sha2 0.10.8", + "signature", + "subtle", + "subtle-encoding", + "tendermint-proto", + "time", + "zeroize", +] + +[[package]] +name = "tendermint-config" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1a02da769166e2052cd537b1a97c78017632c2d9e19266367b27e73910434fc" +dependencies = [ + "flex-error", + "serde", + "serde_json", + "tendermint", + "toml", + "url", +] + +[[package]] +name = "tendermint-proto" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b797dd3d2beaaee91d2f065e7bdf239dc8d80bba4a183a288bc1279dd5a69a1e" +dependencies = [ + "bytes", + "flex-error", + "num-derive", + "num-traits", + "prost", + "prost-types", + "serde", + "serde_bytes", + "subtle-encoding", + "time", +] + +[[package]] +name = "tendermint-rpc" +version = "0.34.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71afae8bb5f6b14ed48d4e1316a643b6c2c3cbad114f510be77b4ed20b7b3e42" +dependencies = [ + "async-trait", + "bytes", + "flex-error", + "futures", + "getrandom", + "peg", + "pin-project", + "rand", + "reqwest", + "semver", + "serde", + "serde_bytes", + "serde_json", + "subtle", + "subtle-encoding", + "tendermint", + "tendermint-config", + "tendermint-proto", + "thiserror", + "time", + "tokio", + "tracing", + "url", + "uuid", + "walkdir", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "textwrap" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" + +[[package]] +name = "thiserror" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +dependencies = [ + "deranged", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] + +[[package]] +name = "tracing-core" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "unicode-bidi" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "uuid" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.53", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "web-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.4", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +dependencies = [ + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.53", +] diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index b36199cbde..45e19e7b15 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -14,31 +14,31 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "=0.27.2", path = "../../crates/relayer-types" } -ibc-relayer = { version = "=0.27.2", path = "../../crates/relayer" } -ibc-relayer-cli = { version = "=1.8.2", path = "../../crates/relayer-cli" } -ibc-proto = { version = "0.42.0", features = ["serde"] } -tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } +ibc-relayer-types = { workspace = true } +ibc-relayer = { workspace = true } +ibc-relayer-cli = { workspace = true } +ibc-proto = { workspace = true, features = ["serde"] } +tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } -http = "0.2.9" -tokio = { version = "1.0", features = ["full"] } -tracing = "0.1.36" -tracing-subscriber = "0.3.14" -eyre = "0.6.12" -color-eyre = "0.6" -rand = "0.8.5" -hex = "0.4.3" -serde = "1.0" -serde_json = "1" -serde_yaml = "0.9.31" -itertools = "0.10" -toml = "0.8" -subtle-encoding = "0.5.1" -sha2 = "0.10.6" -crossbeam-channel = "0.5.11" -semver = "1.0.21" -flex-error = "0.4.4" -prost = { version = "0.12" } -tonic = { version = "0.10", features = ["tls", "tls-roots"] } -hdpath = "0.6.3" -once_cell = "1.19.0" +color-eyre = { workspace = true } +crossbeam-channel = { workspace = true } +eyre = { workspace = true } +flex-error = { workspace = true } +hdpath = { workspace = true } +hex = { workspace = true } +http = { workspace = true } +itertools = { workspace = true } +once_cell = { workspace = true } +prost = { workspace = true } +rand = { workspace = true } +semver = { workspace = true } +serde = { workspace = true } +serde_json = { workspace = true } +serde_yaml = { workspace = true } +sha2 = { workspace = true } +subtle-encoding = { workspace = true } +tokio = { workspace = true, features = ["full"] } +toml = { workspace = true } +tonic = { workspace = true, features = ["tls", "tls-roots"] } +tracing = { workspace = true } +tracing-subscriber = { workspace = true } From 0783023bc82042a6b98a89269d21a2e032a9dc4b Mon Sep 17 00:00:00 2001 From: Jayden Lee <41176085+tkxkd0159@users.noreply.github.com> Date: Fri, 22 Mar 2024 20:25:18 +0900 Subject: [PATCH 059/200] Set `compat_mode` for pull mode in `hermes listen` command (#3911) * set compat_mode for pull mode * add CHANGELOG --- .../ibc-relayer-cli/3910-fix-subscribe-bug.md | 2 ++ crates/relayer-cli/src/commands/listen.rs | 21 ++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer-cli/3910-fix-subscribe-bug.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3910-fix-subscribe-bug.md b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3910-fix-subscribe-bug.md new file mode 100644 index 0000000000..065ca533fe --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3910-fix-subscribe-bug.md @@ -0,0 +1,2 @@ +- Set `compat_mode` for pull mode in `hermes listen` command + ([\#3910](https://github.com/informalsystems/hermes/issues/3910)) \ No newline at end of file diff --git a/crates/relayer-cli/src/commands/listen.rs b/crates/relayer-cli/src/commands/listen.rs index bc9400b516..101a9ab9da 100644 --- a/crates/relayer-cli/src/commands/listen.rs +++ b/crates/relayer-cli/src/commands/listen.rs @@ -16,6 +16,7 @@ use tracing::{error, info, instrument}; use ibc_relayer::{ chain::handle::Subscription, config::{ChainConfig, EventSourceMode}, + error::Error, event::source::EventSource, util::compat_mode::compat_mode_from_version, }; @@ -159,13 +160,19 @@ fn subscribe( EventSourceMode::Pull { interval, max_retries, - } => EventSource::rpc( - chain_config.id().clone(), - HttpClient::new(config.rpc_addr.clone())?, - *interval, - *max_retries, - rt, - ), + } => { + let mut rpc_client = HttpClient::new(config.rpc_addr.clone()) + .map_err(|e| Error::rpc(config.rpc_addr.clone(), e))?; + rpc_client.set_compat_mode(compat_mode); + + EventSource::rpc( + chain_config.id().clone(), + rpc_client, + *interval, + *max_retries, + rt, + ) + } }?; thread::spawn(move || event_source.run()); From d223dd1ed30f3e1847d8256f6940c5030f4541e5 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Fri, 22 Mar 2024 12:26:51 +0100 Subject: [PATCH 060/200] Use constant backoff in handshake retry strategy (#3900) --- crates/relayer/src/channel.rs | 4 ++-- crates/relayer/src/connection.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/relayer/src/channel.rs b/crates/relayer/src/channel.rs index a2075baa78..ade8806fdf 100644 --- a/crates/relayer/src/channel.rs +++ b/crates/relayer/src/channel.rs @@ -55,13 +55,13 @@ pub mod channel_handshake_retry { /// Defines the increment in delay between subsequent retries. /// A value of `0` will make the retry delay constant. - const DELAY_INCREMENT: Duration = Duration::from_secs(1); + const DELAY_INCREMENT: Duration = Duration::from_secs(0); /// Maximum number of retries const MAX_RETRIES: u32 = 10; /// The default retry strategy. - /// We retry with a growing backoff strategy. The strategy is parametrized by the + /// We retry with a constant backoff strategy. The strategy is parametrized by the /// maximum block time expressed as a `Duration`. pub fn default_strategy(max_block_time: Duration) -> impl Iterator { let retry_delay = max_block_time / PER_BLOCK_RETRIES; diff --git a/crates/relayer/src/connection.rs b/crates/relayer/src/connection.rs index 5b3ce0c084..47b5620845 100644 --- a/crates/relayer/src/connection.rs +++ b/crates/relayer/src/connection.rs @@ -50,13 +50,13 @@ mod handshake_retry { /// Defines the increment in delay between subsequent retries. /// A value of `0` will make the retry delay constant. - const DELAY_INCREMENT: Duration = Duration::from_secs(1); + const DELAY_INCREMENT: Duration = Duration::from_secs(0); /// Maximum number of retries const MAX_RETRIES: u32 = 10; /// The default retry strategy. - /// We retry with a growing backoff strategy. The strategy is parametrized by the + /// We retry with a constant backoff strategy. The strategy is parametrized by the /// maximum block time expressed as a `Duration`. pub fn default_strategy(max_block_time: Duration) -> impl Iterator { let retry_delay = max_block_time / PER_BLOCK_RETRIES; From b0ddfebd604c9fc7c53f617d4f78c504fbec406d Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 25 Mar 2024 13:28:14 +0100 Subject: [PATCH 061/200] Add action to determine and check the MSRV (#3909) * Use actions-rust-lang action for setting up Rust * Add action to determine and check the MSRV * Update MSRV to 1.71.1 * Check MSRV on CI * Fix warning * Update cargo-doc nightly * Use latest cargo-msrv * Update guide/src/quick-start/pre-requisites.md Signed-off-by: Romain Ruetschi --------- Signed-off-by: Romain Ruetschi --- .github/workflows/cargo-doc.yaml | 6 ++-- .github/workflows/guide-templates.yaml | 3 +- .github/workflows/integration.yaml | 28 +++++------------ .github/workflows/misbehaviour.yml | 20 +++--------- .github/workflows/multi-chains.yaml | 4 +-- .github/workflows/publish-dry-run.yml | 3 +- .github/workflows/publish.yml | 3 +- .github/workflows/rust.yml | 31 ++++++++++++------- README.md | 6 ++-- clippy.toml | 2 +- crates/chain-registry/Cargo.toml | 2 +- crates/relayer-cli/Cargo.toml | 2 +- .../src/commands/query/packet/commitment.rs | 7 ----- crates/relayer-rest/Cargo.toml | 2 +- crates/relayer-rest/README.md | 4 +-- crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 2 +- crates/telemetry/Cargo.toml | 2 +- guide/src/quick-start/pre-requisites.md | 3 +- tools/integration-test/Cargo.toml | 2 +- 20 files changed, 50 insertions(+), 84 deletions(-) diff --git a/.github/workflows/cargo-doc.yaml b/.github/workflows/cargo-doc.yaml index 1cb9f346a6..8cf05b4045 100644 --- a/.github/workflows/cargo-doc.yaml +++ b/.github/workflows/cargo-doc.yaml @@ -26,11 +26,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-03-03 - override: true - + toolchain: nightly-2024-03-21 - name: Build API documentation uses: actions-rs/cargo@v1 env: diff --git a/.github/workflows/guide-templates.yaml b/.github/workflows/guide-templates.yaml index 1d558a86cc..9eefc0d3fc 100644 --- a/.github/workflows/guide-templates.yaml +++ b/.github/workflows/guide-templates.yaml @@ -28,10 +28,9 @@ jobs: timeout-minutes: 60 steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - name: Check templates run: bash scripts/auto_gen_templates.sh --mode "check" - uses: actions-rs/cargo@v1 diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index e28709b664..2acace2b36 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -109,11 +109,9 @@ jobs: extra-conf: | substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test @@ -145,11 +143,9 @@ jobs: extra-conf: | substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test @@ -186,11 +182,9 @@ jobs: extra-conf: | substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test @@ -229,11 +223,9 @@ jobs: extra-conf: | substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test @@ -272,11 +264,9 @@ jobs: extra-conf: | substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test @@ -316,11 +306,9 @@ jobs: extra-conf: | substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test @@ -355,11 +343,9 @@ jobs: extra-conf: | substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index c3adff0afc..38b4912d47 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -73,12 +73,9 @@ jobs: rename-to: stoml chmod: 0755 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - name: Use Rust cache - uses: Swatinem/rust-cache@v2 - name: Build Hermes uses: actions-rs/cargo@v1 with: @@ -124,12 +121,9 @@ jobs: rename-to: stoml chmod: 0755 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - name: Use Rust cache - uses: Swatinem/rust-cache@v2 - name: Build Hermes uses: actions-rs/cargo@v1 with: @@ -175,12 +169,9 @@ jobs: rename-to: stoml chmod: 0755 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - name: Use Rust cache - uses: Swatinem/rust-cache@v2 - name: Build Hermes uses: actions-rs/cargo@v1 with: @@ -227,12 +218,9 @@ jobs: rename-to: stoml chmod: 0755 - name: Install Rust - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - name: Use Rust cache - uses: Swatinem/rust-cache@v2 - name: Build Hermes uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index d65eac0591..5dca7548df 100644 --- a/.github/workflows/multi-chains.yaml +++ b/.github/workflows/multi-chains.yaml @@ -92,11 +92,9 @@ jobs: extra-conf: | substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/cargo@v1 with: command: test diff --git a/.github/workflows/publish-dry-run.yml b/.github/workflows/publish-dry-run.yml index 9689c0d1f0..2f22b4d851 100644 --- a/.github/workflows/publish-dry-run.yml +++ b/.github/workflows/publish-dry-run.yml @@ -11,10 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - uses: katyo/publish-crates@v2 with: dry-run: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 29b0e03d40..42106466c5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,10 +11,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - uses: katyo/publish-crates@v2 with: registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 49acf5017c..bc19b03142 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -38,10 +38,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - uses: actions-rs/cargo@v1 with: command: fmt @@ -51,12 +50,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable components: clippy - override: true - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/clippy-check@v1 with: name: clippy-all-features @@ -67,12 +64,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable components: clippy - override: true - - uses: Swatinem/rust-cache@v2 - uses: actions-rs/clippy-check@v1 with: name: clippy-no-default-features @@ -84,11 +79,9 @@ jobs: timeout-minutes: 30 steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - override: true - - uses: Swatinem/rust-cache@v2 - name: Install cargo-nextest run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin - uses: actions-rs/cargo@v1 @@ -100,13 +93,27 @@ jobs: command: nextest args: run --all-features --no-fail-fast --workspace --exclude ibc-integration-test --no-capture + msrv: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + - name: Install cargo-binstall + uses: taiki-e/install-action@cargo-binstall + - name: Install cargo-msrv + run: cargo binstall --no-confirm --force cargo-msrv@0.16.0-beta.20 + - name: Check MSRV + run: cargo msrv verify --output-format minimal --manifest-path crates/relayer-cli/Cargo.toml -- 'cargo check --all-features' + # test-coverage: # runs-on: ubuntu-latest # steps: # - uses: actions/checkout@v4 # with: # fetch-depth: 0 - # - uses: actions-rs/toolchain@v1 + # - uses: actions-rust-lang/setup-rust-toolchain@v1 # with: # toolchain: stable # override: true diff --git a/README.md b/README.md index 98adbc745a..883079cb00 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Integration tests][test-image]][test-link] [![Apache 2.0 Licensed][license-image]][license-link] ![Rust Stable][rustc-image] -![Rust 1.71+][rustc-version] +![Rust 1.71.1+][rustc-version] Rust implementation of an Inter-Blockchain Communication (IBC) relayer. @@ -48,7 +48,7 @@ The repository also includes [TLA+ specifications](docs/spec). ## Requirements -The crates in this project require Rust `1.71.0`. +The crates in this project require Rust `1.71.1`. ## Hermes Guide @@ -123,7 +123,7 @@ Unless required by applicable law or agreed to in writing, software distributed [license-image]: https://img.shields.io/badge/license-Apache_2.0-blue.svg [license-link]: https://github.com/informalsystems/hermes/blob/master/LICENSE [rustc-image]: https://img.shields.io/badge/rustc-stable-blue.svg -[rustc-version]: https://img.shields.io/badge/rustc-1.71+-blue.svg +[rustc-version]: https://img.shields.io/badge/rustc-1.71.1+-blue.svg [cosmos-shield]: https://img.shields.io/static/v1?label=&labelColor=1B1E36&color=1B1E36&message=cosmos%20ecosystem&style=for-the-badge&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAyNTAwIDI1MDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1MDAgMjUwMDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiM2RjczOTA7fQoJLnN0MXtmaWxsOiNCN0I5Qzg7fQo8L3N0eWxlPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTI1Mi42LDE1OS41Yy0xMzQuOSwwLTI0NC4zLDQ4OS40LTI0NC4zLDEwOTMuMXMxMDkuNCwxMDkzLjEsMjQ0LjMsMTA5My4xczI0NC4zLTQ4OS40LDI0NC4zLTEwOTMuMQoJUzEzODcuNSwxNTkuNSwxMjUyLjYsMTU5LjV6IE0xMjY5LjQsMjI4NGMtMTUuNCwyMC42LTMwLjksNS4xLTMwLjksNS4xYy02Mi4xLTcyLTkzLjItMjA1LjgtOTMuMi0yMDUuOAoJYy0xMDguNy0zNDkuOC04Mi44LTExMDAuOC04Mi44LTExMDAuOGM1MS4xLTU5Ni4yLDE0NC03MzcuMSwxNzUuNi03NjguNGM2LjctNi42LDE3LjEtNy40LDI0LjctMmM0NS45LDMyLjUsODQuNCwxNjguNSw4NC40LDE2OC41CgljMTEzLjYsNDIxLjgsMTAzLjMsODE3LjksMTAzLjMsODE3LjljMTAuMywzNDQuNy01Ni45LDczMC41LTU2LjksNzMwLjVDMTM0MS45LDIyMjIuMiwxMjY5LjQsMjI4NCwxMjY5LjQsMjI4NHoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTIyMDAuNyw3MDguNmMtNjcuMi0xMTcuMS01NDYuMSwzMS42LTEwNzAsMzMycy04OTMuNSw2MzguOS04MjYuMyw3NTUuOXM1NDYuMS0zMS42LDEwNzAtMzMyCglTMjI2Ny44LDgyNS42LDIyMDAuNyw3MDguNkwyMjAwLjcsNzA4LjZ6IE0zNjYuNCwxNzgwLjRjLTI1LjctMy4yLTE5LjktMjQuNC0xOS45LTI0LjRjMzEuNi04OS43LDEzMi0xODMuMiwxMzItMTgzLjIKCWMyNDkuNC0yNjguNCw5MTMuOC02MTkuNyw5MTMuOC02MTkuN2M1NDIuNS0yNTIuNCw3MTEuMS0yNDEuOCw3NTMuOC0yMzBjOS4xLDIuNSwxNSwxMS4yLDE0LDIwLjZjLTUuMSw1Ni0xMDQuMiwxNTctMTA0LjIsMTU3CgljLTMwOS4xLDMwOC42LTY1Ny44LDQ5Ni44LTY1Ny44LDQ5Ni44Yy0yOTMuOCwxODAuNS02NjEuOSwzMTQuMS02NjEuOSwzMTQuMUM0NTYsMTgxMi42LDM2Ni40LDE3ODAuNCwzNjYuNCwxNzgwLjRMMzY2LjQsMTc4MC40CglMMzY2LjQsMTc4MC40eiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjE5OC40LDE4MDAuNGM2Ny43LTExNi44LTMwMC45LTQ1Ni44LTgyMy03NTkuNVMzNzQuNCw1ODcuOCwzMDYuOCw3MDQuN3MzMDAuOSw0NTYuOCw4MjMuMyw3NTkuNQoJUzIxMzAuNywxOTE3LjQsMjE5OC40LDE4MDAuNHogTTM1MS42LDc0OS44Yy0xMC0yMy43LDExLjEtMjkuNCwxMS4xLTI5LjRjOTMuNS0xNy42LDIyNC43LDIyLjYsMjI0LjcsMjIuNgoJYzM1Ny4yLDgxLjMsOTk0LDQ4MC4yLDk5NCw0ODAuMmM0OTAuMywzNDMuMSw1NjUuNSw0OTQuMiw1NzYuOCw1MzcuMWMyLjQsOS4xLTIuMiwxOC42LTEwLjcsMjIuNGMtNTEuMSwyMy40LTE4OC4xLTExLjUtMTg4LjEtMTEuNQoJYy00MjIuMS0xMTMuMi03NTkuNi0zMjAuNS03NTkuNi0zMjAuNWMtMzAzLjMtMTYzLjYtNjAzLjItNDE1LjMtNjAzLjItNDE1LjNjLTIyNy45LTE5MS45LTI0NS0yODUuNC0yNDUtMjg1LjRMMzUxLjYsNzQ5Ljh6Ii8+CjxjaXJjbGUgY2xhc3M9InN0MSIgY3g9IjEyNTAiIGN5PSIxMjUwIiByPSIxMjguNiIvPgo8ZWxsaXBzZSBjbGFzcz0ic3QxIiBjeD0iMTc3Ny4zIiBjeT0iNzU2LjIiIHJ4PSI3NC42IiByeT0iNzcuMiIvPgo8ZWxsaXBzZSBjbGFzcz0ic3QxIiBjeD0iNTUzIiBjeT0iMTAxOC41IiByeD0iNzQuNiIgcnk9Ijc3LjIiLz4KPGVsbGlwc2UgY2xhc3M9InN0MSIgY3g9IjEwOTguMiIgY3k9IjE5NjUiIHJ4PSI3NC42IiByeT0iNzcuMiIvPgo8L3N2Zz4K [cosmos-link]: https://cosmos.network diff --git a/clippy.toml b/clippy.toml index 8f7dac5dc3..f634529786 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.71.0" +msrv = "1.71.1" diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index 76a160ca38..59e5ca1b4f 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -6,7 +6,7 @@ license = "Apache-2.0" keywords = ["cosmos", "ibc", "relayer", "chain", "registry"] repository = "https://github.com/informalsystems/hermes" authors = ["Informal Systems "] -rust-version = "1.71" +rust-version = "1.71.1" description = """ Service to fetch data from the chain-registry """ diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index 0648b8c889..da9deeb9f1 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -8,7 +8,7 @@ keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] homepage = "https://hermes.informal.systems/" repository = "https://github.com/informalsystems/hermes" authors = ["Informal Systems "] -rust-version = "1.71" +rust-version = "1.71.1" description = """ Hermes is an IBC Relayer written in Rust """ diff --git a/crates/relayer-cli/src/commands/query/packet/commitment.rs b/crates/relayer-cli/src/commands/query/packet/commitment.rs index 57a45282f1..4c4edd911b 100644 --- a/crates/relayer-cli/src/commands/query/packet/commitment.rs +++ b/crates/relayer-cli/src/commands/query/packet/commitment.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use serde::Serialize; use subtle_encoding::{Encoding, Hex}; use ibc_relayer::chain::handle::ChainHandle; @@ -13,12 +12,6 @@ use crate::conclude::{exit_with_unrecoverable_error, Output}; use crate::error::Error; use crate::prelude::*; -#[derive(Serialize, Debug)] -struct PacketSeqs { - height: Height, - seqs: Vec, -} - #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryPacketCommitmentCmd { #[clap( diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index 82480fcb4e..e5c6ae8364 100644 --- a/crates/relayer-rest/Cargo.toml +++ b/crates/relayer-rest/Cargo.toml @@ -8,7 +8,7 @@ readme = "README.md" keywords = ["ibc", "rest", "api", "cosmos", "tendermint"] homepage = "https://hermes.informal.systems/" repository = "https://github.com/informalsystems/hermes" -rust-version = "1.71" +rust-version = "1.71.1" description = """ Rust implementation of a RESTful API server for Hermes """ diff --git a/crates/relayer-rest/README.md b/crates/relayer-rest/README.md index ee66cb6870..82f3e7fd78 100644 --- a/crates/relayer-rest/README.md +++ b/crates/relayer-rest/README.md @@ -6,7 +6,7 @@ [![End to End testing][e2e-image]][e2e-link] [![Apache 2.0 Licensed][license-image]][license-link] ![Rust Stable][rustc-image] -![Rust 1.71+][rustc-version] +![Rust 1.71.1+][rustc-version] This is the repository for the IBC REST server for use in the Hermes IBC relayer. @@ -39,4 +39,4 @@ Unless required by applicable law or agreed to in writing, software distributed [license-image]: https://img.shields.io/badge/license-Apache2.0-blue.svg [license-link]: https://github.com/informalsystems/hermes/blob/master/LICENSE [rustc-image]: https://img.shields.io/badge/rustc-stable-blue.svg -[rustc-version]: https://img.shields.io/badge/rustc-1.71+-blue.svg +[rustc-version]: https://img.shields.io/badge/rustc-1.71.1+-blue.svg diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 58bc71f21d..fb09b6daf7 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] repository = "https://github.com/informalsystems/hermes" authors = ["Informal Systems "] -rust-version = "1.71" +rust-version = "1.71.1" description = """ Implementation of the Inter-Blockchain Communication Protocol (IBC). This crate comprises the main data structures and on-chain logic. diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 17d0bf9460..1bc3c3564a 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] repository = "https://github.com/informalsystems/hermes" authors = ["Informal Systems "] -rust-version = "1.71" +rust-version = "1.71.1" description = """ Implementation of an IBC Relayer in Rust, as a library """ diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index d1be584bd6..6fdd7830ec 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" keywords = ["cosmos", "ibc", "relayer", "telemetry"] repository = "https://github.com/informalsystems/hermes" authors = ["Informal Systems "] -rust-version = "1.71" +rust-version = "1.71.1" description = """ Telemetry service for the Hermes IBC relayer """ diff --git a/guide/src/quick-start/pre-requisites.md b/guide/src/quick-start/pre-requisites.md index aefafe2c18..fa430166d8 100644 --- a/guide/src/quick-start/pre-requisites.md +++ b/guide/src/quick-start/pre-requisites.md @@ -12,8 +12,7 @@ The provided instructions will install all the Rust tool chain including `rustc` ### Version requirements -Hermes is developed and tested using the latest version of Rust, `1.71` at -the moment. To check that your tool chain is up-to-date run: +Hermes is developed and tested using the latest stable version of Rust. To check that your tool chain is up-to-date run: ```shell rustc --version diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 11ab0d8961..2bf7cc2210 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -2,7 +2,7 @@ name = "ibc-integration-test" version = "0.27.2" edition = "2021" -rust-version = "1.71" +rust-version = "1.71.1" license = "Apache-2.0" readme = "README.md" keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] From 3b4ec699a810a19319dd96a297e8f8db8b2a6cca Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 25 Mar 2024 13:31:54 +0100 Subject: [PATCH 062/200] Revert "Build multi-platform image on macOS runner to speed up build (#3843)" (#3892) This reverts commit 7cfb234408da28961464d1634c4a556c38212e0d. --- .github/workflows/docker.yml | 92 ++++++++++++++++++++++++++++++------ 1 file changed, 77 insertions(+), 15 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5604786f18..bd2c49c0f2 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -13,9 +13,15 @@ env: jobs: docker-build: - runs-on: macos-14 + runs-on: ubuntu-latest strategy: fail-fast: false + matrix: + platform: + - id: linux/amd64 + name: amd64 + - id: linux/arm64 + name: arm64 steps: - name: Checkout uses: actions/checkout@v4 @@ -30,11 +36,12 @@ jobs: type=ref,event=branch type=semver,pattern={{version}} + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx id: buildx uses: docker/setup-buildx-action@v3 - with: - platforms: linux/amd64,linux/arm64 - name: Login to Docker Hub uses: docker/login-action@v3 @@ -42,27 +49,82 @@ jobs: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build and push + - name: Build and push by digest id: build uses: docker/build-push-action@v5 with: context: . file: ./ci/release/hermes.Dockerfile - platforms: linux/amd64,linux/arm64 - push: true + platforms: ${{ matrix.platform.id }} + labels: ${{ steps.meta.outputs.labels }} + outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true cache-from: type=gha cache-to: type=gha,mode=max + + - name: Export digest + run: | + mkdir -p /tmp/digests + digest="${{ steps.build.outputs.digest }}" + touch "/tmp/digests/${digest#sha256:}" + + - name: Upload digest + uses: actions/upload-artifact@v4 + with: + name: digests-${{ matrix.platform.name }} + path: /tmp/digests/* + if-no-files-found: error + retention-days: 1 + + docker-merge: + runs-on: ubuntu-latest + needs: + - docker-build + steps: + - name: Download digests + uses: actions/download-artifact@v4 + with: + pattern: digests-* + merge-multiple: true + path: /tmp/digests + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY_IMAGE }} tags: | - ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} - ghcr.io/${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} + type=ref,event=tag + type=ref,event=branch + type=semver,pattern={{version}} + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Create manifest list and push + working-directory: /tmp/digests + run: | + docker buildx imagetools create --tag ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} \ + $(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *) - name: Inspect image run: | docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Push image to GHCR + run: | + docker buildx imagetools create \ + --tag ghcr.io/${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} \ + ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }} From d7e0cb70841c62e842a1b7e617c50a1ae6063b93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 10:26:10 +0100 Subject: [PATCH 063/200] Bump crossbeam-channel from 0.5.11 to 0.5.12 (#3918) Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.11 to 0.5.12. - [Release notes](https://github.com/crossbeam-rs/crossbeam/releases) - [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md) - [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.11...crossbeam-channel-0.5.12) --- updated-dependencies: - dependency-name: crossbeam-channel dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c6d8ab5bc..964753a0fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -642,9 +642,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ "crossbeam-utils 0.8.19", ] @@ -1509,7 +1509,7 @@ dependencies = [ "bs58", "byte-unit", "bytes", - "crossbeam-channel 0.5.11", + "crossbeam-channel 0.5.12", "digest 0.10.7", "dirs-next", "ed25519", @@ -1576,7 +1576,7 @@ dependencies = [ "clap_complete", "color-eyre", "console", - "crossbeam-channel 0.5.11", + "crossbeam-channel 0.5.12", "dialoguer", "dirs-next", "eyre", @@ -1613,7 +1613,7 @@ name = "ibc-relayer-rest" version = "0.27.2" dependencies = [ "axum", - "crossbeam-channel 0.5.11", + "crossbeam-channel 0.5.12", "ibc-relayer", "ibc-relayer-types", "reqwest", @@ -1678,7 +1678,7 @@ name = "ibc-test-framework" version = "0.27.2" dependencies = [ "color-eyre", - "crossbeam-channel 0.5.11", + "crossbeam-channel 0.5.12", "eyre", "flex-error", "hdpath", @@ -1950,7 +1950,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1911e88d5831f748a4097a43862d129e3c6fca831eecac9b8db6d01d93c9de2" dependencies = [ - "crossbeam-channel 0.5.11", + "crossbeam-channel 0.5.12", "crossbeam-epoch", "crossbeam-utils 0.8.19", "once_cell", @@ -2120,7 +2120,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b3a2a91fdbfdd4d212c0dcc2ab540de2c2bcbbd90be17de7a7daf8822d010c1" dependencies = [ "async-trait", - "crossbeam-channel 0.5.11", + "crossbeam-channel 0.5.12", "dashmap", "fnv", "futures-channel", diff --git a/Cargo.toml b/Cargo.toml index 2a6adc1fc9..669cd37012 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,7 +53,7 @@ clap = "3.2" clap_complete = "3.2" color-eyre = "0.6" console = "0.15.5" -crossbeam-channel = "0.5.11" +crossbeam-channel = "0.5.12" dashmap = "5.4.0" derive_more = { version = "0.99.17", default-features = false } dialoguer = "0.11.0" From a1fa6ee97de324a289a97ef0744e3158ac3b95f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 10:26:22 +0100 Subject: [PATCH 064/200] Bump async-trait from 0.1.77 to 0.1.79 (#3919) Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.77 to 0.1.79. - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.77...0.1.79) --- updated-dependencies: - dependency-name: async-trait dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 964753a0fa..c6da6dd639 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -161,9 +161,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 669cd37012..6b3ebd3300 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ tendermint-testgen = "0.34.0" abscissa_core = "=0.6.0" anyhow = "1.0" async-stream = "0.3.5" -async-trait = "0.1.72" +async-trait = "0.1.79" axum = "0.6.18" bech32 = "0.9.1" bitcoin = "0.31.1" From a1c43609f3d99b47999e84803d12b42175508c30 Mon Sep 17 00:00:00 2001 From: Adi Seredinschi Date: Tue, 26 Mar 2024 11:28:35 +0100 Subject: [PATCH 065/200] Update release-template.md to consistently notify comms team (#3908) Trying to find a way for the marketing/comms team to get early notification, consistently, that a new release will happen. @romac or Luca (not tagging b/c of holidays) if you prefer other approaches then happy to go with something else. Signed-off-by: Adi Seredinschi --- .github/ISSUE_TEMPLATE/release-template.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/release-template.md b/.github/ISSUE_TEMPLATE/release-template.md index b0904f59e9..960b3364ab 100644 --- a/.github/ISSUE_TEMPLATE/release-template.md +++ b/.github/ISSUE_TEMPLATE/release-template.md @@ -20,4 +20,4 @@ v without deliberation - [ ] Create a new release in the changelog, using [`unclog`](https://github.com/informalsystems/unclog) - If doing a release candidate (`rc`) version, then skip the `unclog release` step - [ ] Reassign unfinished issues of previous milestone to the next milestone -- [ ] Notify the comms team about the pending new release and [prepare a message](https://www.notion.so/informalsystems/Communications-pipeline-b8c0eeb71dc24203a048fa6ccf189e1a?pvs=4) to announce it +- [ ] Notify the comms team about the pending new release by tagging [@isa-belch](https://github.com/isa-belch) as a reviewer here From ff9e2dfc7eb7c16cf03e528e8dcca3bd5f6af458 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Wed, 27 Mar 2024 19:26:57 +0100 Subject: [PATCH 066/200] Use pull event source when generating configuration with `hermes config auto` (#3920) * Use pull event source when generating configuration with `hermes config auto` * Add changelog entry --- .../ibc-relayer-cli/3913-config-auto-pull.md | 2 + crates/chain-registry/src/error.rs | 2 +- crates/chain-registry/src/querier.rs | 49 ++++++------------- crates/relayer-cli/src/chain_registry.rs | 26 +++++----- .../relayer-cli/src/commands/config/auto.rs | 10 +++- crates/relayer/src/config.rs | 2 +- 6 files changed, 39 insertions(+), 52 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer-cli/3913-config-auto-pull.md diff --git a/.changelog/unreleased/improvements/ibc-relayer-cli/3913-config-auto-pull.md b/.changelog/unreleased/improvements/ibc-relayer-cli/3913-config-auto-pull.md new file mode 100644 index 0000000000..c19c7f34d6 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer-cli/3913-config-auto-pull.md @@ -0,0 +1,2 @@ +- Use RPC (pull) event source instead of WebSocket (push) when generating configuration with `hermes config auto` + ([\#3913](https://github.com/informalsystems/hermes/issues/3913)) diff --git a/crates/chain-registry/src/error.rs b/crates/chain-registry/src/error.rs index e64f3d267c..01ccf6af39 100644 --- a/crates/chain-registry/src/error.rs +++ b/crates/chain-registry/src/error.rs @@ -74,7 +74,7 @@ define_error! { .iter() .join(", "); - format!("Error finding a healthy endpoint after {} retries. Endpoints: {endpoints}", e.retries) + format!("Did not find a healthy endpoint after {} retries. Endpoints: {endpoints}", e.retries) }, UriParseError diff --git a/crates/chain-registry/src/querier.rs b/crates/chain-registry/src/querier.rs index ac5a2c385c..3102011f16 100644 --- a/crates/chain-registry/src/querier.rs +++ b/crates/chain-registry/src/querier.rs @@ -8,15 +8,14 @@ use std::str::FromStr; use async_trait::async_trait; use futures::{stream::FuturesUnordered, StreamExt}; use http::Uri; -use tokio::time::timeout; -use tokio::time::Duration; +use tendermint_rpc::HttpClient; +use tendermint_rpc::HttpClientUrl; use tracing::{debug, info}; use ibc_proto::cosmos::bank::v1beta1::query_client::QueryClient; -use tendermint_rpc::{Client, SubscriptionClient, Url, WebSocketClient}; +use tendermint_rpc::{Client, Url}; use crate::error::RegistryError; -use crate::formatter::{SimpleWebSocketFormatter, UriFormatter}; /// `QueryTypes` represents the basic types required to query a node pub trait QueryTypes { @@ -73,8 +72,8 @@ pub trait QueryContext: QueryTypes { // ----------------- RPC ------------------ -/// `SimpleHermesRpcQuerier` retrieves `HermesConfigData` by querying a list of RPC endpoints through their WebSocket API -/// and returns the result of the first endpoint to answer. +/// `SimpleHermesRpcQuerier` retrieves `HermesConfigData` by querying a list of RPC endpoints +/// through their RPC API and returns the result of the first endpoint to answer. pub struct SimpleHermesRpcQuerier; /// Data which must be retrieved from RPC endpoints for Hermes @@ -82,7 +81,6 @@ pub struct SimpleHermesRpcQuerier; pub struct HermesConfigData { pub rpc_address: Url, pub max_block_size: u64, - pub websocket: Url, // max_block_time should also be retrieved from the RPC // however it looks like it is not in the genesis file anymore } @@ -101,46 +99,31 @@ impl QueryContext for SimpleHermesRpcQuerier { RegistryError::no_healthy_rpc(chain_name) } - /// Convert the RPC url to a WebSocket url, query the endpoint, return the data from the RPC. - async fn query(rpc: Self::QueryInput) -> Result { - let websocket_addr = SimpleWebSocketFormatter::parse_or_build_address(rpc.as_str())?; + /// Query the endpoint, return the data from the RPC. + async fn query(rpc_url: Self::QueryInput) -> Result { + info!("Querying RPC server at {rpc_url}"); - info!("Querying WebSocket server at {websocket_addr}"); + let url = HttpClientUrl::from_str(&rpc_url) + .map_err(|e| RegistryError::tendermint_url_parse_error(rpc_url.clone(), e))?; - let (client, driver) = timeout( - Duration::from_secs(5), - WebSocketClient::new(websocket_addr.clone()), - ) - .await - .map_err(|e| RegistryError::websocket_time_out_error(websocket_addr.to_string(), e))? - .map_err(|e| RegistryError::websocket_connect_error(websocket_addr.to_string(), e))?; - - let driver_handle = tokio::spawn(driver.run()); + let client = HttpClient::builder(url) + .build() + .map_err(|e| RegistryError::rpc_connect_error(rpc_url.clone(), e))?; let latest_consensus_params = match client.latest_consensus_params().await { Ok(response) => response.consensus_params.block.max_bytes, Err(e) => { return Err(RegistryError::rpc_consensus_params_error( - websocket_addr.to_string(), + rpc_url.to_string(), e, )) } }; - client.close().map_err(|e| { - RegistryError::websocket_conn_close_error(websocket_addr.to_string(), e) - })?; - - driver_handle - .await - .map_err(|e| RegistryError::join_error("chain_data_join".to_string(), e))? - .map_err(|e| RegistryError::websocket_driver_error(websocket_addr.to_string(), e))?; - Ok(HermesConfigData { - rpc_address: Url::from_str(&rpc) - .map_err(|e| RegistryError::tendermint_url_parse_error(rpc, e))?, + rpc_address: Url::from_str(&rpc_url) + .map_err(|e| RegistryError::tendermint_url_parse_error(rpc_url, e))?, max_block_size: latest_consensus_params, - websocket: websocket_addr, }) } } diff --git a/crates/relayer-cli/src/chain_registry.rs b/crates/relayer-cli/src/chain_registry.rs index 9745312194..a0152b0af2 100644 --- a/crates/relayer-cli/src/chain_registry.rs +++ b/crates/relayer-cli/src/chain_registry.rs @@ -109,11 +109,6 @@ where ) .await?; - let websocket_address = - rpc_data.websocket.clone().try_into().map_err(|e| { - RegistryError::websocket_url_parse_error(rpc_data.websocket.to_string(), e) - })?; - let avg_gas_price = if let Some(fee_token) = chain_data.fees.fee_tokens.first() { fee_token.average_gas_price } else { @@ -131,9 +126,9 @@ where id: chain_data.chain_id, rpc_addr: rpc_data.rpc_address, grpc_addr: grpc_address, - event_source: EventSourceMode::Push { - url: websocket_address, - batch_delay: default::batch_delay(), + event_source: EventSourceMode::Pull { + interval: default::poll_interval(), + max_retries: default::max_retries(), }, rpc_timeout: default::rpc_timeout(), trusted_node: default::trusted_node(), @@ -191,6 +186,7 @@ where for i in 0..retries { let query_response = QuerierType::query_healthy(chain_name.to_string(), endpoints.clone()).await; + match query_response { Ok(r) => { return Ok(r); @@ -200,13 +196,13 @@ where } } } - Err(RegistryError::unhealthy_endpoints( - endpoints - .iter() - .map(|endpoint| endpoint.to_string()) - .collect(), - retries, - )) + + let endpoints = endpoints + .iter() + .map(|endpoint| endpoint.to_string()) + .collect(); + + Err(RegistryError::unhealthy_endpoints(endpoints, retries)) } /// Fetches the specified resources from the Cosmos chain registry, using the specified commit hash diff --git a/crates/relayer-cli/src/commands/config/auto.rs b/crates/relayer-cli/src/commands/config/auto.rs index 3c866ec304..dde3742428 100644 --- a/crates/relayer-cli/src/commands/config/auto.rs +++ b/crates/relayer-cli/src/commands/config/auto.rs @@ -9,7 +9,7 @@ use ibc_relayer::config::{store, ChainConfig, Config}; use std::collections::HashSet; use std::path::PathBuf; -use tracing::{info, warn}; +use tracing::{error, info, warn}; fn find_key(chain_config: &ChainConfig) -> Option { let keys = chain_config.list_keys().ok()?; @@ -115,7 +115,13 @@ impl Runnable for AutoCmd { let mut chain_configs: Vec<(String, ChainConfig)> = config_results .unwrap() .into_iter() - .filter_map(|(name, config)| config.ok().map(|c| (name, c))) + .filter_map(|(name, config)| match config { + Ok(config) => Some((name, config)), + Err(e) => { + error!("Failed to generate chain config for chain '{name}': {e}"); + None + } + }) .collect(); // Determine which chains were not fetched diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index d1ed7c14c0..973a0d400a 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -175,7 +175,7 @@ pub mod default { } pub fn poll_interval() -> Duration { - Duration::from_secs(1) + Duration::from_millis(500) } pub fn max_retries() -> u32 { From 07f40597a7f2007d61484b1c3d97e86db0c0059b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 07:21:28 +0000 Subject: [PATCH 067/200] Bump color-eyre from 0.6.2 to 0.6.3 (#3926) --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c6da6dd639..1da170219a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -538,9 +538,9 @@ dependencies = [ [[package]] name = "color-eyre" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204" +checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" dependencies = [ "backtrace", "color-spantrace", From d3fc891843786d0b755e3d9d893366d22e9a49fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 07:23:24 +0000 Subject: [PATCH 068/200] Bump regex from 1.10.3 to 1.10.4 (#3925) --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1da170219a..40626dfd93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2475,9 +2475,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 6b3ebd3300..85a36aa084 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,7 +86,7 @@ primitive-types = { version = "0.12.1", default-features = false } prometheus = "0.13.2" prost = "0.12" rand = "0.8.5" -regex = "1.9.5" +regex = "1.10.4" reqwest = { version = "0.11.16", default-features = false } retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" From 23a2d00cd4d9ae160427b5b9a3fad1d7c6fe73b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 07:35:45 +0000 Subject: [PATCH 069/200] Bump bs58 from 0.5.0 to 0.5.1 (#3924) --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 40626dfd93..994e4fc389 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -386,9 +386,9 @@ dependencies = [ [[package]] name = "bs58" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ "tinyvec", ] diff --git a/Cargo.toml b/Cargo.toml index 85a36aa084..a70329d920 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,7 @@ async-trait = "0.1.79" axum = "0.6.18" bech32 = "0.9.1" bitcoin = "0.31.1" -bs58 = "0.5.0" +bs58 = "0.5.1" byte-unit = { version = "4.0.19", default-features = false } bytes = "1.4.0" clap = "3.2" From cf17704d31521716d5cf6e93cc00e786b67a28b0 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 2 Apr 2024 09:56:45 +0200 Subject: [PATCH 070/200] Remove `telemetry` and `rest-server` feature flags (#3878) * Enable telemetry unconditionally and remove `telemetry` feature flag * Formatting * Add changelog entry * Remove `rest-server` feature flag * Update changelog entry --------- Signed-off-by: Romain Ruetschi --- .../3878-remove-telemetry-flag.md | 3 ++ crates/relayer-cli/Cargo.toml | 11 ++------ crates/relayer-cli/src/commands/start.rs | 28 ------------------- crates/relayer/Cargo.toml | 3 +- crates/relayer/src/chain/cosmos/estimate.rs | 1 - crates/relayer/src/link/relay_path.rs | 4 --- crates/relayer/src/supervisor.rs | 1 - crates/relayer/src/telemetry.rs | 11 -------- crates/relayer/src/worker/map.rs | 1 - crates/relayer/src/worker/packet.rs | 5 ---- 10 files changed, 6 insertions(+), 62 deletions(-) create mode 100644 .changelog/unreleased/breaking-changes/ibc-telemetry/3878-remove-telemetry-flag.md diff --git a/.changelog/unreleased/breaking-changes/ibc-telemetry/3878-remove-telemetry-flag.md b/.changelog/unreleased/breaking-changes/ibc-telemetry/3878-remove-telemetry-flag.md new file mode 100644 index 0000000000..4f0d3f5646 --- /dev/null +++ b/.changelog/unreleased/breaking-changes/ibc-telemetry/3878-remove-telemetry-flag.md @@ -0,0 +1,3 @@ +- Remove the `telemetry` and `rest-server` feature flags, ensuring Hermes is always built with telemetry and REST support. + Both servers can still be disabled in the configuration file, by setting `telemtry.enabled = false` and `rest.enabled = false`, respectively. + ([\#3878](https://github.com/informalsystems/hermes/pull/3878)) diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index da9deeb9f1..ebc2941fa2 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -17,18 +17,11 @@ default-run = "hermes" [[bin]] name = "hermes" -[features] -default = ["telemetry", "rest-server", "std", "eyre_tracer"] -std = ["flex-error/std"] -eyre_tracer = ["flex-error/eyre_tracer"] -telemetry = ["ibc-relayer/telemetry", "ibc-telemetry"] -rest-server = ["ibc-relayer-rest"] - [dependencies] ibc-relayer-types = { workspace = true } ibc-relayer = { workspace = true } -ibc-telemetry = { workspace = true, optional = true } -ibc-relayer-rest = { workspace = true, optional = true } +ibc-telemetry = { workspace = true } +ibc-relayer-rest = { workspace = true } ibc-chain-registry = { workspace = true } abscissa_core = { workspace = true, features = ["options"] } diff --git a/crates/relayer-cli/src/commands/start.rs b/crates/relayer-cli/src/commands/start.rs index a102e66c0c..cc9c9193f7 100644 --- a/crates/relayer-cli/src/commands/start.rs +++ b/crates/relayer-cli/src/commands/start.rs @@ -131,7 +131,6 @@ fn register_signals(tx_cmd: Sender) -> Result<(), io::Error> { Ok(()) } -#[cfg(feature = "rest-server")] fn spawn_rest_server(config: &Config) -> Option { use ibc_relayer::util::spawn_blocking; @@ -169,23 +168,6 @@ fn spawn_rest_server(config: &Config) -> Option { Some(rx) } -#[cfg(not(feature = "rest-server"))] -fn spawn_rest_server(config: &Config) -> Option { - let rest = config.rest.clone(); - - if rest.enabled { - warn!( - "REST server enabled in the config but Hermes was built without REST support, \ - build Hermes with --features=rest-server to enable REST support." - ); - - None - } else { - None - } -} - -#[cfg(feature = "telemetry")] fn spawn_telemetry_server(config: &Config) { use ibc_relayer::util::spawn_blocking; @@ -220,16 +202,6 @@ fn spawn_telemetry_server(config: &Config) { }); } -#[cfg(not(feature = "telemetry"))] -fn spawn_telemetry_server(config: &Config) { - if config.telemetry.enabled { - warn!( - "telemetry enabled in the config but Hermes was built without telemetry support, \ - build Hermes with --features=telemetry to enable telemetry support." - ); - } -} - fn make_supervisor( config: Config, options: SupervisorOptions, diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 1bc3c3564a..f338761093 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -17,11 +17,10 @@ all-features = true [features] default = ["flex-error/std", "flex-error/eyre_tracer"] -telemetry = ["ibc-telemetry"] [dependencies] ibc-proto = { workspace = true, features = ["serde"] } -ibc-telemetry = { workspace = true, optional = true } +ibc-telemetry = { workspace = true } ibc-relayer-types = { workspace = true, features = ["clock"] } anyhow = { workspace = true } diff --git a/crates/relayer/src/chain/cosmos/estimate.rs b/crates/relayer/src/chain/cosmos/estimate.rs index dff1a5cdff..e68ea86b2b 100644 --- a/crates/relayer/src/chain/cosmos/estimate.rs +++ b/crates/relayer/src/chain/cosmos/estimate.rs @@ -212,7 +212,6 @@ fn can_recover_from_simulation_failure(e: &Error) -> bool { } } -#[cfg(feature = "telemetry")] fn get_error_text(e: &Error) -> String { use crate::error::ErrorDetail::*; diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index a1372b8bbf..511ecc383b 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -1845,7 +1845,6 @@ impl RelayPath { } // we need fully qualified ChainId to avoid unneeded imports warnings - #[cfg(feature = "telemetry")] fn target_info( &self, target: OperationalDataTarget, @@ -1871,7 +1870,6 @@ impl RelayPath { } } - #[cfg(feature = "telemetry")] fn backlog_update(&self, event: &IbcEvent) { match event { IbcEvent::SendPacket(send_packet_ev) => { @@ -1905,7 +1903,6 @@ impl RelayPath { } } - #[cfg(feature = "telemetry")] fn record_cleared_send_packet(&self, event_with_height: &IbcEventWithHeight) { if let IbcEvent::SendPacket(send_packet_ev) = &event_with_height.event { ibc_telemetry::global().send_packet_events( @@ -1927,7 +1924,6 @@ impl RelayPath { } } - #[cfg(feature = "telemetry")] fn record_cleared_acknowledgments<'a>( &self, events_with_heights: impl Iterator, diff --git a/crates/relayer/src/supervisor.rs b/crates/relayer/src/supervisor.rs index cab6f55c82..53661e7007 100644 --- a/crates/relayer/src/supervisor.rs +++ b/crates/relayer/src/supervisor.rs @@ -848,7 +848,6 @@ fn process_batch( /// So successfully sending a packet from chain A to chain B will result in first a SendPacket /// event with `chain_id = A` and `counterparty_chain_id = B` and then a WriteAcknowlegment /// event with `chain_id = B` and `counterparty_chain_id = A`. -#[cfg(feature = "telemetry")] fn send_telemetry( src: &Src, dst: &Dst, diff --git a/crates/relayer/src/telemetry.rs b/crates/relayer/src/telemetry.rs index 0734ee454b..bc8bc77ae6 100644 --- a/crates/relayer/src/telemetry.rs +++ b/crates/relayer/src/telemetry.rs @@ -1,15 +1,6 @@ // If the `telemetry` feature is enabled, re-export the `ibc-telemetry` state. -#[cfg(feature = "telemetry")] pub type Telemetry = alloc::sync::Arc; -// Otherwise, define and export a dummy type. -#[cfg(not(feature = "telemetry"))] -#[derive(Clone, Debug)] -pub struct TelemetryDisabled; - -#[cfg(not(feature = "telemetry"))] -pub type Telemetry = TelemetryDisabled; - /// A macro to send metric updates via a telemetry handle, /// only if the `telemetry` feature is enabled. /// Otherwise, it compiles to a no-op. @@ -32,7 +23,6 @@ pub type Telemetry = TelemetryDisabled; #[macro_export] macro_rules! telemetry { ($id:ident, $($args:expr),* $(,)*) => { - #[cfg(feature = "telemetry")] #[allow(unused_imports, unused_variables)] { use ::ibc_telemetry::state::WorkerType; @@ -42,7 +32,6 @@ macro_rules! telemetry { }; ($e:expr) => { - #[cfg(feature = "telemetry")] #[allow(unused_imports, unused_variables)] { use ::ibc_telemetry::state::WorkerType; diff --git a/crates/relayer/src/worker/map.rs b/crates/relayer/src/worker/map.rs index c5305f52cb..eb498c8f69 100644 --- a/crates/relayer/src/worker/map.rs +++ b/crates/relayer/src/worker/map.rs @@ -252,7 +252,6 @@ impl Drop for WorkerMap { } } -#[cfg(feature = "telemetry")] fn metric_type(o: &Object) -> ibc_telemetry::state::WorkerType { use ibc_telemetry::state::WorkerType; diff --git a/crates/relayer/src/worker/packet.rs b/crates/relayer/src/worker/packet.rs index 841b6ada98..98fe15c3e3 100644 --- a/crates/relayer/src/worker/packet.rs +++ b/crates/relayer/src/worker/packet.rs @@ -484,10 +484,8 @@ fn lowest_sequence(events: &[IbcEventWithHeight]) -> Option { .min() } -#[cfg(feature = "telemetry")] use crate::link::RelaySummary; -#[cfg(feature = "telemetry")] fn packet_metrics( path: &Packet, summary: &RelaySummary, @@ -499,7 +497,6 @@ fn packet_metrics( timeout_metrics(path, summary, dst_channel, dst_port); } -#[cfg(feature = "telemetry")] fn receive_packet_metrics( path: &Packet, summary: &RelaySummary, @@ -526,7 +523,6 @@ fn receive_packet_metrics( ); } -#[cfg(feature = "telemetry")] fn acknowledgment_metrics( path: &Packet, summary: &RelaySummary, @@ -553,7 +549,6 @@ fn acknowledgment_metrics( ); } -#[cfg(feature = "telemetry")] fn timeout_metrics( path: &Packet, summary: &RelaySummary, From 5e4955443a1f73d59665246d069cfaca5ec067c3 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 2 Apr 2024 09:57:00 +0200 Subject: [PATCH 071/200] Use `packet_ack_hex` event attribute instead of deprecated `packet_ack` attribute to decode `WriteAck` event (#3922) * Use `packet_ack_hex` event attribute instead of deprecated `packet_ack` attribute * Add changelog entry --- .../improvements/ibc-relayer/3921-packet-ack-hex.md | 2 ++ crates/relayer-types/src/core/ics04_channel/error.rs | 8 ++++++++ crates/relayer-types/src/core/ics04_channel/events.rs | 2 +- crates/relayer-types/src/events.rs | 4 ++++ crates/relayer/src/chain/cosmos/types/events/channel.rs | 7 +++++-- crates/relayer/src/event.rs | 3 ++- 6 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/3921-packet-ack-hex.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/3921-packet-ack-hex.md b/.changelog/unreleased/improvements/ibc-relayer/3921-packet-ack-hex.md new file mode 100644 index 0000000000..cd0f2c0aed --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/3921-packet-ack-hex.md @@ -0,0 +1,2 @@ +- Use `packet_ack_hex` event attribute instead of deprecated `packet_ack` attribute to decode `WriteAck` event + ([\#3921](https://github.com/informalsystems/hermes/issues/3921)) diff --git a/crates/relayer-types/src/core/ics04_channel/error.rs b/crates/relayer-types/src/core/ics04_channel/error.rs index 49fe8c77e9..659ee07d6c 100644 --- a/crates/relayer-types/src/core/ics04_channel/error.rs +++ b/crates/relayer-types/src/core/ics04_channel/error.rs @@ -199,6 +199,14 @@ define_error! { format_args!("Invalid packet data, not a valid hex-encoded string: {}", e.data) }, + InvalidPacketAck + { + ack: String, + } + | e | { + format_args!("Invalid packet ack, not a valid hex-encoded string: {}", e.ack) + }, + LowPacketHeight { chain_height: Height, diff --git a/crates/relayer-types/src/core/ics04_channel/events.rs b/crates/relayer-types/src/core/ics04_channel/events.rs index 24dd66dceb..bf8452f8e2 100644 --- a/crates/relayer-types/src/core/ics04_channel/events.rs +++ b/crates/relayer-types/src/core/ics04_channel/events.rs @@ -29,7 +29,7 @@ pub const PKT_DST_PORT_ATTRIBUTE_KEY: &str = "packet_dst_port"; pub const PKT_DST_CHANNEL_ATTRIBUTE_KEY: &str = "packet_dst_channel"; pub const PKT_TIMEOUT_HEIGHT_ATTRIBUTE_KEY: &str = "packet_timeout_height"; pub const PKT_TIMEOUT_TIMESTAMP_ATTRIBUTE_KEY: &str = "packet_timeout_timestamp"; -pub const PKT_ACK_ATTRIBUTE_KEY: &str = "packet_ack"; +pub const PKT_ACK_ATTRIBUTE_KEY: &str = "packet_ack_hex"; #[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)] pub struct Attributes { diff --git a/crates/relayer-types/src/events.rs b/crates/relayer-types/src/events.rs index 3ec1892eb1..c5de3355c7 100644 --- a/crates/relayer-types/src/events.rs +++ b/crates/relayer-types/src/events.rs @@ -69,6 +69,10 @@ define_error! { { data: String } | e | { format_args!("error decoding hex-encoded packet data: {}", e.data) }, + InvalidPacketAck + { ack: String } + | e | { format_args!("error decoding hex-encoded packet ack: {}", e.ack) }, + MissingActionString | _ | { "missing action string" }, diff --git a/crates/relayer/src/chain/cosmos/types/events/channel.rs b/crates/relayer/src/chain/cosmos/types/events/channel.rs index 442d73a21d..6844900ba9 100644 --- a/crates/relayer/src/chain/cosmos/types/events/channel.rs +++ b/crates/relayer/src/chain/cosmos/types/events/channel.rs @@ -85,8 +85,11 @@ impl TryFrom> for WriteAcknowledgement { type Error = EventError; fn try_from(obj: RawObject<'_>) -> Result { - let ack = extract_attribute(&obj, &format!("{}.{}", obj.action, PKT_ACK_ATTRIBUTE_KEY))? - .into_bytes(); + let ack_str = + extract_attribute(&obj, &format!("{}.{}", obj.action, PKT_ACK_ATTRIBUTE_KEY))?; + + let ack = hex::decode(ack_str.to_lowercase()) + .map_err(|_| EventError::invalid_packet_ack(ack_str))?; let packet = Packet::try_from(obj)?; diff --git a/crates/relayer/src/event.rs b/crates/relayer/src/event.rs index bf58338eb7..d9c19f5da1 100644 --- a/crates/relayer/src/event.rs +++ b/crates/relayer/src/event.rs @@ -438,7 +438,8 @@ pub fn extract_packet_and_write_ack_from_tx( .map_err(|_| ChannelError::invalid_packet_data(value.to_string()))?; } channel_events::PKT_ACK_ATTRIBUTE_KEY => { - write_ack = Vec::from(value.as_bytes()); + write_ack = hex::decode(value.to_lowercase()) + .map_err(|_| ChannelError::invalid_packet_ack(value.to_string()))?; } _ => {} } From ccd45d643739cabfc240d000567e63fd4b8d0cf7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Apr 2024 11:47:25 +0200 Subject: [PATCH 072/200] Bump reqwest from 0.11.23 to 0.11.27 (#3923) Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.23 to 0.11.27. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.23...v0.11.27) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 5 +++-- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 994e4fc389..fbde8e6b8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2519,9 +2519,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64", "bytes", @@ -2546,6 +2546,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-rustls", diff --git a/Cargo.toml b/Cargo.toml index a70329d920..06928aa369 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,7 +87,7 @@ prometheus = "0.13.2" prost = "0.12" rand = "0.8.5" regex = "1.10.4" -reqwest = { version = "0.11.16", default-features = false } +reqwest = { version = "0.11.27", default-features = false } retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" secp256k1 = "0.28.2" From 04361f2a496f8bfcaf6bbddf033b513fa59e7fcc Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 8 Apr 2024 12:18:39 +0200 Subject: [PATCH 073/200] Switch Nix cache to Cachix (#3932) --- .github/workflows/integration.yaml | 56 +++++++++++++++++++++-------- .github/workflows/misbehaviour.yml | 32 ++++++++++++----- .github/workflows/multi-chains.yaml | 8 +++-- 3 files changed, 72 insertions(+), 24 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 2acace2b36..bbea3de5b5 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -107,8 +107,12 @@ jobs: uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= + substituters = https://cache.nixos.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Install Cachix + uses: cachix/cachix-action@v14 + with: + name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable @@ -141,8 +145,12 @@ jobs: uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= + substituters = https://cache.nixos.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Install Cachix + uses: cachix/cachix-action@v14 + with: + name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable @@ -180,8 +188,12 @@ jobs: uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= + substituters = https://cache.nixos.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Install Cachix + uses: cachix/cachix-action@v14 + with: + name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable @@ -221,8 +233,12 @@ jobs: uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= + substituters = https://cache.nixos.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Install Cachix + uses: cachix/cachix-action@v14 + with: + name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable @@ -262,8 +278,12 @@ jobs: uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= + substituters = https://cache.nixos.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Install Cachix + uses: cachix/cachix-action@v14 + with: + name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable @@ -304,8 +324,12 @@ jobs: uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= + substituters = https://cache.nixos.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Install Cachix + uses: cachix/cachix-action@v14 + with: + name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable @@ -341,8 +365,12 @@ jobs: uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= + substituters = https://cache.nixos.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Install Cachix + uses: cachix/cachix-action@v14 + with: + name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index 38b4912d47..f9f9d9f635 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -52,8 +52,12 @@ jobs: uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= + substituters = https://cache.nixos.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Install Cachix + uses: cachix/cachix-action@v14 + with: + name: cosmos-nix - name: Install sconfig uses: jaxxstorm/action-install-gh-release@v1.11.0 with: @@ -100,8 +104,12 @@ jobs: uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= + substituters = https://cache.nixos.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Install Cachix + uses: cachix/cachix-action@v14 + with: + name: cosmos-nix - name: Install sconfig uses: jaxxstorm/action-install-gh-release@v1.11.0 with: @@ -148,8 +156,12 @@ jobs: uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= + substituters = https://cache.nixos.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Install Cachix + uses: cachix/cachix-action@v14 + with: + name: cosmos-nix - name: Install sconfig uses: jaxxstorm/action-install-gh-release@v1.11.0 with: @@ -197,8 +209,12 @@ jobs: uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= + substituters = https://cache.nixos.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Install Cachix + uses: cachix/cachix-action@v14 + with: + name: cosmos-nix - name: Install sconfig uses: jaxxstorm/action-install-gh-release@v1.11.0 with: diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index 5dca7548df..013ab5c915 100644 --- a/.github/workflows/multi-chains.yaml +++ b/.github/workflows/multi-chains.yaml @@ -90,8 +90,12 @@ jobs: uses: DeterminateSystems/nix-installer-action@main with: extra-conf: | - substituters = https://cache.nixos.org https://cosmosnix-store.s3.us-east-2.amazonaws.com - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= cosmosnix.store-1:O28HneR1MPtgY3WYruWFuXCimRPwY7em5s0iynkQxdk= + substituters = https://cache.nixos.org + trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= + - name: Install Cachix + uses: cachix/cachix-action@v14 + with: + name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable From 6a3212a908a929437431fb243a2ef6894aaa24f3 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 8 Apr 2024 16:21:08 +0200 Subject: [PATCH 074/200] Update nix flake (#3933) --- flake.lock | 376 +++++++++++++++++++++++++++++------------------------ 1 file changed, 208 insertions(+), 168 deletions(-) diff --git a/flake.lock b/flake.lock index d676a39d15..abf4702b70 100644 --- a/flake.lock +++ b/flake.lock @@ -3,7 +3,6 @@ "akash-src": { "flake": false, "locked": { - "lastModified": 1648485085, "narHash": "sha256-33FPy0dn6QuqneEqZYkFoCRm9agG7PE+9C/pYH9Gwx4=", "owner": "ovrclk", "repo": "akash", @@ -20,7 +19,6 @@ "andromeda-src": { "flake": false, "locked": { - "lastModified": 1699913909, "narHash": "sha256-8nKekKLBZR7nDNXZ1UL0J7YOMRv6HbzT7pj0W+fV+4U=", "owner": "andromedaprotocol", "repo": "andromedad", @@ -37,7 +35,6 @@ "apalache-src": { "flake": false, "locked": { - "lastModified": 1692625213, "narHash": "sha256-Z/tmBMv+QshFJLo2kBgBdkqfKwF93CgURVIbYF3dwJE=", "owner": "informalsystems", "repo": "apalache", @@ -54,24 +51,22 @@ "beaker-src": { "flake": false, "locked": { - "lastModified": 1686823358, - "narHash": "sha256-bQiN5Q7RV4Uupc7rk1rGurRvCTy+5EiiB4p3bHct7M0=", + "narHash": "sha256-ZLDuTwB8PG0rMiDcLRxCf/xuoFowgK+aat9mSZVp+Dw=", "owner": "osmosis-labs", "repo": "beaker", - "rev": "f3c7a9fc6886aa2b4e0d259f70058d6c23c225e5", + "rev": "fc046f8fe9d8baecdd76404b57b31f5a4e100301", "type": "github" }, "original": { "owner": "osmosis-labs", - "ref": "v0.1.6", + "ref": "v0.1.8", "repo": "beaker", "type": "github" } }, - "celestia-src": { + "celestia-app-src": { "flake": false, "locked": { - "lastModified": 1700494564, "narHash": "sha256-O6KrCStrZLmWy3xybQUNsWEb3O7vIRCFDE9MsEtsFro=", "owner": "celestiaorg", "repo": "celestia-app", @@ -85,27 +80,25 @@ "type": "github" } }, - "centauri-src": { + "celestia-node-src": { "flake": false, "locked": { - "lastModified": 1701431373, - "narHash": "sha256-EpZ1CQN0gMU8W1u3CMbqlaHeeVpQO2i1GPg6pOyOQTc=", - "owner": "ComposableFi", - "repo": "composable-cosmos", - "rev": "387c96b434db9d96b0506aa7f14536d9bdec968c", + "narHash": "sha256-O5a8Dy7WOSaLzYHTZAZFHFeJwqOLyajcHmGEcphOpKg=", + "owner": "celestiaorg", + "repo": "celestia-node", + "rev": "e55e1c88708b46839867bcbbed9bcdd8a3ffa830", "type": "github" }, "original": { - "owner": "ComposableFi", - "repo": "composable-cosmos", - "rev": "387c96b434db9d96b0506aa7f14536d9bdec968c", + "owner": "celestiaorg", + "ref": "v0.13.0", + "repo": "celestia-node", "type": "github" } }, "cometbft-src": { "flake": false, "locked": { - "lastModified": 1694550324, "narHash": "sha256-G5gchJMn/BFzwYx8/ikPDL5fS/TuFIBF4DKJbkalp/M=", "owner": "cometbft", "repo": "cometbft", @@ -119,20 +112,38 @@ "type": "github" } }, + "composable-cosmos-src": { + "flake": false, + "locked": { + "lastModified": 1710970443, + "narHash": "sha256-7h+vLGFxj2QvcTfXgHqS3pfnYzIzyf8DhO7adJKRe8c=", + "owner": "ComposableFi", + "repo": "composable-cosmos", + "rev": "a76ebd371059b778aa3e9799366b09e8453f114b", + "type": "github" + }, + "original": { + "owner": "ComposableFi", + "ref": "v6.4.88", + "repo": "composable-cosmos", + "type": "github" + } + }, "cosmos-nix": { "inputs": { "akash-src": "akash-src", "andromeda-src": "andromeda-src", "apalache-src": "apalache-src", "beaker-src": "beaker-src", - "celestia-src": "celestia-src", - "centauri-src": "centauri-src", + "celestia-app-src": "celestia-app-src", + "celestia-node-src": "celestia-node-src", "cometbft-src": "cometbft-src", + "composable-cosmos-src": "composable-cosmos-src", "cosmos-sdk-src": "cosmos-sdk-src", "cosmwasm-src": "cosmwasm-src", - "crescent-src": "crescent-src", "cw-plus-src": "cw-plus-src", "dydx-src": "dydx-src", + "dymension-src": "dymension-src", "evmos-src": "evmos-src", "flake-parts": "flake-parts", "gaia-main-src": "gaia-main-src", @@ -170,11 +181,13 @@ "namada-src": "namada-src", "neutron-src": "neutron-src", "nix-std": "nix-std", + "nix2container": "nix2container", "nixpkgs": "nixpkgs_3", "osmosis-src": "osmosis-src", "provenance-src": "provenance-src", "regen-src": "regen-src", "relayer-src": "relayer-src", + "rollapp-evm-src": "rollapp-evm-src", "rust-overlay": "rust-overlay", "sbt-derivation": "sbt-derivation", "sconfig-src": "sconfig-src", @@ -193,16 +206,18 @@ "wasmvm_1_1_2-src": "wasmvm_1_1_2-src", "wasmvm_1_2_3-src": "wasmvm_1_2_3-src", "wasmvm_1_2_4-src": "wasmvm_1_2_4-src", + "wasmvm_1_2_6-src": "wasmvm_1_2_6-src", "wasmvm_1_3_0-src": "wasmvm_1_3_0-src", "wasmvm_1_5_0-src": "wasmvm_1_5_0-src", + "wasmvm_1_5_2-src": "wasmvm_1_5_2-src", "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" }, "locked": { - "lastModified": 1710159227, - "narHash": "sha256-YtGtc7e4xIou6fD2r0xAzgEbIgrklYoT8YQnDObqBgU=", + "lastModified": 1712575879, + "narHash": "sha256-GYXUqApWtdkEYW50rRPaVCcEXEkMS/JE1UVacQCgRdg=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "3d922c4bc02a5433aa2a9343268a58790c631349", + "rev": "2555dd09ad8c2b69281baf30aeb561dd506766f2", "type": "github" }, "original": { @@ -214,7 +229,6 @@ "cosmos-sdk-src": { "flake": false, "locked": { - "lastModified": 1658846655, "narHash": "sha256-Xs83vbgt4+YH2LRJx7692nIjRBr5QCYoUHI17njsjlw=", "owner": "cosmos", "repo": "cosmos-sdk", @@ -231,41 +245,22 @@ "cosmwasm-src": { "flake": false, "locked": { - "lastModified": 1698745412, - "narHash": "sha256-41s5jLFzw9Jo+dirAVOad1dtUqCBY6rIz/6TRc0frMw=", + "narHash": "sha256-F+INGtJZj272HZkj/lUPlskNqAPe9x5itNYXCQsezkA=", "owner": "CosmWasm", "repo": "cosmwasm", - "rev": "89891f0bb2de2c83d00600208695d0d5e1b617ac", + "rev": "3c33a0a5dfa5d1c30f474011c77117ec3bf4dc04", "type": "github" }, "original": { "owner": "CosmWasm", - "ref": "v1.5.0", + "ref": "v1.5.3", "repo": "cosmwasm", "type": "github" } }, - "crescent-src": { - "flake": false, - "locked": { - "lastModified": 1647869429, - "narHash": "sha256-c1xiTB/HgtQJSwD3ccFQIoSHPbJK6rf1nSjnM3r0oCE=", - "owner": "crescent-network", - "repo": "crescent", - "rev": "01980cfd06b06786109eaba78c154e6db1adc3d6", - "type": "github" - }, - "original": { - "owner": "crescent-network", - "ref": "v1.0.0-rc3", - "repo": "crescent", - "type": "github" - } - }, "cw-plus-src": { "flake": false, "locked": { - "lastModified": 1700757493, "narHash": "sha256-E5vkY+B4BDoTDtvuB+7Tm3k/5dCYPSjUujMWcgYsWf0=", "owner": "CosmWasm", "repo": "cw-plus", @@ -291,7 +286,6 @@ "pre-commit-hooks": "pre-commit-hooks" }, "locked": { - "lastModified": 1700127701, "narHash": "sha256-NLvhvXBmX+WuqDN9PbRbQCsA+y57yGaf+jCWuJVdaIQ=", "owner": "cachix", "repo": "devenv", @@ -307,7 +301,6 @@ "dydx-src": { "flake": false, "locked": { - "lastModified": 1702405483, "narHash": "sha256-NiC+Nol8Cye0z/U5cgQ+zhvlbDJX6DouaMo8oYsRGDQ=", "owner": "dydxprotocol", "repo": "v4-chain", @@ -321,10 +314,25 @@ "type": "github" } }, + "dymension-src": { + "flake": false, + "locked": { + "narHash": "sha256-K1F0kL4/HVxOJvXNvLJsZUFXS3MyuqrUotyyd5u6QTQ=", + "owner": "dymensionxyz", + "repo": "dymension", + "rev": "c3294dc8d2dce1aa8efbc967b1dfd3b0e965b095", + "type": "github" + }, + "original": { + "owner": "dymensionxyz", + "ref": "v3.0.0", + "repo": "dymension", + "type": "github" + } + }, "evmos-src": { "flake": false, "locked": { - "lastModified": 1702504794, "narHash": "sha256-ECXXQ0hx/MXascMP6aXf880zts/dNPpQM9jOCIHTLZQ=", "owner": "evmos", "repo": "evmos", @@ -341,7 +349,6 @@ "flake-compat": { "flake": false, "locked": { - "lastModified": 1673956053, "narHash": "sha256-4gtG9iQuiKITOjNQQeQIpoIB6b16fm+504Ch3sNKLd8=", "owner": "edolstra", "repo": "flake-compat", @@ -359,7 +366,6 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1701473968, "narHash": "sha256-YcVE5emp1qQ8ieHUnxt1wCZCC3ZfAS+SRRWZ2TMda7E=", "owner": "hercules-ci", "repo": "flake-parts", @@ -377,7 +383,6 @@ "systems": "systems" }, "locked": { - "lastModified": 1694529238, "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", @@ -395,7 +400,6 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1685518550, "narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=", "owner": "numtide", "repo": "flake-utils", @@ -413,7 +417,6 @@ "systems": "systems_3" }, "locked": { - "lastModified": 1694529238, "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", @@ -431,11 +434,11 @@ "systems": "systems_4" }, "locked": { - "lastModified": 1681202837, - "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "lastModified": 1694529238, + "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", - "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "type": "github" }, "original": { @@ -445,8 +448,25 @@ } }, "flake-utils_5": { + "inputs": { + "systems": "systems_5" + }, + "locked": { + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_6": { "locked": { - "lastModified": 1667395993, "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", "owner": "numtide", "repo": "flake-utils", @@ -459,9 +479,9 @@ "type": "github" } }, - "flake-utils_6": { + "flake-utils_7": { "inputs": { - "systems": "systems_5" + "systems": "systems_6" }, "locked": { "lastModified": 1710146030, @@ -480,7 +500,6 @@ "gaia-main-src": { "flake": false, "locked": { - "lastModified": 1702388853, "narHash": "sha256-1O8ncSd0mUNEUHSTi2U9d21Dv1yszQKohjp/AS6IxcU=", "owner": "cosmos", "repo": "gaia", @@ -496,7 +515,6 @@ "gaia10-src": { "flake": false, "locked": { - "lastModified": 1688401730, "narHash": "sha256-F72AxDI1OdleE8If5s4HJbORqMsDVsdEO5q7nrK07E8=", "owner": "cosmos", "repo": "gaia", @@ -513,7 +531,6 @@ "gaia11-src": { "flake": false, "locked": { - "lastModified": 1690464504, "narHash": "sha256-bIegGSPDdDRbznfgsrojsGCwCPSesNknpffTFskc7fE=", "owner": "cosmos", "repo": "gaia", @@ -530,7 +547,6 @@ "gaia12-src": { "flake": false, "locked": { - "lastModified": 1692870038, "narHash": "sha256-KqpkazhGGQWzvHiiwCiE7ciA8+L2t2HgxN8270zuGd0=", "owner": "cosmos", "repo": "gaia", @@ -547,7 +563,6 @@ "gaia13-src": { "flake": false, "locked": { - "lastModified": 1699370179, "narHash": "sha256-bvJ33JL1Fr7ilnnYEjrjnbS/dbFkyhZ2uq6u39CeTa0=", "owner": "cosmos", "repo": "gaia", @@ -564,7 +579,6 @@ "gaia14-src": { "flake": false, "locked": { - "lastModified": 1700067649, "narHash": "sha256-7AnaIy/SElf/Uj2xTbHzLSgPY68SgQqqJZ2BPmt6czo=", "owner": "cosmos", "repo": "gaia", @@ -581,7 +595,6 @@ "gaia5-src": { "flake": false, "locked": { - "lastModified": 1634231239, "narHash": "sha256-NfR9GRBNBlm5hB3lFea+Vlf4dkapZIZg0sZuyOX2cn8=", "owner": "cosmos", "repo": "gaia", @@ -598,7 +611,6 @@ "gaia6-ordered-src": { "flake": false, "locked": { - "lastModified": 1648034337, "narHash": "sha256-yw3WUCLRvn46xlWAnk6nBmvc3T91aryvBcOOfJ2ocPA=", "owner": "informalsystems", "repo": "gaia", @@ -615,7 +627,6 @@ "gaia6-src": { "flake": false, "locked": { - "lastModified": 1646904235, "narHash": "sha256-JdD0DTdMo05ggGvpHN5hugEEtGA0/WQ4bhbryDlfGXo=", "owner": "cosmos", "repo": "gaia", @@ -632,7 +643,6 @@ "gaia7-src": { "flake": false, "locked": { - "lastModified": 1665762684, "narHash": "sha256-hsDqDASwTPIb1BGOqa9nu4C5Y5q3hBoXYhkAFY7B9Cs=", "owner": "cosmos", "repo": "gaia", @@ -649,7 +659,6 @@ "gaia8-src": { "flake": false, "locked": { - "lastModified": 1676667875, "narHash": "sha256-8XPcJRQEQDtTbGFg0pWexkNdWESn1FoKvz4T2Z8UPDw=", "owner": "cosmos", "repo": "gaia", @@ -666,7 +675,6 @@ "gaia9-src": { "flake": false, "locked": { - "lastModified": 1681924944, "narHash": "sha256-UIM6yfqs1yZZ2BO/bBB43pPYSW1IzaYsk2f500tDYzA=", "owner": "cosmos", "repo": "gaia", @@ -683,7 +691,6 @@ "gex-src": { "flake": false, "locked": { - "lastModified": 1697704475, "narHash": "sha256-lgJVxn7Q2I8TBdvbzyn7bl1MN5StEw3NvRzCvBFFuB8=", "owner": "cosmos", "repo": "gex", @@ -708,7 +715,6 @@ ] }, "locked": { - "lastModified": 1660459072, "narHash": "sha256-8DFJjXG8zqoONA1vXtgeKXy68KdJL5UaXR8NtVMUbx8=", "owner": "hercules-ci", "repo": "gitignore.nix", @@ -727,7 +733,6 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1702956934, "narHash": "sha256-f1NuMA2mZ3Chw2CjlUkRAzNgDw0TYyj1i5YZJRByDdo=", "owner": "JonathanLorimer", "repo": "gomod2nix", @@ -755,7 +760,6 @@ ] }, "locked": { - "lastModified": 1705314449, "narHash": "sha256-yfQQ67dLejP0FLK76LKHbkzcQqNIrux6MFe32MMFGNQ=", "owner": "nix-community", "repo": "gomod2nix", @@ -778,7 +782,6 @@ "nixpkgs-unstable": "nixpkgs-unstable" }, "locked": { - "lastModified": 1707232493, "narHash": "sha256-pXbLGvq6ZyZbtKYoe8GbgaxGV0SIbARrT6DkDmPwlYE=", "owner": "haqq-network", "repo": "haqq", @@ -795,7 +798,6 @@ "hermes-src": { "flake": false, "locked": { - "lastModified": 1702629809, "narHash": "sha256-JTZMp4By/pGsMdKzfi4H1LQS1RKYQHBq5NEju5ADX/s=", "owner": "informalsystems", "repo": "hermes", @@ -812,7 +814,6 @@ "ibc-go-v2-src": { "flake": false, "locked": { - "lastModified": 1663274791, "narHash": "sha256-LuJvlXmGRyJAiM6+uk+NuamjIsEqMqF20twBmB0p8+k=", "owner": "cosmos", "repo": "ibc-go", @@ -829,7 +830,6 @@ "ibc-go-v3-src": { "flake": false, "locked": { - "lastModified": 1663683283, "narHash": "sha256-Er24B1unLYR/gG4JSrV+vZ/cPD6t7OFvtqp7AJCtDSE=", "owner": "cosmos", "repo": "ibc-go", @@ -846,16 +846,16 @@ "ibc-go-v4-src": { "flake": false, "locked": { - "lastModified": 1667809128, - "narHash": "sha256-R1/AH6laXdaMftgwnV4t/pL3QoKnZ1UaBGoqOipOvQI=", + "lastModified": 1712304740, + "narHash": "sha256-CNv3uBCALT21ZczOmXcQaavOy7KsR0VTBahw5DrvO4w=", "owner": "cosmos", "repo": "ibc-go", - "rev": "ecb845d5e43f53decf48f8ed88c7847a9a4375cb", + "rev": "5480cf7fac99882a8833ddb7c95e8b4820ab7d4f", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v4.2.0", + "ref": "v4.6.0", "repo": "ibc-go", "type": "github" } @@ -863,16 +863,16 @@ "ibc-go-v5-src": { "flake": false, "locked": { - "lastModified": 1668024626, - "narHash": "sha256-+Z78PyGODLr2Y5G8evubsoQE3tyUcxCHJDsLXKTmdlI=", + "lastModified": 1712304845, + "narHash": "sha256-CE6Nv6U3Jqn4c+5JB/rek9LHD+AXEnkS0FVJYz4/uSc=", "owner": "cosmos", "repo": "ibc-go", - "rev": "c0acd5bd1778f2b7ecdf593006f56bd3e273bd49", + "rev": "40cacfe075947f21520b014294f1f7948e4eda7c", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v5.1.0", + "ref": "v5.4.0", "repo": "ibc-go", "type": "github" } @@ -880,16 +880,16 @@ "ibc-go-v6-src": { "flake": false, "locked": { - "lastModified": 1671525236, - "narHash": "sha256-V8kUNwgNfx1tZJazlnaTF6wBb7ztueh1KrAGgiP8hCM=", + "lastModified": 1712318519, + "narHash": "sha256-roRXZEOJIFJiXEQ+a71QdMmqoVJKVk2wvPgHJ9r/mQ8=", "owner": "cosmos", "repo": "ibc-go", - "rev": "d34cef7e075dda1a24a0a3e9b6d3eff406cc606c", + "rev": "8e31269c692d87ac65bfe70cf609925975a57203", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v6.1.0", + "ref": "v6.3.0", "repo": "ibc-go", "type": "github" } @@ -897,16 +897,16 @@ "ibc-go-v7-src": { "flake": false, "locked": { - "lastModified": 1693509694, - "narHash": "sha256-umh/ckDALt0ugXwN8glcaCkGfAQvXY7S3Jd95Do2XeA=", + "lastModified": 1712318559, + "narHash": "sha256-uYiUNXLD48v3vRGK6/aQ7z7Ed5hY8VnEBGG/3Uv87Nc=", "owner": "cosmos", "repo": "ibc-go", - "rev": "c75650a1a037a9fecba5a9005df380f707520ff7", + "rev": "802ca265dba74a293747e1ccb8b7999aa985af19", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v7.3.0", + "ref": "v7.4.0", "repo": "ibc-go", "type": "github" } @@ -914,16 +914,16 @@ "ibc-go-v8-src": { "flake": false, "locked": { - "lastModified": 1706691043, - "narHash": "sha256-eS+X4bT7vp1+LyIPd0mOnAJahAONr+Syton3v3rSkGI=", + "lastModified": 1712305073, + "narHash": "sha256-J/tuv2U6cW+y51gUi4aXzR39lJD/8J/36lf7h2242sU=", "owner": "cosmos", "repo": "ibc-go", - "rev": "7e01c9149149b9d4b1d871e58eb88a22f15bdb3c", + "rev": "a2f3d7a78d21641178043341de96c3ecf06fa47b", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v8.1.0", + "ref": "v8.2.0", "repo": "ibc-go", "type": "github" } @@ -931,7 +931,6 @@ "ibc-rs-src": { "flake": false, "locked": { - "lastModified": 1661171856, "narHash": "sha256-M9KsPQdvyTArDe3sTi29+gfs69KHtpoNYLgI7IHYo9U=", "owner": "informalsystems", "repo": "ibc-rs", @@ -948,7 +947,6 @@ "ica-src": { "flake": false, "locked": { - "lastModified": 1695202199, "narHash": "sha256-8RwZSnqqZzVjQsSMTckNhmTy3VYyubVmgE/hU6ntq9M=", "owner": "cosmos", "repo": "interchain-accounts-demo", @@ -981,7 +979,6 @@ "injective-src": { "flake": false, "locked": { - "lastModified": 1706041278, "narHash": "sha256-Vr/l8/wtZ47wi1OTWhsfLetKZH8c1fUFeoQaxF+QS3c=", "owner": "OpenDeFiFoundation", "repo": "injective-core", @@ -998,7 +995,6 @@ "interchain-security-src": { "flake": false, "locked": { - "lastModified": 1700577019, "narHash": "sha256-adBzn51PKoRsCL9gIzC5Tcqmu7u3GjxTcDj2jpZ/da8=", "owner": "cosmos", "repo": "interchain-security", @@ -1015,7 +1011,6 @@ "iris-src": { "flake": false, "locked": { - "lastModified": 1618986686, "narHash": "sha256-1nPJOuYeGjzBYFCS0IiC5j9TJd5KVa9IL0kROks328E=", "owner": "irisnet", "repo": "irishub", @@ -1032,7 +1027,6 @@ "ixo-src": { "flake": false, "locked": { - "lastModified": 1645476442, "narHash": "sha256-Ewp9UyoH6z7YGrcXVpYJveRvDq02c1mNZj2hzlOoW8s=", "owner": "ixofoundation", "repo": "ixo-blockchain", @@ -1049,7 +1043,6 @@ "juno-src": { "flake": false, "locked": { - "lastModified": 1697166503, "narHash": "sha256-z9TOeDyUnn1T8Z662XqQJ9ydVIKKB54YISt7ms4xvos=", "owner": "CosmosContracts", "repo": "juno", @@ -1066,7 +1059,6 @@ "lowdown-src": { "flake": false, "locked": { - "lastModified": 1633514407, "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", "owner": "kristapsdz", "repo": "lowdown", @@ -1082,7 +1074,6 @@ "migaloo-src": { "flake": false, "locked": { - "lastModified": 1699273936, "narHash": "sha256-O+vGWFnV3+bvXinxl1QjVyDnQskp5H1VnlL+TaMfiSs=", "owner": "White-Whale-Defi-Platform", "repo": "migaloo-chain", @@ -1099,7 +1090,6 @@ "namada-src": { "flake": false, "locked": { - "lastModified": 1702488720, "narHash": "sha256-WyIVffqszY3rz3ClQJlpDaexLGQk8pVK+Y3k/D9Lvxg=", "owner": "anoma", "repo": "namada", @@ -1116,7 +1106,6 @@ "neutron-src": { "flake": false, "locked": { - "lastModified": 1701174344, "narHash": "sha256-NuoOlrciBeL2f/A7wlQBqYlYJhSYucXRhLgxdasfyhI=", "owner": "neutron-org", "repo": "neutron", @@ -1142,7 +1131,6 @@ "nixpkgs-regression": "nixpkgs-regression" }, "locked": { - "lastModified": 1676545802, "narHash": "sha256-EK4rZ+Hd5hsvXnzSzk2ikhStJnD63odF7SzsQ8CuSPU=", "owner": "domenkozar", "repo": "nix", @@ -1158,11 +1146,11 @@ }, "nix-std": { "locked": { - "lastModified": 1701658249, - "narHash": "sha256-KIt1TUuBvldhaVRta010MI5FeQlB8WadjqljybjesN0=", + "lastModified": 1710870712, + "narHash": "sha256-e+7MJF2gsgTBuOWv4mCimSP0D9+naeFSw9a7N3yEmv4=", "owner": "chessai", "repo": "nix-std", - "rev": "715db541ffff4194620e48d210b76f73a74b5b5d", + "rev": "31bbc925750cc9d8f828fe55cee1a2bd985e0c00", "type": "github" }, "original": { @@ -1171,9 +1159,30 @@ "type": "github" } }, + "nix2container": { + "inputs": { + "flake-utils": "flake-utils_4", + "nixpkgs": [ + "cosmos-nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1708764364, + "narHash": "sha256-+pOtDvmuVTg0Gi58hKDUyrNla5NbyUvt3Xs3gLR0Fws=", + "owner": "nlewo", + "repo": "nix2container", + "rev": "c891f90d2e3c48a6b33466c96e4851e0fc0cf455", + "type": "github" + }, + "original": { + "owner": "nlewo", + "repo": "nix2container", + "type": "github" + } + }, "nixpkgs": { "locked": { - "lastModified": 1702272962, "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=", "owner": "nixos", "repo": "nixpkgs", @@ -1190,7 +1199,6 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1701253981, "narHash": "sha256-ztaDIyZ7HrTAfEEUt9AtTDNoCYxUdSd6NrRHaYOIxtk=", "owner": "NixOS", "repo": "nixpkgs", @@ -1207,7 +1215,6 @@ }, "nixpkgs-regression": { "locked": { - "lastModified": 1643052045, "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", "owner": "NixOS", "repo": "nixpkgs", @@ -1223,7 +1230,6 @@ }, "nixpkgs-stable": { "locked": { - "lastModified": 1685801374, "narHash": "sha256-otaSUoFEMM+LjBI1XL/xGB5ao6IwnZOXc47qhIgJe8U=", "owner": "NixOS", "repo": "nixpkgs", @@ -1239,7 +1245,6 @@ }, "nixpkgs-unstable": { "locked": { - "lastModified": 1707092692, "narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=", "owner": "NixOS", "repo": "nixpkgs", @@ -1255,7 +1260,6 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1707091808, "narHash": "sha256-LahKBAfGbY836gtpVNnWwBTIzN7yf/uYM/S0g393r0Y=", "rev": "9f2ee8c91ac42da3ae6c6a1d21555f283458247e", "revCount": 555392, @@ -1269,7 +1273,6 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1706683685, "narHash": "sha256-FtPPshEpxH/ewBOsdKBNhlsL2MLEFv1hEnQ19f/bFsQ=", "owner": "nixos", "repo": "nixpkgs", @@ -1285,11 +1288,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1681358109, - "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", + "lastModified": 1706487304, + "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9", + "rev": "90f456026d284c22b3e3497be980b2e47d0b28ac", "type": "github" }, "original": { @@ -1301,7 +1304,6 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1674990008, "narHash": "sha256-4zOyp+hFW2Y7imxIpZqZGT8CEqKmDjwgfD6BzRUE0mQ=", "owner": "NixOS", "repo": "nixpkgs", @@ -1317,11 +1319,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1710222005, - "narHash": "sha256-irXySffHz7b82dZIme6peyAu+8tTJr1zyxcfUPhqUrg=", + "lastModified": 1712543224, + "narHash": "sha256-9RSfZL1TKYdGxZwgDxwtBtsKMGR4Zgn+DAnF9s71/lU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "9a9a7552431c4f1a3b2eee9398641babf7c30d0e", + "rev": "b0dab7cc34ef4d8a1b2de36178da801090bcb271", "type": "github" }, "original": { @@ -1334,16 +1336,16 @@ "osmosis-src": { "flake": false, "locked": { - "lastModified": 1702398856, - "narHash": "sha256-4uLO7izIZ8JvKTfUXbYkxQFpIjwMEcO81WvhklrzI9E=", + "lastModified": 1707262742, + "narHash": "sha256-DudppJmGaToUcYVbVA17FVXlev1NuoSY+Jy2c7PpZlY=", "owner": "osmosis-labs", "repo": "osmosis", - "rev": "b0aee0006ce55d0851773084bd7880db7e32ad70", + "rev": "350901e523815fc34a1de1ca54e9ccd3c4d1f756", "type": "github" }, "original": { "owner": "osmosis-labs", - "ref": "v21.0.0", + "ref": "v22.0.5", "repo": "osmosis", "type": "github" } @@ -1367,7 +1369,6 @@ "nixpkgs-stable": "nixpkgs-stable" }, "locked": { - "lastModified": 1688056373, "narHash": "sha256-2+SDlNRTKsgo3LBRiMUcoEUb6sDViRNQhzJquZ4koOI=", "owner": "cachix", "repo": "pre-commit-hooks.nix", @@ -1383,7 +1384,6 @@ "provenance-src": { "flake": false, "locked": { - "lastModified": 1699901286, "narHash": "sha256-dTX3kg2QUsC9SwsaommP4IFgIdQgWZrGQNtp/B+fzys=", "owner": "provenance-io", "repo": "provenance", @@ -1400,7 +1400,6 @@ "regen-src": { "flake": false, "locked": { - "lastModified": 1645832054, "narHash": "sha256-lDb0/Bw4hAX71jsCQJUju1mKYNacWEVezx6+KdIdu6Q=", "owner": "regen-network", "repo": "regen-ledger", @@ -1417,7 +1416,6 @@ "relayer-src": { "flake": false, "locked": { - "lastModified": 1635197290, "narHash": "sha256-xD+xZG4Gb6557y/jkXTGdbt8qJ6izMgC4H3uo2/j5vU=", "owner": "cosmos", "repo": "relayer", @@ -1431,24 +1429,40 @@ "type": "github" } }, + "rollapp-evm-src": { + "flake": false, + "locked": { + "narHash": "sha256-bOH7QsNYjZVVHW7x5ysrO0IJmRNEUeE+bJRVPwdb5U8=", + "owner": "dymensionxyz", + "repo": "rollapp-evm", + "rev": "21b29f6e77f5c11a2036252d60819810abbbd7b8", + "type": "github" + }, + "original": { + "owner": "dymensionxyz", + "repo": "rollapp-evm", + "rev": "21b29f6e77f5c11a2036252d60819810abbbd7b8", + "type": "github" + } + }, "root": { "inputs": { "cosmos-nix": "cosmos-nix", - "flake-utils": "flake-utils_6", + "flake-utils": "flake-utils_7", "nixpkgs": "nixpkgs_6" } }, "rust-overlay": { "inputs": { - "flake-utils": "flake-utils_4", + "flake-utils": "flake-utils_5", "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1702347444, - "narHash": "sha256-ueDw7aQf4Xyk69XnDD0YNWDlFdlOgJGPeWFa7uu/cfw=", + "lastModified": 1710468700, + "narHash": "sha256-YGN6R0nLfB2L57J8T/DX+LcB06QipyYzHSz7AD8B0n0=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "bc13176f27cf3be724d18924b4f6aa47686ca2e3", + "rev": "7ff8e9a04ac7777a3446788cb4018b452157ab8a", "type": "github" }, "original": { @@ -1459,11 +1473,10 @@ }, "sbt-derivation": { "inputs": { - "flake-utils": "flake-utils_5", + "flake-utils": "flake-utils_6", "nixpkgs": "nixpkgs_5" }, "locked": { - "lastModified": 1698464090, "narHash": "sha256-Pnej7WZIPomYWg8f/CZ65sfW85IfIUjYhphMMg7/LT0=", "owner": "zaninime", "repo": "sbt-derivation", @@ -1479,7 +1492,6 @@ "sconfig-src": { "flake": false, "locked": { - "lastModified": 1679585941, "narHash": "sha256-ywh9IcqMWbRHqJkGJezcDCvfbBYNJH7ualKvPJQRcHA=", "owner": "freshautomations", "repo": "sconfig", @@ -1495,7 +1507,6 @@ "sentinel-src": { "flake": false, "locked": { - "lastModified": 1647195309, "narHash": "sha256-+ZobsjLNxVL3+zi6OEFQhff6Gbd9kng8B0haqcOoiP0=", "owner": "sentinel-official", "repo": "hub", @@ -1512,7 +1523,6 @@ "sifchain-src": { "flake": false, "locked": { - "lastModified": 1648486445, "narHash": "sha256-n5fmWtdrc0Rhs6Uo+zjcSXmyEFVIsA5L9dlrbRXGDmU=", "owner": "Sifchain", "repo": "sifnode", @@ -1529,7 +1539,6 @@ "slinky-src": { "flake": false, "locked": { - "lastModified": 1706741000, "narHash": "sha256-gto9l+zeM1WLIv/VtVlrhTpUTMLN+niQTo5zlrbkx30=", "owner": "skip-mev", "repo": "slinky", @@ -1546,7 +1555,6 @@ "stargaze-src": { "flake": false, "locked": { - "lastModified": 1645539964, "narHash": "sha256-5I5pdnBJHwNaI2Soet+zH3aH+pUbYdC9TgHBjOd1TmA=", "owner": "public-awesome", "repo": "stargaze", @@ -1563,7 +1571,6 @@ "stoml-src": { "flake": false, "locked": { - "lastModified": 1666796497, "narHash": "sha256-Adjag1/Hd2wrar2/anD6jQEMDvUc2TOIG7DlEgxpTXc=", "owner": "freshautomations", "repo": "stoml", @@ -1579,7 +1586,6 @@ "stride-consumer-src": { "flake": false, "locked": { - "lastModified": 1689464372, "narHash": "sha256-DByig9ISs9x9Kvakc8LFL558VKhM+UBiaESWgyVzI0w=", "owner": "Stride-Labs", "repo": "stride", @@ -1596,7 +1602,6 @@ "stride-src": { "flake": false, "locked": { - "lastModified": 1679819302, "narHash": "sha256-fdjnFHPBZNnhDyVoMuPfqNb6YUYRdcMO73FlZHjIuzA=", "owner": "Stride-Labs", "repo": "stride", @@ -1612,7 +1617,6 @@ }, "systems": { "locked": { - "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", "repo": "default", @@ -1627,7 +1631,6 @@ }, "systems_2": { "locked": { - "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", "repo": "default", @@ -1642,7 +1645,6 @@ }, "systems_3": { "locked": { - "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", "repo": "default", @@ -1685,10 +1687,24 @@ "type": "github" } }, + "systems_6": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, "umee-src": { "flake": false, "locked": { - "lastModified": 1649261156, "narHash": "sha256-hydRL/88fHCW/k7z7GoqAwvynZuvLEDLyA6A9Cm+6UY=", "owner": "umee-network", "repo": "umee", @@ -1705,7 +1721,6 @@ "wasmd-src": { "flake": false, "locked": { - "lastModified": 1669987561, "narHash": "sha256-F0p555FEeA405tuLn82yUEbRZpJLs85GrUKvSrjTdjk=", "owner": "CosmWasm", "repo": "wasmd", @@ -1722,7 +1737,6 @@ "wasmd_next-src": { "flake": false, "locked": { - "lastModified": 1682094944, "narHash": "sha256-b+6XhBdKyQlrzsYxVRrDf4vHpv8GAJkGwHVfJ9sdf3U=", "owner": "CosmWasm", "repo": "wasmd", @@ -1739,7 +1753,6 @@ "wasmvm_1-src": { "flake": false, "locked": { - "lastModified": 1652698028, "narHash": "sha256-4m64mPwFLz7aZEKVxM2lJQtX98BkhdKTZb3evpDOk/4=", "owner": "CosmWasm", "repo": "wasmvm", @@ -1756,7 +1769,6 @@ "wasmvm_1_1_1-src": { "flake": false, "locked": { - "lastModified": 1663600745, "narHash": "sha256-9K/G7Wu/TfW4Z+lseEutXbdtr+A40nbVejBphegF5z4=", "owner": "CosmWasm", "repo": "wasmvm", @@ -1773,7 +1785,6 @@ "wasmvm_1_1_2-src": { "flake": false, "locked": { - "lastModified": 1681833975, "narHash": "sha256-EbzMNkZUO94jEdX0WgAdy5qfhlCG3lpHpVHyT2FcSDw=", "owner": "CosmWasm", "repo": "wasmvm", @@ -1790,7 +1801,6 @@ "wasmvm_1_2_3-src": { "flake": false, "locked": { - "lastModified": 1681831436, "narHash": "sha256-GscUMJ0Tkg77S9IYA9komyKKoa1AyVXSSaU8hw3ZNwk=", "owner": "CosmWasm", "repo": "wasmvm", @@ -1807,7 +1817,6 @@ "wasmvm_1_2_4-src": { "flake": false, "locked": { - "lastModified": 1685977963, "narHash": "sha256-/GOvkKLQwsPms7h7yEZYLwbZn9Lzk5qQnBXXoZ/R6JM=", "owner": "CosmWasm", "repo": "wasmvm", @@ -1821,10 +1830,26 @@ "type": "github" } }, + "wasmvm_1_2_6-src": { + "flake": false, + "locked": { + "lastModified": 1704896412, + "narHash": "sha256-W0WuC9eRxp67UeQZ0HDZ9/iIC5JKsylB2g6YpYFjMGM=", + "owner": "CosmWasm", + "repo": "wasmvm", + "rev": "66763124d7dd49b775cb86b637376eecb1e3f56a", + "type": "github" + }, + "original": { + "owner": "CosmWasm", + "ref": "v1.2.6", + "repo": "wasmvm", + "type": "github" + } + }, "wasmvm_1_3_0-src": { "flake": false, "locked": { - "lastModified": 1689589428, "narHash": "sha256-rsTYvbkYpDkUE4IvILdSL3hXMgAWxz5ltGotJB2t1e4=", "owner": "CosmWasm", "repo": "wasmvm", @@ -1841,7 +1866,6 @@ "wasmvm_1_5_0-src": { "flake": false, "locked": { - "lastModified": 1698746477, "narHash": "sha256-l0cNF0YjviEl/JLJ4VdvDtIGuAYyFfncVo83ROfQFD8=", "owner": "CosmWasm", "repo": "wasmvm", @@ -1855,10 +1879,26 @@ "type": "github" } }, + "wasmvm_1_5_2-src": { + "flake": false, + "locked": { + "lastModified": 1705576719, + "narHash": "sha256-3KJq5jFllFSqlm85/iRWYMhu99iuokvR3Ib9Gq3gIjc=", + "owner": "CosmWasm", + "repo": "wasmvm", + "rev": "b742b2623cce98f04ae5d8bfb488c73988f3dd61", + "type": "github" + }, + "original": { + "owner": "CosmWasm", + "ref": "v1.5.2", + "repo": "wasmvm", + "type": "github" + } + }, "wasmvm_1_beta7-src": { "flake": false, "locked": { - "lastModified": 1646675433, "narHash": "sha256-tt9aAPLxtIRsG1VFM1YAIHSotuBl170EiBcHSWTtARI=", "owner": "CosmWasm", "repo": "wasmvm", From 1edcb15269f12aa3667f39fe1263945b1ff6959b Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 9 Apr 2024 14:01:30 +0200 Subject: [PATCH 075/200] Remove mock types and associated tests (#3939) --- crates/relayer-types/Cargo.toml | 3 - .../clients/ics07_tendermint/client_state.rs | 33 ----- .../src/clients/ics07_tendermint/header.rs | 65 -------- .../src/core/ics02_client/client_type.rs | 30 ---- .../core/ics02_client/msgs/create_client.rs | 35 ----- .../core/ics02_client/msgs/update_client.rs | 28 ---- .../core/ics02_client/msgs/upgrade_client.rs | 80 ---------- .../src/core/ics23_commitment/mock.rs | 1 - .../src/core/ics23_commitment/mod.rs | 1 - .../src/core/ics24_host/identifier.rs | 3 - crates/relayer-types/src/lib.rs | 5 +- crates/relayer-types/src/mock/client_state.rs | 135 ----------------- .../relayer-types/src/mock/consensus_state.rs | 106 ------------- crates/relayer-types/src/mock/header.rs | 139 ------------------ crates/relayer-types/src/mock/misbehaviour.rs | 57 ------- crates/relayer-types/src/mock/mod.rs | 6 - crates/relayer/Cargo.toml | 2 +- crates/relayer/src/chain/cosmos.rs | 45 +----- .../src/chain/cosmos/types/events/client.rs | 47 ------ crates/relayer/src/client_state.rs | 85 ----------- crates/relayer/src/consensus_state.rs | 38 ----- crates/relayer/src/event.rs | 16 -- crates/relayer/src/foreign_client.rs | 2 - crates/relayer/src/light_client/tendermint.rs | 15 -- crates/relayer/src/misbehaviour.rs | 35 ----- 25 files changed, 3 insertions(+), 1009 deletions(-) delete mode 100644 crates/relayer-types/src/core/ics23_commitment/mock.rs delete mode 100644 crates/relayer-types/src/mock/client_state.rs delete mode 100644 crates/relayer-types/src/mock/consensus_state.rs delete mode 100644 crates/relayer-types/src/mock/header.rs delete mode 100644 crates/relayer-types/src/mock/misbehaviour.rs delete mode 100644 crates/relayer-types/src/mock/mod.rs diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index fb09b6daf7..e0eec54df0 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -18,9 +18,6 @@ all-features = true [features] clock = [] -# This feature grants access to development-time mocking libraries, such as `MockContext` or `MockHeader`. -# Depends on the `testgen` suite for generating Tendermint light blocks. -mocks = ["tendermint-testgen", "clock"] [dependencies] bytes = { workspace = true } diff --git a/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs b/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs index 9e53f1e63f..597e3e78d9 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs @@ -659,36 +659,3 @@ mod tests { } } } - -#[cfg(any(test, feature = "mocks"))] -pub mod test_util { - use core::time::Duration; - - use tendermint::block::Header; - - use crate::clients::ics07_tendermint::client_state::{AllowUpdate, ClientState}; - use crate::core::ics02_client::height::Height; - use crate::core::ics24_host::identifier::ChainId; - - pub fn get_dummy_tendermint_client_state(tm_header: Header) -> ClientState { - ClientState::new( - ChainId::from(tm_header.chain_id.clone()), - Default::default(), - Duration::from_secs(64000), - Duration::from_secs(128000), - Duration::from_millis(3000), - Height::new( - ChainId::chain_version(tm_header.chain_id.as_str()), - u64::from(tm_header.height), - ) - .unwrap(), - Default::default(), - vec!["".to_string()], - AllowUpdate { - after_expiry: false, - after_misbehaviour: false, - }, - ) - .unwrap() - } -} diff --git a/crates/relayer-types/src/clients/ics07_tendermint/header.rs b/crates/relayer-types/src/clients/ics07_tendermint/header.rs index 57b99db1e9..412aa11630 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/header.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/header.rs @@ -146,68 +146,3 @@ impl From
for RawHeader { } } } - -#[cfg(any(test, feature = "mocks"))] -pub mod test_util { - - use subtle_encoding::hex; - use tendermint::block::signed_header::SignedHeader; - use tendermint::validator::Info as ValidatorInfo; - use tendermint::validator::Set as ValidatorSet; - use tendermint::PublicKey; - - use crate::clients::ics07_tendermint::header::Header; - use crate::Height; - - pub fn get_dummy_tendermint_header() -> tendermint::block::Header { - serde_json::from_str::(include_str!( - "../../../tests/support/signed_header.json" - )) - .unwrap() - .header - } - - // TODO: This should be replaced with a ::default() or ::produce(). - // The implementation of this function comprises duplicate code (code borrowed from - // `tendermint-rs` for assembling a Header). - // See https://github.com/informalsystems/tendermint-rs/issues/381. - // - // The normal flow is: - // - get the (trusted) signed header and the `trusted_validator_set` at a `trusted_height` - // - get the `signed_header` and the `validator_set` at latest height - // - build the ics07 Header - // For testing purposes this function does: - // - get the `signed_header` from a .json file - // - create the `validator_set` with a single validator that is also the proposer - // - assume a `trusted_height` of 1 and no change in the validator set since height 1, - // i.e. `trusted_validator_set` = `validator_set` - pub fn get_dummy_ics07_header() -> Header { - // Build a SignedHeader from a JSON file. - let shdr = serde_json::from_str::(include_str!( - "../../../tests/support/signed_header.json" - )) - .unwrap(); - - // Build a set of validators. - // Below are test values inspired form `test_validator_set()` in tendermint-rs. - let v1: ValidatorInfo = ValidatorInfo::new( - PublicKey::from_raw_ed25519( - &hex::decode_upper( - "F349539C7E5EF7C49549B09C4BFC2335318AB0FE51FBFAA2433B4F13E816F4A7", - ) - .unwrap(), - ) - .unwrap(), - 281_815_u64.try_into().unwrap(), - ); - - let vs = ValidatorSet::new(vec![v1.clone()], Some(v1)); - - Header { - signed_header: shdr, - validator_set: vs.clone(), - trusted_height: Height::new(0, 1).unwrap(), - trusted_validator_set: vs, - } - } -} diff --git a/crates/relayer-types/src/core/ics02_client/client_type.rs b/crates/relayer-types/src/core/ics02_client/client_type.rs index a35e44604d..0966d500b5 100644 --- a/crates/relayer-types/src/core/ics02_client/client_type.rs +++ b/crates/relayer-types/src/core/ics02_client/client_type.rs @@ -7,24 +7,15 @@ use super::error::Error; #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub enum ClientType { Tendermint = 1, - - #[cfg(any(test, feature = "mocks"))] - Mock = 9999, } impl ClientType { const TENDERMINT_STR: &'static str = "07-tendermint"; - #[cfg_attr(not(test), allow(dead_code))] - const MOCK_STR: &'static str = "9999-mock"; - /// Yields the identifier of this client type as a string pub fn as_str(&self) -> &'static str { match self { Self::Tendermint => Self::TENDERMINT_STR, - - #[cfg(any(test, feature = "mocks"))] - Self::Mock => Self::MOCK_STR, } } } @@ -42,9 +33,6 @@ impl core::str::FromStr for ClientType { match s { Self::TENDERMINT_STR => Ok(Self::Tendermint), - #[cfg(any(test, feature = "mocks"))] - Self::MOCK_STR => Ok(Self::Mock), - _ => Err(Error::unknown_client_type(s.to_string())), } } @@ -68,16 +56,6 @@ mod tests { } } - #[test] - fn parse_mock_client_type() { - let client_type = ClientType::from_str("9999-mock"); - - match client_type { - Ok(ClientType::Mock) => (), - _ => panic!("parse failed"), - } - } - #[test] fn parse_unknown_client_type() { let client_type_str = "some-random-client-type"; @@ -93,14 +71,6 @@ mod tests { } } - #[test] - fn parse_mock_as_string_result() { - let client_type = ClientType::Mock; - let type_string = client_type.as_str(); - let client_type_from_str = ClientType::from_str(type_string).unwrap(); - assert_eq!(client_type_from_str, client_type); - } - #[test] fn parse_tendermint_as_string_result() { let client_type = ClientType::Tendermint; diff --git a/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs b/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs index 078bce2d31..1c760f644f 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs @@ -72,38 +72,3 @@ impl From for RawMsgCreateClient { } } } - -#[cfg(test)] -mod tests { - - use test_log::test; - - use ibc_proto::ibc::core::client::v1::MsgCreateClient as RawMsgCreateClient; - - use crate::clients::ics07_tendermint::client_state::test_util::get_dummy_tendermint_client_state; - use crate::clients::ics07_tendermint::consensus_state::ConsensusState as TmConsensusState; - use crate::clients::ics07_tendermint::header::test_util::get_dummy_tendermint_header; - use crate::core::ics02_client::msgs::create_client::MsgCreateClient; - use crate::test_utils::get_dummy_account_id; - - #[test] - fn msg_create_client_serialization() { - let signer = get_dummy_account_id(); - - let tm_header = get_dummy_tendermint_header(); - let tm_client_state = get_dummy_tendermint_client_state(tm_header.clone()).into(); - - let msg = MsgCreateClient::new( - tm_client_state, - TmConsensusState::from(tm_header).into(), - signer, - ) - .unwrap(); - - let raw = RawMsgCreateClient::from(msg.clone()); - let msg_back = MsgCreateClient::try_from(raw.clone()).unwrap(); - let raw_back = RawMsgCreateClient::from(msg_back.clone()); - assert_eq!(msg, msg_back); - assert_eq!(raw, raw_back); - } -} diff --git a/crates/relayer-types/src/core/ics02_client/msgs/update_client.rs b/crates/relayer-types/src/core/ics02_client/msgs/update_client.rs index e5966b7b7c..a0de417d6a 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs/update_client.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs/update_client.rs @@ -69,31 +69,3 @@ impl From for RawMsgUpdateClient { } } } - -#[cfg(test)] -mod tests { - - use test_log::test; - - use ibc_proto::ibc::core::client::v1::MsgUpdateClient as RawMsgUpdateClient; - - use crate::clients::ics07_tendermint::header::test_util::get_dummy_ics07_header; - use crate::core::ics02_client::msgs::MsgUpdateClient; - use crate::core::ics24_host::identifier::ClientId; - use crate::test_utils::get_dummy_account_id; - - #[test] - fn msg_update_client_serialization() { - let client_id: ClientId = "tendermint".parse().unwrap(); - let signer = get_dummy_account_id(); - - let header = get_dummy_ics07_header(); - - let msg = MsgUpdateClient::new(client_id, header.into(), signer); - let raw = RawMsgUpdateClient::from(msg.clone()); - let msg_back = MsgUpdateClient::try_from(raw.clone()).unwrap(); - let raw_back = RawMsgUpdateClient::from(msg_back.clone()); - assert_eq!(msg, msg_back); - assert_eq!(raw, raw_back); - } -} diff --git a/crates/relayer-types/src/core/ics02_client/msgs/upgrade_client.rs b/crates/relayer-types/src/core/ics02_client/msgs/upgrade_client.rs index 20fcf6ccc3..5338eda56b 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs/upgrade_client.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs/upgrade_client.rs @@ -112,83 +112,3 @@ impl TryFrom for MsgUpgradeClient { }) } } - -#[cfg(test)] -pub mod test_util { - use ibc_proto::ibc::core::client::v1::MsgUpgradeClient as RawMsgUpgradeClient; - - use crate::{ - core::{ics02_client::height::Height, ics24_host::identifier::ClientId}, - mock::{ - client_state::MockClientState, consensus_state::MockConsensusState, header::MockHeader, - }, - test_utils::{get_dummy_bech32_account, get_dummy_proof}, - }; - - use super::MsgUpgradeClient; - - /// Extends the implementation with additional helper methods. - impl MsgUpgradeClient { - /// Setter for `client_id`. Amenable to chaining, since it consumes the input message. - pub fn with_client_id(self, client_id: ClientId) -> Self { - MsgUpgradeClient { client_id, ..self } - } - } - - /// Returns a dummy `RawMsgUpgradeClient`, for testing only! - pub fn get_dummy_raw_msg_upgrade_client(height: Height) -> RawMsgUpgradeClient { - RawMsgUpgradeClient { - client_id: "tendermint".parse().unwrap(), - client_state: Some(MockClientState::new(MockHeader::new(height)).into()), - consensus_state: Some(MockConsensusState::new(MockHeader::new(height)).into()), - proof_upgrade_client: get_dummy_proof(), - proof_upgrade_consensus_state: get_dummy_proof(), - signer: get_dummy_bech32_account(), - } - } -} - -#[cfg(test)] -mod tests { - - use ibc_proto::ibc::core::client::v1::MsgUpgradeClient as RawMsgUpgradeClient; - - use crate::{ - core::{ - ics02_client::{height::Height, msgs::upgrade_client::MsgUpgradeClient}, - ics23_commitment::commitment::test_util::get_dummy_merkle_proof, - ics24_host::identifier::ClientId, - }, - mock::{ - client_state::MockClientState, consensus_state::MockConsensusState, header::MockHeader, - }, - test_utils::get_dummy_account_id, - }; - - #[test] - fn msg_upgrade_client_serialization() { - let client_id: ClientId = "tendermint".parse().unwrap(); - let signer = get_dummy_account_id(); - - let height = Height::new(1, 1).unwrap(); - - let client_state = MockClientState::new(MockHeader::new(height)); - let consensus_state = MockConsensusState::new(MockHeader::new(height)); - - let proof = get_dummy_merkle_proof(); - - let msg = MsgUpgradeClient::new( - client_id, - client_state.into(), - consensus_state.into(), - proof.clone(), - proof, - signer, - ); - let raw: RawMsgUpgradeClient = RawMsgUpgradeClient::from(msg.clone()); - let msg_back = MsgUpgradeClient::try_from(raw.clone()).unwrap(); - let raw_back: RawMsgUpgradeClient = RawMsgUpgradeClient::from(msg_back.clone()); - assert_eq!(msg, msg_back); - assert_eq!(raw, raw_back); - } -} diff --git a/crates/relayer-types/src/core/ics23_commitment/mock.rs b/crates/relayer-types/src/core/ics23_commitment/mock.rs deleted file mode 100644 index 8b13789179..0000000000 --- a/crates/relayer-types/src/core/ics23_commitment/mock.rs +++ /dev/null @@ -1 +0,0 @@ - diff --git a/crates/relayer-types/src/core/ics23_commitment/mod.rs b/crates/relayer-types/src/core/ics23_commitment/mod.rs index e3806ad771..ecffa81d63 100644 --- a/crates/relayer-types/src/core/ics23_commitment/mod.rs +++ b/crates/relayer-types/src/core/ics23_commitment/mod.rs @@ -4,5 +4,4 @@ pub mod commitment; pub mod error; pub mod merkle; -pub mod mock; pub mod specs; diff --git a/crates/relayer-types/src/core/ics24_host/identifier.rs b/crates/relayer-types/src/core/ics24_host/identifier.rs index bba663db3f..8c472d8947 100644 --- a/crates/relayer-types/src/core/ics24_host/identifier.rs +++ b/crates/relayer-types/src/core/ics24_host/identifier.rs @@ -178,9 +178,6 @@ impl ClientId { pub fn prefix(client_type: ClientType) -> &'static str { match client_type { ClientType::Tendermint => ClientType::Tendermint.as_str(), - - #[cfg(any(test, feature = "mocks"))] - ClientType::Mock => ClientType::Mock.as_str(), } } diff --git a/crates/relayer-types/src/lib.rs b/crates/relayer-types/src/lib.rs index 61f3b14cbc..eee880d3cb 100644 --- a/crates/relayer-types/src/lib.rs +++ b/crates/relayer-types/src/lib.rs @@ -63,8 +63,5 @@ pub type Height = core::ics02_client::height::Height; #[cfg(test)] mod test; -#[cfg(any(test, feature = "mocks"))] +#[cfg(test)] pub mod test_utils; - -#[cfg(any(test, feature = "mocks"))] -pub mod mock; // Context mock, the underlying host chain, and client types: for testing all handlers. diff --git a/crates/relayer-types/src/mock/client_state.rs b/crates/relayer-types/src/mock/client_state.rs deleted file mode 100644 index 98917b0ef0..0000000000 --- a/crates/relayer-types/src/mock/client_state.rs +++ /dev/null @@ -1,135 +0,0 @@ -use std::time::Duration; - -use serde::{Deserialize, Serialize}; - -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::mock::ClientState as RawMockClientState; -use ibc_proto::Protobuf; - -use crate::core::ics02_client::client_state::ClientState; -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics02_client::error::Error; - -use crate::core::ics24_host::identifier::ChainId; - -use crate::mock::consensus_state::MockConsensusState; -use crate::mock::header::MockHeader; - -use crate::Height; - -pub const MOCK_CLIENT_STATE_TYPE_URL: &str = "/ibc.mock.ClientState"; - -/// A mock of a client state. For an example of a real structure that this mocks, you can see -/// `ClientState` of ics07_tendermint/client_state.rs. -#[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -pub struct MockClientState { - pub header: MockHeader, - pub frozen_height: Option, -} - -impl MockClientState { - pub fn new(header: MockHeader) -> Self { - Self { - header, - frozen_height: None, - } - } - - pub fn latest_height(&self) -> Height { - self.header.height() - } -} - -impl Protobuf for MockClientState {} - -impl TryFrom for MockClientState { - type Error = Error; - - fn try_from(raw: RawMockClientState) -> Result { - Ok(Self::new(raw.header.unwrap().try_into()?)) - } -} - -impl From for RawMockClientState { - fn from(value: MockClientState) -> Self { - RawMockClientState { - header: Some(ibc_proto::ibc::mock::Header { - height: Some(value.header.height().into()), - timestamp: value.header.timestamp.nanoseconds(), - }), - frozen: false, - trusting_period: 14 * 24 * 60 * 60, - } - } -} - -impl Protobuf for MockClientState {} - -impl TryFrom for MockClientState { - type Error = Error; - - fn try_from(raw: Any) -> Result { - use bytes::Buf; - use core::ops::Deref; - use prost::Message; - - fn decode_client_state(buf: B) -> Result { - RawMockClientState::decode(buf) - .map_err(Error::decode)? - .try_into() - } - - match raw.type_url.as_str() { - MOCK_CLIENT_STATE_TYPE_URL => { - decode_client_state(raw.value.deref()).map_err(Into::into) - } - _ => Err(Error::unexpected_client_state_type( - MOCK_CLIENT_STATE_TYPE_URL.to_string(), - raw.type_url, - )), - } - } -} - -impl From for Any { - fn from(client_state: MockClientState) -> Self { - Any { - type_url: MOCK_CLIENT_STATE_TYPE_URL.to_string(), - value: Protobuf::::encode_vec(client_state), - } - } -} - -impl ClientState for MockClientState { - type UpgradeOptions = (); - - fn chain_id(&self) -> ChainId { - unimplemented!() - } - - fn client_type(&self) -> ClientType { - ClientType::Mock - } - - fn latest_height(&self) -> Height { - self.header.height() - } - - fn frozen_height(&self) -> Option { - self.frozen_height - } - - fn upgrade(&mut self, _upgrade_height: Height, _upgrade_options: (), _chain_id: ChainId) { - unimplemented!() - } - - fn expired(&self, _elapsed: Duration) -> bool { - false - } -} - -impl From for MockClientState { - fn from(cs: MockConsensusState) -> Self { - Self::new(cs.header) - } -} diff --git a/crates/relayer-types/src/mock/consensus_state.rs b/crates/relayer-types/src/mock/consensus_state.rs deleted file mode 100644 index 0237d50074..0000000000 --- a/crates/relayer-types/src/mock/consensus_state.rs +++ /dev/null @@ -1,106 +0,0 @@ -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::mock::ConsensusState as RawMockConsensusState; -use ibc_proto::Protobuf; -use serde::{Deserialize, Serialize}; - -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics02_client::consensus_state::ConsensusState; -use crate::core::ics02_client::error::Error; -use crate::core::ics23_commitment::commitment::CommitmentRoot; -use crate::mock::header::MockHeader; -use crate::timestamp::Timestamp; - -pub const MOCK_CONSENSUS_STATE_TYPE_URL: &str = "/ibc.mock.ConsensusState"; - -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -pub struct MockConsensusState { - pub header: MockHeader, - pub root: CommitmentRoot, -} - -impl MockConsensusState { - pub fn new(header: MockHeader) -> Self { - MockConsensusState { - header, - root: CommitmentRoot::from(vec![0]), - } - } - - pub fn timestamp(&self) -> Timestamp { - self.header.timestamp - } -} - -impl Protobuf for MockConsensusState {} - -impl TryFrom for MockConsensusState { - type Error = Error; - - fn try_from(raw: RawMockConsensusState) -> Result { - let raw_header = raw.header.ok_or_else(Error::missing_raw_consensus_state)?; - - Ok(Self { - header: MockHeader::try_from(raw_header)?, - root: CommitmentRoot::from(vec![0]), - }) - } -} - -impl From for RawMockConsensusState { - fn from(value: MockConsensusState) -> Self { - RawMockConsensusState { - header: Some(ibc_proto::ibc::mock::Header { - height: Some(value.header.height().into()), - timestamp: value.header.timestamp.nanoseconds(), - }), - } - } -} - -impl Protobuf for MockConsensusState {} - -impl TryFrom for MockConsensusState { - type Error = Error; - - fn try_from(raw: Any) -> Result { - use bytes::Buf; - use core::ops::Deref; - use prost::Message; - - fn decode_consensus_state(buf: B) -> Result { - RawMockConsensusState::decode(buf) - .map_err(Error::decode)? - .try_into() - } - - match raw.type_url.as_str() { - MOCK_CONSENSUS_STATE_TYPE_URL => { - decode_consensus_state(raw.value.deref()).map_err(Into::into) - } - _ => Err(Error::unknown_consensus_state_type(raw.type_url)), - } - } -} - -impl From for Any { - fn from(consensus_state: MockConsensusState) -> Self { - Any { - type_url: MOCK_CONSENSUS_STATE_TYPE_URL.to_string(), - value: Protobuf::::encode_vec(consensus_state), - } - } -} - -impl ConsensusState for MockConsensusState { - fn client_type(&self) -> ClientType { - ClientType::Mock - } - - fn root(&self) -> &CommitmentRoot { - &self.root - } - - fn timestamp(&self) -> Timestamp { - self.header.timestamp - } -} diff --git a/crates/relayer-types/src/mock/header.rs b/crates/relayer-types/src/mock/header.rs deleted file mode 100644 index cd53cd6a68..0000000000 --- a/crates/relayer-types/src/mock/header.rs +++ /dev/null @@ -1,139 +0,0 @@ -use std::fmt::{Display, Error as FmtError, Formatter}; - -use ibc_proto::google::protobuf::Any; -use ibc_proto::ibc::mock::Header as RawMockHeader; -use ibc_proto::Protobuf; -use serde_derive::{Deserialize, Serialize}; - -use crate::core::ics02_client::client_type::ClientType; -use crate::core::ics02_client::error::Error; -use crate::core::ics02_client::header::Header; -use crate::timestamp::Timestamp; -use crate::Height; - -pub const MOCK_HEADER_TYPE_URL: &str = "/ibc.mock.Header"; - -#[derive(Copy, Clone, Debug, Deserialize, PartialEq, Eq, Serialize)] -pub struct MockHeader { - pub height: Height, - pub timestamp: Timestamp, -} - -impl Default for MockHeader { - fn default() -> Self { - Self { - height: Height::new(0, 1).unwrap(), - timestamp: Default::default(), - } - } -} - -impl Display for MockHeader { - fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { - write!( - f, - "MockHeader {{ height: {}, timestamp: {} }}", - self.height, self.timestamp - ) - } -} - -impl Protobuf for MockHeader {} - -impl TryFrom for MockHeader { - type Error = Error; - - fn try_from(raw: RawMockHeader) -> Result { - Ok(MockHeader { - height: raw - .height - .and_then(|raw_height| raw_height.try_into().ok()) - .ok_or_else(Error::missing_raw_header)?, - - timestamp: Timestamp::from_nanoseconds(raw.timestamp) - .map_err(Error::invalid_packet_timestamp)?, - }) - } -} - -impl From for RawMockHeader { - fn from(value: MockHeader) -> Self { - RawMockHeader { - height: Some(value.height.into()), - timestamp: value.timestamp.nanoseconds(), - } - } -} - -impl MockHeader { - pub fn height(&self) -> Height { - self.height - } - - pub fn new(height: Height) -> Self { - Self { - height, - timestamp: Timestamp::now(), - } - } - - pub fn with_timestamp(self, timestamp: Timestamp) -> Self { - Self { timestamp, ..self } - } -} - -impl Header for MockHeader { - fn client_type(&self) -> ClientType { - ClientType::Mock - } - - fn height(&self) -> Height { - self.height - } - - fn timestamp(&self) -> Timestamp { - self.timestamp - } -} - -impl Protobuf for MockHeader {} - -impl TryFrom for MockHeader { - type Error = Error; - - fn try_from(raw: Any) -> Result { - match raw.type_url.as_str() { - MOCK_HEADER_TYPE_URL => Ok(Protobuf::::decode_vec(&raw.value) - .map_err(Error::invalid_raw_header)?), - _ => Err(Error::unknown_header_type(raw.type_url)), - } - } -} - -impl From for Any { - fn from(header: MockHeader) -> Self { - Any { - type_url: MOCK_HEADER_TYPE_URL.to_string(), - value: Protobuf::::encode_vec(header), - } - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn encode_any() { - let header = MockHeader::new(Height::new(1, 10).unwrap()).with_timestamp(Timestamp::none()); - let bytes = >::encode_vec(header); - - assert_eq!( - &bytes, - &[ - 10, 16, 47, 105, 98, 99, 46, 109, 111, 99, 107, 46, 72, 101, 97, 100, 101, 114, 18, - 6, 10, 4, 8, 1, 16, 10 - ] - ); - } -} diff --git a/crates/relayer-types/src/mock/misbehaviour.rs b/crates/relayer-types/src/mock/misbehaviour.rs deleted file mode 100644 index 17e303940c..0000000000 --- a/crates/relayer-types/src/mock/misbehaviour.rs +++ /dev/null @@ -1,57 +0,0 @@ -use ibc_proto::ibc::mock::Misbehaviour as RawMisbehaviour; -use ibc_proto::Protobuf; -use serde::{Deserialize, Serialize}; - -use crate::core::ics02_client::error::Error; -use crate::core::ics24_host::identifier::ClientId; -use crate::mock::header::MockHeader; -use crate::Height; - -pub const MOCK_MISBEHAVIOUR_TYPE_URL: &str = "/ibc.mock.Misbehavior"; - -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -pub struct Misbehaviour { - pub client_id: ClientId, - pub header1: MockHeader, - pub header2: MockHeader, -} - -impl crate::core::ics02_client::misbehaviour::Misbehaviour for Misbehaviour { - fn client_id(&self) -> &ClientId { - &self.client_id - } - - fn height(&self) -> Height { - self.header1.height() - } -} - -impl Protobuf for Misbehaviour {} - -impl TryFrom for Misbehaviour { - type Error = Error; - - fn try_from(raw: RawMisbehaviour) -> Result { - Ok(Self { - client_id: Default::default(), - header1: raw - .header1 - .ok_or_else(Error::missing_raw_misbehaviour)? - .try_into()?, - header2: raw - .header2 - .ok_or_else(Error::missing_raw_misbehaviour)? - .try_into()?, - }) - } -} - -impl From for RawMisbehaviour { - fn from(value: Misbehaviour) -> Self { - RawMisbehaviour { - client_id: value.client_id.to_string(), - header1: Some(value.header1.into()), - header2: Some(value.header2.into()), - } - } -} diff --git a/crates/relayer-types/src/mock/mod.rs b/crates/relayer-types/src/mock/mod.rs deleted file mode 100644 index 340dacdaef..0000000000 --- a/crates/relayer-types/src/mock/mod.rs +++ /dev/null @@ -1,6 +0,0 @@ -//! Implementation of mocks for context, host chain, and client. - -pub mod client_state; -pub mod consensus_state; -pub mod header; -pub mod misbehaviour; diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index f338761093..e90d3baa3c 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -81,7 +81,7 @@ tracing-subscriber = { workspace = true, features = ["fmt", "env-f uuid = { workspace = true, features = ["v4"] } [dev-dependencies] -ibc-relayer-types = { workspace = true, features = ["mocks"] } +ibc-relayer-types = { workspace = true } serial_test = { workspace = true } env_logger = { workspace = true } test-log = { workspace = true, features = ["trace"] } diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 91909eb606..e4eb4f9e39 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -2529,17 +2529,8 @@ fn do_health_check(chain: &CosmosSdkChain) -> Result<(), Error> { #[cfg(test)] mod tests { - use ibc_relayer_types::{ - core::{ics02_client::client_type::ClientType, ics24_host::identifier::ClientId}, - mock::client_state::MockClientState, - mock::header::MockHeader, - Height, - }; - - use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; - use crate::{chain::cosmos::client_id_suffix, config::GasPrice}; - use super::calculate_fee; + use crate::config::GasPrice; #[test] fn mul_ceil() { @@ -2577,38 +2568,4 @@ mod tests { let fee = calculate_fee(gas_amount, &gas_price); assert_eq!(&fee.amount, "90000000000000000000000000"); } - - #[test] - fn sort_clients_id_suffix() { - let mut clients: Vec = vec![ - IdentifiedAnyClientState::new( - ClientId::new(ClientType::Tendermint, 4).unwrap(), - AnyClientState::Mock(MockClientState::new(MockHeader::new( - Height::new(0, 1).unwrap(), - ))), - ), - IdentifiedAnyClientState::new( - ClientId::new(ClientType::Tendermint, 1).unwrap(), - AnyClientState::Mock(MockClientState::new(MockHeader::new( - Height::new(0, 1).unwrap(), - ))), - ), - IdentifiedAnyClientState::new( - ClientId::new(ClientType::Tendermint, 7).unwrap(), - AnyClientState::Mock(MockClientState::new(MockHeader::new( - Height::new(0, 1).unwrap(), - ))), - ), - ]; - clients.sort_by_cached_key(|c| client_id_suffix(&c.client_id).unwrap_or(0)); - assert_eq!( - client_id_suffix(&clients.first().unwrap().client_id).unwrap(), - 1 - ); - assert_eq!(client_id_suffix(&clients[1].client_id).unwrap(), 4); - assert_eq!( - client_id_suffix(&clients.last().unwrap().client_id).unwrap(), - 7 - ); - } } diff --git a/crates/relayer/src/chain/cosmos/types/events/client.rs b/crates/relayer/src/chain/cosmos/types/events/client.rs index f4e27264bc..fcb1415ef7 100644 --- a/crates/relayer/src/chain/cosmos/types/events/client.rs +++ b/crates/relayer/src/chain/cosmos/types/events/client.rs @@ -77,50 +77,3 @@ pub fn extract_header_from_tx(event: &AbciEvent) -> Result, Erro } Err(Error::missing_raw_header()) } - -#[cfg(test)] -mod tests { - use ibc_relayer_types::core::ics02_client::client_type::ClientType; - use ibc_relayer_types::mock::header::MockHeader; - use ibc_relayer_types::Height; - - use super::*; - - #[test] - fn client_event_to_abci_event() { - let height = Height::new(1, 1).unwrap(); - let attributes = Attributes { - height, - client_id: "test_client".parse().unwrap(), - client_type: ClientType::Tendermint, - consensus_height: height, - }; - let mut abci_events = vec![]; - let create_client = CreateClient::from(attributes.clone()); - abci_events.push(AbciEvent::from(create_client.clone())); - let client_misbehaviour = ClientMisbehaviour::from(attributes.clone()); - abci_events.push(AbciEvent::from(client_misbehaviour.clone())); - let upgrade_client = UpgradeClient::from(attributes.clone()); - abci_events.push(AbciEvent::from(upgrade_client.clone())); - let mut update_client = UpdateClient::from(attributes); - let header = AnyHeader::Mock(MockHeader::new(height)); - update_client.header = Some(header.into_box()); - abci_events.push(AbciEvent::from(update_client.clone())); - - for event in abci_events { - match try_from_tx(&event) { - Some(e) => match e { - IbcEvent::CreateClient(e) => assert_eq!(e.0, create_client.0), - IbcEvent::ClientMisbehaviour(e) => assert_eq!(e.0, client_misbehaviour.0), - IbcEvent::UpgradeClient(e) => assert_eq!(e.0, upgrade_client.0), - IbcEvent::UpdateClient(e) => { - assert_eq!(e.common, update_client.common); - assert_eq!(e.header, update_client.header); - } - _ => panic!("unexpected event type"), - }, - None => panic!("converted event was wrong"), - } - } - } -} diff --git a/crates/relayer/src/client_state.rs b/crates/relayer/src/client_state.rs index 814abddff6..e5a761b213 100644 --- a/crates/relayer/src/client_state.rs +++ b/crates/relayer/src/client_state.rs @@ -18,28 +18,16 @@ use ibc_relayer_types::core::ics24_host::error::ValidationError; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use ibc_relayer_types::Height; -#[cfg(test)] -use ibc_proto::ibc::mock::ClientState as RawMockClientState; -#[cfg(test)] -use ibc_relayer_types::mock::client_state::MockClientState; -#[cfg(test)] -use ibc_relayer_types::mock::client_state::MOCK_CLIENT_STATE_TYPE_URL; - #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "type")] pub enum AnyUpgradeOptions { Tendermint(TmUpgradeOptions), - - #[cfg(test)] - Mock(()), } impl AnyUpgradeOptions { fn into_tm_upgrade_options(self) -> Option { match self { AnyUpgradeOptions::Tendermint(tm) => Some(tm), - #[cfg(test)] - AnyUpgradeOptions::Mock(_) => None, } } } @@ -48,72 +36,48 @@ impl AnyUpgradeOptions { #[serde(tag = "type")] pub enum AnyClientState { Tendermint(TmClientState), - - #[cfg(test)] - Mock(MockClientState), } impl AnyClientState { pub fn chain_id(&self) -> ChainId { match self { AnyClientState::Tendermint(tm_state) => tm_state.chain_id(), - - #[cfg(test)] - AnyClientState::Mock(mock_state) => mock_state.chain_id(), } } pub fn latest_height(&self) -> Height { match self { Self::Tendermint(tm_state) => tm_state.latest_height(), - - #[cfg(test)] - Self::Mock(mock_state) => mock_state.latest_height(), } } pub fn frozen_height(&self) -> Option { match self { Self::Tendermint(tm_state) => tm_state.frozen_height(), - - #[cfg(test)] - Self::Mock(mock_state) => mock_state.frozen_height(), } } pub fn trust_threshold(&self) -> Option { match self { AnyClientState::Tendermint(state) => Some(state.trust_threshold), - - #[cfg(test)] - AnyClientState::Mock(_) => None, } } pub fn trusting_period(&self) -> Duration { match self { AnyClientState::Tendermint(state) => state.trusting_period, - - #[cfg(test)] - AnyClientState::Mock(_) => Duration::from_secs(14 * 24 * 60 * 60), // 2 weeks } } pub fn max_clock_drift(&self) -> Duration { match self { AnyClientState::Tendermint(state) => state.max_clock_drift, - - #[cfg(test)] - AnyClientState::Mock(_) => Duration::new(0, 0), } } pub fn client_type(&self) -> ClientType { match self { Self::Tendermint(state) => state.client_type(), - - #[cfg(test)] - Self::Mock(state) => state.client_type(), } } } @@ -132,12 +96,6 @@ impl TryFrom for AnyClientState { .map_err(Error::decode_raw_client_state)?, )), - #[cfg(test)] - MOCK_CLIENT_STATE_TYPE_URL => Ok(AnyClientState::Mock( - Protobuf::::decode_vec(&raw.value) - .map_err(Error::decode_raw_client_state)?, - )), - _ => Err(Error::unknown_client_state_type(raw.type_url)), } } @@ -150,11 +108,6 @@ impl From for Any { type_url: TENDERMINT_CLIENT_STATE_TYPE_URL.to_string(), value: Protobuf::::encode_vec(value), }, - #[cfg(test)] - AnyClientState::Mock(value) => Any { - type_url: MOCK_CLIENT_STATE_TYPE_URL.to_string(), - value: Protobuf::::encode_vec(value), - }, } } } @@ -165,9 +118,6 @@ impl ClientState for AnyClientState { fn chain_id(&self) -> ChainId { match self { AnyClientState::Tendermint(tm_state) => tm_state.chain_id(), - - #[cfg(test)] - AnyClientState::Mock(mock_state) => mock_state.chain_id(), } } @@ -197,20 +147,12 @@ impl ClientState for AnyClientState { // TODO: Handle case where upgrade options are not of the right type, // not a problem in practice for now but good to have. } - - #[cfg(test)] - AnyClientState::Mock(mock_state) => { - mock_state.upgrade(upgrade_height, (), chain_id); - } } } fn expired(&self, elapsed_since_latest: Duration) -> bool { match self { AnyClientState::Tendermint(tm_state) => tm_state.expired(elapsed_since_latest), - - #[cfg(test)] - AnyClientState::Mock(mock_state) => mock_state.expired(elapsed_since_latest), } } } @@ -221,13 +163,6 @@ impl From for AnyClientState { } } -#[cfg(test)] -impl From for AnyClientState { - fn from(cs: MockClientState) -> Self { - Self::Mock(cs) - } -} - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "type")] pub struct IdentifiedAnyClientState { @@ -270,23 +205,3 @@ impl From for IdentifiedClientState { } } } - -#[cfg(test)] -mod tests { - use ibc_proto::google::protobuf::Any; - use ibc_relayer_types::clients::ics07_tendermint::client_state::test_util::get_dummy_tendermint_client_state; - use ibc_relayer_types::clients::ics07_tendermint::header::test_util::get_dummy_tendermint_header; - use test_log::test; - - use super::AnyClientState; - - #[test] - fn any_client_state_serialization() { - let tm_client_state: AnyClientState = - get_dummy_tendermint_client_state(get_dummy_tendermint_header()).into(); - - let raw: Any = tm_client_state.clone().into(); - let tm_client_state_back = AnyClientState::try_from(raw).unwrap(); - assert_eq!(tm_client_state, tm_client_state_back); - } -} diff --git a/crates/relayer/src/consensus_state.rs b/crates/relayer/src/consensus_state.rs index c6b6f8114e..500fb3bcef 100644 --- a/crates/relayer/src/consensus_state.rs +++ b/crates/relayer/src/consensus_state.rs @@ -14,39 +14,22 @@ use ibc_relayer_types::core::ics23_commitment::commitment::CommitmentRoot; use ibc_relayer_types::timestamp::Timestamp; use ibc_relayer_types::Height; -#[cfg(test)] -use ibc_proto::ibc::mock::ConsensusState as RawMockConsensusState; -#[cfg(test)] -use ibc_relayer_types::mock::consensus_state::MockConsensusState; -#[cfg(test)] -use ibc_relayer_types::mock::consensus_state::MOCK_CONSENSUS_STATE_TYPE_URL; - #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "type")] -#[non_exhaustive] pub enum AnyConsensusState { Tendermint(TmConsensusState), - - #[cfg(test)] - Mock(MockConsensusState), } impl AnyConsensusState { pub fn timestamp(&self) -> Timestamp { match self { Self::Tendermint(cs_state) => cs_state.timestamp.into(), - - #[cfg(test)] - Self::Mock(mock_state) => mock_state.timestamp(), } } pub fn client_type(&self) -> ClientType { match self { AnyConsensusState::Tendermint(_cs) => ClientType::Tendermint, - - #[cfg(test)] - AnyConsensusState::Mock(_cs) => ClientType::Mock, } } } @@ -65,12 +48,6 @@ impl TryFrom for AnyConsensusState { .map_err(Error::decode_raw_client_state)?, )), - #[cfg(test)] - MOCK_CONSENSUS_STATE_TYPE_URL => Ok(AnyConsensusState::Mock( - Protobuf::::decode_vec(&value.value) - .map_err(Error::decode_raw_client_state)?, - )), - _ => Err(Error::unknown_consensus_state_type(value.type_url)), } } @@ -83,22 +60,10 @@ impl From for Any { type_url: TENDERMINT_CONSENSUS_STATE_TYPE_URL.to_string(), value: Protobuf::::encode_vec(value), }, - #[cfg(test)] - AnyConsensusState::Mock(value) => Any { - type_url: MOCK_CONSENSUS_STATE_TYPE_URL.to_string(), - value: Protobuf::::encode_vec(value), - }, } } } -#[cfg(test)] -impl From for AnyConsensusState { - fn from(cs: MockConsensusState) -> Self { - Self::Mock(cs) - } -} - impl From for AnyConsensusState { fn from(cs: TmConsensusState) -> Self { Self::Tendermint(cs) @@ -150,9 +115,6 @@ impl ConsensusState for AnyConsensusState { fn root(&self) -> &CommitmentRoot { match self { Self::Tendermint(cs_state) => cs_state.root(), - - #[cfg(test)] - Self::Mock(mock_state) => mock_state.root(), } } diff --git a/crates/relayer/src/event.rs b/crates/relayer/src/event.rs index d9c19f5da1..6240e6e77a 100644 --- a/crates/relayer/src/event.rs +++ b/crates/relayer/src/event.rs @@ -466,22 +466,6 @@ pub fn parse_timeout_height(s: &str) -> Result { mod tests { use super::*; - use ibc_proto::google::protobuf::Any; - use ibc_proto::Protobuf; - use ibc_relayer_types::clients::ics07_tendermint::header::test_util::get_dummy_ics07_header; - - #[test] - fn extract_header() { - let header = get_dummy_ics07_header(); - let mut header_bytes = Vec::new(); - Protobuf::::encode(header.clone(), &mut header_bytes).unwrap(); - - let decoded_dyn_header = decode_header(&header_bytes).unwrap(); - let AnyHeader::Tendermint(decoded_tm_header) = decoded_dyn_header; - - assert_eq!(header, decoded_tm_header); - } - #[test] fn connection_event_to_abci_event() { let attributes = ConnectionAttributes { diff --git a/crates/relayer/src/foreign_client.rs b/crates/relayer/src/foreign_client.rs index 46268b94d4..2a3cf41d01 100644 --- a/crates/relayer/src/foreign_client.rs +++ b/crates/relayer/src/foreign_client.rs @@ -1768,8 +1768,6 @@ impl ForeignClient Some(tm_misbehaviour.clone()), - #[cfg(test)] - _ => None, } .ok_or_else(|| { ForeignClientError::misbehaviour_desc(format!( diff --git a/crates/relayer/src/light_client/tendermint.rs b/crates/relayer/src/light_client/tendermint.rs index 1927b0558e..bb48d8dbc4 100644 --- a/crates/relayer/src/light_client/tendermint.rs +++ b/crates/relayer/src/light_client/tendermint.rs @@ -27,9 +27,6 @@ use ibc_relayer_types::core::ics02_client::header::AnyHeader; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use ibc_relayer_types::Height as ICSHeight; -#[cfg(test)] -use ibc_relayer_types::core::ics02_client::client_type::ClientType; - use crate::{ chain::cosmos::config::CosmosSdkConfig, chain::cosmos::CosmosSdkChain, @@ -150,12 +147,6 @@ impl super::LightClient for LightClient { let client_state = match client_state { AnyClientState::Tendermint(client_state) => Ok(client_state), - - #[cfg(test)] - _ => Err(Error::misbehaviour(format!( - "client type incompatible for chain {}", - self.chain_id - ))), }?; let next_validators = self @@ -317,12 +308,6 @@ impl LightClient { let client_state = match client_state { AnyClientState::Tendermint(client_state) => Ok(client_state), - - #[cfg(test)] - _ => Err(Error::client_type_mismatch( - ClientType::Tendermint, - client_state.client_type(), - )), }?; Ok(TmLightClient::new( diff --git a/crates/relayer/src/misbehaviour.rs b/crates/relayer/src/misbehaviour.rs index 4d11974149..69b533f462 100644 --- a/crates/relayer/src/misbehaviour.rs +++ b/crates/relayer/src/misbehaviour.rs @@ -11,11 +11,6 @@ use ibc_relayer_types::core::ics24_host::identifier::ClientId; use ibc_relayer_types::Height; use tendermint_proto::Protobuf; -#[cfg(test)] -use ibc_relayer_types::mock::misbehaviour::Misbehaviour as MockMisbehaviour; -#[cfg(test)] -use ibc_relayer_types::mock::misbehaviour::MOCK_MISBEHAVIOUR_TYPE_URL; - #[derive(Clone, Debug, PartialEq, Eq)] pub struct MisbehaviourEvidence { pub misbehaviour: AnyMisbehaviour, @@ -26,27 +21,18 @@ pub struct MisbehaviourEvidence { #[allow(clippy::large_enum_variant)] pub enum AnyMisbehaviour { Tendermint(TmMisbehaviour), - - #[cfg(test)] - Mock(MockMisbehaviour), } impl Misbehaviour for AnyMisbehaviour { fn client_id(&self) -> &ClientId { match self { Self::Tendermint(misbehaviour) => misbehaviour.client_id(), - - #[cfg(test)] - Self::Mock(misbehaviour) => misbehaviour.client_id(), } } fn height(&self) -> Height { match self { Self::Tendermint(misbehaviour) => misbehaviour.height(), - - #[cfg(test)] - Self::Mock(misbehaviour) => misbehaviour.height(), } } } @@ -62,11 +48,6 @@ impl TryFrom for AnyMisbehaviour { TmMisbehaviour::decode_vec(&raw.value).map_err(Error::decode_raw_misbehaviour)?, )), - #[cfg(test)] - MOCK_MISBEHAVIOUR_TYPE_URL => Ok(AnyMisbehaviour::Mock( - MockMisbehaviour::decode_vec(&raw.value).map_err(Error::decode_raw_misbehaviour)?, - )), - _ => Err(Error::unknown_misbehaviour_type(raw.type_url)), } } @@ -79,12 +60,6 @@ impl From for Any { type_url: TENDERMINT_MISBEHAVIOR_TYPE_URL.to_string(), value: misbehaviour.encode_vec(), }, - - #[cfg(test)] - AnyMisbehaviour::Mock(misbehaviour) => Any { - type_url: MOCK_MISBEHAVIOUR_TYPE_URL.to_string(), - value: misbehaviour.encode_vec(), - }, } } } @@ -93,9 +68,6 @@ impl core::fmt::Display for AnyMisbehaviour { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> { match self { AnyMisbehaviour::Tendermint(tm) => write!(f, "{tm}"), - - #[cfg(test)] - AnyMisbehaviour::Mock(mock) => write!(f, "{mock:?}"), } } } @@ -105,10 +77,3 @@ impl From for AnyMisbehaviour { Self::Tendermint(misbehaviour) } } - -#[cfg(test)] -impl From for AnyMisbehaviour { - fn from(misbehaviour: MockMisbehaviour) -> Self { - Self::Mock(misbehaviour) - } -} From bb6ed41921356a2118adbf00e99be6f944cf2fec Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 11 Apr 2024 12:07:11 +0200 Subject: [PATCH 076/200] Split ICS 02 `ClientState` trait into `ClientState` and `UpgradableClientState` traits (#3942) --- .../clients/ics07_tendermint/client_state.rs | 18 +++--- .../src/core/ics02_client/client_state.rs | 9 +-- crates/relayer/src/client_state.rs | 60 +++++-------------- crates/relayer/src/link/operational_data.rs | 2 +- crates/relayer/src/upgrade_chain.rs | 2 +- 5 files changed, 32 insertions(+), 59 deletions(-) diff --git a/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs b/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs index 597e3e78d9..818cf13347 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs @@ -12,7 +12,9 @@ use tendermint_light_client_verifier::options::Options; use crate::clients::ics07_tendermint::error::Error; use crate::clients::ics07_tendermint::header::Header as TmHeader; -use crate::core::ics02_client::client_state::ClientState as Ics2ClientState; +use crate::core::ics02_client::client_state::{ + ClientState as Ics2ClientState, UpgradableClientState, +}; use crate::core::ics02_client::client_type::ClientType; use crate::core::ics02_client::error::Error as Ics02Error; use crate::core::ics02_client::trust_threshold::TrustThreshold; @@ -192,8 +194,6 @@ pub struct UpgradeOptions { } impl Ics2ClientState for ClientState { - type UpgradeOptions = UpgradeOptions; - fn chain_id(&self) -> ChainId { self.chain_id.clone() } @@ -210,6 +210,14 @@ impl Ics2ClientState for ClientState { self.frozen_height } + fn expired(&self, elapsed: Duration) -> bool { + elapsed > self.trusting_period + } +} + +impl UpgradableClientState for ClientState { + type UpgradeOptions = UpgradeOptions; + fn upgrade( &mut self, upgrade_height: Height, @@ -229,10 +237,6 @@ impl Ics2ClientState for ClientState { self.unbonding_period = upgrade_options.unbonding_period; self.chain_id = chain_id; } - - fn expired(&self, elapsed: Duration) -> bool { - elapsed > self.trusting_period - } } impl Protobuf for ClientState {} diff --git a/crates/relayer-types/src/core/ics02_client/client_state.rs b/crates/relayer-types/src/core/ics02_client/client_state.rs index bf2d7cb706..b91baf62a1 100644 --- a/crates/relayer-types/src/core/ics02_client/client_state.rs +++ b/crates/relayer-types/src/core/ics02_client/client_state.rs @@ -6,10 +6,7 @@ use crate::core::ics24_host::identifier::ChainId; use crate::Height; -pub trait ClientState: Clone + Debug + Send + Sync // Any: From, -{ - type UpgradeOptions; - +pub trait ClientState: Clone + Debug + Send + Sync { /// Return the chain identifier which this client is serving (i.e., the client is verifying /// consensus states from this chain). fn chain_id(&self) -> ChainId; @@ -31,6 +28,10 @@ pub trait ClientState: Clone + Debug + Send + Sync // Any: From, /// Check if the state is expired when `elapsed` time has passed since the latest consensus /// state timestamp fn expired(&self, elapsed: Duration) -> bool; +} + +pub trait UpgradableClientState: ClientState { + type UpgradeOptions; /// Helper function to verify the upgrade client procedure. /// Resets all fields except the blockchain-specific ones, diff --git a/crates/relayer/src/client_state.rs b/crates/relayer/src/client_state.rs index e5a761b213..85f5b83dc4 100644 --- a/crates/relayer/src/client_state.rs +++ b/crates/relayer/src/client_state.rs @@ -1,4 +1,4 @@ -use core::time::Duration; +use std::time::Duration; use serde::{Deserialize, Serialize}; @@ -7,8 +7,7 @@ use ibc_proto::ibc::core::client::v1::IdentifiedClientState; use ibc_proto::ibc::lightclients::tendermint::v1::ClientState as RawTmClientState; use ibc_proto::Protobuf; use ibc_relayer_types::clients::ics07_tendermint::client_state::{ - ClientState as TmClientState, UpgradeOptions as TmUpgradeOptions, - TENDERMINT_CLIENT_STATE_TYPE_URL, + ClientState as TmClientState, TENDERMINT_CLIENT_STATE_TYPE_URL, }; use ibc_relayer_types::core::ics02_client::client_state::ClientState; use ibc_relayer_types::core::ics02_client::client_type::ClientType; @@ -18,20 +17,6 @@ use ibc_relayer_types::core::ics24_host::error::ValidationError; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use ibc_relayer_types::Height; -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -#[serde(tag = "type")] -pub enum AnyUpgradeOptions { - Tendermint(TmUpgradeOptions), -} - -impl AnyUpgradeOptions { - fn into_tm_upgrade_options(self) -> Option { - match self { - AnyUpgradeOptions::Tendermint(tm) => Some(tm), - } - } -} - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(tag = "type")] pub enum AnyClientState { @@ -80,6 +65,12 @@ impl AnyClientState { Self::Tendermint(state) => state.client_type(), } } + + pub fn expired(&self, elapsed: Duration) -> bool { + match self { + Self::Tendermint(state) => state.expired(elapsed), + } + } } impl Protobuf for AnyClientState {} @@ -113,47 +104,24 @@ impl From for Any { } impl ClientState for AnyClientState { - type UpgradeOptions = AnyUpgradeOptions; - fn chain_id(&self) -> ChainId { - match self { - AnyClientState::Tendermint(tm_state) => tm_state.chain_id(), - } + AnyClientState::chain_id(self) } fn client_type(&self) -> ClientType { - self.client_type() + AnyClientState::client_type(self) } fn latest_height(&self) -> Height { - self.latest_height() + AnyClientState::latest_height(self) } fn frozen_height(&self) -> Option { - self.frozen_height() + AnyClientState::frozen_height(self) } - fn upgrade( - &mut self, - upgrade_height: Height, - upgrade_options: AnyUpgradeOptions, - chain_id: ChainId, - ) { - match self { - AnyClientState::Tendermint(tm_state) => { - if let Some(upgrade_options) = upgrade_options.into_tm_upgrade_options() { - tm_state.upgrade(upgrade_height, upgrade_options, chain_id); - } - // TODO: Handle case where upgrade options are not of the right type, - // not a problem in practice for now but good to have. - } - } - } - - fn expired(&self, elapsed_since_latest: Duration) -> bool { - match self { - AnyClientState::Tendermint(tm_state) => tm_state.expired(elapsed_since_latest), - } + fn expired(&self, elapsed: Duration) -> bool { + AnyClientState::expired(self, elapsed) } } diff --git a/crates/relayer/src/link/operational_data.rs b/crates/relayer/src/link/operational_data.rs index 5c5315b09a..38d8495119 100644 --- a/crates/relayer/src/link/operational_data.rs +++ b/crates/relayer/src/link/operational_data.rs @@ -2,9 +2,9 @@ use core::fmt::{Display, Error as FmtError, Formatter}; use std::ops::Add; use std::time::{Duration, Instant}; -use ibc_proto::google::protobuf::Any; use tracing::{debug, info}; +use ibc_proto::google::protobuf::Any; use ibc_relayer_types::core::ics02_client::client_state::ClientState; use ibc_relayer_types::Height; diff --git a/crates/relayer/src/upgrade_chain.rs b/crates/relayer/src/upgrade_chain.rs index 81ec1bc579..2889d7ab62 100644 --- a/crates/relayer/src/upgrade_chain.rs +++ b/crates/relayer/src/upgrade_chain.rs @@ -14,7 +14,7 @@ use ibc_proto::cosmos::upgrade::v1beta1::Plan; use ibc_proto::google::protobuf::Any; use ibc_proto::ibc::core::client::v1::{MsgIbcSoftwareUpgrade, UpgradeProposal}; use ibc_relayer_types::clients::ics07_tendermint::client_state::UpgradeOptions; -use ibc_relayer_types::core::ics02_client::client_state::ClientState; +use ibc_relayer_types::core::ics02_client::client_state::UpgradableClientState; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use ibc_relayer_types::{downcast, Height}; use tracing::warn; From 672d2ecdec4d53c3d67f2f3f6b8df9e3a0020078 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:26:06 +0200 Subject: [PATCH 077/200] Bump bitcoin from 0.31.1 to 0.31.2 (#3938) Bumps [bitcoin](https://github.com/rust-bitcoin/rust-bitcoin) from 0.31.1 to 0.31.2. - [Release notes](https://github.com/rust-bitcoin/rust-bitcoin/releases) - [Commits](https://github.com/rust-bitcoin/rust-bitcoin/compare/bitcoin-0.31.1...bitcoin-0.31.2) --- updated-dependencies: - dependency-name: bitcoin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fbde8e6b8a..fac317bec5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -299,9 +299,9 @@ checksum = "98f7eed2b2781a6f0b5c903471d48e15f56fb4e1165df8a9a2337fd1a59d45ea" [[package]] name = "bitcoin" -version = "0.31.1" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd00f3c09b5f21fb357abe32d29946eb8bb7a0862bae62c0b5e4a692acbbe73c" +checksum = "6c85783c2fe40083ea54a33aa2f0ba58831d90fcd190f5bdc47e74e84d2a96ae" dependencies = [ "bech32 0.10.0-beta", "bitcoin-internals", diff --git a/Cargo.toml b/Cargo.toml index 06928aa369..05bf774dd8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ async-stream = "0.3.5" async-trait = "0.1.79" axum = "0.6.18" bech32 = "0.9.1" -bitcoin = "0.31.1" +bitcoin = "0.31.2" bs58 = "0.5.1" byte-unit = { version = "4.0.19", default-features = false } bytes = "1.4.0" From 585fe969d65a6e06a93926dd5ed651a6d539d79c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:26:57 +0200 Subject: [PATCH 078/200] Bump serde_json from 1.0.111 to 1.0.115 (#3935) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.111 to 1.0.115. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.111...v1.0.115) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fac317bec5..81b33b757e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2838,9 +2838,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ "itoa", "ryu", diff --git a/Cargo.toml b/Cargo.toml index 05bf774dd8..d94c805d5a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ secp256k1 = "0.28.2" semver = "1.0.21" serde = "1.0.197" serde_derive = "1.0.104" -serde_json = "1.0.111" +serde_json = "1.0.115" serde_yaml = "0.9.31" serial_test = "3.0.0" sha2 = "0.10.6" From 8ca40e3b08caca2abaea6efd5b4ea98f52f3231c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:27:17 +0200 Subject: [PATCH 079/200] Bump h2 from 0.3.25 to 0.3.26 in /tools/query-events (#3929) Bumps [h2](https://github.com/hyperium/h2) from 0.3.25 to 0.3.26. - [Release notes](https://github.com/hyperium/h2/releases) - [Changelog](https://github.com/hyperium/h2/blob/v0.3.26/CHANGELOG.md) - [Commits](https://github.com/hyperium/h2/compare/v0.3.25...v0.3.26) --- updated-dependencies: - dependency-name: h2 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- tools/query-events/Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/query-events/Cargo.lock b/tools/query-events/Cargo.lock index 599a54f9b3..2c67070e4e 100644 --- a/tools/query-events/Cargo.lock +++ b/tools/query-events/Cargo.lock @@ -474,9 +474,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "h2" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", From 1ea8227ab28715b78ce2d7e97b89b2b535391143 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 11:27:27 +0200 Subject: [PATCH 080/200] Bump h2 from 0.3.24 to 0.3.26 (#3928) Bumps [h2](https://github.com/hyperium/h2) from 0.3.24 to 0.3.26. - [Release notes](https://github.com/hyperium/h2/releases) - [Changelog](https://github.com/hyperium/h2/blob/v0.3.26/CHANGELOG.md) - [Commits](https://github.com/hyperium/h2/compare/v0.3.24...v0.3.26) --- updated-dependencies: - dependency-name: h2 dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81b33b757e..74689b42b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1249,9 +1249,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", From a67a3e1c43d9a03705e850dd7413d3cacc6ba5d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:03:26 +0200 Subject: [PATCH 081/200] Bump uuid from 1.7.0 to 1.8.0 (#3949) Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.7.0 to 1.8.0. - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/1.7.0...1.8.0) --- updated-dependencies: - dependency-name: uuid dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 74689b42b9..b2bf89c83c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1564,7 +1564,7 @@ dependencies = [ "tonic", "tracing", "tracing-subscriber", - "uuid 1.7.0", + "uuid 1.8.0", ] [[package]] @@ -1962,7 +1962,7 @@ dependencies = [ "tagptr", "thiserror", "triomphe", - "uuid 1.7.0", + "uuid 1.8.0", ] [[package]] @@ -3948,9 +3948,9 @@ checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", ] diff --git a/Cargo.toml b/Cargo.toml index d94c805d5a..12bfa070a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -115,7 +115,7 @@ tonic = "0.10" tracing = { version = "0.1.36", default-features = false } tracing-subscriber = "0.3.14" uint = "0.9" -uuid = "1.7.0" +uuid = "1.8.0" [profile.release] overflow-checks = true From 4bc63cd61b1d516dce8803198ca5ffef8f1f9772 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:03:43 +0200 Subject: [PATCH 082/200] Bump serde_yaml from 0.9.31 to 0.9.34+deprecated (#3948) Bumps [serde_yaml](https://github.com/dtolnay/serde-yaml) from 0.9.31 to 0.9.34+deprecated. - [Release notes](https://github.com/dtolnay/serde-yaml/releases) - [Commits](https://github.com/dtolnay/serde-yaml/compare/0.9.31...0.9.34) --- updated-dependencies: - dependency-name: serde_yaml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2bf89c83c..11ae2821f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2891,9 +2891,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.31" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ "indexmap 2.2.1", "itoa", @@ -3895,9 +3895,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unsafe-libyaml" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "untrusted" diff --git a/Cargo.toml b/Cargo.toml index 12bfa070a9..f5f33765ce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,7 +95,7 @@ semver = "1.0.21" serde = "1.0.197" serde_derive = "1.0.104" serde_json = "1.0.115" -serde_yaml = "0.9.31" +serde_yaml = "0.9.34" serial_test = "3.0.0" sha2 = "0.10.6" signal-hook = "0.3.17" From fb7c9dc5e0749396edd730343d3dcdd91028efff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:05:36 +0200 Subject: [PATCH 083/200] Bump time from 0.3.31 to 0.3.36 (#3946) Bumps [time](https://github.com/time-rs/time) from 0.3.31 to 0.3.36. - [Release notes](https://github.com/time-rs/time/releases) - [Changelog](https://github.com/time-rs/time/blob/main/CHANGELOG.md) - [Commits](https://github.com/time-rs/time/compare/v0.3.31...v0.3.36) --- updated-dependencies: - dependency-name: time dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11ae2821f0..61b5d58ea6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1987,6 +1987,12 @@ dependencies = [ "serde", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-derive" version = "0.3.3" @@ -3455,11 +3461,12 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", + "num-conv", "powerfmt", "serde", "time-core", @@ -3474,10 +3481,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] From ec8ae19ade9a45c02db544b3df9ba2f7abf24065 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:05:50 +0200 Subject: [PATCH 084/200] Bump prost from 0.12.3 to 0.12.4 (#3937) Bumps [prost](https://github.com/tokio-rs/prost) from 0.12.3 to 0.12.4. - [Release notes](https://github.com/tokio-rs/prost/releases) - [Commits](https://github.com/tokio-rs/prost/compare/v0.12.3...v0.12.4) --- updated-dependencies: - dependency-name: prost dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 61b5d58ea6..bde8e8d6a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1451,7 +1451,7 @@ dependencies = [ "http", "ibc-proto", "ibc-relayer-types", - "itertools 0.10.5", + "itertools", "reqwest", "serde", "serde_json", @@ -1527,7 +1527,7 @@ dependencies = [ "ibc-proto", "ibc-relayer-types", "ibc-telemetry", - "itertools 0.10.5", + "itertools", "moka", "num-bigint", "num-rational", @@ -1590,7 +1590,7 @@ dependencies = [ "ibc-relayer-rest", "ibc-relayer-types", "ibc-telemetry", - "itertools 0.10.5", + "itertools", "once_cell", "oneline-eyre", "regex", @@ -1633,7 +1633,7 @@ dependencies = [ "flex-error", "ibc-proto", "ics23", - "itertools 0.10.5", + "itertools", "num-rational", "primitive-types", "prost", @@ -1688,7 +1688,7 @@ dependencies = [ "ibc-relayer", "ibc-relayer-cli", "ibc-relayer-types", - "itertools 0.10.5", + "itertools", "once_cell", "prost", "rand", @@ -1801,15 +1801,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.10" @@ -2349,9 +2340,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" dependencies = [ "bytes", "prost-derive", @@ -2359,12 +2350,12 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" dependencies = [ "anyhow", - "itertools 0.11.0", + "itertools", "proc-macro2", "quote", "syn 2.0.48", From 4ece16adb56b4b8f3a6c331f6ca6a3551a12265a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:06:19 +0200 Subject: [PATCH 085/200] Bump peaceiris/actions-gh-pages from 3 to 4 (#3934) Bumps [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) from 3 to 4. - [Release notes](https://github.com/peaceiris/actions-gh-pages/releases) - [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md) - [Commits](https://github.com/peaceiris/actions-gh-pages/compare/v3...v4) --- updated-dependencies: - dependency-name: peaceiris/actions-gh-pages dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/cargo-doc.yaml | 2 +- .github/workflows/guide.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cargo-doc.yaml b/.github/workflows/cargo-doc.yaml index 8cf05b4045..c26f1d9248 100644 --- a/.github/workflows/cargo-doc.yaml +++ b/.github/workflows/cargo-doc.yaml @@ -39,7 +39,7 @@ jobs: - name: Push API documentation to GitHub Pages if: github.ref == 'refs/heads/master' - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: deploy_key: ${{ secrets.IBC_RS_DOC_PRIVATE_KEY }} external_repository: informalsystems/hermes-api-doc diff --git a/.github/workflows/guide.yml b/.github/workflows/guide.yml index 5f37b5665e..869c5a4f6f 100644 --- a/.github/workflows/guide.yml +++ b/.github/workflows/guide.yml @@ -33,7 +33,7 @@ jobs: # Only deploy guide when releasing a new version of Hermes - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') with: github_token: ${{ secrets.GITHUB_TOKEN }} From d0b2491a2572000ffed84a24114062648e6f99f1 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Thu, 18 Apr 2024 17:06:45 +0200 Subject: [PATCH 086/200] Update Gaia, Stride, Neutron and Osmosis versions used in CI (#3944) * Use Gaia v15.2.0 in CI jobs * Update consumer chain bootstrap in test-framework * Fix ICQ test * Update dev-env script to work with Gaia v15 * Fix ICQ test by increasing time between ICQs * Fix Celestia CI job * Fix create_fork.sh used in misbehaviour test * Fix client upgrade test * Fix bug where only first CCQ event was extracted (#3955) * Fix create_fork.sh used in misbehaviour test * Fix client upgrade test * Fix 'interchainquery' event extraction to extract all events instead of only the first one * Add changelog entry * Update .changelog/unreleased/bug-fixes/ibc-relayer/3954-interchainquery-missed-events.md Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * ICS 031 event extraction perf improvement and refactor (#3956) * Small performance optimizations * Re-use existing `append_events` infrastructure * Cleanup * Add the flag '--reject-config-defaults' to the start command for Osmosis --------- Co-authored-by: Luca Joss Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi --- .../3954-interchainquery-missed-events.md | 2 + .github/workflows/integration.yaml | 75 +++---------------- .github/workflows/misbehaviour.yml | 2 +- .github/workflows/multi-chains.yaml | 5 +- ci/misbehaviour/create_fork.sh | 4 +- .../src/applications/ics31_icq/events.rs | 72 ++---------------- .../src/chain/cosmos/types/events/channel.rs | 24 ++++++ crates/relayer/src/error.rs | 4 + .../relayer/src/event/source/rpc/extract.rs | 2 +- .../src/event/source/websocket/extract.rs | 16 +++- flake.lock | 69 +++++++++-------- flake.nix | 5 +- scripts/one-chain | 18 +++-- .../src/tests/client_upgrade.rs | 20 ++++- .../src/tests/interchain_security/icq.rs | 67 ++++++++++++----- .../test-framework/src/bootstrap/consumer.rs | 1 + tools/test-framework/src/chain/chain_type.rs | 13 +++- .../test-framework/src/chain/cli/host_zone.rs | 5 +- .../test-framework/src/chain/cli/provider.rs | 2 +- tools/test-framework/src/chain/config.rs | 19 +++++ .../test-framework/src/chain/ext/bootstrap.rs | 2 +- .../src/chain/ext/crosschainquery.rs | 7 +- .../test-framework/src/chain/ext/proposal.rs | 4 +- tools/test-framework/src/relayer/channel.rs | 21 +++++- 24 files changed, 235 insertions(+), 224 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer/3954-interchainquery-missed-events.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/3954-interchainquery-missed-events.md b/.changelog/unreleased/bug-fixes/ibc-relayer/3954-interchainquery-missed-events.md new file mode 100644 index 0000000000..9ac2212acb --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer/3954-interchainquery-missed-events.md @@ -0,0 +1,2 @@ +- Fix a bug where Hermes would only ever extract the first emitted ICS 031 CrossChain Query event, which would cause it to miss the other CCQ events. + ([\#3954](https://github.com/informalsystems/hermes/issues/3954)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index bbea3de5b5..5065d78e6e 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -45,12 +45,7 @@ jobs: fail-fast: false matrix: chain: - - package: gaia13 - command: gaiad - account_prefix: cosmos - native_token: stake - features: forward-packet,clean-workers - - package: gaia14 + - package: gaia15 command: gaiad account_prefix: cosmos native_token: stake @@ -170,63 +165,18 @@ jobs: cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \ --features ordered test_ordered_channel - interchain-security-no-ica: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - chain: - - package: .#gaia13 .#neutron - command: gaiad,neutrond - account_prefix: cosmos,neutron - - package: .#gaia14 .#neutron - command: gaiad,neutrond - account_prefix: cosmos,neutron - steps: - - uses: actions/checkout@v4 - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main - with: - extra-conf: | - substituters = https://cache.nixos.org - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - - name: Install Cachix - uses: cachix/cachix-action@v14 - with: - name: cosmos-nix - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: stable - - uses: actions-rs/cargo@v1 - with: - command: test - args: -p ibc-integration-test --features interchain-security --no-fail-fast --no-run - - name: Install cargo-nextest - run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin - - env: - RUST_LOG: trace - RUST_BACKTRACE: 1 - NO_COLOR_LOG: 1 - NEXTEST_RETRIES: 2 - CHAIN_COMMAND_PATHS: ${{ matrix.chain.command }} - ACCOUNT_PREFIXES: ${{ matrix.chain.account_prefix }} - run: | - nix shell ${{ matrix.chain.package }} -c \ - cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \ - --features interchain-security interchain_security:: - interchain-security-ica: runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: chain: - - package: .#gaia13 .#stride-consumer - command: gaiad,strided - account_prefix: cosmos,stride - - package: .#gaia14 .#stride-consumer + - package: .#gaia15 .#stride command: gaiad,strided account_prefix: cosmos,stride + - package: .#gaia15 .#neutron + command: gaiad,neutrond + account_prefix: cosmos,neutron steps: - uses: actions/checkout@v4 - name: Install Nix @@ -245,7 +195,7 @@ jobs: - uses: actions-rs/cargo@v1 with: command: test - args: -p ibc-integration-test --features interchain-security --no-fail-fast --no-run + args: -p ibc-integration-test --features interchain-security,ica --no-fail-fast --no-run - name: Install cargo-nextest run: curl -LsSf https://get.nexte.st/latest/linux | tar zxf - -C ${CARGO_HOME:-~/.cargo}/bin - env: @@ -266,10 +216,7 @@ jobs: fail-fast: false matrix: chain: - - package: .#gaia13 .#stride-consumer-no-admin - command: gaiad,strided - account_prefix: cosmos,stride - - package: .#gaia14 .#stride-consumer-no-admin + - package: .#gaia15 .#stride-no-admin command: gaiad,strided account_prefix: cosmos,stride steps: @@ -310,11 +257,7 @@ jobs: fail-fast: false matrix: chain: - - package: .#celestia .#gaia13 - command: celestia-appd,gaiad - account_prefix: celestia,cosmos - native_token: utia,stake - - package: .#celestia .#gaia14 + - package: .#celestia .#gaia15 command: celestia-appd,gaiad account_prefix: celestia,cosmos native_token: utia,stake @@ -343,7 +286,7 @@ jobs: RUST_LOG: info RUST_BACKTRACE: 1 NO_COLOR_LOG: 1 - COMPAT_MODES: 0.34 + COMPAT_MODES: 0.34,0.37 CHAIN_COMMAND_PATHS: ${{ matrix.chain.command }} ACCOUNT_PREFIXES: ${{ matrix.chain.account_prefix }} NATIVE_TOKENS: ${{ matrix.chain.native_token }} diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index f9f9d9f635..378185e459 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -43,7 +43,7 @@ jobs: fail-fast: false matrix: chain: - - package: gaia14 + - package: gaia15 command: gaiad account_prefix: cosmos steps: diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index 013ab5c915..352cbb7a47 100644 --- a/.github/workflows/multi-chains.yaml +++ b/.github/workflows/multi-chains.yaml @@ -58,10 +58,7 @@ jobs: fail-fast: false matrix: first-package: - - package: gaia13 - command: gaiad - account_prefix: cosmos - - package: gaia14 + - package: gaia15 command: gaiad account_prefix: cosmos - package: ibc-go-v7-simapp diff --git a/ci/misbehaviour/create_fork.sh b/ci/misbehaviour/create_fork.sh index 66092298d0..c21eefa7f0 100755 --- a/ci/misbehaviour/create_fork.sh +++ b/ci/misbehaviour/create_fork.sh @@ -50,7 +50,7 @@ sconfig data/ibc-1-f/config/config.toml "rpc.laddr=tcp://0.0.0.0:26457" sconfig data/ibc-1-f/config/config.toml "p2p.laddr=tcp://0.0.0.0:26456" info "Starting ibc-1..." -gaiad --home ./data/ibc-1 start --pruning=nothing --grpc.address=0.0.0.0:9091 --log_level error > data/ibc-1.log 2>&1 & +gaiad --home ./data/ibc-1 start --pruning=nothing --rpc.laddr="tcp://0.0.0.0:26557" --grpc.address=0.0.0.0:9091 --log_level error > data/ibc-1.log 2>&1 & info "Starting ibc-1 fork..." -gaiad --home ./data/ibc-1-f start --pruning=nothing --grpc.address=0.0.0.0:9092 --log_level error > data/ibc-1-f.log 2>&1 & +gaiad --home ./data/ibc-1-f start --pruning=nothing --rpc.laddr="tcp://0.0.0.0:26457" --grpc.address=0.0.0.0:9092 --log_level error > data/ibc-1-f.log 2>&1 & diff --git a/crates/relayer-types/src/applications/ics31_icq/events.rs b/crates/relayer-types/src/applications/ics31_icq/events.rs index 739fecedba..b14a5d668f 100644 --- a/crates/relayer-types/src/applications/ics31_icq/events.rs +++ b/crates/relayer-types/src/applications/ics31_icq/events.rs @@ -1,4 +1,3 @@ -use std::collections::BTreeMap; use std::str::FromStr; use serde::{Deserialize, Serialize}; @@ -9,7 +8,7 @@ use crate::events::IbcEvent; use super::error::Error; -const EVENT_TYPE_PREFIX: &str = "query_request"; +pub const EVENT_TYPE_PREFIX: &str = "query_request"; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq)] pub struct CrossChainQueryPacket { @@ -23,6 +22,12 @@ pub struct CrossChainQueryPacket { pub request: String, } +impl From for IbcEvent { + fn from(packet: CrossChainQueryPacket) -> Self { + IbcEvent::CrossChainQueryPacket(packet) + } +} + fn find_value<'a>(key: &str, entries: &'a [abci::EventAttribute]) -> Result<&'a str, Error> { entries .iter() @@ -93,66 +98,3 @@ impl<'a> TryFrom<&'a [abci::EventAttribute]> for CrossChainQueryPacket { }) } } - -fn fetch_first_element_from_events( - block_events: &BTreeMap>, - key: &str, -) -> Result { - let res = block_events - .get(key) - .ok_or_else(|| Error::event(format!("attribute not found for key: {key}")))? - .first() - .ok_or_else(|| { - Error::event(format!( - "element at position 0, of attribute with key `{key}`, not found" - )) - })?; - - Ok(res.clone()) -} - -impl CrossChainQueryPacket { - pub fn extract_query_event( - block_events: &BTreeMap>, - ) -> Result { - let chain_id_str = fetch_first_element_from_events( - block_events, - &format!("{}.{}", EVENT_TYPE_PREFIX, "chain_id"), - )?; - let connection_id_str = fetch_first_element_from_events( - block_events, - &format!("{}.{}", EVENT_TYPE_PREFIX, "connection_id"), - )?; - let query_type = fetch_first_element_from_events( - block_events, - &format!("{}.{}", EVENT_TYPE_PREFIX, "type"), - )?; - let height_str = fetch_first_element_from_events( - block_events, - &format!("{}.{}", EVENT_TYPE_PREFIX, "height"), - )?; - - Ok(IbcEvent::CrossChainQueryPacket(CrossChainQueryPacket { - module: fetch_first_element_from_events( - block_events, - &format!("{}.{}", EVENT_TYPE_PREFIX, "module"), - )?, - action: fetch_first_element_from_events( - block_events, - &format!("{}.{}", EVENT_TYPE_PREFIX, "action"), - )?, - query_id: fetch_first_element_from_events( - block_events, - &format!("{}.{}", EVENT_TYPE_PREFIX, "query_id"), - )?, - chain_id: ChainId::from_string(&chain_id_str), - connection_id: ConnectionId::from_str(&connection_id_str)?, - query_type, - height: Height::from_str(&height_str)?, - request: fetch_first_element_from_events( - block_events, - &format!("{}.{}", EVENT_TYPE_PREFIX, "request"), - )?, - })) - } -} diff --git a/crates/relayer/src/chain/cosmos/types/events/channel.rs b/crates/relayer/src/chain/cosmos/types/events/channel.rs index 6844900ba9..6849fab285 100644 --- a/crates/relayer/src/chain/cosmos/types/events/channel.rs +++ b/crates/relayer/src/chain/cosmos/types/events/channel.rs @@ -1,5 +1,6 @@ use alloc::collections::btree_map::BTreeMap as HashMap; +use ibc_relayer_types::applications::ics31_icq::events::CrossChainQueryPacket; use ibc_relayer_types::core::ics02_client::height::HeightErrorDetail; use ibc_relayer_types::core::ics04_channel::error::Error; use ibc_relayer_types::core::ics04_channel::events::{ @@ -12,6 +13,7 @@ use ibc_relayer_types::core::ics04_channel::events::{ use ibc_relayer_types::core::ics04_channel::events::{ReceivePacket, TimeoutOnClosePacket}; use ibc_relayer_types::core::ics04_channel::packet::Packet; use ibc_relayer_types::core::ics04_channel::timeout::TimeoutHeight; +use ibc_relayer_types::core::ics24_host::identifier::ChainId; use ibc_relayer_types::events::Error as EventError; use ibc_relayer_types::Height; @@ -176,6 +178,28 @@ impl TryFrom> for Packet { } } +impl TryFrom> for CrossChainQueryPacket { + type Error = EventError; + + fn try_from(obj: RawObject<'_>) -> Result { + Ok(Self { + module: extract_attribute(&obj, &format!("{}.module", obj.action))?, + action: extract_attribute(&obj, &format!("{}.action", obj.action))?, + query_id: extract_attribute(&obj, &format!("{}.query_id", obj.action))?, + chain_id: extract_attribute(&obj, &format!("{}.chain_id", obj.action)) + .map(|s| ChainId::from_string(&s))?, + connection_id: extract_attribute(&obj, &format!("{}.connection_id", obj.action))? + .parse() + .map_err(EventError::parse)?, + query_type: extract_attribute(&obj, &format!("{}.type", obj.action))?, + request: extract_attribute(&obj, &format!("{}.request", obj.action))?, + height: extract_attribute(&obj, &format!("{}.height", obj.action))? + .parse() + .map_err(|_| EventError::height())?, + }) + } +} + #[derive(Debug, Clone)] pub struct RawObject<'a> { pub height: Height, diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index 4dcde924d4..aa6e312a32 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -520,6 +520,10 @@ define_error! { { address: String } |e| { format!("Query/Account RPC returned an empty account for address: {}", e.address) }, + EmptyProposal + { proposal_id: String } + |e| { format!("Query/Proposal RPC returned an empty proposal for proposal id: {}", e.proposal_id) }, + NoHistoricalEntries { chain_id: ChainId } |e| { diff --git a/crates/relayer/src/event/source/rpc/extract.rs b/crates/relayer/src/event/source/rpc/extract.rs index 7df189cd38..819194c4b0 100644 --- a/crates/relayer/src/event/source/rpc/extract.rs +++ b/crates/relayer/src/event/source/rpc/extract.rs @@ -1,6 +1,6 @@ -use ibc_relayer_types::applications::ics29_fee::events::DistributionType; use tendermint::abci; +use ibc_relayer_types::applications::ics29_fee::events::DistributionType; use ibc_relayer_types::core::ics02_client::height::Height; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use ibc_relayer_types::events::IbcEvent; diff --git a/crates/relayer/src/event/source/websocket/extract.rs b/crates/relayer/src/event/source/websocket/extract.rs index 4a183edfb8..b905c9e561 100644 --- a/crates/relayer/src/event/source/websocket/extract.rs +++ b/crates/relayer/src/event/source/websocket/extract.rs @@ -1,6 +1,7 @@ use alloc::collections::BTreeMap as HashMap; use ibc_relayer_types::applications::ics29_fee::events::DistributionType; +use ibc_relayer_types::applications::ics31_icq; use tendermint_rpc::{event::Event as RpcEvent, event::EventData as RpcEventData}; use ibc_relayer_types::applications::ics31_icq::events::CrossChainQueryPacket; @@ -328,10 +329,17 @@ fn extract_block_events( extract_events(height, block_events, "channel_close_confirm", "channel_id"), height, ); - // extract cross chain query event from block_events - if let Ok(ccq) = CrossChainQueryPacket::extract_query_event(block_events) { - events.push(IbcEventWithHeight::new(ccq, height)); - } + + append_events::( + &mut events, + extract_events( + height, + block_events, + ics31_icq::events::EVENT_TYPE_PREFIX, + "query_id", + ), + height, + ); events } diff --git a/flake.lock b/flake.lock index abf4702b70..520cb5024f 100644 --- a/flake.lock +++ b/flake.lock @@ -152,6 +152,7 @@ "gaia12-src": "gaia12-src", "gaia13-src": "gaia13-src", "gaia14-src": "gaia14-src", + "gaia15-src": "gaia15-src", "gaia5-src": "gaia5-src", "gaia6-ordered-src": "gaia6-ordered-src", "gaia6-src": "gaia6-src", @@ -196,7 +197,6 @@ "slinky-src": "slinky-src", "stargaze-src": "stargaze-src", "stoml-src": "stoml-src", - "stride-consumer-src": "stride-consumer-src", "stride-src": "stride-src", "umee-src": "umee-src", "wasmd-src": "wasmd-src", @@ -213,11 +213,11 @@ "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" }, "locked": { - "lastModified": 1712575879, - "narHash": "sha256-GYXUqApWtdkEYW50rRPaVCcEXEkMS/JE1UVacQCgRdg=", + "lastModified": 1713267602, + "narHash": "sha256-2zfGCgm2wdoCLVTEzxKWXYLjciwpVEukDIpwlA5CnZI=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "2555dd09ad8c2b69281baf30aeb561dd506766f2", + "rev": "ffd8ab2cf6a7746f50474c85f097ad426d05c75d", "type": "github" }, "original": { @@ -592,6 +592,23 @@ "type": "github" } }, + "gaia15-src": { + "flake": false, + "locked": { + "lastModified": 1712522710, + "narHash": "sha256-2LsF++HkbVpX9h4DgkNea5nnyEuhDQSlNOAICdhAggU=", + "owner": "cosmos", + "repo": "gaia", + "rev": "7281c9b9dc4e3087ee87f5b24e416802b52e8661", + "type": "github" + }, + "original": { + "owner": "cosmos", + "ref": "v15.2.0", + "repo": "gaia", + "type": "github" + } + }, "gaia5-src": { "flake": false, "locked": { @@ -1106,15 +1123,16 @@ "neutron-src": { "flake": false, "locked": { - "narHash": "sha256-NuoOlrciBeL2f/A7wlQBqYlYJhSYucXRhLgxdasfyhI=", + "lastModified": 1712330928, + "narHash": "sha256-3olixILNnkRcNwtpPDqQJ63cYjV5qiVYTM+fJEIH65s=", "owner": "neutron-org", "repo": "neutron", - "rev": "e605ed3db4381994ee8185ba4a0ff0877d34e67f", + "rev": "d652580f204231a5d6d76c83a084d7110d981416", "type": "github" }, "original": { "owner": "neutron-org", - "ref": "v2.0.0", + "ref": "v3.0.2", "repo": "neutron", "type": "github" } @@ -1319,11 +1337,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1712543224, - "narHash": "sha256-9RSfZL1TKYdGxZwgDxwtBtsKMGR4Zgn+DAnF9s71/lU=", + "lastModified": 1713254108, + "narHash": "sha256-0TZIsfDbHG5zibtlw6x0yOp3jkInIGaJ35B7Y4G8Pec=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b0dab7cc34ef4d8a1b2de36178da801090bcb271", + "rev": "2fd19c8be2551a61c1ddc3d9f86d748f4db94f00", "type": "github" }, "original": { @@ -1336,16 +1354,16 @@ "osmosis-src": { "flake": false, "locked": { - "lastModified": 1707262742, - "narHash": "sha256-DudppJmGaToUcYVbVA17FVXlev1NuoSY+Jy2c7PpZlY=", + "lastModified": 1712687434, + "narHash": "sha256-j1PtSv4i/3IV6hUHxxgO/5t9/bfWs28i3D/uVAkf68Q=", "owner": "osmosis-labs", "repo": "osmosis", - "rev": "350901e523815fc34a1de1ca54e9ccd3c4d1f756", + "rev": "0021d3812a8c8d2798ab17e58991a677b82e8955", "type": "github" }, "original": { "owner": "osmosis-labs", - "ref": "v22.0.5", + "ref": "v24.0.1", "repo": "osmosis", "type": "github" } @@ -1583,34 +1601,19 @@ "type": "github" } }, - "stride-consumer-src": { - "flake": false, - "locked": { - "narHash": "sha256-DByig9ISs9x9Kvakc8LFL558VKhM+UBiaESWgyVzI0w=", - "owner": "Stride-Labs", - "repo": "stride", - "rev": "bbf0bb7f52878f3205c76bb1e96662fe7bd7af8d", - "type": "github" - }, - "original": { - "owner": "Stride-Labs", - "ref": "v12.1.0", - "repo": "stride", - "type": "github" - } - }, "stride-src": { "flake": false, "locked": { - "narHash": "sha256-fdjnFHPBZNnhDyVoMuPfqNb6YUYRdcMO73FlZHjIuzA=", + "lastModified": 1711572539, + "narHash": "sha256-WOoaijuB/Xziw3RMzVcLgR1iDWv72StuLL8K5JzcdlA=", "owner": "Stride-Labs", "repo": "stride", - "rev": "3c69e7644859981b1fd9313eb1f0c5e5886e4a0d", + "rev": "093f25e17b1c9fae38a8092f9582af7c84bbaee4", "type": "github" }, "original": { "owner": "Stride-Labs", - "ref": "v8.0.0", + "ref": "v21.0.0", "repo": "stride", "type": "github" } diff --git a/flake.nix b/flake.nix index 9f823c4f16..9fd05f9ce9 100644 --- a/flake.nix +++ b/flake.nix @@ -32,8 +32,7 @@ cometbft evmos gaia6-ordered - gaia13 - gaia14 + gaia15 ibc-go-v2-simapp ibc-go-v3-simapp ibc-go-v4-simapp @@ -49,8 +48,6 @@ provenance stride stride-no-admin - stride-consumer-no-admin - stride-consumer wasmd injective ; diff --git a/scripts/one-chain b/scripts/one-chain index 47bf41365e..7ad2e0dfe2 100755 --- a/scripts/one-chain +++ b/scripts/one-chain @@ -89,25 +89,25 @@ sleep 1 # Add samoleans to user USER=$($BINARY --home $CHAIN_DIR/$CHAIN_ID keys --keyring-backend="test" show user -a) -$BINARY --home $CHAIN_DIR/$CHAIN_ID add-genesis-account $USER $USER_COINS &> /dev/null +$BINARY --home $CHAIN_DIR/$CHAIN_ID genesis add-genesis-account $USER $USER_COINS &> /dev/null sleep 1 # Add samoleans to user2 USER2=$($BINARY --home $CHAIN_DIR/$CHAIN_ID keys --keyring-backend="test" show user2 -a) -$BINARY --home $CHAIN_DIR/$CHAIN_ID add-genesis-account $USER2 $USER_COINS &> /dev/null +$BINARY --home $CHAIN_DIR/$CHAIN_ID genesis add-genesis-account $USER2 $USER_COINS &> /dev/null sleep 1 # Add stake to validator VALIDATOR=$($BINARY --home $CHAIN_DIR/$CHAIN_ID keys --keyring-backend="test" show validator -a) -$BINARY --home $CHAIN_DIR/$CHAIN_ID add-genesis-account $VALIDATOR $STAKE &> /dev/null +$BINARY --home $CHAIN_DIR/$CHAIN_ID genesis add-genesis-account $VALIDATOR $STAKE &> /dev/null sleep 1 # Stake everything -$BINARY --home $CHAIN_DIR/$CHAIN_ID gentx validator --keyring-backend="test" --chain-id $CHAIN_ID $STAKE &> /dev/null +$BINARY --home $CHAIN_DIR/$CHAIN_ID genesis gentx validator --keyring-backend="test" --chain-id $CHAIN_ID $STAKE &> /dev/null sleep 1 -$BINARY --home $CHAIN_DIR/$CHAIN_ID collect-gentxs &> /dev/null +$BINARY --home $CHAIN_DIR/$CHAIN_ID genesis collect-gentxs &> /dev/null sleep 1 # Check platform @@ -121,23 +121,25 @@ fi echo "Change settings in config.toml file..." if [ $platform = 'linux' ]; then sed -i 's#"172800s"#"200s"#g' $CHAIN_DIR/$CHAIN_ID/config/genesis.json - sed -i 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$RPC_PORT"'"#g' $CHAIN_DIR/$CHAIN_ID/config/config.toml + sed -i 's#"tcp://0.0.0.0:26657"#"tcp://0.0.0.0:'"$RPC_PORT"'"#g' $CHAIN_DIR/$CHAIN_ID/config/config.toml sed -i 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$P2P_PORT"'"#g' $CHAIN_DIR/$CHAIN_ID/config/config.toml sed -i 's#"localhost:6060"#"localhost:'"$PROF_PORT"'"#g' $CHAIN_DIR/$CHAIN_ID/config/config.toml sed -i 's/timeout_commit = "5s"/timeout_commit = "1s"/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml sed -i 's/timeout_propose = "3s"/timeout_propose = "1s"/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml sed -i 's/index_all_keys = false/index_all_keys = true/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml sed -i '/^\[grpc-web\]/,/^\[/s/^enable = true/enable = false/' $CHAIN_DIR/$CHAIN_ID/config/app.toml + sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0stake"/g' $CHAIN_DIR/$CHAIN_ID/config/app.toml # sed -i '' 's#index-events = \[\]#index-events = \["message.action","send_packet.packet_src_channel","send_packet.packet_sequence"\]#g' $CHAIN_DIR/$CHAIN_ID/config/app.toml else sed -i '' 's#"172800s"#"200s"#g' $CHAIN_DIR/$CHAIN_ID/config/genesis.json - sed -i '' 's#"tcp://127.0.0.1:26657"#"tcp://0.0.0.0:'"$RPC_PORT"'"#g' $CHAIN_DIR/$CHAIN_ID/config/config.toml + sed -i '' 's#"tcp://0.0.0.0:26657"#"tcp://0.0.0.0:'"$RPC_PORT"'"#g' $CHAIN_DIR/$CHAIN_ID/config/config.toml sed -i '' 's#"tcp://0.0.0.0:26656"#"tcp://0.0.0.0:'"$P2P_PORT"'"#g' $CHAIN_DIR/$CHAIN_ID/config/config.toml sed -i '' 's#"localhost:6060"#"localhost:'"$PROF_PORT"'"#g' $CHAIN_DIR/$CHAIN_ID/config/config.toml sed -i '' 's/timeout_commit = "5s"/timeout_commit = "1s"/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml sed -i '' 's/timeout_propose = "3s"/timeout_propose = "1s"/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml sed -i '' 's/index_all_keys = false/index_all_keys = true/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml sed -i '' '/^\[grpc-web\]/,/^\[/s/^enable = true/enable = false/' $CHAIN_DIR/$CHAIN_ID/config/app.toml + sed -i '' 's/minimum-gas-prices = ""/minimum-gas-prices = "0stake"/g' $CHAIN_DIR/$CHAIN_ID/config/app.toml # sed -i '' 's/min-retain-blocks = 0/min-retain-blocks = 100/g' $CHAIN_DIR/$CHAIN_ID/config/app.toml # sed -i '' 's#index-events = \[\]#index-events = \["message.action","send_packet.packet_src_channel","send_packet.packet_sequence"\]#g' $CHAIN_DIR/$CHAIN_ID/config/app.toml # sed -i '' 's/error/debug/g' $CHAIN_DIR/$CHAIN_ID/config/config.toml @@ -146,7 +148,7 @@ fi # Start gaia echo "Start gaia on grpc port: $GRPC_PORT..." -$BINARY --home $CHAIN_DIR/$CHAIN_ID start --pruning=nothing --grpc.address="0.0.0.0:$GRPC_PORT" --log_level info > $CHAIN_DIR/$CHAIN_ID.log 2>&1 & +$BINARY --home $CHAIN_DIR/$CHAIN_ID start --pruning=nothing --rpc.laddr="tcp://0.0.0.0:$RPC_PORT" --grpc.address="0.0.0.0:$GRPC_PORT" --log_level info > $CHAIN_DIR/$CHAIN_ID.log 2>&1 & # Show validator's and user's balance sleep 3 diff --git a/tools/integration-test/src/tests/client_upgrade.rs b/tools/integration-test/src/tests/client_upgrade.rs index 01731e6d8b..9cf174abff 100644 --- a/tools/integration-test/src/tests/client_upgrade.rs +++ b/tools/integration-test/src/tests/client_upgrade.rs @@ -32,6 +32,7 @@ const MAX_DEPOSIT_PERIOD: &str = "10s"; const VOTING_PERIOD: u64 = 10; const DELTA_HEIGHT: u64 = 15; const WAIT_CHAIN_UPGRADE: Duration = Duration::from_secs(4); +const WAIT_CHAIN_HEIGHT: Duration = Duration::from_secs(3); const MIN_DEPOSIT: u64 = 10000000u64; #[test] @@ -134,15 +135,28 @@ impl BinaryChainTest for ClientUpgradeTest { "1", )?; - // Wait for the chain to upgrade - std::thread::sleep(WAIT_CHAIN_UPGRADE); + let halt_height = (client_upgrade_height - 1).unwrap(); + + // Wait for the chain to get to the halt height + loop { + let latest_height = chains.handle_a().query_latest_height()?; + info!("latest height: {latest_height}"); + + if latest_height >= halt_height { + break; + } + std::thread::sleep(WAIT_CHAIN_HEIGHT); + } + // Wait for an additional height which is required to fetch + // the header + std::thread::sleep(WAIT_CHAIN_HEIGHT); // Trigger the client upgrade // The error is ignored as the client state will be asserted afterwards. let _ = foreign_clients.client_a_to_b.upgrade(client_upgrade_height); // Wait to seconds before querying the client state - std::thread::sleep(Duration::from_secs(2)); + std::thread::sleep(WAIT_CHAIN_UPGRADE); let (state, _) = chains.handle_b().query_client_state( QueryClientStateRequest { diff --git a/tools/integration-test/src/tests/interchain_security/icq.rs b/tools/integration-test/src/tests/interchain_security/icq.rs index d1fde8a0c9..3c78fbac3e 100644 --- a/tools/integration-test/src/tests/interchain_security/icq.rs +++ b/tools/integration-test/src/tests/interchain_security/icq.rs @@ -9,24 +9,21 @@ //! The test then waits for a Cross-chain Query to be pending and //! then processed. -use ibc_relayer::config::{self, ModeConfig}; - +use ibc_test_framework::chain::cli::host_zone::register_host_zone; +use ibc_test_framework::chain::config::{ + set_crisis_denom, set_mint_mint_denom, set_staking_bond_denom, set_staking_max_entries, + set_voting_period, +}; +use ibc_test_framework::chain::ext::crosschainquery::CrossChainQueryMethodsExt; +use ibc_test_framework::framework::binary::channel::run_binary_interchain_security_channel_test; use ibc_test_framework::prelude::*; +use ibc_test_framework::relayer::channel::{ + assert_eventually_channel_established, query_identified_channel_ends, +}; use ibc_test_framework::util::interchain_security::{ update_genesis_for_consumer_chain, update_relayer_config_for_consumer_chain, }; use ibc_test_framework::util::random::random_u128_range; -use ibc_test_framework::{ - chain::{ - cli::host_zone::register_host_zone, - config::{ - set_crisis_denom, set_mint_mint_denom, set_staking_bond_denom, set_staking_max_entries, - set_voting_period, - }, - ext::crosschainquery::CrossChainQueryMethodsExt, - }, - framework::binary::channel::run_binary_interchain_security_channel_test, -}; #[test] fn test_ics31_cross_chain_queries() -> Result<(), Error> { @@ -54,7 +51,14 @@ impl TestOverrides for InterchainSecurityIcqTest { .get_mut("duration") .ok_or_else(|| eyre!("failed to get duration"))?; - *duration = serde_json::Value::String("20s".to_owned()); + *duration = serde_json::Value::String("25s".to_owned()); + } else if identifier.as_str() == Some("day") { + // The stride epoch must be 1/4th the length of the day epoch + let duration = v + .get_mut("duration") + .ok_or_else(|| eyre!("failed to get duration"))?; + + *duration = serde_json::Value::String("100s".to_owned()); } } set_voting_period(genesis, 10)?; @@ -72,11 +76,9 @@ impl TestOverrides for InterchainSecurityIcqTest { // When calling `strided tx stakeibc register-host-zone` new channel // will be created. So the channel worker needs to be enabled. fn modify_relayer_config(&self, config: &mut Config) { - config.mode = ModeConfig { - connections: config::Connections { enabled: false }, - channels: config::Channels { enabled: true }, - ..Default::default() - }; + config.mode.clients.misbehaviour = false; + config.mode.connections.enabled = true; + config.mode.channels.enabled = true; update_relayer_config_for_consumer_chain(config); } @@ -139,6 +141,33 @@ impl BinaryChannelTest for InterchainSecurityIcqTest { &wallet_b.0.id.to_string(), )?; + // Wait for channel to initialise so that the query can find + // all the channels related to registering a host-zone + std::thread::sleep(Duration::from_secs(5)); + + let channels = query_identified_channel_ends::(chains.handle_a())?; + + // Wait for channel created by registering a host-zone to be Open + for channel in channels.iter() { + let tagged_channel_id: TaggedChannelId = + DualTagged::new(channel.0.channel_id.clone()); + let tagged_port_id: TaggedPortId = + DualTagged::new(channel.0.port_id.clone()); + + if channel.0.port_id.as_str() == "icahost" { + info!( + "Will assert that channel {}/{} is eventually Open", + channel.0.channel_id, channel.0.port_id + ); + assert_eventually_channel_established( + chains.handle_a(), + chains.handle_b(), + &tagged_channel_id.as_ref(), + &tagged_port_id.as_ref(), + )?; + } + } + // Wait for the cross chain query to be pending. chains .node_b diff --git a/tools/test-framework/src/bootstrap/consumer.rs b/tools/test-framework/src/bootstrap/consumer.rs index bd60bcdab1..6c85595331 100644 --- a/tools/test-framework/src/bootstrap/consumer.rs +++ b/tools/test-framework/src/bootstrap/consumer.rs @@ -74,6 +74,7 @@ pub fn bootstrap_consumer_node( config::set_soft_opt_out_threshold(genesis, "0.05")?; config::consensus_params_max_gas(genesis, "3000000")?; config::globalfee_minimum_gas_prices(genesis, globalfee_minimum_gas)?; + config::set_retry_delay_period(genesis, "100s")?; Ok(()) })?; diff --git a/tools/test-framework/src/chain/chain_type.rs b/tools/test-framework/src/chain/chain_type.rs index d66ecd7511..8d40fe17fc 100644 --- a/tools/test-framework/src/chain/chain_type.rs +++ b/tools/test-framework/src/chain/chain_type.rs @@ -12,6 +12,7 @@ const PROVENANCE_HD_PATH: &str = "m/44'/505'/0'/0/0"; #[derive(Clone, Debug)] pub enum ChainType { Cosmos, + Osmosis, Evmos, Provenance, Injective, @@ -20,7 +21,7 @@ pub enum ChainType { impl ChainType { pub fn hd_path(&self) -> &str { match self { - Self::Cosmos => COSMOS_HD_PATH, + Self::Cosmos | Self::Osmosis => COSMOS_HD_PATH, Self::Evmos | Self::Injective => EVMOS_HD_PATH, Self::Provenance => PROVENANCE_HD_PATH, } @@ -28,7 +29,7 @@ impl ChainType { pub fn chain_id(&self, prefix: &str, use_random_id: bool) -> ChainId { match self { - Self::Cosmos => { + Self::Cosmos | Self::Osmosis => { if use_random_id { ChainId::from_string(&format!("ibc-{}-{:x}", prefix, random_u32())) } else { @@ -47,6 +48,9 @@ impl ChainType { let json_rpc_port = random_unused_tcp_port(); match self { Self::Cosmos | Self::Injective | Self::Provenance => {} + Self::Osmosis => { + res.push("--reject-config-defaults".to_owned()); + } Self::Evmos => { res.push("--json-rpc.address".to_owned()); res.push(format!("localhost:{json_rpc_port}")); @@ -59,7 +63,7 @@ impl ChainType { pub fn extra_add_genesis_account_args(&self, chain_id: &ChainId) -> Vec { let mut res = vec![]; match self { - Self::Cosmos | Self::Evmos | Self::Provenance => {} + Self::Cosmos | Self::Osmosis | Self::Evmos | Self::Provenance => {} Self::Injective => { res.push("--chain-id".to_owned()); res.push(format!("{chain_id}")); @@ -70,7 +74,7 @@ impl ChainType { pub fn address_type(&self) -> AddressType { match self { - Self::Cosmos | Self::Provenance => AddressType::default(), + Self::Cosmos | Self::Osmosis | Self::Provenance => AddressType::default(), Self::Evmos => AddressType::Ethermint { pk_type: "/ethermint.crypto.v1.ethsecp256k1.PubKey".to_string(), }, @@ -89,6 +93,7 @@ impl FromStr for ChainType { name if name.contains("evmosd") => Ok(ChainType::Evmos), name if name.contains("injectived") => Ok(ChainType::Injective), name if name.contains("provenanced") => Ok(ChainType::Provenance), + name if name.contains("osmosisd") => Ok(ChainType::Osmosis), _ => Ok(ChainType::Cosmos), } } diff --git a/tools/test-framework/src/chain/cli/host_zone.rs b/tools/test-framework/src/chain/cli/host_zone.rs index 5ffb53ad77..94e2400e2a 100644 --- a/tools/test-framework/src/chain/cli/host_zone.rs +++ b/tools/test-framework/src/chain/cli/host_zone.rs @@ -31,13 +31,16 @@ pub fn register_host_zone( bech32_prefix, ibc_denom, channel_id, - "1", + "10", + "false", "--from", sender, "--chain-id", chain_id, "--gas", "auto", + "--gas-adjustment", + "1.3", "--yes", ], )?; diff --git a/tools/test-framework/src/chain/cli/provider.rs b/tools/test-framework/src/chain/cli/provider.rs index 6a1c7c34f3..fe52c86512 100644 --- a/tools/test-framework/src/chain/cli/provider.rs +++ b/tools/test-framework/src/chain/cli/provider.rs @@ -19,7 +19,7 @@ pub fn submit_consumer_chain_proposal( &[ "tx", "gov", - "submit-proposal", + "submit-legacy-proposal", "consumer-addition", &proposal_file, "--chain-id", diff --git a/tools/test-framework/src/chain/config.rs b/tools/test-framework/src/chain/config.rs index 66f4f3a02d..280aac29fd 100644 --- a/tools/test-framework/src/chain/config.rs +++ b/tools/test-framework/src/chain/config.rs @@ -397,6 +397,25 @@ pub fn globalfee_minimum_gas_prices( Ok(()) } +pub fn set_retry_delay_period( + genesis: &mut serde_json::Value, + retry_delay_period: &str, +) -> Result<(), Error> { + let params = genesis + .get_mut("app_state") + .and_then(|app_state| app_state.get_mut("ccvconsumer")) + .and_then(|ccvconsumer| ccvconsumer.get_mut("params")) + .and_then(|params| params.as_object_mut()) + .ok_or_else(|| eyre!("failed to get ccvconsumer params in genesis file"))?; + + params.insert( + "retry_delay_period".to_owned(), + serde_json::Value::String(retry_delay_period.to_string()), + ); + + Ok(()) +} + /// Look up a key in a JSON object, falling back to the second key if the first one cannot be found. /// /// This lets us support both Tendermint 0.34 and 0.37, which sometimes use different keys for the diff --git a/tools/test-framework/src/chain/ext/bootstrap.rs b/tools/test-framework/src/chain/ext/bootstrap.rs index a05f4dc76e..0c69c1d4ee 100644 --- a/tools/test-framework/src/chain/ext/bootstrap.rs +++ b/tools/test-framework/src/chain/ext/bootstrap.rs @@ -293,7 +293,7 @@ impl ChainBootstrapMethodsExt for ChainDriver { let raw_proposal = r#" { "title": "Create consumer chain", - "description": "First consumer chain", + "summary": "First consumer chain", "chain_id": "{consumer_chain_id}", "initial_height": { "revision_number": 1, diff --git a/tools/test-framework/src/chain/ext/crosschainquery.rs b/tools/test-framework/src/chain/ext/crosschainquery.rs index 252839c86f..aca80110b8 100644 --- a/tools/test-framework/src/chain/ext/crosschainquery.rs +++ b/tools/test-framework/src/chain/ext/crosschainquery.rs @@ -14,7 +14,7 @@ use crate::types::tagged::MonoTagged; If you encounter retry error, verify the value of `stride_epoch`in the `stride_epoch` configuration in Stride's `genesis.toml` file. */ -const WAIT_CROSS_CHAIN_QUERY_ATTEMPTS: u16 = 60; +const WAIT_CROSS_CHAIN_QUERY_ATTEMPTS: u16 = 100; pub trait CrossChainQueryMethodsExt { fn assert_pending_cross_chain_query(&self) -> Result<(), Error>; @@ -72,14 +72,13 @@ impl<'a, Chain: Send> CrossChainQueryMethodsExt for MonoTagged(&output) + if !json::from_str::(&output) .map_err(handle_generic_error)? .get("pending_queries") .ok_or_else(|| eyre!("no pending cross chain queries"))? .as_array() .ok_or_else(|| eyre!("pending cross chain queries is not an array"))? - .first() - .is_some() + .is_empty() { return Err(Error::generic(eyre!( "Pending query has not been processed" diff --git a/tools/test-framework/src/chain/ext/proposal.rs b/tools/test-framework/src/chain/ext/proposal.rs index e15e9a93ce..b0e5cb4c9a 100644 --- a/tools/test-framework/src/chain/ext/proposal.rs +++ b/tools/test-framework/src/chain/ext/proposal.rs @@ -70,10 +70,10 @@ pub async fn query_upgrade_proposal_height( .map(|r| r.into_inner()) .map_err(|e| RelayerError::grpc_status(e, "query_upgrade_proposal_height".to_owned()))?; - // Querying for a balance might fail, i.e. if the account doesn't actually exist + // Querying for proposal might not exist if the proposal id is incorrect let proposal = response .proposal - .ok_or_else(|| RelayerError::empty_query_account(proposal_id.to_string()))?; + .ok_or_else(|| RelayerError::empty_proposal(proposal_id.to_string()))?; let proposal_content = proposal .content diff --git a/tools/test-framework/src/relayer/channel.rs b/tools/test-framework/src/relayer/channel.rs index 2affc07f87..2d24d00e1a 100644 --- a/tools/test-framework/src/relayer/channel.rs +++ b/tools/test-framework/src/relayer/channel.rs @@ -1,7 +1,9 @@ use core::time::Duration; use eyre::eyre; use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeight}; +use ibc_relayer::chain::requests::{ + IncludeProof, QueryChannelRequest, QueryChannelsRequest, QueryHeight, +}; use ibc_relayer::channel::version::Version; use ibc_relayer::channel::{extract_channel_id, Channel, ChannelSide}; use ibc_relayer_types::core::ics04_channel::channel::State as ChannelState; @@ -207,6 +209,23 @@ pub fn query_identified_channel_end( ))) } +pub fn query_identified_channel_ends( + handle: &ChainA, +) -> Result>, Error> { + let channel_ends = handle.query_channels(QueryChannelsRequest { pagination: None })?; + let identified_channels = channel_ends + .iter() + .map(|c| { + DualTagged::new(IdentifiedChannelEnd::new( + c.port_id.clone(), + c.channel_id.clone(), + c.channel_end.clone(), + )) + }) + .collect(); + Ok(identified_channels) +} + pub fn assert_eventually_channel_established( handle_a: &ChainA, handle_b: &ChainB, From 402b8c8bb8cb8b61ba70c4262264a76eb69baea5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Apr 2024 10:34:08 +0200 Subject: [PATCH 087/200] Bump rustls from 0.21.10 to 0.21.11 (#3963) Bumps [rustls](https://github.com/rustls/rustls) from 0.21.10 to 0.21.11. - [Release notes](https://github.com/rustls/rustls/releases) - [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustls/rustls/compare/v/0.21.10...v/0.21.11) --- updated-dependencies: - dependency-name: rustls dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bde8e8d6a2..ca801cf1e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2630,9 +2630,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" dependencies = [ "log", "ring", From aa85985e714b4a5c949e187f463dcc990d8bdeb1 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 22 Apr 2024 11:02:32 +0200 Subject: [PATCH 088/200] Update nightly toolchain for cargo-doc --- .github/workflows/cargo-doc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cargo-doc.yaml b/.github/workflows/cargo-doc.yaml index c26f1d9248..9682a8456f 100644 --- a/.github/workflows/cargo-doc.yaml +++ b/.github/workflows/cargo-doc.yaml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-03-21 + toolchain: nightly-2024-04-21 - name: Build API documentation uses: actions-rs/cargo@v1 env: From 87da864a9c8030011609a28a5b1d8e2322da69d7 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:22:49 +0200 Subject: [PATCH 089/200] Update Migaloo Chain version used in CI (#3965) * Update Nix flake * Add changelog entry --- .../3960-update-migaloo-to-v4.md | 3 +++ flake.lock | 26 ++++++++++--------- 2 files changed, 17 insertions(+), 12 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md b/.changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md new file mode 100644 index 0000000000..3484257822 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md @@ -0,0 +1,3 @@ +- Update the version of Migaloo Chain running the + integraiton tests in the CI from `v3.0.2` to `v4.1.3` + ([\#3960](https://github.com/informalsystems/hermes/issues/3960)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index 520cb5024f..d12304fbfa 100644 --- a/flake.lock +++ b/flake.lock @@ -213,11 +213,11 @@ "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" }, "locked": { - "lastModified": 1713267602, - "narHash": "sha256-2zfGCgm2wdoCLVTEzxKWXYLjciwpVEukDIpwlA5CnZI=", + "lastModified": 1713760054, + "narHash": "sha256-Qsx6/C0AlUldU98RjKt3d+KHVGUBmfirynq1ldvWZeU=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "ffd8ab2cf6a7746f50474c85f097ad426d05c75d", + "rev": "47a6d6d4d40d9770b23147951635bef0ac5507c5", "type": "github" }, "original": { @@ -1060,15 +1060,16 @@ "juno-src": { "flake": false, "locked": { - "narHash": "sha256-z9TOeDyUnn1T8Z662XqQJ9ydVIKKB54YISt7ms4xvos=", + "lastModified": 1709992388, + "narHash": "sha256-8VcxdvaaBNyzza6U65PELt8bUII3teruokfbu5j7i9M=", "owner": "CosmosContracts", "repo": "juno", - "rev": "48507ed9b83511089cbf1fdc5bae54cae4a7f4b2", + "rev": "e98863bf7112f4b117a2114e22f7482367362764", "type": "github" }, "original": { "owner": "CosmosContracts", - "ref": "v17.1.1", + "ref": "v21.0.0", "repo": "juno", "type": "github" } @@ -1091,15 +1092,16 @@ "migaloo-src": { "flake": false, "locked": { - "narHash": "sha256-O+vGWFnV3+bvXinxl1QjVyDnQskp5H1VnlL+TaMfiSs=", + "lastModified": 1710414169, + "narHash": "sha256-BGOUAw48c92KGpUMvzStiJfd+tgJpTBYk0bAvvUNYL8=", "owner": "White-Whale-Defi-Platform", "repo": "migaloo-chain", - "rev": "de98de2dd96917ae1ab79161d573fc0b4ee1facf", + "rev": "5382bfc56173a0f57dcaef34e99c59c99cf70dda", "type": "github" }, "original": { "owner": "White-Whale-Defi-Platform", - "ref": "v3.0.2", + "ref": "v4.1.3", "repo": "migaloo-chain", "type": "github" } @@ -1337,11 +1339,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1713254108, - "narHash": "sha256-0TZIsfDbHG5zibtlw6x0yOp3jkInIGaJ35B7Y4G8Pec=", + "lastModified": 1713687659, + "narHash": "sha256-Yd8KuOBpZ0Slau/NxFhMPJI0gBxeax0vq/FD0rqKwuQ=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2fd19c8be2551a61c1ddc3d9f86d748f4db94f00", + "rev": "f2d7a289c5a5ece8521dd082b81ac7e4a57c2c5c", "type": "github" }, "original": { From f71c409471e54224bb06d6bb729361b116a8a0fa Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Mon, 22 Apr 2024 11:51:16 +0200 Subject: [PATCH 090/200] Fix cargo-doc build on nightly (#3967) --- crates/relayer-cli/src/lib.rs | 2 +- .../relayer-types/src/core/ics03_connection/connection.rs | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/crates/relayer-cli/src/lib.rs b/crates/relayer-cli/src/lib.rs index 5185118d69..0b817798ff 100644 --- a/crates/relayer-cli/src/lib.rs +++ b/crates/relayer-cli/src/lib.rs @@ -14,7 +14,7 @@ #![forbid(unsafe_code)] #![deny(rust_2018_idioms, trivial_casts, unused_lifetimes)] -#![allow(deprecated)] +#![allow(deprecated, unknown_lints, non_local_definitions)] extern crate alloc; diff --git a/crates/relayer-types/src/core/ics03_connection/connection.rs b/crates/relayer-types/src/core/ics03_connection/connection.rs index d240eaf905..d9c3ce9c60 100644 --- a/crates/relayer-types/src/core/ics03_connection/connection.rs +++ b/crates/relayer-types/src/core/ics03_connection/connection.rs @@ -1,9 +1,6 @@ +use std::fmt::{Display, Error as FmtError, Formatter}; use std::str::FromStr; use std::time::Duration; -use std::{ - fmt::{Display, Error as FmtError, Formatter}, - u64, -}; use ibc_proto::Protobuf; use serde::{Deserialize, Serialize}; @@ -388,6 +385,6 @@ impl TryFrom for State { impl From for i32 { fn from(value: State) -> Self { - value.into() + value as i32 } } From bdbbef3c8d59942a8e5c7468911131fa35661609 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 22 Apr 2024 11:54:45 +0200 Subject: [PATCH 091/200] Update Juno version used in CI (#3962) * Update Juno version used in CI and run ica tests with Juno * Add changelog entry --------- Signed-off-by: Romain Ruetschi Co-authored-by: Romain Ruetschi --- .../ibc-integration-test/3959-update-juno-to-v21.md | 2 ++ .github/workflows/integration.yaml | 2 +- tools/integration-test/src/tests/mod.rs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md b/.changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md new file mode 100644 index 0000000000..295947659d --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md @@ -0,0 +1,2 @@ +- Update the version of Juno running the integraiton tests in the CI from `v17.1.1` + to `v21.0.0` ([\#3959](https://github.com/informalsystems/hermes/issues/3959)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 5065d78e6e..3c6ca354ed 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -79,7 +79,7 @@ jobs: command: junod account_prefix: juno native_token: stake - features: juno,forward-packet + features: juno,forward-packet,ica - package: provenance command: provenanced account_prefix: pb diff --git a/tools/integration-test/src/tests/mod.rs b/tools/integration-test/src/tests/mod.rs index b6bff318ab..bd1defd1bc 100644 --- a/tools/integration-test/src/tests/mod.rs +++ b/tools/integration-test/src/tests/mod.rs @@ -10,7 +10,7 @@ pub mod client_expiration; pub mod client_filter; pub mod client_refresh; pub mod client_settings; -#[cfg(not(any(feature = "celestia", feature = "juno")))] +#[cfg(not(feature = "celestia"))] pub mod client_upgrade; pub mod connection_delay; pub mod consensus_states; From 2138a49d5da3da7cd0a6d85b11078e52546ee8c5 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 22 Apr 2024 16:11:25 +0200 Subject: [PATCH 092/200] Update `wasmd` version used in CI (#3968) * Update nix flake * Add changelog entry --- .../3961-update-wasmd-to-v0-50.md | 3 ++ flake.lock | 30 +++++-------------- 2 files changed, 10 insertions(+), 23 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md b/.changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md new file mode 100644 index 0000000000..40b8f62a0b --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md @@ -0,0 +1,3 @@ +- Update the version of `wasmd` running the + integraiton tests in the CI from `v0.30.0` to `v0.50.0` + ([\#3961](https://github.com/informalsystems/hermes/issues/3961)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index d12304fbfa..2d34b775ad 100644 --- a/flake.lock +++ b/flake.lock @@ -200,7 +200,6 @@ "stride-src": "stride-src", "umee-src": "umee-src", "wasmd-src": "wasmd-src", - "wasmd_next-src": "wasmd_next-src", "wasmvm_1-src": "wasmvm_1-src", "wasmvm_1_1_1-src": "wasmvm_1_1_1-src", "wasmvm_1_1_2-src": "wasmvm_1_1_2-src", @@ -213,11 +212,11 @@ "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" }, "locked": { - "lastModified": 1713760054, - "narHash": "sha256-Qsx6/C0AlUldU98RjKt3d+KHVGUBmfirynq1ldvWZeU=", + "lastModified": 1713771294, + "narHash": "sha256-vBfFaW06np8dtxq1lNmo2zA26/8kf82g2CMEhgyqxw4=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "47a6d6d4d40d9770b23147951635bef0ac5507c5", + "rev": "e68f2d5e7121c10e956fda7f6c0a564becd3a7e0", "type": "github" }, "original": { @@ -1726,31 +1725,16 @@ "wasmd-src": { "flake": false, "locked": { - "narHash": "sha256-F0p555FEeA405tuLn82yUEbRZpJLs85GrUKvSrjTdjk=", + "lastModified": 1700749637, + "narHash": "sha256-rKbuaWcRdHXSI+acHrx/hCdGOx5prPd+Dmng4BVrhzs=", "owner": "CosmWasm", "repo": "wasmd", - "rev": "a347ace2ff41539fe06c68168bc6f28d6ca9fa52", + "rev": "7ea00e2ea858ed599141e322bd68171998a3259a", "type": "github" }, "original": { "owner": "CosmWasm", - "ref": "v0.30.0", - "repo": "wasmd", - "type": "github" - } - }, - "wasmd_next-src": { - "flake": false, - "locked": { - "narHash": "sha256-b+6XhBdKyQlrzsYxVRrDf4vHpv8GAJkGwHVfJ9sdf3U=", - "owner": "CosmWasm", - "repo": "wasmd", - "rev": "c2bb27d289f7f72f1471a4b33cb08fdfc8d66f63", - "type": "github" - }, - "original": { - "owner": "CosmWasm", - "ref": "v0.40.0-rc.1", + "ref": "v0.50.0", "repo": "wasmd", "type": "github" } From 99be9a78d2949c70e595f80d2e30e139ce67196a Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 23 Apr 2024 08:48:04 +0200 Subject: [PATCH 093/200] Update tendermint-rs to 0.35.0 (#3895) * Update tendermint-rs to 0.35.0 * Add changelog entries * Update to ibc-proto-rs v0.43.0 --- .../3817-deserialize-block-results.md | 3 + .../ibc-relayer/3895-tendermint-rs-0.35.md | 2 + Cargo.lock | 947 +++++++++--------- Cargo.toml | 18 +- 4 files changed, 475 insertions(+), 495 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer/3817-deserialize-block-results.md create mode 100644 .changelog/unreleased/improvements/ibc-relayer/3895-tendermint-rs-0.35.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/3817-deserialize-block-results.md b/.changelog/unreleased/bug-fixes/ibc-relayer/3817-deserialize-block-results.md new file mode 100644 index 0000000000..611643818d --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer/3817-deserialize-block-results.md @@ -0,0 +1,3 @@ +- Fix creation of channels and connection on chains + using an unsupported version of ibc-go, eg. Sei + ([\#3817](https://github.com/informalsystems/hermes/issues/3817)) \ No newline at end of file diff --git a/.changelog/unreleased/improvements/ibc-relayer/3895-tendermint-rs-0.35.md b/.changelog/unreleased/improvements/ibc-relayer/3895-tendermint-rs-0.35.md new file mode 100644 index 0000000000..fd27d9961e --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/3895-tendermint-rs-0.35.md @@ -0,0 +1,2 @@ +- Update to tendermint-rs v0.35.0 + ([\#3895](https://github.com/informalsystems/hermes/issues/3895)) \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index ca801cf1e8..e1bbe360bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -58,18 +58,18 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -81,9 +81,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -115,15 +115,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "arc-swap" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "arrayref" @@ -156,33 +156,34 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] name = "async-trait" -version = "0.1.79" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] name = "async-tungstenite" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e9efbe14612da0a19fb983059a0b621e9cf6225d7018ecab4f9988215540dc" +checksum = "3609af4bbf701ddaf1f6bb4e6257dff4ff8932327d0e685d3f653724c258b1ac" dependencies = [ "futures-io", "futures-util", "log", "pin-project-lite", - "rustls-native-certs", + "rustls-native-certs 0.7.0", + "rustls-pki-types", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tungstenite", ] @@ -199,9 +200,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "axum" @@ -214,7 +215,7 @@ dependencies = [ "bitflags 1.3.2", "bytes", "futures-util", - "http", + "http 0.2.12", "http-body", "hyper", "itoa", @@ -244,7 +245,7 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http", + "http 0.2.12", "http-body", "mime", "rustversion", @@ -254,13 +255,13 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -279,6 +280,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" + [[package]] name = "base64ct" version = "1.6.0" @@ -340,9 +347,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "blake2" @@ -355,14 +362,14 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" +checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" dependencies = [ "arrayref", "arrayvec", "cc", - "cfg-if 1.0.0", + "cfg-if", "constant_time_eq", ] @@ -395,9 +402,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-unit" @@ -409,12 +416,6 @@ dependencies = [ "utf8-width", ] -[[package]] -name = "bytecount" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" - [[package]] name = "byteorder" version = "1.5.0" @@ -423,18 +424,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" -dependencies = [ - "serde", -] - -[[package]] -name = "camino" -version = "1.1.6" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" dependencies = [ "serde", ] @@ -445,42 +437,11 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" -[[package]] -name = "cargo-platform" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", -] - [[package]] name = "cc" -version = "1.0.83" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" [[package]] name = "cfg-if" @@ -630,23 +591,13 @@ dependencies = [ "libc", ] -[[package]] -name = "crossbeam-channel" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" -dependencies = [ - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - [[package]] name = "crossbeam-channel" version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ - "crossbeam-utils 0.8.19", + "crossbeam-utils", ] [[package]] @@ -655,18 +606,7 @@ version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "crossbeam-utils 0.8.19", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "lazy_static", + "crossbeam-utils", ] [[package]] @@ -709,7 +649,7 @@ version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", @@ -728,7 +668,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] @@ -750,7 +690,7 @@ version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "hashbrown 0.14.3", "lock_api", "once_cell", @@ -765,9 +705,9 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", @@ -839,7 +779,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -894,9 +834,9 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", @@ -921,9 +861,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "elliptic-curve" @@ -952,11 +892,11 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -971,18 +911,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" -dependencies = [ - "log", -] - -[[package]] -name = "env_logger" -version = "0.11.1" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ "anstream", "anstyle", @@ -1007,15 +938,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "error-chain" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" -dependencies = [ - "version_check", -] - [[package]] name = "eyre" version = "0.6.12" @@ -1028,9 +950,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "ff" @@ -1044,9 +966,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" +checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" [[package]] name = "fixed-hash" @@ -1147,7 +1069,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] @@ -1193,11 +1115,11 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi", @@ -1210,12 +1132,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - [[package]] name = "group" version = "0.13.0" @@ -1258,8 +1174,8 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", - "indexmap 2.2.1", + "http 0.2.12", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -1268,9 +1184,9 @@ dependencies = [ [[package]] name = "half" -version = "1.8.2" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" [[package]] name = "hashbrown" @@ -1310,9 +1226,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -1343,9 +1259,20 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -1359,7 +1286,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", "pin-project-lite", ] @@ -1402,7 +1329,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", + "http 0.2.12", "http-body", "httparse", "httpdate", @@ -1422,11 +1349,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http", + "http 0.2.12", "hyper", - "rustls", + "rustls 0.21.11", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -1448,10 +1375,10 @@ dependencies = [ "async-trait", "flex-error", "futures", - "http", + "http 0.2.12", "ibc-proto", "ibc-relayer-types", - "itertools", + "itertools 0.10.5", "reqwest", "serde", "serde_json", @@ -1465,7 +1392,7 @@ name = "ibc-integration-test" version = "0.27.2" dependencies = [ "byte-unit", - "http", + "http 0.2.12", "ibc-relayer", "ibc-relayer-types", "ibc-test-framework", @@ -1476,17 +1403,17 @@ dependencies = [ "tendermint", "tendermint-rpc", "time", - "toml 0.8.8", + "toml 0.8.12", "tonic", ] [[package]] name = "ibc-proto" -version = "0.42.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80701a1b0e0ade6f28071d7d2d6412e01869f22bb7039f52722161ecdeb083e0" +checksum = "af781637b107aa33042426c9d17b181ced05ae97b1d88dba50f40f19ad44e36f" dependencies = [ - "base64", + "base64 0.22.0", "bytes", "flex-error", "ics23", @@ -1509,25 +1436,25 @@ dependencies = [ "bs58", "byte-unit", "bytes", - "crossbeam-channel 0.5.12", + "crossbeam-channel", "digest 0.10.7", "dirs-next", "ed25519", "ed25519-dalek", "ed25519-dalek-bip32", - "env_logger 0.11.1", + "env_logger", "flex-error", "futures", "generic-array", "hdpath", "hex", - "http", + "http 0.2.12", "humantime", "humantime-serde", "ibc-proto", "ibc-relayer-types", "ibc-telemetry", - "itertools", + "itertools 0.10.5", "moka", "num-bigint", "num-rational", @@ -1560,11 +1487,11 @@ dependencies = [ "tiny-keccak", "tokio", "tokio-stream", - "toml 0.8.8", + "toml 0.8.12", "tonic", "tracing", "tracing-subscriber", - "uuid 1.8.0", + "uuid", ] [[package]] @@ -1576,21 +1503,21 @@ dependencies = [ "clap_complete", "color-eyre", "console", - "crossbeam-channel 0.5.12", + "crossbeam-channel", "dialoguer", "dirs-next", "eyre", "flex-error", "futures", "hdpath", - "http", + "http 0.2.12", "humantime", "ibc-chain-registry", "ibc-relayer", "ibc-relayer-rest", "ibc-relayer-types", "ibc-telemetry", - "itertools", + "itertools 0.10.5", "once_cell", "oneline-eyre", "regex", @@ -1613,13 +1540,13 @@ name = "ibc-relayer-rest" version = "0.27.2" dependencies = [ "axum", - "crossbeam-channel 0.5.12", + "crossbeam-channel", "ibc-relayer", "ibc-relayer-types", "reqwest", "serde", "tokio", - "toml 0.8.8", + "toml 0.8.12", "tracing", ] @@ -1629,11 +1556,11 @@ version = "0.27.2" dependencies = [ "bytes", "derive_more", - "env_logger 0.11.1", + "env_logger", "flex-error", "ibc-proto", "ics23", - "itertools", + "itertools 0.10.5", "num-rational", "primitive-types", "prost", @@ -1678,17 +1605,17 @@ name = "ibc-test-framework" version = "0.27.2" dependencies = [ "color-eyre", - "crossbeam-channel 0.5.12", + "crossbeam-channel", "eyre", "flex-error", "hdpath", "hex", - "http", + "http 0.2.12", "ibc-proto", "ibc-relayer", "ibc-relayer-cli", "ibc-relayer-types", - "itertools", + "itertools 0.10.5", "once_cell", "prost", "rand", @@ -1700,7 +1627,7 @@ dependencies = [ "subtle-encoding", "tendermint-rpc", "tokio", - "toml 0.8.8", + "toml 0.8.12", "tonic", "tracing", "tracing-subscriber", @@ -1768,9 +1695,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.1" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433de089bd45971eecf4668ee0ee8f4cec17db4f8bd8f7bc3197a6ce37aa7d9b" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -1782,7 +1709,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aa4a0980c8379295100d70854354e78df2ee1c6ca0f96ffe89afeb3140e3a3d" dependencies = [ - "base64", + "base64 0.21.7", "serde", ] @@ -1801,17 +1728,26 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1822,7 +1758,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ecdsa", "elliptic-curve", "sha2 0.10.8", @@ -1845,19 +1781,18 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "libc", - "redox_syscall", ] [[package]] @@ -1878,9 +1813,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "matchers" @@ -1897,17 +1832,11 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "mime" @@ -1917,18 +1846,18 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -1937,23 +1866,22 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1911e88d5831f748a4097a43862d129e3c6fca831eecac9b8db6d01d93c9de2" +checksum = "9e0d88686dc561d743b40de8269b26eaf0dc58781bde087b0984646602021d08" dependencies = [ - "crossbeam-channel 0.5.12", + "crossbeam-channel", "crossbeam-epoch", - "crossbeam-utils 0.8.19", + "crossbeam-utils", "once_cell", "parking_lot", "quanta", "rustc_version", - "skeptic", "smallvec", "tagptr", "thiserror", "triomphe", - "uuid 1.8.0", + "uuid", ] [[package]] @@ -1986,22 +1914,21 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-derive" -version = "0.3.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.60", ] [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] @@ -2020,9 +1947,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -2033,7 +1960,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.4", + "hermit-abi 0.3.9", "libc", ] @@ -2063,9 +1990,9 @@ dependencies = [ [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl-probe" @@ -2117,7 +2044,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b3a2a91fdbfdd4d212c0dcc2ab540de2c2bcbbd90be17de7a7daf8822d010c1" dependencies = [ "async-trait", - "crossbeam-channel 0.5.12", + "crossbeam-channel", "dashmap", "fnv", "futures-channel", @@ -2164,7 +2091,7 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "redox_syscall", "smallvec", @@ -2188,9 +2115,9 @@ dependencies = [ [[package]] name = "peg" -version = "0.7.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07c0b841ea54f523f7aa556956fbd293bcbe06f2e67d2eb732b7278aaf1d166a" +checksum = "400bcab7d219c38abf8bd7cc2054eb9bbbd4312d66f6a5557d572a203f646f61" dependencies = [ "peg-macros", "peg-runtime", @@ -2198,9 +2125,9 @@ dependencies = [ [[package]] name = "peg-macros" -version = "0.7.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aa52829b8decbef693af90202711348ab001456803ba2a98eb4ec8fb70844c" +checksum = "46e61cce859b76d19090f62da50a9fe92bab7c2a5f09e183763559a2ac392c90" dependencies = [ "peg-runtime", "proc-macro2", @@ -2209,9 +2136,9 @@ dependencies = [ [[package]] name = "peg-runtime" -version = "0.7.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c719dcf55f09a3a7e764c6649ab594c18a177e3599c467983cdf644bfc0a4088" +checksum = "36bae92c60fa2398ce4678b98b2c4b5a7c61099961ca1fa305aec04a9ad28922" [[package]] name = "percent-encoding" @@ -2221,29 +2148,29 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2263,9 +2190,9 @@ dependencies = [ [[package]] name = "platforms" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" +checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "powerfmt" @@ -2316,9 +2243,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -2329,7 +2256,7 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fnv", "lazy_static", "memchr", @@ -2355,17 +2282,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" dependencies = [ "anyhow", - "itertools", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] name = "prost-types" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe" dependencies = [ "prost", ] @@ -2376,24 +2303,13 @@ version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" -[[package]] -name = "pulldown-cmark" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" -dependencies = [ - "bitflags 1.3.2", - "memchr", - "unicase", -] - [[package]] name = "quanta" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" dependencies = [ - "crossbeam-utils 0.8.19", + "crossbeam-utils", "libc", "once_cell", "raw-cpuid", @@ -2404,9 +2320,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2447,7 +2363,7 @@ version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", ] [[package]] @@ -2461,9 +2377,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", @@ -2478,8 +2394,8 @@ checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.4", - "regex-syntax 0.8.2", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -2493,13 +2409,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -2510,9 +2426,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" @@ -2520,13 +2436,13 @@ version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "base64", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", "futures-util", "h2", - "http", + "http 0.2.12", "http-body", "hyper", "hyper-rustls", @@ -2537,16 +2453,16 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-native-certs", - "rustls-pemfile", + "rustls 0.21.11", + "rustls-native-certs 0.6.3", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", "system-configuration", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -2573,16 +2489,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2617,11 +2534,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "e3cc72858054fcff6d7dea32df2aeaee6a7c24227366d7ea429aada2f26b16ad" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -2636,10 +2553,24 @@ checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" dependencies = [ "log", "ring", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.2", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -2647,7 +2578,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "schannel", "security-framework", ] @@ -2658,9 +2602,25 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64", + "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.0", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -2671,17 +2631,28 @@ dependencies = [ "untrusted", ] +[[package]] +name = "rustls-webpki" +version = "0.102.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -2692,6 +2663,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scc" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec96560eea317a9cc4e0bb1f6a2c93c09a19b8c4fc5cb3fcc0ec1c094cd783e2" +dependencies = [ + "sdd", +] + [[package]] name = "schannel" version = "0.1.23" @@ -2717,6 +2697,12 @@ dependencies = [ "untrusted", ] +[[package]] +name = "sdd" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b84345e4c9bd703274a082fb80caaa99b7612be48dfaa1dd9266577ec412309d" + [[package]] name = "sec1" version = "0.7.3" @@ -2764,9 +2750,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -2777,9 +2763,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" dependencies = [ "core-foundation-sys", "libc", @@ -2787,18 +2773,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.197" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" dependencies = [ "serde_derive", ] @@ -2824,20 +2810,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "itoa", "ryu", @@ -2846,9 +2832,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -2856,13 +2842,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] @@ -2892,7 +2878,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.1", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -2901,27 +2887,27 @@ dependencies = [ [[package]] name = "serial_test" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ad9342b3aaca7cb43c45c097dd008d4907070394bd0751a0aa8817e5a018d" +checksum = "adb86f9315df5df6a70eae0cc22395a44e544a0d8897586820770a35ede74449" dependencies = [ - "dashmap", "futures", - "lazy_static", "log", + "once_cell", "parking_lot", + "scc", "serial_test_derive", ] [[package]] name = "serial_test_derive" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93fb4adc70021ac1b47f7d45e8cc4169baaa7ea58483bc5b721d19a26202212" +checksum = "a9bb72430492e9549b0c4596725c0f82729bff861c45aa8099c0a8e67fc3b721" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] @@ -2930,7 +2916,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] @@ -2942,7 +2928,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug", @@ -2954,7 +2940,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] @@ -2996,9 +2982,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -3015,24 +3001,9 @@ dependencies = [ [[package]] name = "simple-error" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc47a29ce97772ca5c927f75bac34866b16d64e07f330c3248e2d7226623901b" - -[[package]] -name = "skeptic" -version = "0.13.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" -dependencies = [ - "bytecount", - "cargo_metadata", - "error-chain", - "glob", - "pulldown-cmark", - "tempfile", - "walkdir", -] +checksum = "8542b68b8800c3cda649d2c72d688b6907b30f1580043135d61669d4aad1c175" [[package]] name = "slab" @@ -3045,18 +3016,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3106,7 +3077,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] @@ -3143,9 +3114,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -3203,7 +3174,7 @@ version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", "rustix", "windows-sys 0.52.0", @@ -3211,9 +3182,9 @@ dependencies = [ [[package]] name = "tendermint" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc2294fa667c8b548ee27a9ba59115472d0a09c2ba255771092a7f1dcf03a789" +checksum = "43f8a10105d0a7c4af0a242e23ed5a12519afe5cc0e68419da441bb5981a6802" dependencies = [ "bytes", "digest 0.10.7", @@ -3242,26 +3213,26 @@ dependencies = [ [[package]] name = "tendermint-config" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a25dbe8b953e80f3d61789fbdb83bf9ad6c0ef16df5ca6546f49912542cc137" +checksum = "ac6bf36c613bb113737c333e3c1d6dfd3c99f8ac679e84feb58dd6456d77fb2e" dependencies = [ "flex-error", "serde", "serde_json", "tendermint", - "toml 0.5.11", + "toml 0.8.12", "url", ] [[package]] name = "tendermint-light-client" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94aecbdccbc4b557649b2d1b1a4bfc27ec85205e00fb8020fce044245a4c9e3f" +checksum = "240dbb4b281ab279aa6537bd5000ccf6c8e17d9a076d2af5d27766452c7efb16" dependencies = [ "contracts", - "crossbeam-channel 0.4.4", + "crossbeam-channel", "derive_more", "flex-error", "futures", @@ -3281,12 +3252,11 @@ dependencies = [ [[package]] name = "tendermint-light-client-detector" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea83654b03e3ddc6782c9704a3fefd4d0671bd6c5e3f09d29e31fcb45e75636c" +checksum = "9bbad4541ffa3a56b032f3dfc0790a27ed7c1e8ac9a8452382e11b62b88be0a4" dependencies = [ - "contracts", - "crossbeam-channel 0.4.4", + "crossbeam-channel", "derive_more", "flex-error", "futures", @@ -3305,9 +3275,9 @@ dependencies = [ [[package]] name = "tendermint-light-client-verifier" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74994da9de4b1144837a367ca2c60c650f5526a7c1a54760a3020959b522e474" +checksum = "35678b66e819659617c2e83f9662b8544425694441990c07137904a07872d871" dependencies = [ "derive_more", "flex-error", @@ -3318,9 +3288,9 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.34.1" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b797dd3d2beaaee91d2f065e7bdf239dc8d80bba4a183a288bc1279dd5a69a1e" +checksum = "ff525d5540a9fc535c38dc0d92a98da3ee36fcdfbda99cecb9f3cce5cd4d41d7" dependencies = [ "bytes", "flex-error", @@ -3336,9 +3306,9 @@ dependencies = [ [[package]] name = "tendermint-rpc" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbf0a4753b46a190f367337e0163d0b552a2674a6bac54e74f9f2cdcde2969b" +checksum = "2d8fe61b1772cd50038bdeeadf53773bb37a09e639dd8e6d996668fd220ddb29" dependencies = [ "async-trait", "async-tungstenite", @@ -3348,6 +3318,7 @@ dependencies = [ "getrandom", "peg", "pin-project", + "rand", "reqwest", "semver", "serde", @@ -3363,15 +3334,15 @@ dependencies = [ "tokio", "tracing", "url", - "uuid 0.8.2", + "uuid", "walkdir", ] [[package]] name = "tendermint-testgen" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19d4f02b7e38ce790da973fdc9edc71a0e35340ac57737bf278c8379037c1f5" +checksum = "9921053646fe51d03ebd0c642871b734e2f28437233529d4aa6fbff5e477e924" dependencies = [ "ed25519-consensus", "gumdrop", @@ -3394,59 +3365,59 @@ dependencies = [ [[package]] name = "test-log" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6159ab4116165c99fc88cce31f99fa2c9dbe08d3691cb38da02fc3b45f357d2b" +checksum = "7b319995299c65d522680decf80f2c108d85b861d81dfe340a10d16cee29d9e6" dependencies = [ - "env_logger 0.10.2", + "env_logger", "test-log-macros", "tracing-subscriber", ] [[package]] name = "test-log-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba277e77219e9eea169e8508942db1bf5d8a41ff2db9b20aab5a5aadc9fa25d" +checksum = "c8f546451eaa38373f549093fe9fd05e7d2bade739e2ddf834b9968621d60107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] name = "textwrap" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -3525,9 +3496,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -3560,7 +3531,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] @@ -3569,15 +3540,26 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.11", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.4", + "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -3609,9 +3591,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" dependencies = [ "serde", "serde_spanned", @@ -3630,11 +3612,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.22.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" dependencies = [ - "indexmap 2.2.1", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -3643,28 +3625,28 @@ dependencies = [ [[package]] name = "tonic" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" dependencies = [ "async-stream", "async-trait", "axum", - "base64", + "base64 0.21.7", "bytes", "h2", - "http", + "http 0.2.12", "http-body", "hyper", "hyper-timeout", "percent-encoding", "pin-project", "prost", - "rustls", - "rustls-native-certs", - "rustls-pemfile", + "rustls-native-certs 0.7.0", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tokio-stream", "tower", "tower-layer", @@ -3724,7 +3706,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] [[package]] @@ -3814,18 +3796,19 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 1.1.0", "httparse", "log", "rand", - "rustls", + "rustls 0.22.4", + "rustls-pki-types", "sha1", "thiserror", "url", @@ -3850,15 +3833,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -3873,9 +3847,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -3939,12 +3913,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" - [[package]] name = "uuid" version = "1.8.0" @@ -3977,9 +3945,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -4002,36 +3970,36 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -4039,9 +4007,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4049,28 +4017,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -4122,7 +4090,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -4142,17 +4110,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -4163,9 +4132,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -4175,9 +4144,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -4187,9 +4156,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -4199,9 +4174,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -4211,9 +4186,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -4223,9 +4198,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -4235,15 +4210,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.5.34" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" +checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" dependencies = [ "memchr", ] @@ -4254,7 +4229,7 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] @@ -4275,5 +4250,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.60", ] diff --git a/Cargo.toml b/Cargo.toml index f5f33765ce..dacc639287 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,13 +30,13 @@ ibc-test-framework = { version = "0.27.2", path = "tools/test-framework" } ibc-integration-test = { version = "0.27.2", path = "tools/integration-test" } # Tendermint dependencies -tendermint = { version = "0.34.0", default-features = false } -tendermint-light-client = { version = "0.34.0", default-features = false } -tendermint-light-client-detector = { version = "0.34.0", default-features = false } -tendermint-light-client-verifier = { version = "0.34.0", default-features = false } -tendermint-proto = "0.34.1" -tendermint-rpc = "0.34.0" -tendermint-testgen = "0.34.0" +tendermint = { version = "0.35.0", default-features = false } +tendermint-light-client = { version = "0.35.0", default-features = false } +tendermint-light-client-detector = { version = "0.35.0", default-features = false } +tendermint-light-client-verifier = { version = "0.35.0", default-features = false } +tendermint-proto = "0.35.0" +tendermint-rpc = "0.35.0" +tendermint-testgen = "0.35.0" # Other dependencies abscissa_core = "=0.6.0" @@ -72,7 +72,7 @@ hex = "0.4.3" http = "0.2.9" humantime = "2.1.0" humantime-serde = "1.1.1" -ibc-proto = "0.42.0" +ibc-proto = "0.43.0" ics23 = "0.11.1" itertools = "0.10.5" moka = "0.12.5" @@ -111,7 +111,7 @@ tiny-keccak = { version = "2.0.2", default-features = false } tokio = "1.26.0" tokio-stream = "0.1.14" toml = "0.8.8" -tonic = "0.10" +tonic = "0.11" tracing = { version = "0.1.36", default-features = false } tracing-subscriber = "0.3.14" uint = "0.9" From df5d09b87ef4c163e74479b76dc634b964ee21ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Apr 2024 11:10:04 +0200 Subject: [PATCH 094/200] Bump itertools from 0.10.5 to 0.12.1 (#3974) Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.10.5 to 0.12.1. - [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-itertools/itertools/compare/v0.10.5...v0.12.1) --- updated-dependencies: - dependency-name: itertools dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 21 ++++++--------------- Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e1bbe360bb..21d8994814 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1378,7 +1378,7 @@ dependencies = [ "http 0.2.12", "ibc-proto", "ibc-relayer-types", - "itertools 0.10.5", + "itertools", "reqwest", "serde", "serde_json", @@ -1454,7 +1454,7 @@ dependencies = [ "ibc-proto", "ibc-relayer-types", "ibc-telemetry", - "itertools 0.10.5", + "itertools", "moka", "num-bigint", "num-rational", @@ -1517,7 +1517,7 @@ dependencies = [ "ibc-relayer-rest", "ibc-relayer-types", "ibc-telemetry", - "itertools 0.10.5", + "itertools", "once_cell", "oneline-eyre", "regex", @@ -1560,7 +1560,7 @@ dependencies = [ "flex-error", "ibc-proto", "ics23", - "itertools 0.10.5", + "itertools", "num-rational", "primitive-types", "prost", @@ -1615,7 +1615,7 @@ dependencies = [ "ibc-relayer", "ibc-relayer-cli", "ibc-relayer-types", - "itertools 0.10.5", + "itertools", "once_cell", "prost", "rand", @@ -1719,15 +1719,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.1" @@ -2282,7 +2273,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" dependencies = [ "anyhow", - "itertools 0.12.1", + "itertools", "proc-macro2", "quote", "syn 2.0.60", diff --git a/Cargo.toml b/Cargo.toml index dacc639287..40235420b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,7 +74,7 @@ humantime = "2.1.0" humantime-serde = "1.1.1" ibc-proto = "0.43.0" ics23 = "0.11.1" -itertools = "0.10.5" +itertools = "0.12.1" moka = "0.12.5" num-bigint = "0.4" num-rational = "0.4.1" From 954c2f1b1a6cfadb71f25360be299e6381f7130d Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 25 Apr 2024 16:21:38 +0200 Subject: [PATCH 095/200] Update to tendermint-rs v0.36.0 (#3966) * Adapt to upcoming changes in tendermint-rs regarding `EventAttribute` keys and values https://github.com/informalsystems/tendermint-rs/pull/1405 * Update tendermint-rs to 0.36.0 * Remove ibc-proto patch --- .../ibc-relayer/3966-tendermint-rs-0.36.md | 2 + Cargo.lock | 49 +++++++------------ Cargo.toml | 16 +++--- .../src/applications/ics29_fee/error.rs | 6 ++- .../src/applications/ics29_fee/events.rs | 9 +++- .../src/applications/ics31_icq/events.rs | 15 +++--- .../src/core/ics02_client/error.rs | 7 +++ .../src/core/ics03_connection/error.rs | 7 +++ .../src/core/ics04_channel/error.rs | 9 +++- crates/relayer/src/event.rs | 49 ++++++++++++++----- crates/relayer/src/event/source/rpc.rs | 8 +-- 11 files changed, 113 insertions(+), 64 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/3966-tendermint-rs-0.36.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/3966-tendermint-rs-0.36.md b/.changelog/unreleased/improvements/ibc-relayer/3966-tendermint-rs-0.36.md new file mode 100644 index 0000000000..9d2d3f865e --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/3966-tendermint-rs-0.36.md @@ -0,0 +1,2 @@ +- Update to tendermint-rs v0.36.0 + ([\#3966](https://github.com/informalsystems/hermes/issues/3966)) \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 21d8994814..57fcfc6867 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1409,9 +1409,9 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.43.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af781637b107aa33042426c9d17b181ced05ae97b1d88dba50f40f19ad44e36f" +checksum = "66080040d5a4800d52966d55b055400f86b79c34b854b935bef03c87aacda62a" dependencies = [ "base64 0.22.0", "bytes", @@ -1903,17 +1903,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.60", -] - [[package]] name = "num-integer" version = "0.1.46" @@ -3173,9 +3162,9 @@ dependencies = [ [[package]] name = "tendermint" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f8a10105d0a7c4af0a242e23ed5a12519afe5cc0e68419da441bb5981a6802" +checksum = "8b50aae6ec24c3429149ad59b5b8d3374d7804d4c7d6125ceb97cb53907fb68d" dependencies = [ "bytes", "digest 0.10.7", @@ -3204,9 +3193,9 @@ dependencies = [ [[package]] name = "tendermint-config" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6bf36c613bb113737c333e3c1d6dfd3c99f8ac679e84feb58dd6456d77fb2e" +checksum = "e07b383dc8780ebbec04cfb603f3fdaba6ea6663d8dd861425b1ffa7761fe90d" dependencies = [ "flex-error", "serde", @@ -3218,9 +3207,9 @@ dependencies = [ [[package]] name = "tendermint-light-client" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "240dbb4b281ab279aa6537bd5000ccf6c8e17d9a076d2af5d27766452c7efb16" +checksum = "331544139bbcf353acb5f56e733093d8e4bf2522cda0491b4bba7039ef0b944e" dependencies = [ "contracts", "crossbeam-channel", @@ -3243,9 +3232,9 @@ dependencies = [ [[package]] name = "tendermint-light-client-detector" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bbad4541ffa3a56b032f3dfc0790a27ed7c1e8ac9a8452382e11b62b88be0a4" +checksum = "73d0ffaf614bd2db605c4762e3a31a536b73cd45488fa5bace050135ca348f28" dependencies = [ "crossbeam-channel", "derive_more", @@ -3266,9 +3255,9 @@ dependencies = [ [[package]] name = "tendermint-light-client-verifier" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35678b66e819659617c2e83f9662b8544425694441990c07137904a07872d871" +checksum = "4216e487165e5dbd7af79952eaa0d5f06c5bde861eb76c690acd7f2d2a19395c" dependencies = [ "derive_more", "flex-error", @@ -3279,14 +3268,12 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff525d5540a9fc535c38dc0d92a98da3ee36fcdfbda99cecb9f3cce5cd4d41d7" +checksum = "46f193d04afde6592c20fd70788a10b8cb3823091c07456db70d8a93f5fb99c1" dependencies = [ "bytes", "flex-error", - "num-derive", - "num-traits", "prost", "prost-types", "serde", @@ -3297,9 +3284,9 @@ dependencies = [ [[package]] name = "tendermint-rpc" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d8fe61b1772cd50038bdeeadf53773bb37a09e639dd8e6d996668fd220ddb29" +checksum = "21e3c231a3632cab53f92ad4161c730c468c08cfe4f0aa5a6735b53b390aecbd" dependencies = [ "async-trait", "async-tungstenite", @@ -3331,9 +3318,9 @@ dependencies = [ [[package]] name = "tendermint-testgen" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9921053646fe51d03ebd0c642871b734e2f28437233529d4aa6fbff5e477e924" +checksum = "b233cec83c56c413ccc346af866cb9206a14d468fcecf0255080107bc9b103c0" dependencies = [ "ed25519-consensus", "gumdrop", diff --git a/Cargo.toml b/Cargo.toml index 40235420b3..b093009c8b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,13 +30,13 @@ ibc-test-framework = { version = "0.27.2", path = "tools/test-framework" } ibc-integration-test = { version = "0.27.2", path = "tools/integration-test" } # Tendermint dependencies -tendermint = { version = "0.35.0", default-features = false } -tendermint-light-client = { version = "0.35.0", default-features = false } -tendermint-light-client-detector = { version = "0.35.0", default-features = false } -tendermint-light-client-verifier = { version = "0.35.0", default-features = false } -tendermint-proto = "0.35.0" -tendermint-rpc = "0.35.0" -tendermint-testgen = "0.35.0" +tendermint = { version = "0.36.0", default-features = false } +tendermint-light-client = { version = "0.36.0", default-features = false } +tendermint-light-client-detector = { version = "0.36.0", default-features = false } +tendermint-light-client-verifier = { version = "0.36.0", default-features = false } +tendermint-proto = { version = "0.36.0" } +tendermint-rpc = { version = "0.36.0" } +tendermint-testgen = { version = "0.36.0" } # Other dependencies abscissa_core = "=0.6.0" @@ -72,7 +72,7 @@ hex = "0.4.3" http = "0.2.9" humantime = "2.1.0" humantime-serde = "1.1.1" -ibc-proto = "0.43.0" +ibc-proto = "0.44.0" ics23 = "0.11.1" itertools = "0.12.1" moka = "0.12.5" diff --git a/crates/relayer-types/src/applications/ics29_fee/error.rs b/crates/relayer-types/src/applications/ics29_fee/error.rs index 79ba5e1bc2..f8cc66ae65 100644 --- a/crates/relayer-types/src/applications/ics29_fee/error.rs +++ b/crates/relayer-types/src/applications/ics29_fee/error.rs @@ -37,6 +37,10 @@ define_error! { EventAttributeNotFound { key: String } - | e | { format_args!("IBC event attribute not found for key: {}", e.key) }, + | e | { format_args!("IBC event attribute not found for key `{}`", e.key) }, + + EventAttributeInvalidUtf8 + { key: String } + | e | { format_args!("IBC event attribute value for key `{}` is not a valid UTF-8 string", e.key) }, } } diff --git a/crates/relayer-types/src/applications/ics29_fee/events.rs b/crates/relayer-types/src/applications/ics29_fee/events.rs index 34ea98c8c0..1db6ed9deb 100644 --- a/crates/relayer-types/src/applications/ics29_fee/events.rs +++ b/crates/relayer-types/src/applications/ics29_fee/events.rs @@ -26,12 +26,17 @@ fn find_value<'a>(key: &str, entries: &'a [abci::EventAttribute]) -> Result<&'a entries .iter() .find_map(|entry| { - if entry.key == key { - Some(entry.value.as_str()) + if entry.key_bytes() == key.as_bytes() { + Some( + entry + .value_str() + .map_err(|_| Error::event_attribute_invalid_utf8(key.to_owned())), + ) } else { None } }) + .transpose()? .ok_or_else(|| Error::event_attribute_not_found(key.to_owned())) } diff --git a/crates/relayer-types/src/applications/ics31_icq/events.rs b/crates/relayer-types/src/applications/ics31_icq/events.rs index b14a5d668f..eea8511d15 100644 --- a/crates/relayer-types/src/applications/ics31_icq/events.rs +++ b/crates/relayer-types/src/applications/ics31_icq/events.rs @@ -32,21 +32,22 @@ fn find_value<'a>(key: &str, entries: &'a [abci::EventAttribute]) -> Result<&'a entries .iter() .find_map(|entry| { - if entry.key == key { - Some(entry.value.as_str()) + if entry.key_bytes() == key.as_bytes() { + Some(entry.value_str().map_err(|_| { + Error::event(format!( + "attribute value for key {key} is not a valid UTF-8 string" + )) + })) } else { None } }) + .transpose()? .ok_or_else(|| Error::event(format!("attribute not found for key: {key}"))) } fn new_attr(key: &str, value: &str) -> abci::EventAttribute { - abci::EventAttribute { - key: String::from(key), - value: String::from(value), - index: true, - } + abci::EventAttribute::from((key, value, true)) } impl From for abci::Event { diff --git a/crates/relayer-types/src/core/ics02_client/error.rs b/crates/relayer-types/src/core/ics02_client/error.rs index 094a883aa6..a560a499f1 100644 --- a/crates/relayer-types/src/core/ics02_client/error.rs +++ b/crates/relayer-types/src/core/ics02_client/error.rs @@ -280,5 +280,12 @@ define_error! { ClientSpecific { description: String } | e | { format_args!("client specific error: {0}", e.description) }, + + MalformedEventAttributeKey + | _ | { format_args!("event attribute key is not valid UTF-8") }, + + MalformedEventAttributeValue + { key: String } + | e | { format_args!("event attribute value for key {} is not valid UTF-8", e.key) }, } } diff --git a/crates/relayer-types/src/core/ics03_connection/error.rs b/crates/relayer-types/src/core/ics03_connection/error.rs index 068b3ee30a..00b4529f8b 100644 --- a/crates/relayer-types/src/core/ics03_connection/error.rs +++ b/crates/relayer-types/src/core/ics03_connection/error.rs @@ -157,5 +157,12 @@ define_error! { ImplementationSpecific | _ | { "implementation specific error" }, + + MalformedEventAttributeKey + | _ | { format_args!("event attribute key is not valid UTF-8") }, + + MalformedEventAttributeValue + { key: String } + | e | { format_args!("event attribute value for key {} is not valid UTF-8", e.key) }, } } diff --git a/crates/relayer-types/src/core/ics04_channel/error.rs b/crates/relayer-types/src/core/ics04_channel/error.rs index 659ee07d6c..837fae20dc 100644 --- a/crates/relayer-types/src/core/ics04_channel/error.rs +++ b/crates/relayer-types/src/core/ics04_channel/error.rs @@ -359,7 +359,14 @@ define_error! { AbciConversionFailed { abci_event: String } - | e | { format_args!("Failed to convert abci event to IbcEvent: {}", e.abci_event)} + | e | { format_args!("Failed to convert abci event to IbcEvent: {}", e.abci_event)}, + + MalformedEventAttributeKey + | _ | { format_args!("event attribute key is not valid UTF-8") }, + + MalformedEventAttributeValue + { key: String } + | e | { format_args!("event attribute value for key {} is not valid UTF-8", e.key) }, } } diff --git a/crates/relayer/src/event.rs b/crates/relayer/src/event.rs index 6240e6e77a..2a75d8fc55 100644 --- a/crates/relayer/src/event.rs +++ b/crates/relayer/src/event.rs @@ -301,8 +301,14 @@ fn client_extract_attributes_from_tx(event: &AbciEvent) -> Result { attr.client_id = value @@ -328,9 +334,13 @@ fn client_extract_attributes_from_tx(event: &AbciEvent) -> Result Result { for tag in &event.attributes { - if tag.key == HEADER_ATTRIBUTE_KEY { - let header_bytes = hex::decode(tag.value.to_lowercase()) - .map_err(|_| ClientError::malformed_header())?; + if tag.key_bytes() == HEADER_ATTRIBUTE_KEY.as_bytes() { + let header_bytes = hex::decode( + tag.value_str() + .map_err(|_| ClientError::malformed_header())? + .to_lowercase(), + ) + .map_err(|_| ClientError::malformed_header())?; return decode_header(&header_bytes); } } @@ -344,8 +354,14 @@ fn connection_extract_attributes_from_tx( let mut attr = ConnectionAttributes::default(); for tag in &event.attributes { - let key = tag.key.as_str(); - let value = tag.value.as_str(); + let key = tag + .key_str() + .map_err(|_| ConnectionError::malformed_event_attribute_key())?; + + let value = tag + .value_str() + .map_err(|_| ConnectionError::malformed_event_attribute_value(key.to_owned()))?; + match key { connection_events::CONN_ID_ATTRIBUTE_KEY => { attr.connection_id = value.parse().ok(); @@ -373,8 +389,14 @@ fn channel_extract_attributes_from_tx( let mut attr = ChannelAttributes::default(); for tag in &event.attributes { - let key = tag.key.as_str(); - let value = tag.value.as_str(); + let key = tag + .key_str() + .map_err(|_| ChannelError::malformed_event_attribute_key())?; + + let value = tag + .value_str() + .map_err(|_| ChannelError::malformed_event_attribute_value(key.to_owned()))?; + match key { channel_events::PORT_ID_ATTRIBUTE_KEY => { attr.port_id = value.parse().map_err(ChannelError::identifier)? @@ -405,8 +427,13 @@ pub fn extract_packet_and_write_ack_from_tx( let mut write_ack: Vec = Vec::new(); for tag in &event.attributes { - let key = tag.key.as_str(); - let value = tag.value.as_str(); + let key = tag + .key_str() + .map_err(|_| ChannelError::malformed_event_attribute_key())?; + + let value = tag + .value_str() + .map_err(|_| ChannelError::malformed_event_attribute_value(key.to_owned()))?; match key { channel_events::PKT_SRC_PORT_ATTRIBUTE_KEY => { diff --git a/crates/relayer/src/event/source/rpc.rs b/crates/relayer/src/event/source/rpc.rs index 5aac57baef..5a4b4be722 100644 --- a/crates/relayer/src/event/source/rpc.rs +++ b/crates/relayer/src/event/source/rpc.rs @@ -292,7 +292,9 @@ fn dedupe(events: Vec) -> Vec { .attributes .iter() .zip(other.0.attributes.iter()) - .all(|(a, b)| a.key == b.key && a.value == b.value) + .all(|(a, b)| { + a.key_bytes() == b.key_bytes() && a.value_bytes() == b.value_bytes() + }) } } @@ -304,8 +306,8 @@ fn dedupe(events: Vec) -> Vec { for attr in &self.0.attributes { // NOTE: We don't hash the index because it is not deterministic - attr.key.hash(state); - attr.value.hash(state); + attr.key_bytes().hash(state); + attr.value_bytes().hash(state); } } } From 962cbd11e28659383dc997da63129e0d8d700835 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Apr 2024 21:39:29 +0200 Subject: [PATCH 096/200] Bump lycheeverse/lychee-action from 1.9.3 to 1.10.0 (#3976) --- .github/workflows/markdown-link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/markdown-link-check.yml b/.github/workflows/markdown-link-check.yml index f5da1e2a04..01c16456da 100644 --- a/.github/workflows/markdown-link-check.yml +++ b/.github/workflows/markdown-link-check.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - name: Link Checker id: lychee - uses: lycheeverse/lychee-action@v1.9.3 + uses: lycheeverse/lychee-action@v1.10.0 with: args: --verbose --no-progress --max-concurrency 16 './**/*.md' token: ${{ secrets.GITHUB_TOKEN }} From 42cd6ffb9dbfe07db252ad28b21a61a67564cac0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 10:56:52 +0200 Subject: [PATCH 097/200] Bump serde from 1.0.198 to 1.0.201 (#3986) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.198 to 1.0.201. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.198...v1.0.201) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57fcfc6867..bb3bb374c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2762,9 +2762,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.198" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] @@ -2790,9 +2790,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index b093009c8b..10d124f232 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,7 +92,7 @@ retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" secp256k1 = "0.28.2" semver = "1.0.21" -serde = "1.0.197" +serde = "1.0.201" serde_derive = "1.0.104" serde_json = "1.0.115" serde_yaml = "0.9.34" From 4ca60093e5de50a858febbdba15ac1f7884a373b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 10:57:27 +0200 Subject: [PATCH 098/200] Bump prometheus from 0.13.3 to 0.13.4 (#3981) Bumps [prometheus](https://github.com/tikv/rust-prometheus) from 0.13.3 to 0.13.4. - [Changelog](https://github.com/tikv/rust-prometheus/blob/master/CHANGELOG.md) - [Commits](https://github.com/tikv/rust-prometheus/compare/v0.13.3...v0.13.4) --- updated-dependencies: - dependency-name: prometheus dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bb3bb374c4..05b079c803 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2232,9 +2232,9 @@ dependencies = [ [[package]] name = "prometheus" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" dependencies = [ "cfg-if", "fnv", diff --git a/Cargo.toml b/Cargo.toml index 10d124f232..d928f8b84c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,7 +83,7 @@ oneline-eyre = "0.1" opentelemetry = "0.19.0" opentelemetry-prometheus = "0.12.0" primitive-types = { version = "0.12.1", default-features = false } -prometheus = "0.13.2" +prometheus = "0.13.4" prost = "0.12" rand = "0.8.5" regex = "1.10.4" From 25f547595ff71a4910a68889c625ad7b66180de9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 10:57:40 +0200 Subject: [PATCH 099/200] Bump serial_test from 3.1.0 to 3.1.1 (#3977) Bumps [serial_test](https://github.com/palfrey/serial_test) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/palfrey/serial_test/releases) - [Commits](https://github.com/palfrey/serial_test/compare/v3.1.0...v3.1.1) --- updated-dependencies: - dependency-name: serial_test dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 05b079c803..3b36b1e200 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2867,9 +2867,9 @@ dependencies = [ [[package]] name = "serial_test" -version = "3.1.0" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb86f9315df5df6a70eae0cc22395a44e544a0d8897586820770a35ede74449" +checksum = "4b4b487fe2acf240a021cf57c6b2b4903b1e78ca0ecd862a71b71d2a51fed77d" dependencies = [ "futures", "log", @@ -2881,9 +2881,9 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "3.1.0" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9bb72430492e9549b0c4596725c0f82729bff861c45aa8099c0a8e67fc3b721" +checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index d928f8b84c..36c8413ea0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -96,7 +96,7 @@ serde = "1.0.201" serde_derive = "1.0.104" serde_json = "1.0.115" serde_yaml = "0.9.34" -serial_test = "3.0.0" +serial_test = "3.1.1" sha2 = "0.10.6" signal-hook = "0.3.17" signature = "2.1.0" From be3fc0365c794d95c73b3597023dd16fd2d0c208 Mon Sep 17 00:00:00 2001 From: Anca Zamfir Date: Mon, 27 May 2024 15:44:38 +0200 Subject: [PATCH 100/200] Fix spelling (#4001) --- crates/relayer/src/chain/cosmos/config.rs | 2 +- docs/architecture/adr-005-relayer-v0-implementation.md | 2 +- docs/spec/relayer/Definitions.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/relayer/src/chain/cosmos/config.rs b/crates/relayer/src/chain/cosmos/config.rs index dab51398e6..5e85f2a11d 100644 --- a/crates/relayer/src/chain/cosmos/config.rs +++ b/crates/relayer/src/chain/cosmos/config.rs @@ -56,7 +56,7 @@ pub struct CosmosSdkConfig { pub max_gas: Option, // This field is only meant to be set via the `update client` command, - // for when we need to ugprade a client across a genesis restart and + // for when we need to upgrade a client across a genesis restart and // therefore need and archive node to fetch blocks from. pub genesis_restart: Option, diff --git a/docs/architecture/adr-005-relayer-v0-implementation.md b/docs/architecture/adr-005-relayer-v0-implementation.md index bc35c3e1f0..78d381ba7b 100644 --- a/docs/architecture/adr-005-relayer-v0-implementation.md +++ b/docs/architecture/adr-005-relayer-v0-implementation.md @@ -221,7 +221,7 @@ Accepted [comment](https://github.com/informalsystems/hermes/pull/449#issuecomment-750248113) provides additional insights into development-time relayer `v0.1` environment. -- __Mock__: Has been removed after splittin the ibc-rs repository +- __Mock__: Has been removed after splitting the ibc-rs repository diff --git a/docs/spec/relayer/Definitions.md b/docs/spec/relayer/Definitions.md index 5d8830a717..5468807d93 100644 --- a/docs/spec/relayer/Definitions.md +++ b/docs/spec/relayer/Definitions.md @@ -224,7 +224,7 @@ CreateUpdateClientDatagrams(shs []SignedHeader) IBCDatagram[] // Submit given datagram to a given chain Submit(chain Chain, datagram IBCDatagram) Error -// Return the correspondin chain for a given chainID +// Return the corresponding chain for a given chainID // We assume that the relayer maintains a map of known chainIDs and the corresponding chains. GetChain(chainID String) Chain ``` From 1b3d785dc8e2ff8b094cfe7efa8aafc7e5bf7619 Mon Sep 17 00:00:00 2001 From: Anca Zamfir Date: Mon, 27 May 2024 15:46:18 +0200 Subject: [PATCH 101/200] Query consensus states on counterparty chain for double vote evidence (#3998) * Query consensus states on counterparty chain for double vote evidence --- .../ibc-relayer-cli/3999-duplicate-vote-fix-query.md | 2 ++ crates/relayer-cli/src/commands/evidence.rs | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md new file mode 100644 index 0000000000..8ba593c9a6 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md @@ -0,0 +1,2 @@ +- Fixed the trusted height consensus state query when submitting the double vote evidence + ([\#3999](https://github.com/informalsystems/hermes/issues/3999)) diff --git a/crates/relayer-cli/src/commands/evidence.rs b/crates/relayer-cli/src/commands/evidence.rs index c034d7318e..fa54be707b 100644 --- a/crates/relayer-cli/src/commands/evidence.rs +++ b/crates/relayer-cli/src/commands/evidence.rs @@ -329,11 +329,12 @@ fn submit_duplicate_vote_evidence( // ie. retrieve the consensus state at the highest height smaller than the infraction height. // // Note: The consensus state heights are sorted in increasing order. - let consensus_state_heights = - chain.query_consensus_state_heights(QueryConsensusStateHeightsRequest { + let consensus_state_heights = counterparty_chain_handle.query_consensus_state_heights( + QueryConsensusStateHeightsRequest { client_id: counterparty_client_id.clone(), pagination: Some(PageRequest::all()), - })?; + }, + )?; // Retrieve the consensus state at the highest height smaller than the infraction height. let consensus_state_height_before_infraction_height = consensus_state_heights From 5357a62c32e48b3ae253d02b44804ecca608a112 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 10:25:48 +0200 Subject: [PATCH 102/200] Bump serde from 1.0.201 to 1.0.203 (#4002) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.201 to 1.0.203. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.201...v1.0.203) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3b36b1e200..a84b9b0fed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2762,9 +2762,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.201" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] @@ -2790,9 +2790,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.201" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 36c8413ea0..5971e5e498 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,7 +92,7 @@ retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" secp256k1 = "0.28.2" semver = "1.0.21" -serde = "1.0.201" +serde = "1.0.203" serde_derive = "1.0.104" serde_json = "1.0.115" serde_yaml = "0.9.34" From d30188fc5c09e2db37f5c3a436622b562aade256 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 10:26:17 +0200 Subject: [PATCH 103/200] --- (#3996) updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a84b9b0fed..52f930292f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,9 +115,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arc-swap" From 5c4d4887fdfd15c6eab0210deee54847bd53a845 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 10:26:31 +0200 Subject: [PATCH 104/200] --- (#3995) updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52f930292f..df9e5d2e15 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3371,18 +3371,18 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 5971e5e498..4e8e9237e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,7 +104,7 @@ strum = "0.25" subtle-encoding = "0.5.1" tempfile = "3.10.1" test-log = "0.2.14" -thiserror = "1.0.57" +thiserror = "1.0.61" time = "0.3" tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } From 58350109f155ca90fb02988e410d4c36cb96b203 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 10:28:07 +0200 Subject: [PATCH 105/200] --- (#3994) updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df9e5d2e15..2f3386f782 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2801,9 +2801,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", diff --git a/Cargo.toml b/Cargo.toml index 4e8e9237e9..f2dd104e12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ secp256k1 = "0.28.2" semver = "1.0.21" serde = "1.0.203" serde_derive = "1.0.104" -serde_json = "1.0.115" +serde_json = "1.0.117" serde_yaml = "0.9.34" serial_test = "3.1.1" sha2 = "0.10.6" From b1860f954d25772425f75caf33a5156959f15678 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 10:29:39 +0200 Subject: [PATCH 106/200] --- (#3992) updated-dependencies: - dependency-name: prost dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2f3386f782..c5aed0d69a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2247,9 +2247,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", "prost-derive", @@ -2257,9 +2257,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", "itertools", From 958223c2bcf48eb5a720cda885314583d308d993 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 10:30:15 +0200 Subject: [PATCH 107/200] --- (#3991) updated-dependencies: - dependency-name: jaxxstorm/action-install-gh-release dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/misbehaviour.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index 378185e459..cf68737c31 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -59,7 +59,7 @@ jobs: with: name: cosmos-nix - name: Install sconfig - uses: jaxxstorm/action-install-gh-release@v1.11.0 + uses: jaxxstorm/action-install-gh-release@v1.12.0 with: repo: freshautomations/sconfig platform: linux @@ -68,7 +68,7 @@ jobs: rename-to: sconfig chmod: 0755 - name: Install stoml - uses: jaxxstorm/action-install-gh-release@v1.11.0 + uses: jaxxstorm/action-install-gh-release@v1.12.0 with: repo: freshautomations/stoml platform: linux @@ -111,7 +111,7 @@ jobs: with: name: cosmos-nix - name: Install sconfig - uses: jaxxstorm/action-install-gh-release@v1.11.0 + uses: jaxxstorm/action-install-gh-release@v1.12.0 with: repo: freshautomations/sconfig platform: linux @@ -120,7 +120,7 @@ jobs: rename-to: sconfig chmod: 0755 - name: Install stoml - uses: jaxxstorm/action-install-gh-release@v1.11.0 + uses: jaxxstorm/action-install-gh-release@v1.12.0 with: repo: freshautomations/stoml platform: linux @@ -163,7 +163,7 @@ jobs: with: name: cosmos-nix - name: Install sconfig - uses: jaxxstorm/action-install-gh-release@v1.11.0 + uses: jaxxstorm/action-install-gh-release@v1.12.0 with: repo: freshautomations/sconfig platform: linux @@ -172,7 +172,7 @@ jobs: rename-to: sconfig chmod: 0755 - name: Install stoml - uses: jaxxstorm/action-install-gh-release@v1.11.0 + uses: jaxxstorm/action-install-gh-release@v1.12.0 with: repo: freshautomations/stoml platform: linux @@ -216,7 +216,7 @@ jobs: with: name: cosmos-nix - name: Install sconfig - uses: jaxxstorm/action-install-gh-release@v1.11.0 + uses: jaxxstorm/action-install-gh-release@v1.12.0 with: repo: freshautomations/sconfig platform: linux @@ -225,7 +225,7 @@ jobs: rename-to: sconfig chmod: 0755 - name: Install stoml - uses: jaxxstorm/action-install-gh-release@v1.11.0 + uses: jaxxstorm/action-install-gh-release@v1.12.0 with: repo: freshautomations/stoml platform: linux From 3ef2a35b5a7f9b2a86a967a20d2d4bdb6cd63ad6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 10:30:28 +0200 Subject: [PATCH 108/200] --- (#3990) updated-dependencies: - dependency-name: cachix/cachix-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/integration.yaml | 12 ++++++------ .github/workflows/misbehaviour.yml | 8 ++++---- .github/workflows/multi-chains.yaml | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 3c6ca354ed..1f30c9e60c 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -105,7 +105,7 @@ jobs: substituters = https://cache.nixos.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Install Cachix - uses: cachix/cachix-action@v14 + uses: cachix/cachix-action@v15 with: name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -143,7 +143,7 @@ jobs: substituters = https://cache.nixos.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Install Cachix - uses: cachix/cachix-action@v14 + uses: cachix/cachix-action@v15 with: name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -186,7 +186,7 @@ jobs: substituters = https://cache.nixos.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Install Cachix - uses: cachix/cachix-action@v14 + uses: cachix/cachix-action@v15 with: name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -228,7 +228,7 @@ jobs: substituters = https://cache.nixos.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Install Cachix - uses: cachix/cachix-action@v14 + uses: cachix/cachix-action@v15 with: name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -270,7 +270,7 @@ jobs: substituters = https://cache.nixos.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Install Cachix - uses: cachix/cachix-action@v14 + uses: cachix/cachix-action@v15 with: name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 @@ -311,7 +311,7 @@ jobs: substituters = https://cache.nixos.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Install Cachix - uses: cachix/cachix-action@v14 + uses: cachix/cachix-action@v15 with: name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index cf68737c31..77016f5354 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -55,7 +55,7 @@ jobs: substituters = https://cache.nixos.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Install Cachix - uses: cachix/cachix-action@v14 + uses: cachix/cachix-action@v15 with: name: cosmos-nix - name: Install sconfig @@ -107,7 +107,7 @@ jobs: substituters = https://cache.nixos.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Install Cachix - uses: cachix/cachix-action@v14 + uses: cachix/cachix-action@v15 with: name: cosmos-nix - name: Install sconfig @@ -159,7 +159,7 @@ jobs: substituters = https://cache.nixos.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Install Cachix - uses: cachix/cachix-action@v14 + uses: cachix/cachix-action@v15 with: name: cosmos-nix - name: Install sconfig @@ -212,7 +212,7 @@ jobs: substituters = https://cache.nixos.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Install Cachix - uses: cachix/cachix-action@v14 + uses: cachix/cachix-action@v15 with: name: cosmos-nix - name: Install sconfig diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index 352cbb7a47..9e23d3a5a2 100644 --- a/.github/workflows/multi-chains.yaml +++ b/.github/workflows/multi-chains.yaml @@ -90,7 +90,7 @@ jobs: substituters = https://cache.nixos.org trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - name: Install Cachix - uses: cachix/cachix-action@v14 + uses: cachix/cachix-action@v15 with: name: cosmos-nix - uses: actions-rust-lang/setup-rust-toolchain@v1 From c79d39bfaf4fb62a50e7a621b29a54fa4c7ce190 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Tue, 28 May 2024 16:40:44 +0200 Subject: [PATCH 109/200] Release Hermes v1.8.3 (#4005) * Query consensus states on counterparty chain for double vote evidence (#3998) * Query consensus states on counterparty chain for double vote evidence * Bump version to 1.8.3 * Update changelog * Fix clippy warnings --------- Co-authored-by: Anca Zamfir --- .../3999-duplicate-vote-fix-query.md | 2 ++ .changelog/v1.8.3/summary.md | 1 + CHANGELOG.md | 12 ++++++++++++ Cargo.lock | 16 ++++++++-------- crates/chain-registry/Cargo.toml | 4 ++-- crates/relayer-cli/Cargo.toml | 12 ++++++------ crates/relayer-cli/src/commands/evidence.rs | 7 ++++--- .../src/commands/query/packet/commitment.rs | 7 ------- crates/relayer-rest/Cargo.toml | 6 +++--- crates/relayer-rest/tests/mock.rs | 2 +- crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 8 ++++---- crates/relayer/src/lib.rs | 2 +- crates/telemetry/Cargo.toml | 4 ++-- guide/README.md | 2 +- tools/integration-test/Cargo.toml | 2 +- tools/test-framework/Cargo.toml | 8 ++++---- 17 files changed, 53 insertions(+), 44 deletions(-) create mode 100644 .changelog/v1.8.3/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md create mode 100644 .changelog/v1.8.3/summary.md diff --git a/.changelog/v1.8.3/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md b/.changelog/v1.8.3/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md new file mode 100644 index 0000000000..a248e67ca2 --- /dev/null +++ b/.changelog/v1.8.3/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md @@ -0,0 +1,2 @@ +- Fix the trusted height consensus state query when submitting the double vote evidence + ([\#3999](https://github.com/informalsystems/hermes/issues/3999)) diff --git a/.changelog/v1.8.3/summary.md b/.changelog/v1.8.3/summary.md new file mode 100644 index 0000000000..0495f558c3 --- /dev/null +++ b/.changelog/v1.8.3/summary.md @@ -0,0 +1 @@ +This patch release fixes a bug that may happen prevent the relayer from submitting the evidence for a duplicate vote in some cases. diff --git a/CHANGELOG.md b/CHANGELOG.md index cdd396a273..b7a677c621 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # CHANGELOG +## v1.8.3 + +*May 28th, 2024* + +This patch release fixes a bug that may happen prevent the relayer from submitting the evidence for a duplicate vote in some cases. + +### BUG FIXES + +- [Relayer CLI](relayer-cli) + - Fix the trusted height consensus state query when submitting the double vote evidence + ([\#3999](https://github.com/informalsystems/hermes/issues/3999)) + ## v1.8.2 *March 12th, 2024* diff --git a/Cargo.lock b/Cargo.lock index 11893755c4..78294b1325 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1444,7 +1444,7 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.27.2" +version = "0.27.3" dependencies = [ "async-trait", "flex-error", @@ -1463,7 +1463,7 @@ dependencies = [ [[package]] name = "ibc-integration-test" -version = "0.27.2" +version = "0.27.3" dependencies = [ "byte-unit", "http", @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.27.2" +version = "0.27.3" dependencies = [ "anyhow", "async-stream", @@ -1570,7 +1570,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "1.8.2" +version = "1.8.3" dependencies = [ "abscissa_core", "clap", @@ -1611,7 +1611,7 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.27.2" +version = "0.27.3" dependencies = [ "axum", "crossbeam-channel 0.5.11", @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "ibc-relayer-types" -version = "0.27.2" +version = "0.27.3" dependencies = [ "bytes", "derive_more", @@ -1657,7 +1657,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.27.2" +version = "0.27.3" dependencies = [ "axum", "dashmap", @@ -1676,7 +1676,7 @@ dependencies = [ [[package]] name = "ibc-test-framework" -version = "0.27.2" +version = "0.27.3" dependencies = [ "color-eyre", "crossbeam-channel 0.5.11", diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index 3207ec5c86..fde84780bc 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-chain-registry" -version = "0.27.2" +version = "0.27.3" edition = "2021" license = "Apache-2.0" keywords = ["cosmos", "ibc", "relayer", "chain", "registry"] @@ -12,7 +12,7 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.27.2", path = "../relayer-types" } +ibc-relayer-types = { version = "0.27.3", path = "../relayer-types" } ibc-proto = { version = "0.42.0", features = ["serde"] } tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index 6a90246bf7..03d25244d6 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-cli" -version = "1.8.2" +version = "1.8.3" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -25,11 +25,11 @@ telemetry = ["ibc-relayer/telemetry", "ibc-telemetry"] rest-server = ["ibc-relayer-rest"] [dependencies] -ibc-relayer-types = { version = "0.27.2", path = "../relayer-types" } -ibc-relayer = { version = "0.27.2", path = "../relayer" } -ibc-telemetry = { version = "0.27.2", path = "../telemetry", optional = true } -ibc-relayer-rest = { version = "0.27.2", path = "../relayer-rest", optional = true } -ibc-chain-registry = { version = "0.27.2" , path = "../chain-registry" } +ibc-relayer-types = { version = "0.27.3", path = "../relayer-types" } +ibc-relayer = { version = "0.27.3", path = "../relayer" } +ibc-telemetry = { version = "0.27.3", path = "../telemetry", optional = true } +ibc-relayer-rest = { version = "0.27.3", path = "../relayer-rest", optional = true } +ibc-chain-registry = { version = "0.27.3" , path = "../chain-registry" } clap = { version = "3.2", features = ["cargo"] } clap_complete = "3.2" diff --git a/crates/relayer-cli/src/commands/evidence.rs b/crates/relayer-cli/src/commands/evidence.rs index c034d7318e..fa54be707b 100644 --- a/crates/relayer-cli/src/commands/evidence.rs +++ b/crates/relayer-cli/src/commands/evidence.rs @@ -329,11 +329,12 @@ fn submit_duplicate_vote_evidence( // ie. retrieve the consensus state at the highest height smaller than the infraction height. // // Note: The consensus state heights are sorted in increasing order. - let consensus_state_heights = - chain.query_consensus_state_heights(QueryConsensusStateHeightsRequest { + let consensus_state_heights = counterparty_chain_handle.query_consensus_state_heights( + QueryConsensusStateHeightsRequest { client_id: counterparty_client_id.clone(), pagination: Some(PageRequest::all()), - })?; + }, + )?; // Retrieve the consensus state at the highest height smaller than the infraction height. let consensus_state_height_before_infraction_height = consensus_state_heights diff --git a/crates/relayer-cli/src/commands/query/packet/commitment.rs b/crates/relayer-cli/src/commands/query/packet/commitment.rs index 57a45282f1..4c4edd911b 100644 --- a/crates/relayer-cli/src/commands/query/packet/commitment.rs +++ b/crates/relayer-cli/src/commands/query/packet/commitment.rs @@ -1,5 +1,4 @@ use abscissa_core::clap::Parser; -use serde::Serialize; use subtle_encoding::{Encoding, Hex}; use ibc_relayer::chain::handle::ChainHandle; @@ -13,12 +12,6 @@ use crate::conclude::{exit_with_unrecoverable_error, Output}; use crate::error::Error; use crate::prelude::*; -#[derive(Serialize, Debug)] -struct PacketSeqs { - height: Height, - seqs: Vec, -} - #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryPacketCommitmentCmd { #[clap( diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index 1c4655b065..e994335451 100644 --- a/crates/relayer-rest/Cargo.toml +++ b/crates/relayer-rest/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-rest" -version = "0.27.2" +version = "0.27.3" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" @@ -14,8 +14,8 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.27.2", path = "../relayer-types" } -ibc-relayer = { version = "0.27.2", path = "../relayer" } +ibc-relayer-types = { version = "0.27.3", path = "../relayer-types" } +ibc-relayer = { version = "0.27.3", path = "../relayer" } crossbeam-channel = "0.5" serde = "1.0" diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index c26a225215..eeeffd3f84 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -64,7 +64,7 @@ async fn version() { let rest_api_version = VersionInfo { name: "ibc-relayer-rest".to_string(), - version: "0.27.2".to_string(), + version: "0.27.3".to_string(), }; let result: JsonResult<_, ()> = JsonResult::Success(vec![version.clone(), rest_api_version]); diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 5237d234bd..9424afbea5 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-types" -version = "0.27.2" +version = "0.27.3" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index d18f04c463..987ba15ab6 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer" -version = "0.27.2" +version = "0.27.3" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -21,8 +21,8 @@ telemetry = ["ibc-telemetry"] [dependencies] ibc-proto = { version = "0.42.0", features = ["serde"] } -ibc-telemetry = { version = "0.27.2", path = "../telemetry", optional = true } -ibc-relayer-types = { version = "0.27.2", path = "../relayer-types", features = ["mocks"] } +ibc-telemetry = { version = "0.27.3", path = "../telemetry", optional = true } +ibc-relayer-types = { version = "0.27.3", path = "../relayer-types", features = ["mocks"] } subtle-encoding = "0.5" humantime-serde = "1.1.1" @@ -110,7 +110,7 @@ version = "0.34.0" default-features = false [dev-dependencies] -ibc-relayer-types = { version = "0.27.2", path = "../relayer-types", features = ["mocks"] } +ibc-relayer-types = { version = "0.27.3", path = "../relayer-types", features = ["mocks"] } serial_test = "3.0.0" env_logger = "0.11.1" test-log = { version = "0.2.14", features = ["trace"] } diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index eb0ea4dd40..e57f50158c 100644 --- a/crates/relayer/src/lib.rs +++ b/crates/relayer/src/lib.rs @@ -14,7 +14,7 @@ //! //! For the IBC relayer binary, please see [Hermes] (`ibc-relayer-cli` crate). //! -//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.8.2/ +//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.8.3/ extern crate alloc; diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index 5e065264c7..9a61a0c36b 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-telemetry" -version = "0.27.2" +version = "0.27.3" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -13,7 +13,7 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "0.27.2", path = "../relayer-types" } +ibc-relayer-types = { version = "0.27.3", path = "../relayer-types" } once_cell = "1.19.0" opentelemetry = { version = "0.19.0", features = ["metrics"] } diff --git a/guide/README.md b/guide/README.md index 8491178669..f3cda2122f 100644 --- a/guide/README.md +++ b/guide/README.md @@ -10,7 +10,7 @@ mdBook is a utility to create modern online books from Markdown files. This guide should be permanently deployed at its latest stable version at [hermes.informal.systems](https://hermes.informal.systems). -Current version: `v1.8.2`. +Current version: `v1.8.3`. The version of this guide is aligned with the [versioning of the ibc crates](../README.md). diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index f817feefde..0067ee0d34 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-integration-test" -version = "0.27.2" +version = "0.27.3" edition = "2021" rust-version = "1.71" license = "Apache-2.0" diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index b36199cbde..787a2a4be7 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-test-framework" -version = "0.27.2" +version = "0.27.3" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -14,9 +14,9 @@ description = """ """ [dependencies] -ibc-relayer-types = { version = "=0.27.2", path = "../../crates/relayer-types" } -ibc-relayer = { version = "=0.27.2", path = "../../crates/relayer" } -ibc-relayer-cli = { version = "=1.8.2", path = "../../crates/relayer-cli" } +ibc-relayer-types = { version = "=0.27.3", path = "../../crates/relayer-types" } +ibc-relayer = { version = "=0.27.3", path = "../../crates/relayer" } +ibc-relayer-cli = { version = "=1.8.3", path = "../../crates/relayer-cli" } ibc-proto = { version = "0.42.0", features = ["serde"] } tendermint-rpc = { version = "0.34.0", features = ["http-client", "websocket-client"] } From 1d2aa0c7108dc278e00731cc91bc366a418e2543 Mon Sep 17 00:00:00 2001 From: Anca Zamfir Date: Mon, 27 May 2024 15:46:18 +0200 Subject: [PATCH 110/200] Query consensus states on counterparty chain for double vote evidence (#3998) * Query consensus states on counterparty chain for double vote evidence --- .../bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md new file mode 100644 index 0000000000..8ba593c9a6 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md @@ -0,0 +1,2 @@ +- Fixed the trusted height consensus state query when submitting the double vote evidence + ([\#3999](https://github.com/informalsystems/hermes/issues/3999)) From 6d377abf3879a0bf979ef6327849fa213c7aef22 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Wed, 29 May 2024 11:13:23 +0200 Subject: [PATCH 111/200] Update dynamic gas fee to work with FeeMarket (#4004) * Update dynamic gas fee to work with FeeMarket * Add changelog * Remove unnecessary struct * Apply suggestions from code review Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * Fix import error * Move dynamic gas fee url creation into query_eip_base_fee method * Improve identification of Osmosis chain when querying dynamic gas fee * Fix if condition for Osmosis chain in dynamic gas fee * Apply suggestions from code review Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi --- .../4000-update-dynamic-gas-fee.md | 2 + .../relayer/src/chain/cosmos/eip_base_fee.rs | 70 ++++- crates/relayer/src/chain/cosmos/gas.rs | 2 +- .../interchain_security/dynamic_gas_fee.rs | 255 ++++++++++++++++++ .../src/tests/interchain_security/mod.rs | 2 + tools/test-framework/src/chain/chain_type.rs | 9 +- tools/test-framework/src/chain/config.rs | 17 +- 7 files changed, 340 insertions(+), 17 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/4000-update-dynamic-gas-fee.md create mode 100644 tools/integration-test/src/tests/interchain_security/dynamic_gas_fee.rs diff --git a/.changelog/unreleased/improvements/ibc-relayer/4000-update-dynamic-gas-fee.md b/.changelog/unreleased/improvements/ibc-relayer/4000-update-dynamic-gas-fee.md new file mode 100644 index 0000000000..4c7123523a --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/4000-update-dynamic-gas-fee.md @@ -0,0 +1,2 @@ +- Add support for dynamic gas fee for chains using Skip's [`x/feemarket`](https://github.com/skip-mev/feemarket) module, while keeping compatibility with Osmosis' bespoke implementation + ([\#4000](https://github.com/informalsystems/hermes/issues/4000)) \ No newline at end of file diff --git a/crates/relayer/src/chain/cosmos/eip_base_fee.rs b/crates/relayer/src/chain/cosmos/eip_base_fee.rs index 75cc9eedd4..5c91fc7ad6 100644 --- a/crates/relayer/src/chain/cosmos/eip_base_fee.rs +++ b/crates/relayer/src/chain/cosmos/eip_base_fee.rs @@ -5,17 +5,35 @@ use std::str::FromStr; use serde::Deserialize; use subtle_encoding::base64; use tendermint_rpc::Url; -use tracing::debug; +use tracing::{debug, trace}; -use ibc_proto::cosmos::base::v1beta1::DecProto; +use ibc_proto::cosmos::base::v1beta1::{DecCoin, DecProto}; +use ibc_relayer_types::core::ics24_host::identifier::ChainId; use crate::error::Error; -pub async fn query_eip_base_fee(rpc_address: &Url) -> Result { +pub async fn query_eip_base_fee( + rpc_address: &Url, + gas_price_denom: &str, + chain_id: &ChainId, +) -> Result { debug!("Querying Omosis EIP-1559 base fee from {rpc_address}"); - let url = - format!("{rpc_address}/abci_query?path=\"/osmosis.txfees.v1beta1.Query/GetEipBaseFee\""); + let chain_name = chain_id.name(); + + let is_osmosis = chain_name.starts_with("osmosis") || chain_name.starts_with("osmo-test"); + + let url = if is_osmosis { + format!( + "{}abci_query?path=\"/osmosis.txfees.v1beta1.Query/GetEipBaseFee\"", + rpc_address + ) + } else { + format!( + "{}abci_query?path=\"/feemarket.feemarket.v1.Query/GasPrices\"&denom={}", + rpc_address, gas_price_denom + ) + }; let response = reqwest::get(&url).await.map_err(Error::http_request)?; @@ -40,7 +58,34 @@ pub async fn query_eip_base_fee(rpc_address: &Url) -> Result { let result: EipBaseFeeHTTPResult = response.json().await.map_err(Error::http_response_body)?; - let encoded = result.result.response.value; + let amount = if is_osmosis { + extract_dynamic_gas_price_osmosis(result.result.response.value)? + } else { + extract_dynamic_gas_price(result.result.response.value)? + }; + + trace!("EIP-1559 base fee: {amount}"); + + Ok(amount) +} + +/// This method extracts the gas base fee from Skip's feemarket +fn extract_dynamic_gas_price(encoded: String) -> Result { + let decoded = base64::decode(encoded).map_err(Error::base64_decode)?; + + let gas_price_response: GasPriceResponse = + prost::Message::decode(decoded.as_ref()).map_err(|e| { + Error::protobuf_decode("feemarket.feemarket.v1.GasPricesResponse".to_string(), e) + })?; + let dec_coin = gas_price_response.price.unwrap().clone(); + let base_fee_uint128 = Uint128::from_str(&dec_coin.amount).map_err(Error::parse_int)?; + + let dec = Decimal::new(base_fee_uint128); + f64::from_str(dec.to_string().as_str()).map_err(Error::parse_float) +} + +/// This method extracts the gas base fee from Osmosis EIP-1559 +fn extract_dynamic_gas_price_osmosis(encoded: String) -> Result { let decoded = base64::decode(encoded).map_err(Error::base64_decode)?; let dec_proto: DecProto = prost::Message::decode(decoded.as_ref()) @@ -49,11 +94,16 @@ pub async fn query_eip_base_fee(rpc_address: &Url) -> Result { let base_fee_uint128 = Uint128::from_str(&dec_proto.dec).map_err(Error::parse_int)?; let dec = Decimal::new(base_fee_uint128); - let base_fee = f64::from_str(dec.to_string().as_str()).map_err(Error::parse_float)?; - - debug!("Omosis EIP-1559 base fee is {}", base_fee); + f64::from_str(dec.to_string().as_str()).map_err(Error::parse_float) +} - Ok(base_fee) +/// GasPriceResponse is the response type for the Query/GasPrice RPC method. +/// Returns a gas price in specified denom. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GasPriceResponse { + #[prost(message, optional, tag = "1")] + pub price: ::core::option::Option, } /// Extracted from `cosmwasm-std` diff --git a/crates/relayer/src/chain/cosmos/gas.rs b/crates/relayer/src/chain/cosmos/gas.rs index 07b4b6a20f..2106da3375 100644 --- a/crates/relayer/src/chain/cosmos/gas.rs +++ b/crates/relayer/src/chain/cosmos/gas.rs @@ -43,7 +43,7 @@ pub async fn dynamic_gas_price( rpc_address: &Url, ) -> GasPrice { if config.dynamic_gas_price.enabled { - let dynamic_gas_price = query_eip_base_fee(rpc_address) + let dynamic_gas_price = query_eip_base_fee(rpc_address, &config.gas_price.denom, chain_id) .await .map(|base_fee| base_fee * config.dynamic_gas_price.multiplier) .map(|new_price| GasPrice { diff --git a/tools/integration-test/src/tests/interchain_security/dynamic_gas_fee.rs b/tools/integration-test/src/tests/interchain_security/dynamic_gas_fee.rs new file mode 100644 index 0000000000..3d2f217554 --- /dev/null +++ b/tools/integration-test/src/tests/interchain_security/dynamic_gas_fee.rs @@ -0,0 +1,255 @@ +//! The [`DynamicGasTest`] test ensures that the [`DynamicGas`] +//! configuration works correctly. The test can enable or disable the dynamic +//! gas price for the second chain. +//! +//! To test dynamic gas configuration, it will enable dynamic gas price on the +//! second chain only. It will then create and relay a first IBC transfer with a +//! big memo. The gas fee paid is then recorded. +//! A second IBC transfer without memo will then be relayed. The gas fee paid +//! will also be recorded. The test will assert that the Tx with a big memo +//! and dynamic gas enabled is lower than the Tx without memo and dynamic gas +//! disabled. +//! +//! The second test disables the dynamic gas price on both chains in +//! order to ensure that the first IBC transfer will cost more if dynamic +//! gas is disabled. + +use ibc_relayer::config::dynamic_gas::DynamicGasPrice; +use ibc_relayer::config::gas_multiplier::GasMultiplier; +use ibc_relayer::config::ChainConfig; +use ibc_relayer::config::GasPrice; +use ibc_test_framework::framework::binary::channel::run_binary_interchain_security_channel_test; +use ibc_test_framework::prelude::*; +use ibc_test_framework::util::interchain_security::update_genesis_for_consumer_chain; +use ibc_test_framework::util::interchain_security::update_relayer_config_for_consumer_chain; + +#[test] +fn test_fee_market_dynamic_gas_transfer() -> Result<(), Error> { + run_binary_interchain_security_channel_test(&DynamicGasTest { + dynamic_gas_enabled: true, + }) +} + +#[test] +fn test_fee_market_static_gas_transfer() -> Result<(), Error> { + run_binary_interchain_security_channel_test(&DynamicGasTest { + dynamic_gas_enabled: false, + }) +} + +const MEMO_CHAR: &str = "a"; +const MEMO_SIZE: usize = 10000; + +pub struct DynamicGasTest { + dynamic_gas_enabled: bool, +} + +impl TestOverrides for DynamicGasTest { + fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { + update_genesis_for_consumer_chain(genesis)?; + // This is a configuration specifically for chains with feemarket + if genesis + .get_mut("app_state") + .and_then(|app_state| app_state.get("feemarket")) + .is_some() + { + let params = genesis + .get_mut("app_state") + .and_then(|app_state| app_state.get_mut("feemarket")) + .and_then(|feemarket| feemarket.get_mut("params")) + .and_then(|params| params.as_object_mut()) + .ok_or_else(|| eyre!("failed to get feemarket params in genesis file"))?; + params.insert( + "min_base_fee".to_owned(), + serde_json::Value::String("0.0025".to_owned()), + ); + } + + Ok(()) + } + + // The `ccv_consumer_chain` must be `true` for the Consumer chain. + // The `trusting_period` must be strictly smaller than the `unbonding_period` + // specified in the Consumer chain proposal. The test framework uses 100s in + // the proposal. + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.clients.misbehaviour = false; + config.mode.clients.refresh = false; + config.mode.packets.clear_interval = 0; + + update_relayer_config_for_consumer_chain(config); + + match &mut config.chains[0] { + ChainConfig::CosmosSdk(chain_config_a) => { + chain_config_a.gas_price = + GasPrice::new(0.3, chain_config_a.gas_price.denom.clone()); + + chain_config_a.dynamic_gas_price = DynamicGasPrice::unsafe_new(false, 1.1, 0.6); + } + } + + match &mut config.chains[1] { + ChainConfig::CosmosSdk(chain_config_b) => { + chain_config_b.gas_price = + GasPrice::new(0.3, chain_config_b.gas_price.denom.clone()); + + chain_config_b.gas_multiplier = Some(GasMultiplier::unsafe_new(1.8)); + + chain_config_b.dynamic_gas_price = + DynamicGasPrice::unsafe_new(self.dynamic_gas_enabled, 1.1, 0.6); + } + } + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +impl BinaryChannelTest for DynamicGasTest { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channel: ConnectedChannel, + ) -> Result<(), Error> { + let denom_a = chains.node_a.denom(); + let wallet_a = chains.node_a.wallets().user1().cloned(); + let wallet_b = chains.node_b.wallets().user1().cloned(); + + let a_to_b_amount = 12345u64; + + let denom_a_to_b = derive_ibc_denom( + &channel.port_b.as_ref(), + &channel.channel_id_b.as_ref(), + &denom_a, + )?; + + let gas_denom_a: MonoTagged = + MonoTagged::new(Denom::Base("stake".to_owned())); + let gas_denom_b: MonoTagged = + MonoTagged::new(Denom::Base("stake".to_owned())); + + let balance_relayer_b_before = chains.node_b.chain_driver().query_balance( + &chains.node_b.wallets().relayer().address(), + &gas_denom_b.as_ref(), + )?; + + let memo: String = MEMO_CHAR.repeat(MEMO_SIZE); + + chains + .node_a + .chain_driver() + .ibc_transfer_token_with_memo_and_timeout( + &channel.port_a.as_ref(), + &channel.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + Some(memo), + None, + )?; + + // Do a simple IBC transfer with the dynamic gas configuration + let tx1_paid_gas_relayer = relayer.with_supervisor(|| { + // Assert that user on chain B received the tokens + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b.address(), + &denom_a_to_b.with_amount(a_to_b_amount).as_ref(), + )?; + + // Wait for a bit before querying the new balance + sleep(Duration::from_secs(5)); + + let balance_relayer_b_after = chains.node_b.chain_driver().query_balance( + &chains.node_b.wallets().relayer().address(), + &gas_denom_b.as_ref(), + )?; + + let paid_fees_relayer_b = balance_relayer_b_before + .amount() + .checked_sub(balance_relayer_b_after.amount()); + + assert!( + paid_fees_relayer_b.is_some(), + "subtraction between queried amounts for relayer should be Some" + ); + + info!("IBC transfer with memo was successful"); + + Ok(paid_fees_relayer_b.unwrap()) + })?; + + let b_to_a_amount = 23456u64; + let denom_b = chains.node_b.denom(); + + let denom_b_to_a = derive_ibc_denom( + &channel.port_a.as_ref(), + &channel.channel_id_a.as_ref(), + &denom_b, + )?; + + let balance_relayer_a_before = chains.node_a.chain_driver().query_balance( + &chains.node_a.wallets().relayer().address(), + &gas_denom_a.as_ref(), + )?; + + info!("Will ibc transfer"); + + chains.node_b.chain_driver().ibc_transfer_token( + &channel.port_b.as_ref(), + &channel.channel_id_b.as_ref(), + &chains.node_b.wallets().user1(), + &chains.node_a.wallets().user1().address(), + &denom_b.with_amount(b_to_a_amount).as_ref(), + )?; + + info!("Done ibc transfer"); + + let tx2_paid_gas_relayer = relayer.with_supervisor(|| { + // Assert that user on chain B received the tokens + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &chains.node_a.wallets().user1().address(), + &denom_b_to_a.with_amount(b_to_a_amount).as_ref(), + )?; + + // Wait for a bit before querying the new balance + sleep(Duration::from_secs(5)); + + let balance_relayer_a_after = chains.node_a.chain_driver().query_balance( + &chains.node_a.wallets().relayer().address(), + &gas_denom_a.as_ref(), + )?; + + let paid_fees_relayer_a = balance_relayer_a_before + .amount() + .checked_sub(balance_relayer_a_after.amount()); + + assert!( + paid_fees_relayer_a.is_some(), + "subtraction between queried amounts for relayer should be Some" + ); + + info!("IBC transfer without memo was successful"); + + Ok(paid_fees_relayer_a.unwrap()) + })?; + + info!("paid gas fees for Tx with memo `{tx1_paid_gas_relayer}`, without memo `{tx2_paid_gas_relayer}`"); + + if self.dynamic_gas_enabled { + assert!( + tx1_paid_gas_relayer < tx2_paid_gas_relayer, + "with dynamic gas enabled, gas paid for the first TX should be lower" + ); + } else { + assert!( + tx1_paid_gas_relayer > tx2_paid_gas_relayer, + "with dynamic gas disabled, gas paid for the second TX should be lower" + ); + } + + Ok(()) + } +} diff --git a/tools/integration-test/src/tests/interchain_security/mod.rs b/tools/integration-test/src/tests/interchain_security/mod.rs index 0772d733db..6081fc7e53 100644 --- a/tools/integration-test/src/tests/interchain_security/mod.rs +++ b/tools/integration-test/src/tests/interchain_security/mod.rs @@ -1,3 +1,5 @@ +#[cfg(any(doc, feature = "dynamic-gas-fee"))] +pub mod dynamic_gas_fee; #[cfg(any(doc, feature = "ica"))] pub mod ica_ordered_channel; #[cfg(any(doc, feature = "ica"))] diff --git a/tools/test-framework/src/chain/chain_type.rs b/tools/test-framework/src/chain/chain_type.rs index 8d40fe17fc..1eba905087 100644 --- a/tools/test-framework/src/chain/chain_type.rs +++ b/tools/test-framework/src/chain/chain_type.rs @@ -29,13 +29,20 @@ impl ChainType { pub fn chain_id(&self, prefix: &str, use_random_id: bool) -> ChainId { match self { - Self::Cosmos | Self::Osmosis => { + Self::Cosmos => { if use_random_id { ChainId::from_string(&format!("ibc-{}-{:x}", prefix, random_u32())) } else { ChainId::from_string(&format!("ibc{prefix}")) } } + Self::Osmosis => { + if use_random_id { + ChainId::from_string(&format!("osmosis-{}-{:x}", prefix, random_u32())) + } else { + ChainId::from_string(&format!("osmosis{prefix}")) + } + } Self::Injective => ChainId::from_string(&format!("injective-{prefix}")), Self::Evmos => ChainId::from_string(&format!("evmos_9000-{prefix}")), Self::Provenance => ChainId::from_string(&format!("pio-mainnet-{prefix}")), diff --git a/tools/test-framework/src/chain/config.rs b/tools/test-framework/src/chain/config.rs index 280aac29fd..d22d7d2532 100644 --- a/tools/test-framework/src/chain/config.rs +++ b/tools/test-framework/src/chain/config.rs @@ -359,11 +359,18 @@ pub fn consensus_params_max_gas( genesis: &mut serde_json::Value, max_gas: &str, ) -> Result<(), Error> { - let block = genesis - .get_mut("consensus_params") - .and_then(|consensus_params| consensus_params.get_mut("block")) - .and_then(|block| block.as_object_mut()) - .ok_or_else(|| eyre!("failed to get `block` field in genesis file"))?; + let block = match genesis.get_mut("consensus_params") { + Some(consensus_params) => consensus_params + .get_mut("block") + .and_then(|block| block.as_object_mut()) + .ok_or_else(|| eyre!("failed to get `block` field in genesis file"))?, + None => genesis + .get_mut("consensus") + .and_then(|consensus| consensus.get_mut("params")) + .and_then(|params| params.get_mut("block")) + .and_then(|block| block.as_object_mut()) + .ok_or_else(|| eyre!("failed to get `block` field in genesis file"))?, + }; block.insert( "max_gas".to_owned(), From d60057f8d54e9d288d23977626133fb48ee7da7d Mon Sep 17 00:00:00 2001 From: shuoer86 <129674997+shuoer86@users.noreply.github.com> Date: Wed, 29 May 2024 17:14:11 +0800 Subject: [PATCH 112/200] Fix typos in comments (#3818) --- crates/relayer/src/util/seq_range.rs | 4 ++-- tools/test-framework/src/chain/ext/forward.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/relayer/src/util/seq_range.rs b/crates/relayer/src/util/seq_range.rs index d569d156ef..229ab124e6 100644 --- a/crates/relayer/src/util/seq_range.rs +++ b/crates/relayer/src/util/seq_range.rs @@ -18,7 +18,7 @@ pub enum Error { /// - A range is specified as `start..end`, where `start` and `end` are sequence numbers. /// - If `start` is omitted, the range starts at the minimum sequence number. /// - If `end` is omitted, the range ends at the maximum sequence number. -/// - If both `start` and `end` are omitted, the range sastifies any sequence number. +/// - If both `start` and `end` are omitted, the range satisfies any sequence number. /// /// # Examples /// - `1` Single sequence number `1` @@ -39,7 +39,7 @@ pub fn parse_seq_ranges(s: &str) -> Result>, Error> /// - A range is specified as `start..end`, where `start` and `end` are sequence numbers. /// - If `start` is omitted, the range starts at the minimum sequence number. /// - If `end` is omitted, the range ends at the maximum sequence number.` -/// - If both `start` and `end` are omitted, the range sastifies any sequence number. +/// - If both `start` and `end` are omitted, the range satisfies any sequence number. /// /// # Examples /// - `1` Single sequence number `1` diff --git a/tools/test-framework/src/chain/ext/forward.rs b/tools/test-framework/src/chain/ext/forward.rs index 1e0c23ace9..f56a31b72e 100644 --- a/tools/test-framework/src/chain/ext/forward.rs +++ b/tools/test-framework/src/chain/ext/forward.rs @@ -3,7 +3,7 @@ use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId}; use crate::prelude::{DualTagged, MonoTagged, WalletAddress}; /// Build the recipient address as following: -/// {intermediate_refund_address}|{foward_port}/{forward_channel}:{final_destination_address} +/// {intermediate_refund_address}|{forward_port}/{forward_channel}:{final_destination_address} /// See pub fn build_forward_address<'a, ChainB, ChainC>( intermediate_destination_address: MonoTagged, From fc8376ba98e4b595e446b366b736a0c046d6026a Mon Sep 17 00:00:00 2001 From: Sean Chen Date: Fri, 31 May 2024 03:45:45 -0500 Subject: [PATCH 113/200] Channel upgradability (#3228) * Add new channel states * Change channel state enum discriminants * Update channel state doc comment * Stub out channel upgrade CLI commands * Use tx_chan_cmd macro for TxChanOpenInit command * Stub out build_channel_upgrade_init function * Add MsgChannelUpgradeInit type * Add more tests for MsgChannelUpgradeInit message type * Add chan_upgrade_try file for MsgChannelUpgradeTry message type * Add build_chan_upgrade_init_and_send method * Add UpgradeInit and UpgradeTry ChannelEvents * Fix compilation errors with UpgradeInit and UpgradeTry impls * Stub out MsgChannelUpgradeTry * Add missing fields to MsgChannelUpgradeInit * Use ibc-proto branch with channel upgrade messages * Fill in todos * Comment out code in tx chan-upgrade-init and add todos * Add `UpgradeTimeout` enum * Fleshing out MsgChannelUpgradeTry * Clean up MsgChannelUpgradeTry * Clean up MsgChannelUpgradeTry * Fix error conversion * Formatting and clippy * Disable tests and fix more clippy warnings * Re-enable tests * Wrap up channel upgrade init CLI * Cargo fmt * Remove unnecessary CLI parameter * Pass an `UpgradeTimeout` to `.build_chan_upgrade_init_and_send` * Fix bug when converting integer to channel state * Proper implementation of `State::less_or_equal_progress` * Fix broken test * Ignore channel upgrade try tests for now * Fix channel upgrade try tests * Stub out build_channel_upgrade_try * Stub out build_channel_upgrade_try * Fix return type of build_chan_upgrade_try * Cargo fmt * Remove stub function * Add missing clone * Remove redundant clone * Add integration tests for channel upgradability (#3247) * Add test for ChannelUpgradeInit step * Add conditional check 'channel-upgrade' to channel upgradability tests * Improve info message * Update event processing for UpgradeInit * Update UpgradeInit step test * Rename ChannelUpgradeInit test * Improve channel upgrade steps assertion * Add ChannelUpgradeAssertionAttributes struct for tests * Update tests after merge * Fix channel upgrade init step tests * Fix check for new channel ordering * Fix broken doc comment link * Progress on build_chan_upgrade_try * Progress on build_chan_upgrade_try * Update ChanUpgradeInit step to use new design improvements * Nicely report connection id parsing failures * Document some fields of MsgChannelUpgradeTry * Add build_chan_upgrade_try_and_send fn * Cargo fmt * Update UpgradeInit to mirror event attributers from 'channel_upgrade_init' event * Treat timestamp 0 as no timestamp * Fix parsing UpgradeAttributes and improve ChanUpgradeInit test * Add Hermes data requirements document (#3262) * Add Hermes data requirements document * Update data requirement for some endpoints with actual data being used * Add headers * Fix Order -> Ordering doc comment links * Apply suggestions from code review Co-authored-by: Anca Zamfir Signed-off-by: Romain Ruetschi --------- Signed-off-by: Romain Ruetschi Co-authored-by: Sean Chen Co-authored-by: Anca Zamfir * Update nix flake to use simd v7.0.0 (#3264) * Address compiler errors for now * Cargo fmt * Add channel-upgrade job to the CI * Format flake.nix * Fix test * Update guide templates * Expose `tx chan-upgrade-try` command * Update TRY ste implementation for channel upgrade * Fix channel upgrade TRY step * Update nix flake * Add integration test for `ChanUpgradeTry` step (#3259) * Add test for ChannelUpgradeInit step * Add conditional check 'channel-upgrade' to channel upgradability tests * Improve info message * Update event processing for UpgradeInit * Update UpgradeInit step test * Rename ChannelUpgradeInit test * Add ChanUpgradeTry test * Improve channel upgrade steps assertion * Add ChannelUpgradeAssertionAttributes struct for tests * Update naming for modifiable channel attributes in tests * Fix test doc string * Restore commented lines for channel upgrade TRY step * Improve channel upgrade tests * Disable TRY assert in test * Remove unnecessary test configuration for channel upgrade * Merge channel upgrade Init and Try tests into a single test * Improve channel upgrade test * Use 'CountingAndCachingChainHandle' in integration tests and 'IncludeProof::Yes' when querying channel ends in the integration tests * Updated channel upgrade TRY step tests * Fix and improve channel upgrade TRY step test * Updated nix flake * Fix test-stable * Update nix flake and TRY step test * Fix interchain-security CI. Add domain type FlushStatus * Fix FlushStatus display errors * Add Channel Upgrade ACK and CONFIRM steps (#3462) * Add test for ChannelUpgradeInit step * Add conditional check 'channel-upgrade' to channel upgradability tests * Improve info message * Update event processing for UpgradeInit * Update UpgradeInit step test * Rename ChannelUpgradeInit test * Add ChanUpgradeTry test * Improve channel upgrade steps assertion * Add ChannelUpgradeAssertionAttributes struct for tests * Update naming for modifiable channel attributes in tests * Add test for 'ChanUpgradeAck' step * Fix test doc string * Restore commented lines for channel upgrade TRY step * Improve channel upgrade tests * Fix after merge * Disable TRY assert in test * Remove unnecessary test configuration for channel upgrade * Merge channel upgrade Init and Try tests into a single test * Improve channel upgrade test * Use 'CountingAndCachingChainHandle' in integration tests and 'IncludeProof::Yes' when querying channel ends in the integration tests * Updated channel upgrade TRY step tests * Fix and improve channel upgrade TRY step test * Updated nix flake * Fix test-stable * Update nix flake and TRY step test * Update ACK step assert function * Fix interchain-security CI. Add domain type FlushStatus * Fix FlushStatus display errors * Add build and send MsgChannelUpgradeAck * Add ACK step to Channel Upgrade test * Implement Channel Upgrade OPEN step * Update flake.lock to use latest simapp for channel upgrade * Fix channel upgrade test OPEN step * Fix assertion after channelupgradeopen * Update nix flake * Fix comments * Implement PartialEq for Version * Apply suggestions and improve documentation * Add missing CLIs for channel upgrade (#3495) * Add missing CLIs for channel upgrade * Update CLI template * Add cargo patch for check-guide test * Add documentation TODO to check-guide Cargo.toml * Set dst-channel flag to required for channel upgrade CLIs and updated templates * Clean channel upgrade CLIs * Update guide templates * Update channel upgrade after spec rework * Update nix flake * Update nix flake * Add test bootstrap compatibility for pre and post SDK v0.47.0 * Channel upgrade worker handshake (#3569) * Add missing CLIs for channel upgrade * Update CLI template * Add cargo patch for check-guide test * Add documentation TODO to check-guide Cargo.toml * Set dst-channel flag to required for channel upgrade CLIs and updated templates * Clean channel upgrade CLIs * Update guide templates * Update channel upgrade test to match ibc-go changes * WIP: waiting for new channel states during upgrade to be implemented * Implement channel upgrade handshake * Add channel upgrade handshake test * Removed unnecessary logs * Update channel upgrade test doc * Add test to transfer ics29 packet after channel upgrade * Update tools/integration-test/src/tests/channel_upgrade/ics29.rs Co-authored-by: Sean Chen Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * Add comments * Fix 'query bank balances' CLI to handle SDK v0.50 changes * Remove flush status from channel end * Update Nix flake and use alpha release of channel upgrade simapp for CI * Fix test-stable and change 'into_i32' to 'as_i32' for Channel State * Fix python tests * Use state comparison method 'less_or_equal_progress' where applicable * Add tests for channel upgrade completion * Improve less_or_equal method for channel states and add unit tests * Use automatic link for URL in channel State documentation * Add comment on channel upgrade open assertion --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Sean Chen * Update nix flake and remove log file * Use governance proposal to initialise channel upgrade tests (#3680) * Use governance proposal to initialise channel upgrade tests * Fix issue with chains which don't have 'expedited_voting_period' * Fix issues post merge * Correctly determine if the channel is upgrading or not * Remove CLI to init channel upgrade * Display channel state as 'Open' regardless if it is upgrading or not * Change serialize for channel state * Fix python e2e channel handshake test * feat: implement chan upgrade cancel and add timeout ack integration test (#3736) * feat: implement chan-upgrade-cancel and add integration test for timeout on upgrade ack * uncomment code * formatting * Fix channel upgrade timeout and cancel handling * Fix clippy warnings * Add channel upgrade cancel tests with supervisor * Fix typo * Fix upgrade cancel on confirm test and update guide * Clean channel upgrade tests * Additional clean-up in channel upgrade test assertions * Temporarily disable one chan upgrade timeout test * Remove incorrect timeout channel upgrade test --------- Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Luca Joss * Fix Docker workflow after update to upload-artifact@v4 * Fix Artifact name for Docker job * feat: updates to upgrade fields and logic for `MsgTimeoutOnClose` and `MsgChannelCloseConfirm` (#3764) * wip: update naming of fields * add logic to add counterparty upgrade sequence to timeout on close and channel close confirm messages * add integration test for: when ICA channel upgrades and afterwards packet times out, then channel is closed * argo fmt --all * remove empty comment * Fix channel end parsing and test for ICA timeout after channel upgrade * Update nix flake * Improve documentation for upgraded ICA channel close test * Improve build channel close methods --------- Co-authored-by: Luca Joss * feat: add support for `MsgChannelUpgradeTimeout` and integration test (#3773) * feat: add support for msgchannelupgradetimeout and integration test * fix build errors * Update nix flake * Update CLI templates * cargo fmt * Fix clippy warnings/errors * Fix extracting upgrade_timeout attribute * WIP * Fix channel upgrade logic * Change Height to QueryHeight for restore_from_state method --------- Co-authored-by: Luca Joss * fetch counterparty upgrade sequence from src chain (#3801) * test(channel upgradability): add integration test that relays packets during flushing (#3786) * test: add integration test that flushes packets during channel upgrade * wip: add counterparty upgrade sequence to chan upgrade open * update integration test * cargo fmt * Fix UpgradeInit parsing and Registering ICA account following simd changes * handle new fields in messages: order in msg register interchain account and counterparty upgrade sequence in msg channel upgrade open * fix warnings * Update Nix flake * address review comments * cargo fmt * some clippy warnings * fix assert_eq! * fix test * cargo fmt * chore: rename order to ordering in msg register interchain account * Use ibc-go v8.1.0-rc.0 for channel upgrade tests * Add and use legacy 'MsgRegisterInterchainAccount' * Use different signer to initialise channel upgrade for 'test_channel_upgrade_handshake' test * add test where ICA channel is upgraded to unordered * cargo fmt + add debug log * increase packet timeout * Add case where Channel upgrade Try event is received by source chain while dst chain is open not upgrading * Use user2 to signe channel upgrade init proposal in ICA unordered test --------- Co-authored-by: Luca Joss * Fix ICS29 timeout fee test compatibility for ibc-go v8.1+ * Add compatibility to ICS29 tests for ibc-go v8.1+ * Fix typos * Update method used to verify if there is an ongoing channel upgrade * Update channel query to correctly reflect if it is upgrading or not if the state is open * Add upgrade handshake step if both channel ends are in open upgrading * Fix channel state assertion for channel Init and Try steps * Fix assertions in channel upgrade tests * Fix verification if channel needs to be flushed * Add test for packet flushing during channel upgrade * Fix link creation when channel is upgrading * test(channel-upgrades): add test where upgrade timeouts on acknowledge packet (#3828) * add test where upgrade times out during packet ack * cargo fmt * Fix packet worker spawning if channel is flushing or flushcomplete --------- Co-authored-by: Luca Joss * Clean-up channel upgrade tests * Improve channel upgrade workers * Remove unused code * Use ibc-proto-rs v0.42.0 * Remove unnecessary code * Clean up code and remove guide entries for tx channel upgrade init CLI --------- Co-authored-by: Carlos Rodriguez Co-authored-by: Romain Ruetschi <106849+romac@users.noreply.github.com> * Remove unnecessary fields from IBC channel upgrade events * cargo fmt * Fix async ICQ test * Fix cargo doc * Remove redundant import * Remove redundant import * Correctly handle channel upgrade error * Remove validate basic from channel open try * Improve detection of channel upgrade cancel when one end is in Flushcomplete * Add changelog entry * Fix post-merge compilation issues * Rename `State::Flushcomplete` to `State::FlushComplete` * Small cleanup * Sort imports * Whitespace * Remove patch override * Apply suggestions from code review Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * cargo fmt * Fix codespell errors * Use IncludeProof for query_upgrade and query_upgrade_error * Add a method to build and send channel upgrade open or cancel * Remove unnecessary assertions * Add handling of channel upgrade timeout event in channel worker --------- Signed-off-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Signed-off-by: Romain Ruetschi Co-authored-by: Romain Ruetschi Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Luca Joss Co-authored-by: Anca Zamfir Co-authored-by: Carlos Rodriguez Co-authored-by: Romain Ruetschi <106849+romac@users.noreply.github.com> --- .../ibc-relayer/2547-channel-upgrades.md | 2 + .github/workflows/integration.yaml | 2 +- crates/relayer-cli/src/commands/tx.rs | 18 + crates/relayer-cli/src/commands/tx/channel.rs | 897 ++++++++- crates/relayer-types/Cargo.toml | 1 + .../src/applications/ics27_ica/error.rs | 5 + .../src/applications/ics27_ica/mod.rs | 3 + .../src/core/ics04_channel/channel.rs | 255 ++- .../src/core/ics04_channel/error.rs | 52 +- .../src/core/ics04_channel/events.rs | 728 ++++++- .../src/core/ics04_channel/mod.rs | 2 + .../src/core/ics04_channel/msgs.rs | 9 + .../ics04_channel/msgs/chan_close_confirm.rs | 9 +- .../ics04_channel/msgs/chan_close_init.rs | 2 - .../core/ics04_channel/msgs/chan_open_init.rs | 2 - .../core/ics04_channel/msgs/chan_open_try.rs | 28 +- .../ics04_channel/msgs/chan_upgrade_ack.rs | 249 +++ .../ics04_channel/msgs/chan_upgrade_cancel.rs | 241 +++ .../msgs/chan_upgrade_confirm.rs | 256 +++ .../ics04_channel/msgs/chan_upgrade_init.rs | 200 ++ .../ics04_channel/msgs/chan_upgrade_open.rs | 240 +++ .../msgs/chan_upgrade_timeout.rs | 258 +++ .../ics04_channel/msgs/chan_upgrade_try.rs | 276 +++ .../ics04_channel/msgs/timeout_on_close.rs | 9 +- .../src/core/ics04_channel/timeout.rs | 151 +- .../src/core/ics04_channel/upgrade.rs | 96 + .../src/core/ics04_channel/upgrade_fields.rs | 88 + .../src/core/ics04_channel/version.rs | 33 +- .../src/core/ics24_host/error.rs | 23 +- .../relayer-types/src/core/ics24_host/path.rs | 16 + crates/relayer-types/src/events.rs | 73 +- crates/relayer/src/cache.rs | 3 + crates/relayer/src/chain/cosmos.rs | 140 +- .../src/chain/cosmos/types/events/channel.rs | 57 +- crates/relayer/src/chain/counterparty.rs | 8 +- crates/relayer/src/chain/endpoint.rs | 17 + crates/relayer/src/chain/handle.rs | 30 + crates/relayer/src/chain/handle/base.rs | 38 +- crates/relayer/src/chain/handle/cache.rs | 22 + crates/relayer/src/chain/handle/counting.rs | 23 + crates/relayer/src/chain/runtime.rs | 42 +- crates/relayer/src/channel.rs | 837 +++++++- crates/relayer/src/channel/error.rs | 36 +- crates/relayer/src/connection.rs | 4 +- crates/relayer/src/error.rs | 8 + crates/relayer/src/event.rs | 201 +- .../src/event/source/websocket/extract.rs | 11 + crates/relayer/src/link.rs | 6 +- crates/relayer/src/link/relay_path.rs | 14 +- crates/relayer/src/object.rs | 34 +- crates/relayer/src/supervisor.rs | 25 + crates/relayer/src/supervisor/spawn.rs | 34 +- crates/relayer/src/worker/channel.rs | 86 +- docs/spec/relayer/Definitions.md | 2 +- e2e/e2e/channel.py | 9 +- .../commands/hermes/tx/chan-upgrade-ack_1.md | 1 + .../hermes/tx/chan-upgrade-cancel_1.md | 1 + .../hermes/tx/chan-upgrade-confirm_1.md | 1 + .../commands/hermes/tx/chan-upgrade-open_1.md | 1 + .../hermes/tx/chan-upgrade-timeout_1.md | 1 + .../commands/hermes/tx/chan-upgrade-try_1.md | 1 + guide/src/templates/help_templates/tx.md | 36 +- .../help_templates/tx/chan-upgrade-ack.md | 30 + .../help_templates/tx/chan-upgrade-cancel.md | 30 + .../help_templates/tx/chan-upgrade-confirm.md | 30 + .../help_templates/tx/chan-upgrade-open.md | 30 + .../help_templates/tx/chan-upgrade-timeout.md | 30 + .../help_templates/tx/chan-upgrade-try.md | 30 + scripts/auto_gen_templates.sh | 2 +- tools/check-guide/Cargo.lock | 1710 +++++++++-------- tools/check-guide/Cargo.toml | 1 - tools/integration-test/Cargo.toml | 35 +- .../src/tests/async_icq/simple_query.rs | 25 +- .../src/tests/channel_upgrade/flushing.rs | 422 ++++ .../src/tests/channel_upgrade/ica.rs | 516 +++++ .../src/tests/channel_upgrade/ics29.rs | 227 +++ .../src/tests/channel_upgrade/mod.rs | 6 + .../src/tests/channel_upgrade/timeout.rs | 1067 ++++++++++ .../channel_upgrade/upgrade_handshake.rs | 247 +++ .../upgrade_handshake_steps.rs | 915 +++++++++ .../src/tests/client_upgrade.rs | 6 +- tools/integration-test/src/tests/ica.rs | 23 +- .../ica_ordered_channel.rs | 19 +- .../tests/interchain_security/ica_transfer.rs | 19 +- tools/integration-test/src/tests/mod.rs | 3 + tools/test-framework/src/chain/cli/upgrade.rs | 88 +- tools/test-framework/src/chain/config.rs | 45 + .../test-framework/src/chain/ext/bootstrap.rs | 2 +- .../test-framework/src/chain/ext/proposal.rs | 212 +- .../src/framework/binary/ics.rs | 1 + tools/test-framework/src/relayer/chain.rs | 21 + tools/test-framework/src/relayer/channel.rs | 421 +++- 92 files changed, 10990 insertions(+), 1176 deletions(-) create mode 100644 .changelog/unreleased/features/ibc-relayer/2547-channel-upgrades.md create mode 100644 crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_ack.rs create mode 100644 crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_cancel.rs create mode 100644 crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_confirm.rs create mode 100644 crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_init.rs create mode 100644 crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_open.rs create mode 100644 crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_timeout.rs create mode 100644 crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_try.rs create mode 100644 crates/relayer-types/src/core/ics04_channel/upgrade.rs create mode 100644 crates/relayer-types/src/core/ics04_channel/upgrade_fields.rs create mode 100644 guide/src/templates/commands/hermes/tx/chan-upgrade-ack_1.md create mode 100644 guide/src/templates/commands/hermes/tx/chan-upgrade-cancel_1.md create mode 100644 guide/src/templates/commands/hermes/tx/chan-upgrade-confirm_1.md create mode 100644 guide/src/templates/commands/hermes/tx/chan-upgrade-open_1.md create mode 100644 guide/src/templates/commands/hermes/tx/chan-upgrade-timeout_1.md create mode 100644 guide/src/templates/commands/hermes/tx/chan-upgrade-try_1.md create mode 100644 guide/src/templates/help_templates/tx/chan-upgrade-ack.md create mode 100644 guide/src/templates/help_templates/tx/chan-upgrade-cancel.md create mode 100644 guide/src/templates/help_templates/tx/chan-upgrade-confirm.md create mode 100644 guide/src/templates/help_templates/tx/chan-upgrade-open.md create mode 100644 guide/src/templates/help_templates/tx/chan-upgrade-timeout.md create mode 100644 guide/src/templates/help_templates/tx/chan-upgrade-try.md create mode 100644 tools/integration-test/src/tests/channel_upgrade/flushing.rs create mode 100644 tools/integration-test/src/tests/channel_upgrade/ica.rs create mode 100644 tools/integration-test/src/tests/channel_upgrade/ics29.rs create mode 100644 tools/integration-test/src/tests/channel_upgrade/mod.rs create mode 100644 tools/integration-test/src/tests/channel_upgrade/timeout.rs create mode 100644 tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs create mode 100644 tools/integration-test/src/tests/channel_upgrade/upgrade_handshake_steps.rs diff --git a/.changelog/unreleased/features/ibc-relayer/2547-channel-upgrades.md b/.changelog/unreleased/features/ibc-relayer/2547-channel-upgrades.md new file mode 100644 index 0000000000..869b7096d4 --- /dev/null +++ b/.changelog/unreleased/features/ibc-relayer/2547-channel-upgrades.md @@ -0,0 +1,2 @@ + - Add support for upgrading channels, as per the [ICS 004 specification](https://github.com/cosmos/ibc/blob/main/spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md) ([#3228](https://github.com/informalsystems/hermes/issues/2547)) + This feature allows chains to upgrade an existing channel to take advantage of new features without having to create a new channel, thus preserving all existing packet state processed on the channel. For example, a channel could now be upgraded to enable the [ICS 029 fee middleware](https://ibc.cosmos.network/main/middleware/ics29-fee/overview), allowing relayer operators on that channel to receive fees each time they relay an incentivized packet. diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 1f30c9e60c..65a2c9df70 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -64,7 +64,7 @@ jobs: command: simd account_prefix: cosmos native_token: stake - features: ica,ics29-fee + features: ica,ics29-fee,channel-upgrade - package: wasmd command: wasmd account_prefix: wasm diff --git a/crates/relayer-cli/src/commands/tx.rs b/crates/relayer-cli/src/commands/tx.rs index f8cadf766b..dc5099250c 100644 --- a/crates/relayer-cli/src/commands/tx.rs +++ b/crates/relayer-cli/src/commands/tx.rs @@ -44,6 +44,24 @@ pub enum TxCmd { /// Confirm the closing of a channel (ChannelCloseConfirm) ChanCloseConfirm(channel::TxChanCloseConfirmCmd), + /// Relay the channel upgrade attempt (ChannelUpgradeTry) + ChanUpgradeTry(channel::TxChanUpgradeTryCmd), + + /// Relay the channel upgrade attempt (ChannelUpgradeAck) + ChanUpgradeAck(channel::TxChanUpgradeAckCmd), + + /// Relay the channel upgrade attempt (ChannelUpgradeConfirm) + ChanUpgradeConfirm(channel::TxChanUpgradeConfirmCmd), + + /// Relay the channel upgrade attempt (ChannelUpgradeOpen) + ChanUpgradeOpen(channel::TxChanUpgradeOpenCmd), + + /// Relay the channel upgrade cancellation (ChannelUpgradeCancel) + ChanUpgradeCancel(channel::TxChanUpgradeCancelCmd), + + /// Relay the channel upgrade timeout (ChannelUpgradeTimeout) + ChanUpgradeTimeout(channel::TxChanUpgradeTimeoutCmd), + /// Send a fungible token transfer test transaction (ICS20 MsgTransfer) FtTransfer(transfer::TxIcs20MsgTransferCmd), diff --git a/crates/relayer-cli/src/commands/tx/channel.rs b/crates/relayer-cli/src/commands/tx/channel.rs index 84b93a2e49..de75a48aaf 100644 --- a/crates/relayer-cli/src/commands/tx/channel.rs +++ b/crates/relayer-cli/src/commands/tx/channel.rs @@ -1,6 +1,7 @@ #![allow(clippy::redundant_closure_call)] use abscissa_core::clap::Parser; +use abscissa_core::Command; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::requests::{IncludeProof, QueryConnectionRequest, QueryHeight}; @@ -17,6 +18,19 @@ use crate::conclude::Output; use crate::error::Error; use crate::prelude::*; +/// Macro that generates the `Runnable::run` implementation for a +/// `tx channel` subcommand. +/// +/// The macro takes the following arguments: +/// - `$dbg_string`: a string literal that will be used to identify the subcommand +/// in debug logs +/// - `$func`: the method that will be called to build and send the `Channel` message +/// - `$self`: the type that `Runnable` is being implemented for +/// - `$chan`: a closure that specifies how to build the `Channel` object +/// +/// The macro spawns a `ChainHandlePair`, fetches the destination connection, +/// creates a `Channel` object via the closure, and then calls the `$func` method +/// with the `Channel` object. macro_rules! tx_chan_cmd { ($dbg_string:literal, $func:ident, $self:expr, $chan:expr) => { let config = app_config(); @@ -112,56 +126,33 @@ pub struct TxChanOpenInitCmd { impl Runnable for TxChanOpenInitCmd { fn run(&self) { - let config = app_config(); - - let chains = match ChainHandlePair::spawn(&config, &self.src_chain_id, &self.dst_chain_id) { - Ok(chains) => chains, - Err(e) => Output::error(e).exit(), - }; - - // Retrieve the connection - let dst_connection = match chains.dst.query_connection( - QueryConnectionRequest { - connection_id: self.dst_conn_id.clone(), - height: QueryHeight::Latest, - }, - IncludeProof::No, - ) { - Ok((connection, _)) => connection, - Err(e) => Output::error(e).exit(), - }; - - let channel = Channel { - connection_delay: Default::default(), - ordering: self.order, - a_side: ChannelSide::new( - chains.src, - ClientId::default(), - ConnectionId::default(), - self.src_port_id.clone(), - None, - None, - ), - b_side: ChannelSide::new( - chains.dst, - dst_connection.client_id().clone(), - self.dst_conn_id.clone(), - self.dst_port_id.clone(), - None, - None, - ), - }; - - info!("message ChanOpenInit: {}", channel); - - let res: Result = channel - .build_chan_open_init_and_send() - .map_err(Error::channel); - - match res { - Ok(receipt) => Output::success(receipt).exit(), - Err(e) => Output::error(e).exit(), - } + tx_chan_cmd!( + "ChanOpenInit", + build_chan_open_init_and_send, + self, + |chains: ChainHandlePair, dst_connection: ConnectionEnd| { + Channel { + connection_delay: Default::default(), + ordering: self.order, + a_side: ChannelSide::new( + chains.src, + ClientId::default(), + ConnectionId::default(), + self.src_port_id.clone(), + None, + None, + ), + b_side: ChannelSide::new( + chains.dst, + dst_connection.client_id().clone(), + self.dst_conn_id.clone(), + self.dst_port_id.clone(), + None, + None, + ), + } + } + ); } } @@ -668,19 +659,803 @@ impl Runnable for TxChanCloseConfirmCmd { } } -#[cfg(test)] -mod tests { - use super::{ - TxChanCloseConfirmCmd, TxChanCloseInitCmd, TxChanOpenAckCmd, TxChanOpenConfirmCmd, - TxChanOpenInitCmd, TxChanOpenTryCmd, - }; +/// Relay the channel upgrade attempt (ChannelUpgradeTry) +/// +/// Build and send a `ChannelUpgradeTry` message in response to +/// a `ChannelUpgradeInit` message, signaling the chain's intent to +/// cooperate with the source chain on upgrading the specified channel +/// and initiating the upgrade handshake. +#[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] +pub struct TxChanUpgradeTryCmd { + #[clap( + long = "dst-chain", + required = true, + value_name = "DST_CHAIN_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination chain" + )] + dst_chain_id: ChainId, - use std::str::FromStr; + #[clap( + long = "src-chain", + required = true, + value_name = "SRC_CHAIN_ID", + help_heading = "REQUIRED", + help = "Identifier of the source chain" + )] + src_chain_id: ChainId, - use abscissa_core::clap::Parser; - use ibc_relayer_types::core::{ - ics04_channel::channel::Ordering, - ics24_host::identifier::{ChainId, ChannelId, ConnectionId, PortId}, + #[clap( + long = "dst-connection", + visible_alias = "dst-conn", + required = true, + value_name = "DST_CONNECTION_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination connection" + )] + dst_conn_id: ConnectionId, + + #[clap( + long = "dst-port", + required = true, + value_name = "DST_PORT_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination port" + )] + dst_port_id: PortId, + + #[clap( + long = "src-port", + required = true, + value_name = "SRC_PORT_ID", + help_heading = "REQUIRED", + help = "Identifier of the source port" + )] + src_port_id: PortId, + + #[clap( + long = "src-channel", + visible_alias = "src-chan", + required = true, + value_name = "SRC_CHANNEL_ID", + help_heading = "REQUIRED", + help = "Identifier of the source channel (required)" + )] + src_chan_id: ChannelId, + + #[clap( + long = "dst-channel", + visible_alias = "dst-chan", + required = true, + help_heading = "REQUIRED", + value_name = "DST_CHANNEL_ID", + help = "Identifier of the destination channel (optional)" + )] + dst_chan_id: Option, +} + +impl Runnable for TxChanUpgradeTryCmd { + fn run(&self) { + let config = app_config(); + + let chains = match ChainHandlePair::spawn(&config, &self.src_chain_id, &self.dst_chain_id) { + Ok(chains) => chains, + Err(e) => Output::error(format!("{}", e)).exit(), + }; + + // Retrieve the connection + let dst_connection = match chains.dst.query_connection( + QueryConnectionRequest { + connection_id: self.dst_conn_id.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) { + Ok((connection, _)) => connection, + Err(e) => Output::error(format!("{}", e)).exit(), + }; + + // Fetch the Channel that will facilitate the communication between the channel ends + // being upgraded. This channel is assumed to already exist on the destination chain. + let channel = Channel { + connection_delay: Default::default(), + ordering: Ordering::default(), + a_side: ChannelSide::new( + chains.src, + ClientId::default(), + ConnectionId::default(), + self.src_port_id.clone(), + Some(self.src_chan_id.clone()), + None, + ), + b_side: ChannelSide::new( + chains.dst, + dst_connection.client_id().clone(), + self.dst_conn_id.clone(), + self.dst_port_id.clone(), + self.dst_chan_id.clone(), + None, + ), + }; + + info!("message ChanUpgradeTry: {}", channel); + + let res: Result = channel + .build_chan_upgrade_try_and_send() + .map_err(Error::channel); + + match res { + Ok(receipt) => Output::success(receipt).exit(), + Err(e) => Output::error(e).exit(), + } + } +} + +/// Relay the channel upgrade attempt (ChannelUpgradeAck) +/// +/// Build and send a `ChannelUpgradeAck` message in response to +/// a `ChannelUpgradeTry` message in order to continue the channel +/// upgrade handshake. +#[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] +pub struct TxChanUpgradeAckCmd { + #[clap( + long = "dst-chain", + required = true, + value_name = "DST_CHAIN_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination chain" + )] + dst_chain_id: ChainId, + + #[clap( + long = "src-chain", + required = true, + value_name = "SRC_CHAIN_ID", + help_heading = "REQUIRED", + help = "Identifier of the source chain" + )] + src_chain_id: ChainId, + + #[clap( + long = "dst-connection", + visible_alias = "dst-conn", + required = true, + value_name = "DST_CONNECTION_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination connection" + )] + dst_conn_id: ConnectionId, + + #[clap( + long = "dst-port", + required = true, + value_name = "DST_PORT_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination port" + )] + dst_port_id: PortId, + + #[clap( + long = "src-port", + required = true, + value_name = "SRC_PORT_ID", + help_heading = "REQUIRED", + help = "Identifier of the source port" + )] + src_port_id: PortId, + + #[clap( + long = "src-channel", + visible_alias = "src-chan", + required = true, + value_name = "SRC_CHANNEL_ID", + help_heading = "REQUIRED", + help = "Identifier of the source channel (required)" + )] + src_chan_id: ChannelId, + + #[clap( + long = "dst-channel", + visible_alias = "dst-chan", + required = true, + help_heading = "REQUIRED", + value_name = "DST_CHANNEL_ID", + help = "Identifier of the destination channel (optional)" + )] + dst_chan_id: Option, +} + +impl Runnable for TxChanUpgradeAckCmd { + fn run(&self) { + let config = app_config(); + + let chains = match ChainHandlePair::spawn(&config, &self.src_chain_id, &self.dst_chain_id) { + Ok(chains) => chains, + Err(e) => Output::error(format!("{}", e)).exit(), + }; + + // Retrieve the connection + let dst_connection = match chains.dst.query_connection( + QueryConnectionRequest { + connection_id: self.dst_conn_id.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) { + Ok((connection, _)) => connection, + Err(e) => Output::error(format!("{}", e)).exit(), + }; + + // Fetch the Channel that will facilitate the communication between the channel ends + // being upgraded. This channel is assumed to already exist on the destination chain. + let channel = Channel { + connection_delay: Default::default(), + ordering: Ordering::default(), + a_side: ChannelSide::new( + chains.src, + ClientId::default(), + ConnectionId::default(), + self.src_port_id.clone(), + Some(self.src_chan_id.clone()), + None, + ), + b_side: ChannelSide::new( + chains.dst, + dst_connection.client_id().clone(), + self.dst_conn_id.clone(), + self.dst_port_id.clone(), + self.dst_chan_id.clone(), + None, + ), + }; + + info!("message ChanUpgradeAck: {}", channel); + + let res: Result = channel + .build_chan_upgrade_ack_and_send() + .map_err(Error::channel); + + match res { + Ok(receipt) => Output::success(receipt).exit(), + Err(e) => Output::error(e).exit(), + } + } +} + +/// Relay the channel upgrade attempt (ChannelUpgradeConfirm) +/// +/// Build and send a `ChannelUpgradeConfirm` message in response to +/// a `ChannelUpgradeAck` message in order to continue the channel +/// upgrade handshake. +#[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] +pub struct TxChanUpgradeConfirmCmd { + #[clap( + long = "dst-chain", + required = true, + value_name = "DST_CHAIN_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination chain" + )] + dst_chain_id: ChainId, + + #[clap( + long = "src-chain", + required = true, + value_name = "SRC_CHAIN_ID", + help_heading = "REQUIRED", + help = "Identifier of the source chain" + )] + src_chain_id: ChainId, + + #[clap( + long = "dst-connection", + visible_alias = "dst-conn", + required = true, + value_name = "DST_CONNECTION_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination connection" + )] + dst_conn_id: ConnectionId, + + #[clap( + long = "dst-port", + required = true, + value_name = "DST_PORT_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination port" + )] + dst_port_id: PortId, + + #[clap( + long = "src-port", + required = true, + value_name = "SRC_PORT_ID", + help_heading = "REQUIRED", + help = "Identifier of the source port" + )] + src_port_id: PortId, + + #[clap( + long = "src-channel", + visible_alias = "src-chan", + required = true, + value_name = "SRC_CHANNEL_ID", + help_heading = "REQUIRED", + help = "Identifier of the source channel (required)" + )] + src_chan_id: ChannelId, + + #[clap( + long = "dst-channel", + visible_alias = "dst-chan", + required = true, + help_heading = "REQUIRED", + value_name = "DST_CHANNEL_ID", + help = "Identifier of the destination channel (optional)" + )] + dst_chan_id: Option, +} + +impl Runnable for TxChanUpgradeConfirmCmd { + fn run(&self) { + let config = app_config(); + + let chains = match ChainHandlePair::spawn(&config, &self.src_chain_id, &self.dst_chain_id) { + Ok(chains) => chains, + Err(e) => Output::error(format!("{}", e)).exit(), + }; + + // Retrieve the connection + let dst_connection = match chains.dst.query_connection( + QueryConnectionRequest { + connection_id: self.dst_conn_id.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) { + Ok((connection, _)) => connection, + Err(e) => Output::error(format!("{}", e)).exit(), + }; + + // Fetch the Channel that will facilitate the communication between the channel ends + // being upgraded. This channel is assumed to already exist on the destination chain. + let channel = Channel { + connection_delay: Default::default(), + ordering: Ordering::default(), + a_side: ChannelSide::new( + chains.src, + ClientId::default(), + ConnectionId::default(), + self.src_port_id.clone(), + Some(self.src_chan_id.clone()), + None, + ), + b_side: ChannelSide::new( + chains.dst, + dst_connection.client_id().clone(), + self.dst_conn_id.clone(), + self.dst_port_id.clone(), + self.dst_chan_id.clone(), + None, + ), + }; + + info!("message ChanUpgradeConfirm: {}", channel); + + let res: Result = channel + .build_chan_upgrade_confirm_and_send() + .map_err(Error::channel); + + match res { + Ok(receipt) => Output::success(receipt).exit(), + Err(e) => Output::error(e).exit(), + } + } +} + +/// Relay the channel upgrade attempt (ChannelUpgradeOpen) +/// +/// Build and send a `ChannelUpgradeOpen` message to finalize +/// the channel upgrade handshake. +#[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] +pub struct TxChanUpgradeOpenCmd { + #[clap( + long = "dst-chain", + required = true, + value_name = "DST_CHAIN_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination chain" + )] + dst_chain_id: ChainId, + + #[clap( + long = "src-chain", + required = true, + value_name = "SRC_CHAIN_ID", + help_heading = "REQUIRED", + help = "Identifier of the source chain" + )] + src_chain_id: ChainId, + + #[clap( + long = "dst-connection", + visible_alias = "dst-conn", + required = true, + value_name = "DST_CONNECTION_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination connection" + )] + dst_conn_id: ConnectionId, + + #[clap( + long = "dst-port", + required = true, + value_name = "DST_PORT_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination port" + )] + dst_port_id: PortId, + + #[clap( + long = "src-port", + required = true, + value_name = "SRC_PORT_ID", + help_heading = "REQUIRED", + help = "Identifier of the source port" + )] + src_port_id: PortId, + + #[clap( + long = "src-channel", + visible_alias = "src-chan", + required = true, + value_name = "SRC_CHANNEL_ID", + help_heading = "REQUIRED", + help = "Identifier of the source channel (required)" + )] + src_chan_id: ChannelId, + + #[clap( + long = "dst-channel", + visible_alias = "dst-chan", + required = true, + help_heading = "REQUIRED", + value_name = "DST_CHANNEL_ID", + help = "Identifier of the destination channel (optional)" + )] + dst_chan_id: Option, +} + +impl Runnable for TxChanUpgradeOpenCmd { + fn run(&self) { + let config = app_config(); + + let chains = match ChainHandlePair::spawn(&config, &self.src_chain_id, &self.dst_chain_id) { + Ok(chains) => chains, + Err(e) => Output::error(format!("{}", e)).exit(), + }; + + // Retrieve the connection + let dst_connection = match chains.dst.query_connection( + QueryConnectionRequest { + connection_id: self.dst_conn_id.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) { + Ok((connection, _)) => connection, + Err(e) => Output::error(format!("{}", e)).exit(), + }; + + // Fetch the Channel that will facilitate the communication between the channel ends + // being upgraded. This channel is assumed to already exist on the destination chain. + let channel = Channel { + connection_delay: Default::default(), + ordering: Ordering::default(), + a_side: ChannelSide::new( + chains.src, + ClientId::default(), + ConnectionId::default(), + self.src_port_id.clone(), + Some(self.src_chan_id.clone()), + None, + ), + b_side: ChannelSide::new( + chains.dst, + dst_connection.client_id().clone(), + self.dst_conn_id.clone(), + self.dst_port_id.clone(), + self.dst_chan_id.clone(), + None, + ), + }; + + info!("message ChanUpgradeOpen: {}", channel); + + let res: Result = channel + .build_chan_upgrade_open_and_send() + .map_err(Error::channel); + + match res { + Ok(receipt) => Output::success(receipt).exit(), + Err(e) => Output::error(e).exit(), + } + } +} + +/// Relay channel upgrade cancel when counterparty has aborted the upgrade (ChannelUpgradeCancel) +/// +/// Build and send a `ChannelUpgradeCancel` message to cancel +/// the channel upgrade handshake given that the counterparty has aborted. +#[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] +pub struct TxChanUpgradeCancelCmd { + #[clap( + long = "dst-chain", + required = true, + value_name = "DST_CHAIN_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination chain" + )] + dst_chain_id: ChainId, + + #[clap( + long = "src-chain", + required = true, + value_name = "SRC_CHAIN_ID", + help_heading = "REQUIRED", + help = "Identifier of the source chain" + )] + src_chain_id: ChainId, + + #[clap( + long = "dst-connection", + visible_alias = "dst-conn", + required = true, + value_name = "DST_CONNECTION_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination connection" + )] + dst_conn_id: ConnectionId, + + #[clap( + long = "dst-port", + required = true, + value_name = "DST_PORT_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination port" + )] + dst_port_id: PortId, + + #[clap( + long = "src-port", + required = true, + value_name = "SRC_PORT_ID", + help_heading = "REQUIRED", + help = "Identifier of the source port" + )] + src_port_id: PortId, + + #[clap( + long = "src-channel", + visible_alias = "src-chan", + required = true, + value_name = "SRC_CHANNEL_ID", + help_heading = "REQUIRED", + help = "Identifier of the source channel (required)" + )] + src_chan_id: ChannelId, + + #[clap( + long = "dst-channel", + visible_alias = "dst-chan", + required = true, + help_heading = "REQUIRED", + value_name = "DST_CHANNEL_ID", + help = "Identifier of the destination channel (optional)" + )] + dst_chan_id: Option, +} + +impl Runnable for TxChanUpgradeCancelCmd { + fn run(&self) { + let config = app_config(); + + let chains = match ChainHandlePair::spawn(&config, &self.src_chain_id, &self.dst_chain_id) { + Ok(chains) => chains, + Err(e) => Output::error(format!("{}", e)).exit(), + }; + + // Retrieve the connection + let dst_connection = match chains.dst.query_connection( + QueryConnectionRequest { + connection_id: self.dst_conn_id.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) { + Ok((connection, _)) => connection, + Err(e) => Output::error(format!("{}", e)).exit(), + }; + + // Fetch the Channel that will facilitate the communication between the channel ends + // being upgraded. This channel is assumed to already exist on the destination chain. + let channel = Channel { + connection_delay: Default::default(), + ordering: Ordering::default(), + a_side: ChannelSide::new( + chains.src, + ClientId::default(), + ConnectionId::default(), + self.src_port_id.clone(), + Some(self.src_chan_id.clone()), + None, + ), + b_side: ChannelSide::new( + chains.dst, + dst_connection.client_id().clone(), + self.dst_conn_id.clone(), + self.dst_port_id.clone(), + self.dst_chan_id.clone(), + None, + ), + }; + + info!("message ChanUpgradeCancel: {}", channel); + + let res: Result = channel + .build_chan_upgrade_cancel_and_send() + .map_err(Error::channel); + + match res { + Ok(receipt) => Output::success(receipt).exit(), + Err(e) => Output::error(e).exit(), + } + } +} + +/// Relay channel upgrade timeout when counterparty has not flushed packets before upgrade timeout (ChannelUpgradeTimeout) +/// +/// Build and send a `ChannelUpgradeTimeout` message to timeout +/// the channel upgrade handshake given that the counterparty has not flushed packets before upgrade timeout. +#[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] +pub struct TxChanUpgradeTimeoutCmd { + #[clap( + long = "dst-chain", + required = true, + value_name = "DST_CHAIN_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination chain" + )] + dst_chain_id: ChainId, + + #[clap( + long = "src-chain", + required = true, + value_name = "SRC_CHAIN_ID", + help_heading = "REQUIRED", + help = "Identifier of the source chain" + )] + src_chain_id: ChainId, + + #[clap( + long = "dst-connection", + visible_alias = "dst-conn", + required = true, + value_name = "DST_CONNECTION_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination connection" + )] + dst_conn_id: ConnectionId, + + #[clap( + long = "dst-port", + required = true, + value_name = "DST_PORT_ID", + help_heading = "REQUIRED", + help = "Identifier of the destination port" + )] + dst_port_id: PortId, + + #[clap( + long = "src-port", + required = true, + value_name = "SRC_PORT_ID", + help_heading = "REQUIRED", + help = "Identifier of the source port" + )] + src_port_id: PortId, + + #[clap( + long = "src-channel", + visible_alias = "src-chan", + required = true, + value_name = "SRC_CHANNEL_ID", + help_heading = "REQUIRED", + help = "Identifier of the source channel (required)" + )] + src_chan_id: ChannelId, + + #[clap( + long = "dst-channel", + visible_alias = "dst-chan", + required = true, + help_heading = "REQUIRED", + value_name = "DST_CHANNEL_ID", + help = "Identifier of the destination channel (optional)" + )] + dst_chan_id: Option, +} + +impl Runnable for TxChanUpgradeTimeoutCmd { + fn run(&self) { + let config = app_config(); + + let chains = match ChainHandlePair::spawn(&config, &self.src_chain_id, &self.dst_chain_id) { + Ok(chains) => chains, + Err(e) => Output::error(format!("{}", e)).exit(), + }; + + // Retrieve the connection + let dst_connection = match chains.dst.query_connection( + QueryConnectionRequest { + connection_id: self.dst_conn_id.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) { + Ok((connection, _)) => connection, + Err(e) => Output::error(format!("{}", e)).exit(), + }; + + // Fetch the Channel that will facilitate the communication between the channel ends + // being upgraded. This channel is assumed to already exist on the destination chain. + let channel = Channel { + connection_delay: Default::default(), + ordering: Ordering::default(), + a_side: ChannelSide::new( + chains.src, + ClientId::default(), + ConnectionId::default(), + self.src_port_id.clone(), + Some(self.src_chan_id.clone()), + None, + ), + b_side: ChannelSide::new( + chains.dst, + dst_connection.client_id().clone(), + self.dst_conn_id.clone(), + self.dst_port_id.clone(), + self.dst_chan_id.clone(), + None, + ), + }; + + info!("message ChanUpgradeTimeout: {}", channel); + + let res: Result = channel + .build_chan_upgrade_timeout_and_send() + .map_err(Error::channel); + + match res { + Ok(receipt) => Output::success(receipt).exit(), + Err(e) => Output::error(e).exit(), + } + } +} + +#[cfg(test)] +mod tests { + use abscissa_core::clap::Parser; + use std::str::FromStr; + + use ibc_relayer_types::core::{ + ics04_channel::channel::Ordering, + ics24_host::identifier::{ChainId, ChannelId, ConnectionId, PortId}, + }; + + use crate::commands::tx::channel::{ + TxChanCloseConfirmCmd, TxChanCloseInitCmd, TxChanOpenAckCmd, TxChanOpenConfirmCmd, + TxChanOpenInitCmd, TxChanOpenTryCmd, }; #[test] diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index c61ab56ba9..266d26d127 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -40,6 +40,7 @@ tendermint-testgen = { workspace = true, optional = true } tendermint = { workspace = true, features = ["clock"] } time = { workspace = true } uint = { workspace = true } +tracing = { workspace = true } [dev-dependencies] env_logger = { workspace = true } diff --git a/crates/relayer-types/src/applications/ics27_ica/error.rs b/crates/relayer-types/src/applications/ics27_ica/error.rs index 4143b2467f..263f090fe1 100644 --- a/crates/relayer-types/src/applications/ics27_ica/error.rs +++ b/crates/relayer-types/src/applications/ics27_ica/error.rs @@ -1,3 +1,4 @@ +use crate::core::ics04_channel::error as channel_error; use crate::core::ics24_host::error::ValidationError; use crate::signer::SignerError; @@ -6,6 +7,10 @@ use flex_error::define_error; define_error! { #[derive(Debug, PartialEq, Eq)] Error { + Ics04Channel + [ channel_error::Error ] + | _ | { "ICS 04 channel error" }, + Owner [ SignerError ] | _ | { "failed to parse owner" }, diff --git a/crates/relayer-types/src/applications/ics27_ica/mod.rs b/crates/relayer-types/src/applications/ics27_ica/mod.rs index c42612c711..74c81280b4 100644 --- a/crates/relayer-types/src/applications/ics27_ica/mod.rs +++ b/crates/relayer-types/src/applications/ics27_ica/mod.rs @@ -2,3 +2,6 @@ pub mod cosmos_tx; pub mod error; pub mod msgs; pub mod packet_data; + +/// ICS27 application current version. +pub const VERSION: &str = "ics27-1"; diff --git a/crates/relayer-types/src/core/ics04_channel/channel.rs b/crates/relayer-types/src/core/ics04_channel/channel.rs index fa975a90e8..722ed1f8cd 100644 --- a/crates/relayer-types/src/core/ics04_channel/channel.rs +++ b/crates/relayer-types/src/core/ics04_channel/channel.rs @@ -11,6 +11,7 @@ use ibc_proto::ibc::core::channel::v1::{ IdentifiedChannel as RawIdentifiedChannel, }; +use crate::core::ics04_channel::packet::Sequence; use crate::core::ics04_channel::{error::Error, version::Version}; use crate::core::ics24_host::identifier::{ChannelId, ConnectionId, PortId}; @@ -57,7 +58,7 @@ impl TryFrom for IdentifiedChannelEnd { impl From for RawIdentifiedChannel { fn from(value: IdentifiedChannelEnd) -> Self { RawIdentifiedChannel { - state: value.channel_end.state as i32, + state: value.channel_end.state.as_i32(), ordering: value.channel_end.ordering as i32, counterparty: Some(value.channel_end.counterparty().clone().into()), connection_hops: value @@ -69,7 +70,7 @@ impl From for RawIdentifiedChannel { version: value.channel_end.version.to_string(), port_id: value.port_id.to_string(), channel_id: value.channel_id.to_string(), - upgrade_sequence: value.channel_end.upgrade_sequence, + upgrade_sequence: value.channel_end.upgrade_sequence.into(), } } } @@ -81,7 +82,7 @@ pub struct ChannelEnd { pub remote: Counterparty, pub connection_hops: Vec, pub version: Version, - pub upgrade_sequence: u64, + pub upgrade_sequence: Sequence, } impl Display for ChannelEnd { @@ -102,7 +103,7 @@ impl Default for ChannelEnd { remote: Counterparty::default(), connection_hops: Vec::new(), version: Version::default(), - upgrade_sequence: 0, + upgrade_sequence: Sequence::from(0), // The value of 0 indicates the channel has never been upgraded } } } @@ -143,7 +144,7 @@ impl TryFrom for ChannelEnd { remote, connection_hops, version, - value.upgrade_sequence, + value.upgrade_sequence.into(), )) } } @@ -151,7 +152,7 @@ impl TryFrom for ChannelEnd { impl From for RawChannel { fn from(value: ChannelEnd) -> Self { RawChannel { - state: value.state as i32, + state: value.state.as_i32(), ordering: value.ordering as i32, counterparty: Some(value.counterparty().clone().into()), connection_hops: value @@ -160,7 +161,7 @@ impl From for RawChannel { .map(|v| v.as_str().to_string()) .collect(), version: value.version.to_string(), - upgrade_sequence: value.upgrade_sequence, + upgrade_sequence: value.upgrade_sequence.into(), } } } @@ -173,7 +174,7 @@ impl ChannelEnd { remote: Counterparty, connection_hops: Vec, version: Version, - upgrade_sequence: u64, + upgrade_sequence: Sequence, ) -> Self { Self { state, @@ -198,9 +199,11 @@ impl ChannelEnd { self.remote.channel_id = Some(c); } - /// Returns `true` if this `ChannelEnd` is in state [`State::Open`]. + /// Returns `true` if this `ChannelEnd` is in state [`State::Open`] + /// [`State::Open(UpgradeState::Upgrading)`] is only used in the channel upgrade + /// handshake so this method matches with [`State::Open(UpgradeState::NotUpgrading)`]. pub fn is_open(&self) -> bool { - self.state_matches(&State::Open) + self.state_matches(&State::Open(UpgradeState::NotUpgrading)) } pub fn state(&self) -> &State { @@ -235,25 +238,35 @@ impl ChannelEnd { /// Helper function to compare the state of this end with another state. pub fn state_matches(&self, other: &State) -> bool { - self.state.eq(other) + self.state() == other } /// Helper function to compare the order of this end with another order. pub fn order_matches(&self, other: &Ordering) -> bool { - self.ordering.eq(other) + self.ordering() == other } - #[allow(clippy::ptr_arg)] pub fn connection_hops_matches(&self, other: &Vec) -> bool { - self.connection_hops.eq(other) + self.connection_hops() == other } pub fn counterparty_matches(&self, other: &Counterparty) -> bool { - self.counterparty().eq(other) + self.counterparty() == other } pub fn version_matches(&self, other: &Version) -> bool { - self.version().eq(other) + self.version() == other + } + + /// Returns whether or not the channel with this state is + /// being upgraded. + pub fn is_upgrading(&self) -> bool { + use State::*; + + matches!( + self.state, + Open(UpgradeState::Upgrading) | Flushing | FlushComplete + ) } } @@ -379,13 +392,61 @@ impl FromStr for Ordering { } } +/// This enum is used to differentiate if a channel is being upgraded when +/// a `UpgradeInitChannel` or a `UpgradeOpenChannel` is received. +/// See `handshake_step` method in `crates/relayer/src/channel.rs`. #[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub enum UpgradeState { + Upgrading, + NotUpgrading, +} + +/// The possible state variants that a channel can exhibit. +/// +/// These are encoded with integer discriminants so that there is +/// an easy way to compare channel states against one another. More +/// explicitly, this is an attempt to capture the lifecycle of a +/// channel, beginning from the `Uninitialized` state, through the +/// `Open` state, before finally being `Closed`. +#[derive(Copy, Clone, Debug, PartialEq, Eq, Deserialize)] pub enum State { - Uninitialized = 0, - Init = 1, - TryOpen = 2, - Open = 3, - Closed = 4, + /// Default state + Uninitialized, + /// A channel has just started the opening handshake. + Init, + /// A channel has acknowledged the handshake step on the counterparty chain. + TryOpen, + /// A channel has completed the handshake step. Open channels are ready to + /// send and receive packets. + /// During some steps of channel upgrades, the state is still in Open. The + /// `UpgradeState` is used to differentiate these states during the upgrade + /// handshake. + /// + Open(UpgradeState), + /// A channel has been closed and can no longer be used to send or receive + /// packets. + Closed, + /// A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. + Flushing, + /// A channel has just completed flushing any in-flight packets. + FlushComplete, +} + +impl Serialize for State { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + match self { + Self::Uninitialized => serializer.serialize_str("Uninitialized"), + Self::Init => serializer.serialize_str("Init"), + Self::TryOpen => serializer.serialize_str("TryOpen"), + Self::Open(_) => serializer.serialize_str("Open"), + Self::Closed => serializer.serialize_str("Closed"), + Self::Flushing => serializer.serialize_str("Flushing"), + Self::FlushComplete => serializer.serialize_str("FlushComplete"), + } + } } impl State { @@ -395,8 +456,10 @@ impl State { Self::Uninitialized => "UNINITIALIZED", Self::Init => "INIT", Self::TryOpen => "TRYOPEN", - Self::Open => "OPEN", + Self::Open(_) => "OPEN", Self::Closed => "CLOSED", + Self::Flushing => "FLUSHING", + Self::FlushComplete => "FLUSHCOMPLETE", } } @@ -406,15 +469,30 @@ impl State { 0 => Ok(Self::Uninitialized), 1 => Ok(Self::Init), 2 => Ok(Self::TryOpen), - 3 => Ok(Self::Open), + 3 => Ok(Self::Open(UpgradeState::NotUpgrading)), 4 => Ok(Self::Closed), + 5 => Ok(Self::Flushing), + 6 => Ok(Self::FlushComplete), _ => Err(Error::unknown_state(s)), } } + // Parses the State out from a i32. + pub fn as_i32(&self) -> i32 { + match self { + State::Uninitialized => 0, + State::Init => 1, + State::TryOpen => 2, + State::Open(_) => 3, + State::Closed => 4, + State::Flushing => 5, + State::FlushComplete => 6, + } + } + /// Returns whether or not this channel state is `Open`. pub fn is_open(self) -> bool { - self == State::Open + self == State::Open(UpgradeState::NotUpgrading) } /// Returns whether or not this channel state is `Closed`. @@ -424,6 +502,7 @@ impl State { /// Returns whether or not the channel with this state /// has progressed less or the same than the argument. + /// This only takes into account the open channel handshake. /// /// # Example /// ```rust,ignore @@ -432,7 +511,16 @@ impl State { /// assert!(!State::Closed.less_or_equal_progress(State::Open)); /// ``` pub fn less_or_equal_progress(self, other: Self) -> bool { - self as u32 <= other as u32 + use State::*; + + match self { + Uninitialized => true, + + Init => !matches!(other, Uninitialized), + TryOpen => !matches!(other, Uninitialized | Init), + Open(UpgradeState::NotUpgrading) => !matches!(other, Uninitialized | Init | TryOpen), + _ => false, + } } } @@ -467,7 +555,7 @@ pub mod test_util { counterparty: Some(get_dummy_raw_counterparty()), connection_hops: vec![ConnectionId::default().to_string()], version: "ics20".to_string(), // The version is not validated. - upgrade_sequence: 0, + upgrade_sequence: 0, // The value of 0 indicates the channel has never been upgraded } } } @@ -608,4 +696,119 @@ mod tests { } } } + + #[test] + fn less_or_equal_progress_uninitialized() { + use crate::core::ics04_channel::channel::State; + use crate::core::ics04_channel::channel::UpgradeState; + + let higher_or_equal_states = vec![ + State::Uninitialized, + State::Init, + State::TryOpen, + State::Open(UpgradeState::NotUpgrading), + State::Open(UpgradeState::Upgrading), + State::Closed, + State::Flushing, + State::FlushComplete, + ]; + for state in higher_or_equal_states { + assert!(State::Uninitialized.less_or_equal_progress(state)) + } + } + + #[test] + fn less_or_equal_progress_init() { + use crate::core::ics04_channel::channel::State; + use crate::core::ics04_channel::channel::UpgradeState; + + let lower_states = vec![State::Uninitialized]; + let higher_or_equal_states = vec![ + State::Init, + State::TryOpen, + State::Open(UpgradeState::NotUpgrading), + State::Open(UpgradeState::Upgrading), + State::Closed, + State::Flushing, + State::FlushComplete, + ]; + for state in lower_states { + assert!(!State::Init.less_or_equal_progress(state)); + } + for state in higher_or_equal_states { + assert!(State::Init.less_or_equal_progress(state)) + } + } + + #[test] + fn less_or_equal_progress_tryopen() { + use crate::core::ics04_channel::channel::State; + use crate::core::ics04_channel::channel::UpgradeState; + + let lower_states = vec![State::Uninitialized, State::Init]; + let higher_or_equal_states = vec![ + State::TryOpen, + State::Open(UpgradeState::NotUpgrading), + State::Open(UpgradeState::Upgrading), + State::Closed, + State::Flushing, + State::FlushComplete, + ]; + for state in lower_states { + assert!(!State::TryOpen.less_or_equal_progress(state)); + } + for state in higher_or_equal_states { + assert!(State::TryOpen.less_or_equal_progress(state)) + } + } + + #[test] + fn less_or_equal_progress_open_not_upgrading() { + use crate::core::ics04_channel::channel::State; + use crate::core::ics04_channel::channel::UpgradeState; + + let lower_states = vec![State::Uninitialized, State::Init, State::TryOpen]; + let higher_or_equal_states = vec![ + State::Open(UpgradeState::NotUpgrading), + State::Open(UpgradeState::Upgrading), + State::Closed, + State::Flushing, + State::FlushComplete, + ]; + for state in lower_states { + assert!(!State::Open(UpgradeState::NotUpgrading).less_or_equal_progress(state)); + } + for state in higher_or_equal_states { + assert!(State::Open(UpgradeState::NotUpgrading).less_or_equal_progress(state)) + } + } + + #[test] + fn less_or_equal_progress_upgrading_states() { + use crate::core::ics04_channel::channel::State; + use crate::core::ics04_channel::channel::UpgradeState; + + let states = [ + State::Uninitialized, + State::Init, + State::TryOpen, + State::Open(UpgradeState::NotUpgrading), + State::Open(UpgradeState::Upgrading), + State::Closed, + State::Flushing, + State::FlushComplete, + ]; + + let upgrading_states = vec![ + State::Open(UpgradeState::Upgrading), + State::Closed, + State::Flushing, + State::FlushComplete, + ]; + for upgrade_state in upgrading_states { + for state in states.iter() { + assert!(!upgrade_state.less_or_equal_progress(*state)); + } + } + } } diff --git a/crates/relayer-types/src/core/ics04_channel/error.rs b/crates/relayer-types/src/core/ics04_channel/error.rs index 837fae20dc..3dd6126749 100644 --- a/crates/relayer-types/src/core/ics04_channel/error.rs +++ b/crates/relayer-types/src/core/ics04_channel/error.rs @@ -12,6 +12,7 @@ use crate::timestamp::Timestamp; use crate::Height; use flex_error::{define_error, TraceError}; +use itertools::Itertools; use tendermint_proto::Error as TendermintError; define_error! { @@ -25,6 +26,14 @@ define_error! { { state: i32 } | e | { format_args!("channel state unknown: {}", e.state) }, + UnknownFlushStatus + { state: i32 } + | e | { format_args!("flush status unknown: {}", e.state) }, + + UnknownFlushStatusType + { type_id: String } + | e | { format_args!("flush status unknown: {}", e.type_id) }, + Identifier [ ValidationError ] | _ | { "identifier error" }, @@ -53,6 +62,11 @@ define_error! { [ TraceError ] | _ | { "invalid version" }, + InvalidFlushStatus + { flush_status: i32 } + | e | { format_args!("invalid flush_status value: {}", e.flush_status) }, + + Signer [ SignerError ] | _ | { "invalid signer address" }, @@ -81,6 +95,10 @@ define_error! { InvalidTimeoutHeight | _ | { "invalid timeout height for the packet" }, + InvalidTimeoutTimestamp + [ crate::timestamp::ParseTimestampError ] + | _ | { "invalid timeout timestamp" }, + InvalidPacket | _ | { "invalid packet" }, @@ -94,11 +112,32 @@ define_error! { | _ | { "missing counterparty" }, NoCommonVersion - | _ | { "no commong version" }, + | _ | { "no common version" }, MissingChannel | _ | { "missing channel end" }, + MissingUpgradeTimeout + | _ | { "missing upgrade timeout, either a height or a timestamp must be set" }, + + MissingUpgrade + | _ | { "missing upgrade" }, + + MissingUpgradeFields + | _ | { "missing upgrade fields" }, + + MissingUpgradeErrorReceipt + | _ | { "missing upgrade error receipt" }, + + MissingProposedUpgradeChannel + | _ | { "missing proposed upgrade channel" }, + + MissingProofHeight + | _ | { "missing proof height" }, + + InvalidProofHeight + | _ | { "invalid proof height" }, + InvalidVersionLengthConnection | _ | { "single version must be negotiated on connection before opening channel" }, @@ -361,6 +400,17 @@ define_error! { { abci_event: String } | e | { format_args!("Failed to convert abci event to IbcEvent: {}", e.abci_event)}, + ParseConnectionHopsVector + { failures: Vec<(String, ValidationError)> } + | e | { + let failures = e.failures + .iter() + .map(|(s, e)| format!("\"{}\": {}", s, e)) + .join(", "); + + format!("error parsing a vector of ConnectionId: {}", failures) + }, + MalformedEventAttributeKey | _ | { format_args!("event attribute key is not valid UTF-8") }, diff --git a/crates/relayer-types/src/core/ics04_channel/events.rs b/crates/relayer-types/src/core/ics04_channel/events.rs index bf8452f8e2..85e2493fe5 100644 --- a/crates/relayer-types/src/core/ics04_channel/events.rs +++ b/crates/relayer-types/src/core/ics04_channel/events.rs @@ -6,11 +6,13 @@ use std::str; use serde_derive::{Deserialize, Serialize}; use tendermint::abci; +use crate::core::ics02_client::height::Height; use crate::core::ics04_channel::error::Error; use crate::core::ics04_channel::packet::Packet; +use crate::core::ics04_channel::packet::Sequence; use crate::core::ics24_host::identifier::{ChannelId, ConnectionId, PortId}; use crate::events::{Error as EventError, IbcEvent, IbcEventType}; - +use crate::timestamp::Timestamp; use crate::utils::pretty::PrettySlice; /// Channel event attribute keys @@ -31,6 +33,12 @@ pub const PKT_TIMEOUT_HEIGHT_ATTRIBUTE_KEY: &str = "packet_timeout_height"; pub const PKT_TIMEOUT_TIMESTAMP_ATTRIBUTE_KEY: &str = "packet_timeout_timestamp"; pub const PKT_ACK_ATTRIBUTE_KEY: &str = "packet_ack_hex"; +/// Channel upgrade attribute keys +pub const UPGRADE_SEQUENCE: &str = "upgrade_sequence"; +pub const UPGRADE_TIMEOUT_HEIGHT: &str = "timeout_height"; +pub const UPGRADE_TIMEOUT_TIMESTAMP: &str = "timeout_timestamp"; +pub const UPGRADE_ERROR_RECEIPT: &str = "error_receipt"; + #[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Deserialize, Serialize)] pub struct Attributes { pub port_id: PortId, @@ -86,10 +94,71 @@ impl From for Vec { } } +/// The attributes emitted by upon receiving a channel upgrade init message. +#[derive(Clone, Debug, Default, PartialEq, Eq, Deserialize, Serialize)] +pub struct UpgradeAttributes { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_port_id: PortId, + pub counterparty_channel_id: Option, + pub upgrade_sequence: Sequence, + pub upgrade_timeout_height: Option, + pub upgrade_timeout_timestamp: Option, + pub error_receipt: Option, +} + +impl UpgradeAttributes { + pub fn port_id(&self) -> &PortId { + &self.port_id + } + pub fn channel_id(&self) -> &ChannelId { + &self.channel_id + } +} + +impl Display for UpgradeAttributes { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + if let Some(counterparty_channel_id) = &self.counterparty_channel_id { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: {counterparty_channel_id}, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } else { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: None, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } + write!(f, "], upgrade_sequence: {} }}", self.upgrade_sequence) + } +} pub trait EventType { fn event_type() -> IbcEventType; } +/// Convert channel upgrade attributes to Tendermint ABCI tags +impl From for Vec { + fn from(a: UpgradeAttributes) -> Self { + let mut attributes: Vec = vec![]; + + let port_id: abci::EventAttribute = (PORT_ID_ATTRIBUTE_KEY, a.port_id.as_str()).into(); + attributes.push(port_id); + + let channel_id: abci::EventAttribute = + (CHANNEL_ID_ATTRIBUTE_KEY, a.channel_id.as_str()).into(); + attributes.push(channel_id); + + let counterparty_port_id = ( + COUNTERPARTY_PORT_ID_ATTRIBUTE_KEY, + a.counterparty_port_id.as_str(), + ) + .into(); + + attributes.push(counterparty_port_id); + let channel_id = (COUNTERPARTY_CHANNEL_ID_ATTRIBUTE_KEY, a.channel_id.as_str()).into(); + attributes.push(channel_id); + + let upgrade_sequence = (UPGRADE_SEQUENCE, a.upgrade_sequence.to_string().as_str()).into(); + attributes.push(upgrade_sequence); + + attributes + } +} + #[derive(Clone, Debug, PartialEq, Eq, Serialize)] pub struct OpenInit { pub port_id: PortId, @@ -432,6 +501,663 @@ impl EventType for CloseConfirm { } } +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] +pub struct UpgradeInit { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_port_id: PortId, + pub counterparty_channel_id: Option, + pub upgrade_sequence: Sequence, +} + +impl Display for UpgradeInit { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + if let Some(counterparty_channel_id) = &self.counterparty_channel_id { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: {counterparty_channel_id}, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } else { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: None, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } + write!(f, "], upgrade_sequence: {} }}", self.upgrade_sequence) + } +} + +impl From for UpgradeAttributes { + fn from(ev: UpgradeInit) -> Self { + Self { + port_id: ev.port_id, + channel_id: ev.channel_id, + counterparty_port_id: ev.counterparty_port_id, + counterparty_channel_id: ev.counterparty_channel_id, + upgrade_sequence: ev.upgrade_sequence, + upgrade_timeout_height: None, + upgrade_timeout_timestamp: None, + error_receipt: None, + } + } +} + +impl UpgradeInit { + pub fn channel_id(&self) -> &ChannelId { + &self.channel_id + } + + pub fn port_id(&self) -> &PortId { + &self.port_id + } + + pub fn counterparty_port_id(&self) -> &PortId { + &self.counterparty_port_id + } + + pub fn counterparty_channel_id(&self) -> Option<&ChannelId> { + self.counterparty_channel_id.as_ref() + } +} + +impl TryFrom for UpgradeInit { + type Error = EventError; + + fn try_from(attrs: UpgradeAttributes) -> Result { + Ok(Self { + port_id: attrs.port_id, + channel_id: attrs.channel_id, + counterparty_port_id: attrs.counterparty_port_id, + counterparty_channel_id: attrs.counterparty_channel_id, + upgrade_sequence: attrs.upgrade_sequence, + }) + } +} + +impl From for IbcEvent { + fn from(v: UpgradeInit) -> Self { + IbcEvent::UpgradeInitChannel(v) + } +} + +impl EventType for UpgradeInit { + fn event_type() -> IbcEventType { + IbcEventType::UpgradeInitChannel + } +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] +pub struct UpgradeTry { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_port_id: PortId, + pub counterparty_channel_id: Option, + pub upgrade_sequence: Sequence, +} + +impl Display for UpgradeTry { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + if let Some(counterparty_channel_id) = &self.counterparty_channel_id { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: {counterparty_channel_id}, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } else { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: None, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } + write!(f, "], upgrade_sequence: {} }}", self.upgrade_sequence) + } +} + +impl From for UpgradeAttributes { + fn from(ev: UpgradeTry) -> Self { + Self { + port_id: ev.port_id, + channel_id: ev.channel_id, + counterparty_port_id: ev.counterparty_port_id, + counterparty_channel_id: ev.counterparty_channel_id, + upgrade_sequence: ev.upgrade_sequence, + upgrade_timeout_height: None, + upgrade_timeout_timestamp: None, + error_receipt: None, + } + } +} + +impl UpgradeTry { + pub fn channel_id(&self) -> &ChannelId { + &self.channel_id + } + + pub fn port_id(&self) -> &PortId { + &self.port_id + } + + pub fn counterparty_port_id(&self) -> &PortId { + &self.counterparty_port_id + } + + pub fn counterparty_channel_id(&self) -> Option<&ChannelId> { + self.counterparty_channel_id.as_ref() + } +} + +impl TryFrom for UpgradeTry { + type Error = EventError; + + fn try_from(attrs: UpgradeAttributes) -> Result { + Ok(Self { + port_id: attrs.port_id, + channel_id: attrs.channel_id, + counterparty_port_id: attrs.counterparty_port_id, + counterparty_channel_id: attrs.counterparty_channel_id, + upgrade_sequence: attrs.upgrade_sequence, + }) + } +} + +impl From for IbcEvent { + fn from(v: UpgradeTry) -> Self { + IbcEvent::UpgradeTryChannel(v) + } +} + +impl EventType for UpgradeTry { + fn event_type() -> IbcEventType { + IbcEventType::UpgradeTryChannel + } +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] +pub struct UpgradeAck { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_port_id: PortId, + pub counterparty_channel_id: Option, + pub upgrade_sequence: Sequence, +} + +impl Display for UpgradeAck { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + if let Some(counterparty_channel_id) = &self.counterparty_channel_id { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: {counterparty_channel_id}, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } else { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: None, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } + write!(f, "], upgrade_sequence: {} }}", self.upgrade_sequence) + } +} + +impl From for UpgradeAttributes { + fn from(ev: UpgradeAck) -> Self { + Self { + port_id: ev.port_id, + channel_id: ev.channel_id, + counterparty_port_id: ev.counterparty_port_id, + counterparty_channel_id: ev.counterparty_channel_id, + upgrade_sequence: ev.upgrade_sequence, + upgrade_timeout_height: None, + upgrade_timeout_timestamp: None, + error_receipt: None, + } + } +} + +impl UpgradeAck { + pub fn channel_id(&self) -> &ChannelId { + &self.channel_id + } + + pub fn port_id(&self) -> &PortId { + &self.port_id + } + + pub fn counterparty_port_id(&self) -> &PortId { + &self.counterparty_port_id + } + + pub fn counterparty_channel_id(&self) -> Option<&ChannelId> { + self.counterparty_channel_id.as_ref() + } +} + +impl TryFrom for UpgradeAck { + type Error = EventError; + + fn try_from(attrs: UpgradeAttributes) -> Result { + Ok(Self { + port_id: attrs.port_id, + channel_id: attrs.channel_id, + counterparty_port_id: attrs.counterparty_port_id, + counterparty_channel_id: attrs.counterparty_channel_id, + upgrade_sequence: attrs.upgrade_sequence, + }) + } +} + +impl From for IbcEvent { + fn from(v: UpgradeAck) -> Self { + IbcEvent::UpgradeAckChannel(v) + } +} + +impl EventType for UpgradeAck { + fn event_type() -> IbcEventType { + IbcEventType::UpgradeAckChannel + } +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] +pub struct UpgradeConfirm { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_port_id: PortId, + pub counterparty_channel_id: Option, + pub upgrade_sequence: Sequence, +} + +impl Display for UpgradeConfirm { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + if let Some(counterparty_channel_id) = &self.counterparty_channel_id { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: {counterparty_channel_id}, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } else { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: None, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } + write!(f, "], upgrade_sequence: {} }}", self.upgrade_sequence) + } +} + +impl From for UpgradeAttributes { + fn from(ev: UpgradeConfirm) -> Self { + Self { + port_id: ev.port_id, + channel_id: ev.channel_id, + counterparty_port_id: ev.counterparty_port_id, + counterparty_channel_id: ev.counterparty_channel_id, + upgrade_sequence: ev.upgrade_sequence, + upgrade_timeout_height: None, + upgrade_timeout_timestamp: None, + error_receipt: None, + } + } +} + +impl UpgradeConfirm { + pub fn channel_id(&self) -> &ChannelId { + &self.channel_id + } + + pub fn port_id(&self) -> &PortId { + &self.port_id + } + + pub fn counterparty_port_id(&self) -> &PortId { + &self.counterparty_port_id + } + + pub fn counterparty_channel_id(&self) -> Option<&ChannelId> { + self.counterparty_channel_id.as_ref() + } +} + +impl TryFrom for UpgradeConfirm { + type Error = EventError; + + fn try_from(attrs: UpgradeAttributes) -> Result { + Ok(Self { + port_id: attrs.port_id, + channel_id: attrs.channel_id, + counterparty_port_id: attrs.counterparty_port_id, + counterparty_channel_id: attrs.counterparty_channel_id, + upgrade_sequence: attrs.upgrade_sequence, + }) + } +} + +impl From for IbcEvent { + fn from(v: UpgradeConfirm) -> Self { + IbcEvent::UpgradeConfirmChannel(v) + } +} + +impl EventType for UpgradeConfirm { + fn event_type() -> IbcEventType { + IbcEventType::UpgradeConfirmChannel + } +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] +pub struct UpgradeOpen { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_port_id: PortId, + pub counterparty_channel_id: Option, + pub upgrade_sequence: Sequence, +} + +impl Display for UpgradeOpen { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + if let Some(counterparty_channel_id) = &self.counterparty_channel_id { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: {counterparty_channel_id}, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } else { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: None, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } + write!(f, "], upgrade_sequence: {} }}", self.upgrade_sequence) + } +} + +impl From for UpgradeAttributes { + fn from(ev: UpgradeOpen) -> Self { + Self { + port_id: ev.port_id, + channel_id: ev.channel_id, + counterparty_port_id: ev.counterparty_port_id, + counterparty_channel_id: ev.counterparty_channel_id, + upgrade_sequence: ev.upgrade_sequence, + upgrade_timeout_height: None, + upgrade_timeout_timestamp: None, + error_receipt: None, + } + } +} + +impl UpgradeOpen { + pub fn channel_id(&self) -> &ChannelId { + &self.channel_id + } + + pub fn port_id(&self) -> &PortId { + &self.port_id + } + + pub fn counterparty_port_id(&self) -> &PortId { + &self.counterparty_port_id + } + + pub fn counterparty_channel_id(&self) -> Option<&ChannelId> { + self.counterparty_channel_id.as_ref() + } +} + +impl TryFrom for UpgradeOpen { + type Error = EventError; + + fn try_from(attrs: UpgradeAttributes) -> Result { + Ok(Self { + port_id: attrs.port_id, + channel_id: attrs.channel_id, + counterparty_port_id: attrs.counterparty_port_id, + counterparty_channel_id: attrs.counterparty_channel_id, + upgrade_sequence: attrs.upgrade_sequence, + }) + } +} + +impl From for IbcEvent { + fn from(v: UpgradeOpen) -> Self { + IbcEvent::UpgradeOpenChannel(v) + } +} + +impl EventType for UpgradeOpen { + fn event_type() -> IbcEventType { + IbcEventType::UpgradeOpenChannel + } +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] +pub struct UpgradeCancel { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_port_id: PortId, + pub counterparty_channel_id: Option, + pub upgrade_sequence: Sequence, +} + +impl Display for UpgradeCancel { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + if let Some(counterparty_channel_id) = &self.counterparty_channel_id { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: {counterparty_channel_id}, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } else { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: None, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } + write!(f, "], upgrade_sequence: {} }}", self.upgrade_sequence) + } +} + +impl From for UpgradeAttributes { + fn from(ev: UpgradeCancel) -> Self { + Self { + port_id: ev.port_id, + channel_id: ev.channel_id, + counterparty_port_id: ev.counterparty_port_id, + counterparty_channel_id: ev.counterparty_channel_id, + upgrade_sequence: ev.upgrade_sequence, + upgrade_timeout_height: None, + upgrade_timeout_timestamp: None, + error_receipt: None, + } + } +} + +impl UpgradeCancel { + pub fn channel_id(&self) -> &ChannelId { + &self.channel_id + } + + pub fn port_id(&self) -> &PortId { + &self.port_id + } + + pub fn counterparty_port_id(&self) -> &PortId { + &self.counterparty_port_id + } + + pub fn counterparty_channel_id(&self) -> Option<&ChannelId> { + self.counterparty_channel_id.as_ref() + } +} + +impl TryFrom for UpgradeCancel { + type Error = EventError; + + fn try_from(attrs: UpgradeAttributes) -> Result { + Ok(Self { + port_id: attrs.port_id, + channel_id: attrs.channel_id, + counterparty_port_id: attrs.counterparty_port_id, + counterparty_channel_id: attrs.counterparty_channel_id, + upgrade_sequence: attrs.upgrade_sequence, + }) + } +} + +impl From for IbcEvent { + fn from(v: UpgradeCancel) -> Self { + IbcEvent::UpgradeCancelChannel(v) + } +} + +impl EventType for UpgradeCancel { + fn event_type() -> IbcEventType { + IbcEventType::UpgradeCancelChannel + } +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] +pub struct UpgradeTimeout { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_port_id: PortId, + pub counterparty_channel_id: Option, + pub upgrade_sequence: Sequence, + pub upgrade_timeout_height: Option, + pub upgrade_timeout_timestamp: Option, +} + +impl Display for UpgradeTimeout { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + if let Some(counterparty_channel_id) = &self.counterparty_channel_id { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: {counterparty_channel_id}, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } else { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: None, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } + + write!(f, "], upgrade_sequence: {}", self.upgrade_sequence)?; + + match (self.upgrade_timeout_height, self.upgrade_timeout_timestamp) { + (Some(height), Some(timestamp)) => write!( + f, + " timeout_height: {}, timeout_timestamp: {} }}", + height, timestamp + ), + (Some(height), None) => write!(f, " timeout_height: {} }}", height), + (None, Some(timestamp)) => write!(f, " timeout_timestamp: {} }}", timestamp), + (None, None) => write!(f, " }}"), + } + } +} + +impl From for UpgradeAttributes { + fn from(ev: UpgradeTimeout) -> Self { + Self { + port_id: ev.port_id, + channel_id: ev.channel_id, + counterparty_port_id: ev.counterparty_port_id, + counterparty_channel_id: ev.counterparty_channel_id, + upgrade_sequence: ev.upgrade_sequence, + upgrade_timeout_height: ev.upgrade_timeout_height, + upgrade_timeout_timestamp: ev.upgrade_timeout_timestamp, + error_receipt: None, + } + } +} + +impl UpgradeTimeout { + pub fn channel_id(&self) -> &ChannelId { + &self.channel_id + } + + pub fn port_id(&self) -> &PortId { + &self.port_id + } + + pub fn counterparty_port_id(&self) -> &PortId { + &self.counterparty_port_id + } + + pub fn counterparty_channel_id(&self) -> Option<&ChannelId> { + self.counterparty_channel_id.as_ref() + } +} + +impl TryFrom for UpgradeTimeout { + type Error = EventError; + + fn try_from(attrs: UpgradeAttributes) -> Result { + Ok(Self { + port_id: attrs.port_id, + channel_id: attrs.channel_id, + counterparty_port_id: attrs.counterparty_port_id, + counterparty_channel_id: attrs.counterparty_channel_id, + upgrade_sequence: attrs.upgrade_sequence, + upgrade_timeout_height: attrs.upgrade_timeout_height, + upgrade_timeout_timestamp: attrs.upgrade_timeout_timestamp, + }) + } +} + +impl From for IbcEvent { + fn from(v: UpgradeTimeout) -> Self { + IbcEvent::UpgradeTimeoutChannel(v) + } +} + +impl EventType for UpgradeTimeout { + fn event_type() -> IbcEventType { + IbcEventType::UpgradeTimeoutChannel + } +} +// + +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] +pub struct UpgradeError { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_port_id: PortId, + pub counterparty_channel_id: Option, + pub upgrade_sequence: Sequence, + pub error_receipt: String, +} + +impl Display for UpgradeError { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + if let Some(counterparty_channel_id) = &self.counterparty_channel_id { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: {counterparty_channel_id}, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } else { + write!(f, "UpgradeAttributes {{ port_id: {}, channel_id: {}, counterparty_port_id: {}, counterparty_channel_id: None, upgrade_connection_hops: [", self.port_id, self.channel_id, self.counterparty_port_id)?; + } + + write!( + f, + "], upgrade_sequence: {}, error_receipt: {} }}", + self.upgrade_sequence, self.error_receipt + ) + } +} + +impl From for UpgradeAttributes { + fn from(ev: UpgradeError) -> Self { + Self { + port_id: ev.port_id, + channel_id: ev.channel_id, + counterparty_port_id: ev.counterparty_port_id, + counterparty_channel_id: ev.counterparty_channel_id, + upgrade_sequence: ev.upgrade_sequence, + upgrade_timeout_height: None, + upgrade_timeout_timestamp: None, + error_receipt: Some(ev.error_receipt), + } + } +} + +impl UpgradeError { + pub fn channel_id(&self) -> &ChannelId { + &self.channel_id + } + + pub fn port_id(&self) -> &PortId { + &self.port_id + } + + pub fn counterparty_port_id(&self) -> &PortId { + &self.counterparty_port_id + } + + pub fn counterparty_channel_id(&self) -> Option<&ChannelId> { + self.counterparty_channel_id.as_ref() + } +} + +impl TryFrom for UpgradeError { + type Error = EventError; + + fn try_from(attrs: UpgradeAttributes) -> Result { + let error_receipt = attrs.error_receipt.unwrap_or_default(); + Ok(Self { + port_id: attrs.port_id, + channel_id: attrs.channel_id, + counterparty_port_id: attrs.counterparty_port_id, + counterparty_channel_id: attrs.counterparty_channel_id, + upgrade_sequence: attrs.upgrade_sequence, + error_receipt, + }) + } +} + +impl From for IbcEvent { + fn from(v: UpgradeError) -> Self { + IbcEvent::UpgradeErrorChannel(v) + } +} + +impl EventType for UpgradeError { + fn event_type() -> IbcEventType { + IbcEventType::UpgradeErrorChannel + } +} + macro_rules! impl_try_from_attribute_for_event { ($($event:ty),+) => { $(impl TryFrom for $event { diff --git a/crates/relayer-types/src/core/ics04_channel/mod.rs b/crates/relayer-types/src/core/ics04_channel/mod.rs index 21d1378da6..018a0608de 100644 --- a/crates/relayer-types/src/core/ics04_channel/mod.rs +++ b/crates/relayer-types/src/core/ics04_channel/mod.rs @@ -9,4 +9,6 @@ pub mod msgs; pub mod packet; pub mod packet_id; pub mod timeout; +pub mod upgrade; +pub mod upgrade_fields; pub mod version; diff --git a/crates/relayer-types/src/core/ics04_channel/msgs.rs b/crates/relayer-types/src/core/ics04_channel/msgs.rs index c69f2e267f..c856d76866 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs.rs @@ -22,6 +22,15 @@ pub mod chan_open_try; pub mod chan_close_confirm; pub mod chan_close_init; +// Upgrade handshake messages. +pub mod chan_upgrade_ack; +pub mod chan_upgrade_cancel; +pub mod chan_upgrade_confirm; +pub mod chan_upgrade_init; +pub mod chan_upgrade_open; +pub mod chan_upgrade_timeout; +pub mod chan_upgrade_try; + // Packet specific messages. pub mod acknowledgement; pub mod recv_packet; diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs index 33b4873899..50736ece9e 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs @@ -3,6 +3,7 @@ use ibc_proto::Protobuf; use ibc_proto::ibc::core::channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm; use crate::core::ics04_channel::error::Error; +use crate::core::ics04_channel::packet::Sequence; use crate::core::ics24_host::identifier::{ChannelId, PortId}; use crate::proofs::Proofs; use crate::signer::Signer; @@ -20,7 +21,7 @@ pub struct MsgChannelCloseConfirm { pub channel_id: ChannelId, pub proofs: Proofs, pub signer: Signer, - pub counterparty_upgrade_sequence: u64, + pub counterparty_upgrade_sequence: Sequence, } impl MsgChannelCloseConfirm { @@ -30,7 +31,7 @@ impl MsgChannelCloseConfirm { channel_id, proofs, signer, - counterparty_upgrade_sequence: 0, + counterparty_upgrade_sequence: Sequence::from(0), } } } @@ -75,7 +76,7 @@ impl TryFrom for MsgChannelCloseConfirm { channel_id: raw_msg.channel_id.parse().map_err(Error::identifier)?, proofs, signer: raw_msg.signer.parse().map_err(Error::signer)?, - counterparty_upgrade_sequence: raw_msg.counterparty_upgrade_sequence, + counterparty_upgrade_sequence: raw_msg.counterparty_upgrade_sequence.into(), }) } } @@ -88,7 +89,7 @@ impl From for RawMsgChannelCloseConfirm { proof_init: domain_msg.proofs.object_proof().clone().into(), proof_height: Some(domain_msg.proofs.height().into()), signer: domain_msg.signer.to_string(), - counterparty_upgrade_sequence: domain_msg.counterparty_upgrade_sequence, + counterparty_upgrade_sequence: domain_msg.counterparty_upgrade_sequence.into(), } } } diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_init.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_init.rs index 9e249d6137..d2036eccad 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_init.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_init.rs @@ -9,9 +9,7 @@ use crate::tx_msg::Msg; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelCloseInit"; -/// /// Message definition for the first step in the channel close handshake (`ChanCloseInit` datagram). -/// #[derive(Clone, Debug, PartialEq, Eq)] pub struct MsgChannelCloseInit { pub port_id: PortId, diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_init.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_init.rs index 8128674f24..528b5cb9ab 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_init.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_init.rs @@ -10,9 +10,7 @@ use ibc_proto::Protobuf; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelOpenInit"; -/// /// Message definition for the first step in the channel open handshake (`ChanOpenInit` datagram). -/// #[derive(Clone, Debug, PartialEq, Eq)] pub struct MsgChannelOpenInit { pub port_id: PortId, diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_try.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_try.rs index 597204e5ec..e802433cc4 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_try.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_try.rs @@ -1,7 +1,6 @@ use crate::core::ics04_channel::channel::ChannelEnd; use crate::core::ics04_channel::error::Error as ChannelError; use crate::core::ics04_channel::version::Version; -use crate::core::ics24_host::error::ValidationError; use crate::core::ics24_host::identifier::{ChannelId, PortId}; use crate::proofs::Proofs; @@ -15,9 +14,7 @@ use core::str::FromStr; pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelOpenTry"; -/// /// Message definition for the second step in the channel open handshake (`ChanOpenTry` datagram). -/// #[derive(Clone, Debug, PartialEq, Eq)] pub struct MsgChannelOpenTry { pub port_id: PortId, @@ -59,13 +56,6 @@ impl Msg for MsgChannelOpenTry { fn type_url(&self) -> String { TYPE_URL.to_string() } - - fn validate_basic(&self) -> Result<(), ValidationError> { - match self.channel.counterparty().channel_id() { - None => Err(ValidationError::invalid_counterparty_channel_id()), - Some(_c) => Ok(()), - } - } } impl Protobuf for MsgChannelOpenTry {} @@ -97,21 +87,25 @@ impl TryFrom for MsgChannelOpenTry { .transpose() .map_err(ChannelError::identifier)?; + let channel: ChannelEnd = raw_msg + .channel + .ok_or_else(ChannelError::missing_channel)? + .try_into()?; + + assert!( + channel.counterparty().channel_id().is_some(), + "Expected counterparty channel to have a channel ID" + ); + let msg = MsgChannelOpenTry { port_id: raw_msg.port_id.parse().map_err(ChannelError::identifier)?, previous_channel_id, - channel: raw_msg - .channel - .ok_or_else(ChannelError::missing_channel)? - .try_into()?, + channel, counterparty_version: raw_msg.counterparty_version.into(), proofs, signer: raw_msg.signer.parse().map_err(ChannelError::signer)?, }; - msg.validate_basic() - .map_err(ChannelError::invalid_counterparty_channel_id)?; - Ok(msg) } } diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_ack.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_ack.rs new file mode 100644 index 0000000000..3b92cb7db0 --- /dev/null +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_ack.rs @@ -0,0 +1,249 @@ +use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeAck as RawMsgChannelUpgradeAck; +use ibc_proto::Protobuf; + +use crate::core::ics04_channel::error::Error; +use crate::core::ics04_channel::upgrade::Upgrade; +use crate::core::ics23_commitment::commitment::CommitmentProofBytes; +use crate::core::ics24_host::identifier::{ChannelId, PortId}; +use crate::signer::Signer; +use crate::tx_msg::Msg; +use crate::Height; + +pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelUpgradeAck"; + +/// Message definition for the third step of the channel upgrade +/// handshake (the `ChanUpgradeAck` datagram). +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct MsgChannelUpgradeAck { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_upgrade: Upgrade, + /// The proof of the counterparty channel + pub proof_channel: CommitmentProofBytes, + /// The proof of the counterparty upgrade + pub proof_upgrade: CommitmentProofBytes, + /// The height at which the proofs were queried. + pub proof_height: Height, + pub signer: Signer, +} + +impl MsgChannelUpgradeAck { + #[allow(clippy::too_many_arguments)] + pub fn new( + port_id: PortId, + channel_id: ChannelId, + counterparty_upgrade: Upgrade, + proof_channel: CommitmentProofBytes, + proof_upgrade: CommitmentProofBytes, + proof_height: Height, + signer: Signer, + ) -> Self { + Self { + port_id, + channel_id, + counterparty_upgrade, + proof_channel, + proof_upgrade, + proof_height, + signer, + } + } +} + +impl Msg for MsgChannelUpgradeAck { + type ValidationError = Error; + type Raw = RawMsgChannelUpgradeAck; + + fn route(&self) -> String { + crate::keys::ROUTER_KEY.to_string() + } + + fn type_url(&self) -> String { + TYPE_URL.to_string() + } +} + +impl Protobuf for MsgChannelUpgradeAck {} + +impl TryFrom for MsgChannelUpgradeAck { + type Error = Error; + + fn try_from(raw_msg: RawMsgChannelUpgradeAck) -> Result { + let counterparty_upgrade = raw_msg + .counterparty_upgrade + .ok_or(Error::missing_upgrade())? + .try_into()?; + + let proof_height = raw_msg + .proof_height + .ok_or_else(Error::missing_proof_height)? + .try_into() + .map_err(|_| Error::invalid_proof_height())?; + + Ok(MsgChannelUpgradeAck { + port_id: raw_msg.port_id.parse().map_err(Error::identifier)?, + channel_id: raw_msg.channel_id.parse().map_err(Error::identifier)?, + counterparty_upgrade, + proof_channel: raw_msg + .proof_channel + .try_into() + .map_err(Error::invalid_proof)?, + proof_upgrade: raw_msg + .proof_upgrade + .try_into() + .map_err(Error::invalid_proof)?, + proof_height, + signer: raw_msg.signer.parse().map_err(Error::signer)?, + }) + } +} + +impl From for RawMsgChannelUpgradeAck { + fn from(domain_msg: MsgChannelUpgradeAck) -> Self { + RawMsgChannelUpgradeAck { + port_id: domain_msg.port_id.to_string(), + channel_id: domain_msg.channel_id.to_string(), + counterparty_upgrade: Some(domain_msg.counterparty_upgrade.into()), + proof_upgrade: domain_msg.proof_upgrade.into(), + proof_channel: domain_msg.proof_channel.into(), + proof_height: Some(domain_msg.proof_height.into()), + signer: domain_msg.signer.to_string(), + } + } +} + +#[cfg(test)] +pub mod test_util { + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeAck as RawMsgChannelUpgradeAck; + use ibc_proto::ibc::core::client::v1::Height as RawHeight; + + use crate::core::ics04_channel::upgrade::test_util::get_dummy_upgrade; + use crate::core::ics24_host::identifier::{ChannelId, PortId}; + use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; + + /// Returns a dummy `RawMsgChannelUpgradeAck`, for testing only! + pub fn get_dummy_raw_msg_chan_upgrade_ack() -> RawMsgChannelUpgradeAck { + RawMsgChannelUpgradeAck { + port_id: PortId::default().to_string(), + channel_id: ChannelId::default().to_string(), + counterparty_upgrade: Some(get_dummy_upgrade()), + proof_upgrade: get_dummy_proof(), + proof_channel: get_dummy_proof(), + proof_height: Some(RawHeight { + revision_number: 1, + revision_height: 1, + }), + signer: get_dummy_bech32_account(), + } + } +} + +#[cfg(test)] +mod tests { + use test_log::test; + + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeAck as RawMsgChannelUpgradeAck; + + use crate::core::ics04_channel::msgs::chan_upgrade_ack::test_util::get_dummy_raw_msg_chan_upgrade_ack; + use crate::core::ics04_channel::msgs::chan_upgrade_ack::MsgChannelUpgradeAck; + + #[test] + fn parse_channel_upgrade_try_msg() { + struct Test { + name: String, + raw: RawMsgChannelUpgradeAck, + want_pass: bool, + } + + let default_raw_msg = get_dummy_raw_msg_chan_upgrade_ack(); + + let tests: Vec = vec![ + Test { + name: "Good parameters".to_string(), + raw: default_raw_msg.clone(), + want_pass: true, + }, + Test { + name: "Correct port ID".to_string(), + raw: RawMsgChannelUpgradeAck { + port_id: "p36".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Port too short".to_string(), + raw: RawMsgChannelUpgradeAck { + port_id: "p".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Port too long".to_string(), + raw: RawMsgChannelUpgradeAck { + port_id: "abcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstuabcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstu".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Correct channel ID".to_string(), + raw: RawMsgChannelUpgradeAck { + channel_id: "channel-2".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Channel name too short".to_string(), + raw: RawMsgChannelUpgradeAck { + channel_id: "c".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Channel name too long".to_string(), + raw: RawMsgChannelUpgradeAck { + channel_id: "channel-128391283791827398127398791283912837918273981273987912839".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Empty proof channel".to_string(), + raw: RawMsgChannelUpgradeAck { + proof_channel: vec![], + ..default_raw_msg + }, + want_pass: false, + }, + ] + .into_iter() + .collect(); + + for test in tests { + let res = MsgChannelUpgradeAck::try_from(test.raw.clone()); + + assert_eq!( + test.want_pass, + res.is_ok(), + "MsgChannelUpgradeAck::try_from failed for test {}, \nraw msg {:?} with err {:?}", + test.name, + test.raw, + res.err() + ); + } + } + + #[test] + fn to_and_from() { + let raw = get_dummy_raw_msg_chan_upgrade_ack(); + let msg = MsgChannelUpgradeAck::try_from(raw.clone()).unwrap(); + let raw_back = RawMsgChannelUpgradeAck::from(msg.clone()); + let msg_back = MsgChannelUpgradeAck::try_from(raw_back.clone()).unwrap(); + assert_eq!(raw, raw_back); + assert_eq!(msg, msg_back); + } +} diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_cancel.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_cancel.rs new file mode 100644 index 0000000000..f2e33039b1 --- /dev/null +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_cancel.rs @@ -0,0 +1,241 @@ +use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeCancel as RawMsgChannelUpgradeCancel; +use ibc_proto::Protobuf; + +use crate::core::ics04_channel::error::Error; +use crate::core::ics04_channel::upgrade::ErrorReceipt; +use crate::core::ics23_commitment::commitment::CommitmentProofBytes; +use crate::core::ics24_host::identifier::{ChannelId, PortId}; +use crate::signer::Signer; +use crate::tx_msg::Msg; +use crate::Height; + +pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelUpgradeCancel"; + +/// Message definition the `ChanUpgradeCancel` datagram. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct MsgChannelUpgradeCancel { + pub port_id: PortId, + pub channel_id: ChannelId, + pub error_receipt: ErrorReceipt, + /// The proof of the counterparty error receipt + pub proof_error_receipt: CommitmentProofBytes, + /// The height at which the proofs were queried. + pub proof_height: Height, + pub signer: Signer, +} + +impl MsgChannelUpgradeCancel { + #[allow(clippy::too_many_arguments)] + pub fn new( + port_id: PortId, + channel_id: ChannelId, + error_receipt: ErrorReceipt, + proof_error_receipt: CommitmentProofBytes, + proof_height: Height, + signer: Signer, + ) -> Self { + Self { + port_id, + channel_id, + error_receipt, + proof_error_receipt, + proof_height, + signer, + } + } +} + +impl Msg for MsgChannelUpgradeCancel { + type ValidationError = Error; + type Raw = RawMsgChannelUpgradeCancel; + + fn route(&self) -> String { + crate::keys::ROUTER_KEY.to_string() + } + + fn type_url(&self) -> String { + TYPE_URL.to_string() + } +} + +impl Protobuf for MsgChannelUpgradeCancel {} + +impl TryFrom for MsgChannelUpgradeCancel { + type Error = Error; + + fn try_from(raw_msg: RawMsgChannelUpgradeCancel) -> Result { + let raw_error_receipt = raw_msg + .error_receipt + .ok_or(Error::missing_upgrade_error_receipt())?; + let error_receipt = ErrorReceipt::try_from(raw_error_receipt)?; + + let proof_height = raw_msg + .proof_height + .ok_or_else(Error::missing_proof_height)? + .try_into() + .map_err(|_| Error::invalid_proof_height())?; + + Ok(MsgChannelUpgradeCancel { + port_id: raw_msg.port_id.parse().map_err(Error::identifier)?, + channel_id: raw_msg.channel_id.parse().map_err(Error::identifier)?, + error_receipt, + proof_error_receipt: raw_msg + .proof_error_receipt + .try_into() + .map_err(Error::invalid_proof)?, + proof_height, + signer: raw_msg.signer.parse().map_err(Error::signer)?, + }) + } +} + +impl From for RawMsgChannelUpgradeCancel { + fn from(domain_msg: MsgChannelUpgradeCancel) -> Self { + RawMsgChannelUpgradeCancel { + port_id: domain_msg.port_id.to_string(), + channel_id: domain_msg.channel_id.to_string(), + error_receipt: Some(domain_msg.error_receipt.into()), + proof_error_receipt: domain_msg.proof_error_receipt.into(), + proof_height: Some(domain_msg.proof_height.into()), + signer: domain_msg.signer.to_string(), + } + } +} + +#[cfg(test)] +pub mod test_util { + use ibc_proto::ibc::core::channel::v1::ErrorReceipt as RawErrorReceipt; + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeCancel as RawMsgChannelUpgradeCancel; + use ibc_proto::ibc::core::client::v1::Height as RawHeight; + + use crate::core::ics24_host::identifier::{ChannelId, PortId}; + use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; + + /// Returns a dummy `RawMsgChannelUpgradeCnacel`, for testing only! + pub fn get_dummy_raw_msg_chan_upgrade_cancel() -> RawMsgChannelUpgradeCancel { + RawMsgChannelUpgradeCancel { + port_id: PortId::default().to_string(), + channel_id: ChannelId::default().to_string(), + error_receipt: Some(RawErrorReceipt { + sequence: 1, + message: "error message".to_string(), + }), + proof_error_receipt: get_dummy_proof(), + proof_height: Some(RawHeight { + revision_number: 1, + revision_height: 1, + }), + signer: get_dummy_bech32_account(), + } + } +} + +#[cfg(test)] +mod tests { + use test_log::test; + + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeCancel as RawMsgChannelUpgradeCancel; + + use crate::core::ics04_channel::msgs::chan_upgrade_cancel::test_util::get_dummy_raw_msg_chan_upgrade_cancel; + use crate::core::ics04_channel::msgs::chan_upgrade_cancel::MsgChannelUpgradeCancel; + + #[test] + fn parse_channel_upgrade_try_msg() { + struct Test { + name: String, + raw: RawMsgChannelUpgradeCancel, + want_pass: bool, + } + + let default_raw_msg = get_dummy_raw_msg_chan_upgrade_cancel(); + + let tests: Vec = vec![ + Test { + name: "Good parameters".to_string(), + raw: default_raw_msg.clone(), + want_pass: true, + }, + Test { + name: "Correct port ID".to_string(), + raw: RawMsgChannelUpgradeCancel { + port_id: "p36".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Port too short".to_string(), + raw: RawMsgChannelUpgradeCancel { + port_id: "p".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Port too long".to_string(), + raw: RawMsgChannelUpgradeCancel { + port_id: "abcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstuabcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstu".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Correct channel ID".to_string(), + raw: RawMsgChannelUpgradeCancel { + channel_id: "channel-2".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Channel name too short".to_string(), + raw: RawMsgChannelUpgradeCancel { + channel_id: "c".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Channel name too long".to_string(), + raw: RawMsgChannelUpgradeCancel { + channel_id: "channel-128391283791827398127398791283912837918273981273987912839".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Empty proof channel".to_string(), + raw: RawMsgChannelUpgradeCancel { + proof_error_receipt: vec![], + ..default_raw_msg + }, + want_pass: false, + }, + ] + .into_iter() + .collect(); + + for test in tests { + let res = MsgChannelUpgradeCancel::try_from(test.raw.clone()); + + assert_eq!( + test.want_pass, + res.is_ok(), + "RawMsgChannelUpgradeCancel::try_from failed for test {}, \nraw msg {:?} with err {:?}", + test.name, + test.raw, + res.err() + ); + } + } + + #[test] + fn to_and_from() { + let raw = get_dummy_raw_msg_chan_upgrade_cancel(); + let msg = MsgChannelUpgradeCancel::try_from(raw.clone()).unwrap(); + let raw_back = RawMsgChannelUpgradeCancel::from(msg.clone()); + let msg_back = MsgChannelUpgradeCancel::try_from(raw_back.clone()).unwrap(); + assert_eq!(raw, raw_back); + assert_eq!(msg, msg_back); + } +} diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_confirm.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_confirm.rs new file mode 100644 index 0000000000..d2a2c96b22 --- /dev/null +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_confirm.rs @@ -0,0 +1,256 @@ +use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeConfirm as RawMsgChannelUpgradeConfirm; +use ibc_proto::Protobuf; + +use crate::core::ics04_channel::channel::State; +use crate::core::ics04_channel::error::Error; +use crate::core::ics04_channel::upgrade::Upgrade; +use crate::core::ics23_commitment::commitment::CommitmentProofBytes; +use crate::core::ics24_host::identifier::{ChannelId, PortId}; +use crate::signer::Signer; +use crate::tx_msg::Msg; +use crate::Height; + +pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelUpgradeConfirm"; + +/// Message definition for the third step of the channel upgrade +/// handshake (the `ChanUpgradeConfirm` datagram). +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct MsgChannelUpgradeConfirm { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_channel_state: State, + pub counterparty_upgrade: Upgrade, + /// The proof of the counterparty channel + pub proof_channel: CommitmentProofBytes, + /// The proof of the counterparty upgrade + pub proof_upgrade: CommitmentProofBytes, + /// The height at which the proofs were queried. + pub proof_height: Height, + pub signer: Signer, +} + +impl MsgChannelUpgradeConfirm { + #[allow(clippy::too_many_arguments)] + pub fn new( + port_id: PortId, + channel_id: ChannelId, + counterparty_channel_state: State, + counterparty_upgrade: Upgrade, + proof_channel: CommitmentProofBytes, + proof_upgrade: CommitmentProofBytes, + proof_height: Height, + signer: Signer, + ) -> Self { + Self { + port_id, + channel_id, + counterparty_channel_state, + counterparty_upgrade, + proof_channel, + proof_upgrade, + proof_height, + signer, + } + } +} + +impl Msg for MsgChannelUpgradeConfirm { + type ValidationError = Error; + type Raw = RawMsgChannelUpgradeConfirm; + + fn route(&self) -> String { + crate::keys::ROUTER_KEY.to_string() + } + + fn type_url(&self) -> String { + TYPE_URL.to_string() + } +} + +impl Protobuf for MsgChannelUpgradeConfirm {} + +impl TryFrom for MsgChannelUpgradeConfirm { + type Error = Error; + + fn try_from(raw_msg: RawMsgChannelUpgradeConfirm) -> Result { + let counterparty_upgrade = raw_msg + .counterparty_upgrade + .ok_or(Error::missing_upgrade())? + .try_into()?; + + let proof_height = raw_msg + .proof_height + .ok_or_else(Error::missing_proof_height)? + .try_into() + .map_err(|_| Error::invalid_proof_height())?; + + Ok(MsgChannelUpgradeConfirm { + port_id: raw_msg.port_id.parse().map_err(Error::identifier)?, + channel_id: raw_msg.channel_id.parse().map_err(Error::identifier)?, + counterparty_channel_state: State::from_i32(raw_msg.counterparty_channel_state)?, + counterparty_upgrade, + proof_channel: raw_msg + .proof_channel + .try_into() + .map_err(Error::invalid_proof)?, + proof_upgrade: raw_msg + .proof_upgrade + .try_into() + .map_err(Error::invalid_proof)?, + proof_height, + signer: raw_msg.signer.parse().map_err(Error::signer)?, + }) + } +} + +impl From for RawMsgChannelUpgradeConfirm { + fn from(domain_msg: MsgChannelUpgradeConfirm) -> Self { + RawMsgChannelUpgradeConfirm { + port_id: domain_msg.port_id.to_string(), + channel_id: domain_msg.channel_id.to_string(), + counterparty_channel_state: domain_msg.counterparty_channel_state.as_i32(), + counterparty_upgrade: Some(domain_msg.counterparty_upgrade.into()), + proof_upgrade: domain_msg.proof_upgrade.into(), + proof_channel: domain_msg.proof_channel.into(), + proof_height: Some(domain_msg.proof_height.into()), + signer: domain_msg.signer.to_string(), + } + } +} + +#[cfg(test)] +pub mod test_util { + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeConfirm as RawMsgChannelUpgradeConfirm; + use ibc_proto::ibc::core::client::v1::Height as RawHeight; + + use crate::core::ics04_channel::upgrade::test_util::get_dummy_upgrade; + use crate::core::ics24_host::identifier::{ChannelId, PortId}; + use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; + + /// Returns a dummy `RawMsgChannelUpgradeConfirm`, for testing only! + pub fn get_dummy_raw_msg_chan_upgrade_confirm() -> RawMsgChannelUpgradeConfirm { + RawMsgChannelUpgradeConfirm { + port_id: PortId::default().to_string(), + channel_id: ChannelId::default().to_string(), + counterparty_channel_state: 6, // FlushComplete + counterparty_upgrade: Some(get_dummy_upgrade()), + proof_upgrade: get_dummy_proof(), + proof_channel: get_dummy_proof(), + proof_height: Some(RawHeight { + revision_number: 1, + revision_height: 1, + }), + signer: get_dummy_bech32_account(), + } + } +} + +#[cfg(test)] +mod tests { + use test_log::test; + + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeConfirm as RawMsgChannelUpgradeConfirm; + + use crate::core::ics04_channel::msgs::chan_upgrade_confirm::test_util::get_dummy_raw_msg_chan_upgrade_confirm; + use crate::core::ics04_channel::msgs::chan_upgrade_confirm::MsgChannelUpgradeConfirm; + + #[test] + fn parse_channel_upgrade_try_msg() { + struct Test { + name: String, + raw: RawMsgChannelUpgradeConfirm, + want_pass: bool, + } + + let default_raw_msg = get_dummy_raw_msg_chan_upgrade_confirm(); + + let tests: Vec = vec![ + Test { + name: "Good parameters".to_string(), + raw: default_raw_msg.clone(), + want_pass: true, + }, + Test { + name: "Correct port ID".to_string(), + raw: RawMsgChannelUpgradeConfirm { + port_id: "p36".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Port too short".to_string(), + raw: RawMsgChannelUpgradeConfirm { + port_id: "p".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Port too long".to_string(), + raw: RawMsgChannelUpgradeConfirm { + port_id: "abcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstuabcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstu".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Correct channel ID".to_string(), + raw: RawMsgChannelUpgradeConfirm { + channel_id: "channel-2".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Channel name too short".to_string(), + raw: RawMsgChannelUpgradeConfirm { + channel_id: "c".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Channel name too long".to_string(), + raw: RawMsgChannelUpgradeConfirm { + channel_id: "channel-128391283791827398127398791283912837918273981273987912839".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Empty proof channel".to_string(), + raw: RawMsgChannelUpgradeConfirm { + proof_channel: vec![], + ..default_raw_msg + }, + want_pass: false, + }, + ] + .into_iter() + .collect(); + + for test in tests { + let res = MsgChannelUpgradeConfirm::try_from(test.raw.clone()); + + assert_eq!( + test.want_pass, + res.is_ok(), + "MsgChannelUpgradeConfirm::try_from failed for test {}, \nraw msg {:?} with err {:?}", + test.name, + test.raw, + res.err() + ); + } + } + + #[test] + fn to_and_from() { + let raw = get_dummy_raw_msg_chan_upgrade_confirm(); + let msg = MsgChannelUpgradeConfirm::try_from(raw.clone()).unwrap(); + let raw_back = RawMsgChannelUpgradeConfirm::from(msg.clone()); + let msg_back = MsgChannelUpgradeConfirm::try_from(raw_back.clone()).unwrap(); + assert_eq!(raw, raw_back); + assert_eq!(msg, msg_back); + } +} diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_init.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_init.rs new file mode 100644 index 0000000000..df696905d5 --- /dev/null +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_init.rs @@ -0,0 +1,200 @@ +use crate::core::ics04_channel::upgrade_fields::UpgradeFields; + +use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeInit as RawMsgChannelUpgradeInit; +use ibc_proto::Protobuf; + +use crate::core::ics04_channel::error::Error; +use crate::core::ics24_host::identifier::{ChannelId, PortId}; +use crate::signer::Signer; +use crate::tx_msg::Msg; + +pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelUpgradeInit"; + +/// Message definition for the first step in the channel +/// upgrade handshake (`ChanUpgradeInit` datagram). +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct MsgChannelUpgradeInit { + pub port_id: PortId, + pub channel_id: ChannelId, + pub fields: UpgradeFields, + pub signer: Signer, +} + +impl MsgChannelUpgradeInit { + pub fn new( + port_id: PortId, + channel_id: ChannelId, + fields: UpgradeFields, + signer: Signer, + ) -> Self { + Self { + port_id, + channel_id, + fields, + signer, + } + } +} + +impl Msg for MsgChannelUpgradeInit { + type ValidationError = Error; + type Raw = RawMsgChannelUpgradeInit; + + fn route(&self) -> String { + crate::keys::ROUTER_KEY.to_string() + } + + fn type_url(&self) -> String { + TYPE_URL.to_string() + } +} + +impl Protobuf for MsgChannelUpgradeInit {} + +impl TryFrom for MsgChannelUpgradeInit { + type Error = Error; + + fn try_from(raw_msg: RawMsgChannelUpgradeInit) -> Result { + let raw_fields = raw_msg.fields.ok_or(Error::missing_upgrade_fields())?; + let fields = UpgradeFields::try_from(raw_fields)?; + + Ok(MsgChannelUpgradeInit { + port_id: raw_msg.port_id.parse().map_err(Error::identifier)?, + channel_id: raw_msg.channel_id.parse().map_err(Error::identifier)?, + signer: raw_msg.signer.parse().map_err(Error::signer)?, + fields, + }) + } +} + +impl From for RawMsgChannelUpgradeInit { + fn from(domain_msg: MsgChannelUpgradeInit) -> Self { + Self { + port_id: domain_msg.port_id.to_string(), + channel_id: domain_msg.channel_id.to_string(), + signer: domain_msg.signer.to_string(), + fields: Some(domain_msg.fields.into()), + } + } +} + +#[cfg(test)] +pub mod test_util { + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeInit as RawMsgChannelUpgradeInit; + + use crate::core::ics04_channel::upgrade_fields::test_util::get_dummy_upgrade_fields; + use crate::core::ics24_host::identifier::{ChannelId, PortId}; + use crate::test_utils::get_dummy_bech32_account; + + /// Returns a dummy `RawMsgChannelUpgadeInit`, for testing only! + pub fn get_dummy_raw_msg_chan_upgrade_init() -> RawMsgChannelUpgradeInit { + RawMsgChannelUpgradeInit { + port_id: PortId::default().to_string(), + channel_id: ChannelId::default().to_string(), + signer: get_dummy_bech32_account(), + fields: Some(get_dummy_upgrade_fields()), + } + } +} + +#[cfg(test)] +mod tests { + use test_log::test; + + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeInit as RawMsgChannelUpgradeInit; + + use crate::core::ics04_channel::msgs::chan_upgrade_init::test_util::get_dummy_raw_msg_chan_upgrade_init; + use crate::core::ics04_channel::msgs::chan_upgrade_init::MsgChannelUpgradeInit; + + #[test] + fn parse_channel_upgrade_init_msg() { + struct Test { + name: String, + raw: RawMsgChannelUpgradeInit, + want_pass: bool, + } + + let default_raw_msg = get_dummy_raw_msg_chan_upgrade_init(); + + let tests: Vec = vec![ + Test { + name: "Good parameters".to_string(), + raw: default_raw_msg.clone(), + want_pass: true, + }, + Test { + name: "Correct port ID".to_string(), + raw: RawMsgChannelUpgradeInit { + port_id: "p36".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Port too short".to_string(), + raw: RawMsgChannelUpgradeInit { + port_id: "p".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Port too long".to_string(), + raw: RawMsgChannelUpgradeInit { + port_id: "abcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstuabcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstu".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Correct channel ID".to_string(), + raw: RawMsgChannelUpgradeInit { + channel_id: "channel-2".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Channel name too short".to_string(), + raw: RawMsgChannelUpgradeInit { + channel_id: "c".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Channel name too long".to_string(), + raw: RawMsgChannelUpgradeInit { + channel_id: "channel-128391283791827398127398791283912837918273981273987912839".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + ] + .into_iter() + .collect(); + + for test in tests { + let res = MsgChannelUpgradeInit::try_from(test.raw.clone()); + + assert_eq!( + test.want_pass, + res.is_ok(), + "MsgChannelUpgradeInit::try_from failed for test {}, \nraw msg {:?} with err {:?}", + test.name, + test.raw, + res.err() + ); + } + } + + #[test] + fn to_and_from() { + let raw = get_dummy_raw_msg_chan_upgrade_init(); + let msg = MsgChannelUpgradeInit::try_from(raw.clone()).unwrap(); + let raw_back = RawMsgChannelUpgradeInit::from(msg.clone()); + let msg_back = MsgChannelUpgradeInit::try_from(raw_back.clone()).unwrap(); + assert_eq!(raw, raw_back); + assert_eq!(msg, msg_back); + } +} diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_open.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_open.rs new file mode 100644 index 0000000000..36bac21367 --- /dev/null +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_open.rs @@ -0,0 +1,240 @@ +use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeOpen as RawMsgChannelUpgradeOpen; +use ibc_proto::Protobuf; + +use crate::core::ics04_channel::channel::State; +use crate::core::ics04_channel::error::Error; +use crate::core::ics04_channel::packet::Sequence; +use crate::core::ics23_commitment::commitment::CommitmentProofBytes; +use crate::core::ics24_host::identifier::{ChannelId, PortId}; +use crate::signer::Signer; +use crate::tx_msg::Msg; +use crate::Height; + +pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelUpgradeOpen"; + +/// Message definition for the last step of the channel upgrade +/// handshake (the `ChanUpgradeOpen` datagram). +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct MsgChannelUpgradeOpen { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_channel_state: State, + pub counterparty_upgrade_sequence: Sequence, + /// The proof of the counterparty channel + pub proof_channel: CommitmentProofBytes, + /// The height at which the proofs were queried. + pub proof_height: Height, + pub signer: Signer, +} + +impl MsgChannelUpgradeOpen { + #[allow(clippy::too_many_arguments)] + pub fn new( + port_id: PortId, + channel_id: ChannelId, + counterparty_channel_state: State, + counterparty_upgrade_sequence: Sequence, + proof_channel: CommitmentProofBytes, + proof_height: Height, + signer: Signer, + ) -> Self { + Self { + port_id, + channel_id, + counterparty_channel_state, + counterparty_upgrade_sequence, + proof_channel, + proof_height, + signer, + } + } +} + +impl Msg for MsgChannelUpgradeOpen { + type ValidationError = Error; + type Raw = RawMsgChannelUpgradeOpen; + + fn route(&self) -> String { + crate::keys::ROUTER_KEY.to_string() + } + + fn type_url(&self) -> String { + TYPE_URL.to_string() + } +} + +impl Protobuf for MsgChannelUpgradeOpen {} + +impl TryFrom for MsgChannelUpgradeOpen { + type Error = Error; + + fn try_from(raw_msg: RawMsgChannelUpgradeOpen) -> Result { + let proof_height = raw_msg + .proof_height + .ok_or_else(Error::missing_proof_height)? + .try_into() + .map_err(|_| Error::invalid_proof_height())?; + + Ok(MsgChannelUpgradeOpen { + port_id: raw_msg.port_id.parse().map_err(Error::identifier)?, + channel_id: raw_msg.channel_id.parse().map_err(Error::identifier)?, + counterparty_channel_state: State::from_i32(raw_msg.counterparty_channel_state)?, + counterparty_upgrade_sequence: raw_msg.counterparty_upgrade_sequence.into(), + proof_channel: raw_msg + .proof_channel + .try_into() + .map_err(Error::invalid_proof)?, + proof_height, + signer: raw_msg.signer.parse().map_err(Error::signer)?, + }) + } +} + +impl From for RawMsgChannelUpgradeOpen { + fn from(domain_msg: MsgChannelUpgradeOpen) -> Self { + RawMsgChannelUpgradeOpen { + port_id: domain_msg.port_id.to_string(), + channel_id: domain_msg.channel_id.to_string(), + counterparty_channel_state: domain_msg.counterparty_channel_state.as_i32(), + counterparty_upgrade_sequence: domain_msg.counterparty_upgrade_sequence.into(), + proof_channel: domain_msg.proof_channel.into(), + proof_height: Some(domain_msg.proof_height.into()), + signer: domain_msg.signer.to_string(), + } + } +} + +#[cfg(test)] +pub mod test_util { + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeOpen as RawMsgChannelUpgradeOpen; + use ibc_proto::ibc::core::client::v1::Height as RawHeight; + + use crate::core::ics24_host::identifier::{ChannelId, PortId}; + use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; + + /// Returns a dummy `RawMsgChannelUpgradeOpen`, for testing only! + pub fn get_dummy_raw_msg_chan_upgrade_open() -> RawMsgChannelUpgradeOpen { + RawMsgChannelUpgradeOpen { + port_id: PortId::default().to_string(), + channel_id: ChannelId::default().to_string(), + counterparty_channel_state: 6, // FlushComplete + counterparty_upgrade_sequence: 1, + proof_channel: get_dummy_proof(), + proof_height: Some(RawHeight { + revision_number: 1, + revision_height: 1, + }), + signer: get_dummy_bech32_account(), + } + } +} + +#[cfg(test)] +mod tests { + use test_log::test; + + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeOpen as RawMsgChannelUpgradeOpen; + + use crate::core::ics04_channel::msgs::chan_upgrade_open::test_util::get_dummy_raw_msg_chan_upgrade_open; + use crate::core::ics04_channel::msgs::chan_upgrade_open::MsgChannelUpgradeOpen; + + #[test] + fn parse_channel_upgrade_try_msg() { + struct Test { + name: String, + raw: RawMsgChannelUpgradeOpen, + want_pass: bool, + } + + let default_raw_msg = get_dummy_raw_msg_chan_upgrade_open(); + + let tests: Vec = vec![ + Test { + name: "Good parameters".to_string(), + raw: default_raw_msg.clone(), + want_pass: true, + }, + Test { + name: "Correct port ID".to_string(), + raw: RawMsgChannelUpgradeOpen { + port_id: "p36".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Port too short".to_string(), + raw: RawMsgChannelUpgradeOpen { + port_id: "p".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Port too long".to_string(), + raw: RawMsgChannelUpgradeOpen { + port_id: "abcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstuabcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstu".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Correct channel ID".to_string(), + raw: RawMsgChannelUpgradeOpen { + channel_id: "channel-2".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Channel name too short".to_string(), + raw: RawMsgChannelUpgradeOpen { + channel_id: "c".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Channel name too long".to_string(), + raw: RawMsgChannelUpgradeOpen { + channel_id: "channel-128391283791827398127398791283912837918273981273987912839".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Empty proof channel".to_string(), + raw: RawMsgChannelUpgradeOpen { + proof_channel: vec![], + ..default_raw_msg + }, + want_pass: false, + }, + ] + .into_iter() + .collect(); + + for test in tests { + let res = MsgChannelUpgradeOpen::try_from(test.raw.clone()); + + assert_eq!( + test.want_pass, + res.is_ok(), + "MsgChannelUpgradeOpen::try_from failed for test {}, \nraw msg {:?} with err {:?}", + test.name, + test.raw, + res.err() + ); + } + } + + #[test] + fn to_and_from() { + let raw = get_dummy_raw_msg_chan_upgrade_open(); + let msg = MsgChannelUpgradeOpen::try_from(raw.clone()).unwrap(); + let raw_back = RawMsgChannelUpgradeOpen::from(msg.clone()); + let msg_back = MsgChannelUpgradeOpen::try_from(raw_back.clone()).unwrap(); + assert_eq!(raw, raw_back); + assert_eq!(msg, msg_back); + } +} diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_timeout.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_timeout.rs new file mode 100644 index 0000000000..e6bbe74fd9 --- /dev/null +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_timeout.rs @@ -0,0 +1,258 @@ +use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeTimeout as RawMsgChannelUpgradeTimeout; +use ibc_proto::Protobuf; + +use crate::core::ics04_channel::channel::ChannelEnd; +use crate::core::ics04_channel::error::Error; +use crate::core::ics23_commitment::commitment::CommitmentProofBytes; +use crate::core::ics24_host::identifier::{ChannelId, PortId}; +use crate::signer::Signer; +use crate::tx_msg::Msg; +use crate::Height; + +pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelUpgradeTimeout"; + +/// Message definition the `ChanUpgradeTimeout` datagram. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct MsgChannelUpgradeTimeout { + pub port_id: PortId, + pub channel_id: ChannelId, + pub counterparty_channel: ChannelEnd, + /// The proof of the counterparty channel + pub proof_channel: CommitmentProofBytes, + /// The height at which the proofs were queried. + pub proof_height: Height, + pub signer: Signer, +} + +impl MsgChannelUpgradeTimeout { + #[allow(clippy::too_many_arguments)] + pub fn new( + port_id: PortId, + channel_id: ChannelId, + counterparty_channel: ChannelEnd, + proof_channel: CommitmentProofBytes, + proof_height: Height, + signer: Signer, + ) -> Self { + Self { + port_id, + channel_id, + counterparty_channel, + proof_channel, + proof_height, + signer, + } + } +} + +impl Msg for MsgChannelUpgradeTimeout { + type ValidationError = Error; + type Raw = RawMsgChannelUpgradeTimeout; + + fn route(&self) -> String { + crate::keys::ROUTER_KEY.to_string() + } + + fn type_url(&self) -> String { + TYPE_URL.to_string() + } +} + +impl Protobuf for MsgChannelUpgradeTimeout {} + +impl TryFrom for MsgChannelUpgradeTimeout { + type Error = Error; + + fn try_from(raw_msg: RawMsgChannelUpgradeTimeout) -> Result { + let raw_counterparty_channel = raw_msg + .counterparty_channel + .ok_or(Error::missing_channel())?; + let counterparty_channel = ChannelEnd::try_from(raw_counterparty_channel)?; + + let proof_height = raw_msg + .proof_height + .ok_or_else(Error::missing_proof_height)? + .try_into() + .map_err(|_| Error::invalid_proof_height())?; + + Ok(MsgChannelUpgradeTimeout { + port_id: raw_msg.port_id.parse().map_err(Error::identifier)?, + channel_id: raw_msg.channel_id.parse().map_err(Error::identifier)?, + counterparty_channel, + proof_channel: raw_msg + .proof_channel + .try_into() + .map_err(Error::invalid_proof)?, + proof_height, + signer: raw_msg.signer.parse().map_err(Error::signer)?, + }) + } +} + +impl From for RawMsgChannelUpgradeTimeout { + fn from(domain_msg: MsgChannelUpgradeTimeout) -> Self { + RawMsgChannelUpgradeTimeout { + port_id: domain_msg.port_id.to_string(), + channel_id: domain_msg.channel_id.to_string(), + counterparty_channel: Some(domain_msg.counterparty_channel.into()), + proof_channel: domain_msg.proof_channel.into(), + proof_height: Some(domain_msg.proof_height.into()), + signer: domain_msg.signer.to_string(), + } + } +} + +#[cfg(test)] +pub mod test_util { + use crate::core::ics04_channel::channel::test_util::get_dummy_raw_channel_end; + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeTimeout as RawMsgChannelUpgradeTimeout; + use ibc_proto::ibc::core::client::v1::Height as RawHeight; + + use crate::core::ics24_host::identifier::{ChannelId, PortId}; + use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; + + /// Returns a dummy `RawMsgChannelUpgradeCnacel`, for testing only! + pub fn get_dummy_raw_msg_chan_upgrade_timeout() -> RawMsgChannelUpgradeTimeout { + RawMsgChannelUpgradeTimeout { + port_id: PortId::default().to_string(), + channel_id: ChannelId::default().to_string(), + counterparty_channel: Some(get_dummy_raw_channel_end()), + proof_channel: get_dummy_proof(), + proof_height: Some(RawHeight { + revision_number: 1, + revision_height: 1, + }), + signer: get_dummy_bech32_account(), + } + } +} + +#[cfg(test)] +mod tests { + use test_log::test; + + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeTimeout as RawMsgChannelUpgradeTimeout; + use ibc_proto::ibc::core::client::v1::Height; + + use crate::core::ics04_channel::msgs::chan_upgrade_timeout::test_util::get_dummy_raw_msg_chan_upgrade_timeout; + use crate::core::ics04_channel::msgs::chan_upgrade_timeout::MsgChannelUpgradeTimeout; + + #[test] + fn parse_channel_upgrade_try_msg() { + struct Test { + name: String, + raw: RawMsgChannelUpgradeTimeout, + want_pass: bool, + } + + let default_raw_msg = get_dummy_raw_msg_chan_upgrade_timeout(); + + let tests: Vec = vec![ + Test { + name: "Good parameters".to_string(), + raw: default_raw_msg.clone(), + want_pass: true, + }, + Test { + name: "Correct port ID".to_string(), + raw: RawMsgChannelUpgradeTimeout { + port_id: "p36".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Port too short".to_string(), + raw: RawMsgChannelUpgradeTimeout { + port_id: "p".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Port too long".to_string(), + raw: RawMsgChannelUpgradeTimeout { + port_id: "abcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstuabcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstu".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Correct channel ID".to_string(), + raw: RawMsgChannelUpgradeTimeout { + channel_id: "channel-2".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Channel name too short".to_string(), + raw: RawMsgChannelUpgradeTimeout { + channel_id: "c".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Channel name too long".to_string(), + raw: RawMsgChannelUpgradeTimeout { + channel_id: "channel-128391283791827398127398791283912837918273981273987912839".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Empty proof channel".to_string(), + raw: RawMsgChannelUpgradeTimeout { + proof_channel: vec![], + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Bad proof height, height = 0".to_string(), + raw: RawMsgChannelUpgradeTimeout { + proof_height: Some(Height { + revision_number: 0, + revision_height: 0, + }), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Missing proof height".to_string(), + raw: RawMsgChannelUpgradeTimeout { + proof_height: None, + ..default_raw_msg.clone() + }, + want_pass: false, + }, + ] + .into_iter() + .collect(); + + for test in tests { + let res = MsgChannelUpgradeTimeout::try_from(test.raw.clone()); + + assert_eq!( + test.want_pass, + res.is_ok(), + "RawMsgChannelUpgradeTimeout::try_from failed for test {}, \nraw msg {:?} with err {:?}", + test.name, + test.raw, + res.err() + ); + } + } + + #[test] + fn to_and_from() { + let raw = get_dummy_raw_msg_chan_upgrade_timeout(); + let msg = MsgChannelUpgradeTimeout::try_from(raw.clone()).unwrap(); + let raw_back = RawMsgChannelUpgradeTimeout::from(msg.clone()); + let msg_back = MsgChannelUpgradeTimeout::try_from(raw_back.clone()).unwrap(); + assert_eq!(raw, raw_back); + assert_eq!(msg, msg_back); + } +} diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_try.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_try.rs new file mode 100644 index 0000000000..fa4c2333f9 --- /dev/null +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_upgrade_try.rs @@ -0,0 +1,276 @@ +use crate::core::ics04_channel::packet::Sequence; +use crate::core::ics04_channel::upgrade_fields::UpgradeFields; +use crate::Height; + +use ibc_proto::Protobuf; + +use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeTry as RawMsgChannelUpgradeTry; + +use crate::core::ics04_channel::error::Error; +use crate::core::ics23_commitment::commitment::CommitmentProofBytes; +use crate::core::ics24_host::identifier::{ChannelId, ConnectionId, PortId}; +use crate::signer::Signer; +use crate::tx_msg::Msg; + +pub const TYPE_URL: &str = "/ibc.core.channel.v1.MsgChannelUpgradeTry"; + +/// Message definition for the second step of the channel upgrade +/// handshake (the `ChanUpgradeTry` datagram). +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct MsgChannelUpgradeTry { + pub port_id: PortId, + pub channel_id: ChannelId, + pub proposed_upgrade_connection_hops: Vec, + pub counterparty_upgrade_fields: UpgradeFields, + pub counterparty_upgrade_sequence: Sequence, + /// The proof of the counterparty channel + pub proof_channel: CommitmentProofBytes, + /// The proof of the counterparty upgrade + pub proof_upgrade: CommitmentProofBytes, + /// The height at which the proofs were queried. + pub proof_height: Height, + pub signer: Signer, +} + +impl MsgChannelUpgradeTry { + #[allow(clippy::too_many_arguments)] + pub fn new( + port_id: PortId, + channel_id: ChannelId, + proposed_upgrade_connection_hops: Vec, + counterparty_upgrade_fields: UpgradeFields, + counterparty_upgrade_sequence: Sequence, + proof_channel: CommitmentProofBytes, + proof_upgrade: CommitmentProofBytes, + proof_height: Height, + signer: Signer, + ) -> Self { + Self { + port_id, + channel_id, + proposed_upgrade_connection_hops, + counterparty_upgrade_fields, + counterparty_upgrade_sequence, + proof_channel, + proof_upgrade, + proof_height, + signer, + } + } +} + +impl Msg for MsgChannelUpgradeTry { + type ValidationError = Error; + type Raw = RawMsgChannelUpgradeTry; + + fn route(&self) -> String { + crate::keys::ROUTER_KEY.to_string() + } + + fn type_url(&self) -> String { + TYPE_URL.to_string() + } +} + +impl Protobuf for MsgChannelUpgradeTry {} + +impl TryFrom for MsgChannelUpgradeTry { + type Error = Error; + + fn try_from(raw_msg: RawMsgChannelUpgradeTry) -> Result { + let proposed_upgrade_connection_hops: Result, Error> = raw_msg + .proposed_upgrade_connection_hops + .iter() + .map(|hop| hop.parse().map_err(Error::identifier)) + .collect(); + let counterparty_upgrade_fields = raw_msg + .counterparty_upgrade_fields + .ok_or(Error::missing_upgrade_fields())? + .try_into()?; + let counterparty_upgrade_sequence = raw_msg.counterparty_upgrade_sequence.into(); + + let proof_height = raw_msg + .proof_height + .ok_or_else(Error::missing_proof_height)? + .try_into() + .map_err(|_| Error::invalid_proof_height())?; + + Ok(MsgChannelUpgradeTry { + port_id: raw_msg.port_id.parse().map_err(Error::identifier)?, + channel_id: raw_msg.channel_id.parse().map_err(Error::identifier)?, + proposed_upgrade_connection_hops: proposed_upgrade_connection_hops?, + counterparty_upgrade_fields, + counterparty_upgrade_sequence, + proof_channel: raw_msg + .proof_channel + .try_into() + .map_err(Error::invalid_proof)?, + proof_upgrade: raw_msg + .proof_upgrade + .try_into() + .map_err(Error::invalid_proof)?, + proof_height, + signer: raw_msg.signer.parse().map_err(Error::signer)?, + }) + } +} + +impl From for RawMsgChannelUpgradeTry { + fn from(domain_msg: MsgChannelUpgradeTry) -> Self { + let proposed_upgrade_connection_hops = domain_msg + .proposed_upgrade_connection_hops + .into_iter() + .map(|hop| hop.to_string()) + .collect(); + + RawMsgChannelUpgradeTry { + port_id: domain_msg.port_id.to_string(), + channel_id: domain_msg.channel_id.to_string(), + proposed_upgrade_connection_hops, + counterparty_upgrade_fields: Some(domain_msg.counterparty_upgrade_fields.into()), + counterparty_upgrade_sequence: domain_msg.counterparty_upgrade_sequence.into(), + proof_upgrade: domain_msg.proof_upgrade.into(), + proof_channel: domain_msg.proof_channel.into(), + proof_height: Some(domain_msg.proof_height.into()), + signer: domain_msg.signer.to_string(), + } + } +} + +#[cfg(test)] +pub mod test_util { + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeTry as RawMsgChannelUpgradeTry; + use ibc_proto::ibc::core::client::v1::Height as RawHeight; + + use crate::core::ics04_channel::upgrade_fields::test_util::get_dummy_upgrade_fields; + use crate::core::ics24_host::identifier::{ChannelId, PortId}; + use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; + + /// Returns a dummy `RawMsgChannelUpgradeTry`, for testing only! + pub fn get_dummy_raw_msg_chan_upgrade_try() -> RawMsgChannelUpgradeTry { + RawMsgChannelUpgradeTry { + port_id: PortId::default().to_string(), + channel_id: ChannelId::default().to_string(), + proposed_upgrade_connection_hops: vec![], + counterparty_upgrade_fields: Some(get_dummy_upgrade_fields()), + counterparty_upgrade_sequence: 1, + proof_upgrade: get_dummy_proof(), + proof_channel: get_dummy_proof(), + proof_height: Some(RawHeight { + revision_number: 1, + revision_height: 1, + }), + signer: get_dummy_bech32_account(), + } + } +} + +#[cfg(test)] +mod tests { + use test_log::test; + + use ibc_proto::ibc::core::channel::v1::MsgChannelUpgradeTry as RawMsgChannelUpgradeTry; + + use crate::core::ics04_channel::msgs::chan_upgrade_try::test_util::get_dummy_raw_msg_chan_upgrade_try; + use crate::core::ics04_channel::msgs::chan_upgrade_try::MsgChannelUpgradeTry; + + #[test] + fn parse_channel_upgrade_try_msg() { + struct Test { + name: String, + raw: RawMsgChannelUpgradeTry, + want_pass: bool, + } + + let default_raw_msg = get_dummy_raw_msg_chan_upgrade_try(); + + let tests: Vec = vec![ + Test { + name: "Good parameters".to_string(), + raw: default_raw_msg.clone(), + want_pass: true, + }, + Test { + name: "Correct port ID".to_string(), + raw: RawMsgChannelUpgradeTry { + port_id: "p36".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Port too short".to_string(), + raw: RawMsgChannelUpgradeTry { + port_id: "p".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Port too long".to_string(), + raw: RawMsgChannelUpgradeTry { + port_id: "abcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstuabcdefsdfasdfasdfasdfasdfasdfadsfasdgafsgadfasdfasdfasdfsdfasdfaghijklmnopqrstu".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Correct channel ID".to_string(), + raw: RawMsgChannelUpgradeTry { + channel_id: "channel-2".to_string(), + ..default_raw_msg.clone() + }, + want_pass: true, + }, + Test { + name: "Channel name too short".to_string(), + raw: RawMsgChannelUpgradeTry { + channel_id: "c".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Channel name too long".to_string(), + raw: RawMsgChannelUpgradeTry { + channel_id: "channel-128391283791827398127398791283912837918273981273987912839".to_string(), + ..default_raw_msg.clone() + }, + want_pass: false, + }, + Test { + name: "Empty proof channel".to_string(), + raw: RawMsgChannelUpgradeTry { + proof_channel: vec![], + ..default_raw_msg + }, + want_pass: false, + }, + ] + .into_iter() + .collect(); + + for test in tests { + let res = MsgChannelUpgradeTry::try_from(test.raw.clone()); + + assert_eq!( + test.want_pass, + res.is_ok(), + "MsgChannelUpgradeTry::try_from failed for test {}, \nraw msg {:?} with err {:?}", + test.name, + test.raw, + res.err() + ); + } + } + + #[test] + fn to_and_from() { + let raw = get_dummy_raw_msg_chan_upgrade_try(); + let msg = MsgChannelUpgradeTry::try_from(raw.clone()).unwrap(); + let raw_back = RawMsgChannelUpgradeTry::from(msg.clone()); + let msg_back = MsgChannelUpgradeTry::try_from(raw_back.clone()).unwrap(); + assert_eq!(raw, raw_back); + assert_eq!(msg, msg_back); + } +} diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs b/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs index 57e1cdacae..17a47fe2a0 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs @@ -18,7 +18,7 @@ pub struct MsgTimeoutOnClose { pub next_sequence_recv: Sequence, pub proofs: Proofs, pub signer: Signer, - pub counterparty_upgrade_sequence: u64, + pub counterparty_upgrade_sequence: Sequence, } impl MsgTimeoutOnClose { @@ -27,13 +27,14 @@ impl MsgTimeoutOnClose { next_sequence_recv: Sequence, proofs: Proofs, signer: Signer, + counterparty_upgrade_sequence: Sequence, ) -> MsgTimeoutOnClose { Self { packet, next_sequence_recv, proofs, signer, - counterparty_upgrade_sequence: 0, + counterparty_upgrade_sequence, } } } @@ -88,7 +89,7 @@ impl TryFrom for MsgTimeoutOnClose { next_sequence_recv: Sequence::from(raw_msg.next_sequence_recv), signer: raw_msg.signer.parse().map_err(Error::signer)?, proofs, - counterparty_upgrade_sequence: raw_msg.counterparty_upgrade_sequence, + counterparty_upgrade_sequence: raw_msg.counterparty_upgrade_sequence.into(), }) } } @@ -105,7 +106,7 @@ impl From for RawMsgTimeoutOnClose { proof_height: Some(domain_msg.proofs.height().into()), next_sequence_recv: domain_msg.next_sequence_recv.into(), signer: domain_msg.signer.to_string(), - counterparty_upgrade_sequence: domain_msg.counterparty_upgrade_sequence, + counterparty_upgrade_sequence: domain_msg.counterparty_upgrade_sequence.into(), } } } diff --git a/crates/relayer-types/src/core/ics04_channel/timeout.rs b/crates/relayer-types/src/core/ics04_channel/timeout.rs index aa33ec23b1..cee5f40601 100644 --- a/crates/relayer-types/src/core/ics04_channel/timeout.rs +++ b/crates/relayer-types/src/core/ics04_channel/timeout.rs @@ -1,10 +1,16 @@ -use std::fmt::{Display, Error as FmtError, Formatter}; +use core::fmt::{Display, Error as FmtError, Formatter}; +use std::str::FromStr; +use flex_error::{define_error, TraceError}; use serde::{Deserialize, Serialize}; +use ibc_proto::ibc::core::channel::v1::Timeout as RawTimeout; use ibc_proto::ibc::core::client::v1::Height as RawHeight; +use ibc_proto::Protobuf; use crate::core::ics02_client::{error::Error as ICS2Error, height::Height}; +use crate::core::ics04_channel::error::Error as ChannelError; +use crate::timestamp::{ParseTimestampError, Timestamp}; /// Indicates a consensus height on the destination chain after which the packet /// will no longer be processed, and will instead count as having timed-out. @@ -180,3 +186,146 @@ impl<'de> Deserialize<'de> for TimeoutHeight { }) } } + +/// A composite of timeout height and timeout timestamp types, useful for when +/// performing a channel upgrade handshake, as there are cases when only timeout +/// height is set, only timeout timestamp is set, or both are set. +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub enum Timeout { + /// Timeout height indicates the height at which the counterparty + /// must no longer proceed with the upgrade handshake. + /// The chains will then preserve their original channel and the upgrade handshake is aborted + Height(Height), + + /// Timeout timestamp indicates the time on the counterparty at which + /// the counterparty must no longer proceed with the upgrade handshake. + /// The chains will then preserve their original channel and the upgrade handshake is aborted. + Timestamp(Timestamp), + + /// Both timeouts are set. + Both(Height, Timestamp), +} + +impl Display for Timeout { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + match self { + Self::Height(height) => write!(f, "{height}"), + Self::Timestamp(timestamp) => write!(f, "{timestamp}"), + Self::Both(height, timestamp) => write!(f, "{height}, {timestamp}"), + } + } +} + +impl Timeout { + pub fn new(height: Option, timestamp: Option) -> Result { + match (height, timestamp) { + (Some(height), None) => Ok(Timeout::Height(height)), + (None, Some(timestamp)) => Ok(Timeout::Timestamp(timestamp)), + (Some(height), Some(timestamp)) => Ok(Timeout::Both(height, timestamp)), + (None, None) => Err(ChannelError::missing_upgrade_timeout()), + } + } + + pub fn into_tuple(self) -> (Option, Option) { + match self { + Timeout::Height(height) => (Some(height), None), + Timeout::Timestamp(timestamp) => (None, Some(timestamp)), + Timeout::Both(height, timestamp) => (Some(height), Some(timestamp)), + } + } +} + +define_error! { + #[derive(Debug, PartialEq, Eq)] + TimeoutError { + InvalidTimestamp + { timestamp: String } + [ TraceError ] + |e| { format_args!("cannot convert into a `Timestamp` type from string {0}", e.timestamp) }, + + InvalidTimeout + { timeout: String } + |e| { format_args!("invalid timeout {0}", e.timeout) }, + } +} + +impl FromStr for Timeout { + type Err = TimeoutError; + + fn from_str(value: &str) -> Result { + let split: Vec<&str> = value.split(' ').collect(); + + if split.len() != 2 { + return Err(TimeoutError::invalid_timeout(value.to_owned())); + } + + // only timeout timestamp are supported at the moment + split[1] + .parse::() + .map(Timeout::Timestamp) + .map_err(|e| TimeoutError::invalid_timestamp(value.to_owned(), e)) + } +} + +impl Protobuf for Timeout {} + +impl TryFrom for Timeout { + type Error = ChannelError; + + fn try_from(value: RawTimeout) -> Result { + let raw_timeout_height = value.height.map(Height::try_from).transpose(); + + let raw_timeout_timestamp = Timestamp::from_nanoseconds(value.timestamp) + .map_err(|_| Self::Error::invalid_timeout_timestamp) + .ok() + .filter(|ts| ts.nanoseconds() > 0); + + let (timeout_height, timeout_timestamp) = match (raw_timeout_height, raw_timeout_timestamp) + { + (Ok(timeout_height), Some(timeout_timestamp)) => { + (timeout_height, Some(timeout_timestamp)) + } + (Ok(timeout_height), None) => (timeout_height, None), + (Err(_), Some(timeout_timestamp)) => (None, Some(timeout_timestamp)), + (Err(e), None) => { + return Err(e).map_err(|_| Self::Error::invalid_timeout_height()); + } + }; + + Self::new(timeout_height, timeout_timestamp) + } +} + +impl From for RawTimeout { + fn from(value: Timeout) -> Self { + match value { + Timeout::Height(height) => Self { + height: Some(RawHeight::from(height)), + timestamp: 0, + }, + Timeout::Timestamp(timestamp) => Self { + height: None, + timestamp: timestamp.nanoseconds(), + }, + Timeout::Both(height, timestamp) => Self { + height: Some(RawHeight::from(height)), + timestamp: timestamp.nanoseconds(), + }, + } + } +} + +#[cfg(test)] +pub mod test_util { + use ibc_proto::ibc::core::channel::v1::Timeout as RawTimeout; + use ibc_proto::ibc::core::client::v1::Height as RawHeight; + + use crate::core::ics02_client::height::Height; + + pub fn get_dummy_upgrade_timeout() -> RawTimeout { + RawTimeout { + height: Some(RawHeight::from(Height::new(1, 50).unwrap())), + timestamp: 0, + } + } +} diff --git a/crates/relayer-types/src/core/ics04_channel/upgrade.rs b/crates/relayer-types/src/core/ics04_channel/upgrade.rs new file mode 100644 index 0000000000..a909859cf5 --- /dev/null +++ b/crates/relayer-types/src/core/ics04_channel/upgrade.rs @@ -0,0 +1,96 @@ +use ibc_proto::ibc::core::channel::v1::ErrorReceipt as RawErrorReceipt; +use ibc_proto::ibc::core::channel::v1::Upgrade as RawUpgrade; +use ibc_proto::Protobuf; + +use crate::core::ics04_channel::error::Error as ChannelError; +use crate::core::ics04_channel::packet::Sequence; +use crate::core::ics04_channel::timeout::Timeout; +use crate::core::ics04_channel::upgrade_fields::UpgradeFields; + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Upgrade { + pub fields: UpgradeFields, + // timeout can be zero, see `TryFrom` implementation + pub timeout: Option, + pub next_sequence_send: Sequence, +} + +impl Protobuf for Upgrade {} + +impl TryFrom for Upgrade { + type Error = ChannelError; + + fn try_from(value: RawUpgrade) -> Result { + let fields = value + .fields + .ok_or(ChannelError::missing_upgrade_fields())? + .try_into()?; + let timeout = value + .timeout + .filter(|tm| Timeout::try_from(tm.clone()).is_ok()) + .map(|tm| Timeout::try_from(tm).unwrap()); + let next_sequence_send = value.next_sequence_send.into(); + + Ok(Self { + fields, + timeout, + next_sequence_send, + }) + } +} + +impl From for RawUpgrade { + fn from(value: Upgrade) -> Self { + let timeout = value.timeout.map(|tm| tm.into()); + Self { + fields: Some(value.fields.into()), + timeout, + next_sequence_send: value.next_sequence_send.into(), + } + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct ErrorReceipt { + pub sequence: Sequence, + pub message: String, +} + +impl Protobuf for ErrorReceipt {} + +impl TryFrom for ErrorReceipt { + type Error = ChannelError; + + fn try_from(value: RawErrorReceipt) -> Result { + Ok(Self { + sequence: value.sequence.into(), + message: value.message, + }) + } +} + +impl From for RawErrorReceipt { + fn from(value: ErrorReceipt) -> Self { + Self { + sequence: value.sequence.into(), + message: value.message, + } + } +} + +#[cfg(test)] +pub mod test_util { + use crate::core::ics04_channel::{ + timeout::test_util::get_dummy_upgrade_timeout, + upgrade_fields::test_util::get_dummy_upgrade_fields, + }; + use ibc_proto::ibc::core::channel::v1::Upgrade as RawUpgrade; + + pub fn get_dummy_upgrade() -> RawUpgrade { + RawUpgrade { + fields: Some(get_dummy_upgrade_fields()), + timeout: Some(get_dummy_upgrade_timeout()), + next_sequence_send: 1, + } + } +} diff --git a/crates/relayer-types/src/core/ics04_channel/upgrade_fields.rs b/crates/relayer-types/src/core/ics04_channel/upgrade_fields.rs new file mode 100644 index 0000000000..9d90ed41c1 --- /dev/null +++ b/crates/relayer-types/src/core/ics04_channel/upgrade_fields.rs @@ -0,0 +1,88 @@ +use core::str::FromStr; + +use ibc_proto::ibc::core::channel::v1::UpgradeFields as RawUpgradeFields; +use ibc_proto::Protobuf; +use itertools::Itertools; + +use crate::core::ics04_channel::channel::Ordering; +use crate::core::ics04_channel::error::Error as ChannelError; +use crate::core::ics04_channel::version::Version; +use crate::core::ics24_host::identifier::ConnectionId; + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct UpgradeFields { + ordering: Ordering, + connection_hops: Vec, + version: Version, +} + +impl UpgradeFields { + pub fn new(ordering: Ordering, connection_hops: Vec, version: Version) -> Self { + Self { + ordering, + connection_hops, + version, + } + } +} + +impl Protobuf for UpgradeFields {} + +impl TryFrom for UpgradeFields { + type Error = ChannelError; + + fn try_from(value: RawUpgradeFields) -> Result { + use itertools::Either; + + let ordering = Ordering::from_i32(value.ordering)?; + + let (connection_hops, failures): (Vec<_>, Vec<_>) = value + .connection_hops + .iter() + .partition_map(|id| match ConnectionId::from_str(id) { + Ok(connection_id) => Either::Left(connection_id), + Err(e) => Either::Right((id.clone(), e)), + }); + + if !failures.is_empty() { + return Err(Self::Error::parse_connection_hops_vector(failures)); + } + + let version = Version::from(value.version); + + Ok(Self::new(ordering, connection_hops, version)) + } +} + +impl From for RawUpgradeFields { + fn from(value: UpgradeFields) -> Self { + let raw_connection_hops = value + .connection_hops + .iter() + .map(|id| id.to_string()) + .collect(); + Self { + ordering: value.ordering as i32, + connection_hops: raw_connection_hops, + version: value.version.to_string(), + } + } +} + +#[cfg(test)] +pub mod test_util { + use std::string::ToString; + use std::vec; + + use ibc_proto::ibc::core::channel::v1::UpgradeFields as RawUpgradeFields; + + use crate::core::ics04_channel::version::Version; + + pub fn get_dummy_upgrade_fields() -> RawUpgradeFields { + RawUpgradeFields { + ordering: 1, + connection_hops: vec![], + version: Version::ics20_with_fee().to_string(), + } + } +} diff --git a/crates/relayer-types/src/core/ics04_channel/version.rs b/crates/relayer-types/src/core/ics04_channel/version.rs index 4d15ae3d4b..151b97f746 100644 --- a/crates/relayer-types/src/core/ics04_channel/version.rs +++ b/crates/relayer-types/src/core/ics04_channel/version.rs @@ -15,7 +15,7 @@ use crate::applications::transfer; /// This field is opaque to the core IBC protocol. /// No explicit validation is necessary, and the /// spec (v1) currently allows empty strings. -#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] +#[derive(Clone, Debug, Eq, Deserialize, Serialize)] pub struct Version(pub String); impl Version { @@ -36,6 +36,15 @@ impl Version { Self::new(val.to_string()) } + pub fn app_version_with_fee(app_version: &str) -> Self { + let val = json::json!({ + "fee_version": "ics29-1", + "app_version": app_version, + }); + + Self::new(val.to_string()) + } + pub fn empty() -> Self { Self::new("".to_string()) } @@ -54,6 +63,28 @@ impl Version { } } +impl PartialEq for Version { + fn eq(&self, other: &Self) -> bool { + if self.0 != other.0 { + // If the Version strings don't match, check that this isn't due to the json + // fields being in a different order + let parsed_version = match serde_json::from_str::(&self.0) { + Ok(value) => value, + Err(_) => return false, + }; + let parsed_other = match serde_json::from_str::(&other.to_string()) { + Ok(value) => value, + Err(_) => return false, + }; + + if parsed_version != parsed_other { + return false; + } + } + true + } +} + impl From for Version { fn from(s: String) -> Self { Self::new(s) diff --git a/crates/relayer-types/src/core/ics24_host/error.rs b/crates/relayer-types/src/core/ics24_host/error.rs index 11e6983fe6..331d578a69 100644 --- a/crates/relayer-types/src/core/ics24_host/error.rs +++ b/crates/relayer-types/src/core/ics24_host/error.rs @@ -15,11 +15,20 @@ define_error! { min: usize, max: usize, } - | e | { format_args!("identifier {0} has invalid length {1} must be between {2}-{3} characters", e.id, e.length, e.min, e.max) }, + | e | { + format_args!( + "identifier {0} has invalid length {1} must be between {2}-{3} characters", + e.id, e.length, e.min, e.max + ) + }, InvalidCharacter { id: String } - | e | { format_args!("identifier {0} must only contain alphanumeric characters or `.`, `_`, `+`, `-`, `#`, - `[`, `]`, `<`, `>`", e.id) }, + | e | { + format_args!( + "identifier {0} must only contain alphanumeric characters or `.`, `_`, `+`, `-`, `#`, - `[`, `]`, `<`, `>`", e.id + ) + }, Empty | _ | { "identifier cannot be empty" }, @@ -29,6 +38,14 @@ define_error! { | e | { format_args!("chain identifiers are expected to be in epoch format {0}", e.id) }, InvalidCounterpartyChannelId - |_| { "Invalid channel id in counterparty" } + |_| { "invalid channel id in counterparty" } } } + +impl PartialEq for ValidationError { + fn eq(&self, other: &Self) -> bool { + self.0 == other.0 + } +} + +impl Eq for ValidationError {} diff --git a/crates/relayer-types/src/core/ics24_host/path.rs b/crates/relayer-types/src/core/ics24_host/path.rs index 321549795f..6642cbeebb 100644 --- a/crates/relayer-types/src/core/ics24_host/path.rs +++ b/crates/relayer-types/src/core/ics24_host/path.rs @@ -42,6 +42,22 @@ pub enum Path { Acks(AcksPath), Receipts(ReceiptsPath), Upgrade(ClientUpgradePath), + ChannelUpgrade(ChannelUpgradePath), + ChannelUpgradeError(ChannelUpgradeErrorPath), +} + +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Display)] +#[display(fmt = "channelUpgrades/upgradeError/ports/{port_id}/channels/{channel_id}")] +pub struct ChannelUpgradeErrorPath { + pub port_id: PortId, + pub channel_id: ChannelId, +} + +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Display)] +#[display(fmt = "channelUpgrades/upgrades/ports/{port_id}/channels/{channel_id}")] +pub struct ChannelUpgradePath { + pub port_id: PortId, + pub channel_id: ChannelId, } #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Display)] diff --git a/crates/relayer-types/src/events.rs b/crates/relayer-types/src/events.rs index c5de3355c7..7ceb45d5c2 100644 --- a/crates/relayer-types/src/events.rs +++ b/crates/relayer-types/src/events.rs @@ -17,8 +17,8 @@ use crate::core::ics03_connection::error as connection_error; use crate::core::ics03_connection::events as ConnectionEvents; use crate::core::ics03_connection::events::Attributes as ConnectionAttributes; use crate::core::ics04_channel::error as channel_error; -use crate::core::ics04_channel::events as ChannelEvents; use crate::core::ics04_channel::events::Attributes as ChannelAttributes; +use crate::core::ics04_channel::events::{self as ChannelEvents, UpgradeAttributes}; use crate::core::ics04_channel::packet::Packet; use crate::core::ics24_host::error::ValidationError; use crate::timestamp::ParseTimestampError; @@ -132,6 +132,15 @@ const CHANNEL_OPEN_ACK_EVENT: &str = "channel_open_ack"; const CHANNEL_OPEN_CONFIRM_EVENT: &str = "channel_open_confirm"; const CHANNEL_CLOSE_INIT_EVENT: &str = "channel_close_init"; const CHANNEL_CLOSE_CONFIRM_EVENT: &str = "channel_close_confirm"; +/// Channel upgrade event types +const CHANNEL_UPGRADE_INIT_EVENT: &str = "channel_upgrade_init"; +const CHANNEL_UPGRADE_TRY_EVENT: &str = "channel_upgrade_try"; +const CHANNEL_UPGRADE_ACK_EVENT: &str = "channel_upgrade_ack"; +const CHANNEL_UPGRADE_CONFIRM_EVENT: &str = "channel_upgrade_confirm"; +const CHANNEL_UPGRADE_OPEN_EVENT: &str = "channel_upgrade_open"; +const CHANNEL_UPGRADE_CANCEL_EVENT: &str = "channel_upgrade_cancelled"; +const CHANNEL_UPGRADE_TIMEOUT_EVENT: &str = "channel_upgrade_timeout"; +const CHANNEL_UPGRADE_ERROR_EVENT: &str = "channel_upgrade_error"; /// Packet event types const SEND_PACKET_EVENT: &str = "send_packet"; const RECEIVE_PACKET_EVENT: &str = "receive_packet"; @@ -163,6 +172,14 @@ pub enum IbcEventType { OpenConfirmChannel, CloseInitChannel, CloseConfirmChannel, + UpgradeInitChannel, + UpgradeTryChannel, + UpgradeAckChannel, + UpgradeConfirmChannel, + UpgradeOpenChannel, + UpgradeCancelChannel, + UpgradeTimeoutChannel, + UpgradeErrorChannel, SendPacket, ReceivePacket, WriteAck, @@ -195,6 +212,14 @@ impl IbcEventType { IbcEventType::OpenConfirmChannel => CHANNEL_OPEN_CONFIRM_EVENT, IbcEventType::CloseInitChannel => CHANNEL_CLOSE_INIT_EVENT, IbcEventType::CloseConfirmChannel => CHANNEL_CLOSE_CONFIRM_EVENT, + IbcEventType::UpgradeInitChannel => CHANNEL_UPGRADE_INIT_EVENT, + IbcEventType::UpgradeTryChannel => CHANNEL_UPGRADE_TRY_EVENT, + IbcEventType::UpgradeAckChannel => CHANNEL_UPGRADE_ACK_EVENT, + IbcEventType::UpgradeConfirmChannel => CHANNEL_UPGRADE_CONFIRM_EVENT, + IbcEventType::UpgradeOpenChannel => CHANNEL_UPGRADE_OPEN_EVENT, + IbcEventType::UpgradeCancelChannel => CHANNEL_UPGRADE_CANCEL_EVENT, + IbcEventType::UpgradeTimeoutChannel => CHANNEL_UPGRADE_TIMEOUT_EVENT, + IbcEventType::UpgradeErrorChannel => CHANNEL_UPGRADE_ERROR_EVENT, IbcEventType::SendPacket => SEND_PACKET_EVENT, IbcEventType::ReceivePacket => RECEIVE_PACKET_EVENT, IbcEventType::WriteAck => WRITE_ACK_EVENT, @@ -231,6 +256,14 @@ impl FromStr for IbcEventType { CHANNEL_OPEN_CONFIRM_EVENT => Ok(IbcEventType::OpenConfirmChannel), CHANNEL_CLOSE_INIT_EVENT => Ok(IbcEventType::CloseInitChannel), CHANNEL_CLOSE_CONFIRM_EVENT => Ok(IbcEventType::CloseConfirmChannel), + CHANNEL_UPGRADE_INIT_EVENT => Ok(IbcEventType::UpgradeInitChannel), + CHANNEL_UPGRADE_TRY_EVENT => Ok(IbcEventType::UpgradeTryChannel), + CHANNEL_UPGRADE_ACK_EVENT => Ok(IbcEventType::UpgradeAckChannel), + CHANNEL_UPGRADE_CONFIRM_EVENT => Ok(IbcEventType::UpgradeConfirmChannel), + CHANNEL_UPGRADE_OPEN_EVENT => Ok(IbcEventType::UpgradeOpenChannel), + CHANNEL_UPGRADE_CANCEL_EVENT => Ok(IbcEventType::UpgradeCancelChannel), + CHANNEL_UPGRADE_TIMEOUT_EVENT => Ok(IbcEventType::UpgradeTimeoutChannel), + CHANNEL_UPGRADE_ERROR_EVENT => Ok(IbcEventType::UpgradeErrorChannel), SEND_PACKET_EVENT => Ok(IbcEventType::SendPacket), RECEIVE_PACKET_EVENT => Ok(IbcEventType::ReceivePacket), WRITE_ACK_EVENT => Ok(IbcEventType::WriteAck), @@ -269,6 +302,14 @@ pub enum IbcEvent { OpenConfirmChannel(ChannelEvents::OpenConfirm), CloseInitChannel(ChannelEvents::CloseInit), CloseConfirmChannel(ChannelEvents::CloseConfirm), + UpgradeInitChannel(ChannelEvents::UpgradeInit), + UpgradeTryChannel(ChannelEvents::UpgradeTry), + UpgradeAckChannel(ChannelEvents::UpgradeAck), + UpgradeConfirmChannel(ChannelEvents::UpgradeConfirm), + UpgradeOpenChannel(ChannelEvents::UpgradeOpen), + UpgradeCancelChannel(ChannelEvents::UpgradeCancel), + UpgradeTimeoutChannel(ChannelEvents::UpgradeTimeout), + UpgradeErrorChannel(ChannelEvents::UpgradeError), SendPacket(ChannelEvents::SendPacket), ReceivePacket(ChannelEvents::ReceivePacket), @@ -308,6 +349,14 @@ impl Display for IbcEvent { IbcEvent::OpenConfirmChannel(ev) => write!(f, "OpenConfirmChannel({ev})"), IbcEvent::CloseInitChannel(ev) => write!(f, "CloseInitChannel({ev})"), IbcEvent::CloseConfirmChannel(ev) => write!(f, "CloseConfirmChannel({ev})"), + IbcEvent::UpgradeInitChannel(ev) => write!(f, "UpgradeInitChannel({ev})"), + IbcEvent::UpgradeTryChannel(ev) => write!(f, "UpgradeTryChannel({ev})"), + IbcEvent::UpgradeAckChannel(ev) => write!(f, "UpgradeAckChannel({ev})"), + IbcEvent::UpgradeConfirmChannel(ev) => write!(f, "UpgradeConfirmChannel({ev})"), + IbcEvent::UpgradeOpenChannel(ev) => write!(f, "UpgradeOpenChannel({ev})"), + IbcEvent::UpgradeCancelChannel(ev) => write!(f, "UpgradeCancelChannel({ev})"), + IbcEvent::UpgradeTimeoutChannel(ev) => write!(f, "UpgradeTimeoutChannel({ev})"), + IbcEvent::UpgradeErrorChannel(ev) => write!(f, "UpgradeErrorChannel({ev})"), IbcEvent::SendPacket(ev) => write!(f, "SendPacket({ev})"), IbcEvent::ReceivePacket(ev) => write!(f, "ReceivePacket({ev})"), @@ -353,6 +402,14 @@ impl IbcEvent { IbcEvent::OpenConfirmChannel(_) => IbcEventType::OpenConfirmChannel, IbcEvent::CloseInitChannel(_) => IbcEventType::CloseInitChannel, IbcEvent::CloseConfirmChannel(_) => IbcEventType::CloseConfirmChannel, + IbcEvent::UpgradeInitChannel(_) => IbcEventType::UpgradeInitChannel, + IbcEvent::UpgradeTryChannel(_) => IbcEventType::UpgradeTryChannel, + IbcEvent::UpgradeAckChannel(_) => IbcEventType::UpgradeAckChannel, + IbcEvent::UpgradeConfirmChannel(_) => IbcEventType::UpgradeConfirmChannel, + IbcEvent::UpgradeOpenChannel(_) => IbcEventType::UpgradeOpenChannel, + IbcEvent::UpgradeCancelChannel(_) => IbcEventType::UpgradeCancelChannel, + IbcEvent::UpgradeTimeoutChannel(_) => IbcEventType::UpgradeTimeoutChannel, + IbcEvent::UpgradeErrorChannel(_) => IbcEventType::UpgradeErrorChannel, IbcEvent::SendPacket(_) => IbcEventType::SendPacket, IbcEvent::ReceivePacket(_) => IbcEventType::ReceivePacket, IbcEvent::WriteAcknowledgement(_) => IbcEventType::WriteAck, @@ -377,6 +434,20 @@ impl IbcEvent { } } + pub fn channel_upgrade_attributes(self) -> Option { + match self { + IbcEvent::UpgradeInitChannel(ev) => Some(ev.into()), + IbcEvent::UpgradeTryChannel(ev) => Some(ev.into()), + IbcEvent::UpgradeAckChannel(ev) => Some(ev.into()), + IbcEvent::UpgradeConfirmChannel(ev) => Some(ev.into()), + IbcEvent::UpgradeOpenChannel(ev) => Some(ev.into()), + IbcEvent::UpgradeCancelChannel(ev) => Some(ev.into()), + IbcEvent::UpgradeTimeoutChannel(ev) => Some(ev.into()), + IbcEvent::UpgradeErrorChannel(ev) => Some(ev.into()), + _ => None, + } + } + pub fn connection_attributes(&self) -> Option<&ConnectionAttributes> { match self { IbcEvent::OpenInitConnection(ev) => Some(ev.attributes()), diff --git a/crates/relayer/src/cache.rs b/crates/relayer/src/cache.rs index 474f44ab4f..73038e7245 100644 --- a/crates/relayer/src/cache.rs +++ b/crates/relayer/src/cache.rs @@ -99,6 +99,9 @@ impl Cache { where F: FnOnce() -> Result, { + // FIXME: If a channel being upgraded is queried using Latest + // Height, it might return the wrong Channel End information. + // Find an alternative to avoid this issue if let Some(chan) = self.channels.get(id) { // If cache hit, return it. Ok((chan, CacheStatus::Hit)) diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index e4eb4f9e39..09cd731b77 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -17,6 +17,7 @@ use ibc_proto::cosmos::staking::v1beta1::Params as StakingParams; use ibc_proto::ibc::apps::fee::v1::{ QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, }; +use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; use ibc_proto::interchain_security::ccv::v1::ConsumerParams as CcvConsumerParams; use ibc_proto::Protobuf; use ibc_relayer_types::applications::ics31_icq::response::CrossChainQueryResponse; @@ -32,6 +33,7 @@ use ibc_relayer_types::core::ics03_connection::connection::{ ConnectionEnd, IdentifiedConnectionEnd, }; use ibc_relayer_types::core::ics04_channel::channel::{ChannelEnd, IdentifiedChannelEnd}; +use ibc_relayer_types::core::ics04_channel::channel::{State, UpgradeState}; use ibc_relayer_types::core::ics04_channel::packet::Sequence; use ibc_relayer_types::core::ics23_commitment::commitment::CommitmentPrefix; use ibc_relayer_types::core::ics23_commitment::merkle::MerkleProof; @@ -39,12 +41,17 @@ use ibc_relayer_types::core::ics24_host::identifier::{ ChainId, ChannelId, ClientId, ConnectionId, PortId, }; use ibc_relayer_types::core::ics24_host::path::{ - AcksPath, ChannelEndsPath, ClientConsensusStatePath, ClientStatePath, CommitmentsPath, - ConnectionsPath, ReceiptsPath, SeqRecvsPath, + AcksPath, ChannelEndsPath, ChannelUpgradeErrorPath, ChannelUpgradePath, + ClientConsensusStatePath, ClientStatePath, CommitmentsPath, ConnectionsPath, ReceiptsPath, + SeqRecvsPath, }; use ibc_relayer_types::core::ics24_host::{ ClientUpgradePath, Path, IBC_QUERY_PATH, SDK_UPGRADE_QUERY_PATH, }; +use ibc_relayer_types::core::{ + ics02_client::height::Height, ics04_channel::upgrade::ErrorReceipt, + ics04_channel::upgrade::Upgrade, +}; use ibc_relayer_types::signer::Signer; use ibc_relayer_types::Height as ICSHeight; @@ -1663,7 +1670,9 @@ impl ChainEndpoint for CosmosSdkChain { .map_err(|e| Error::grpc_status(e, "query_connection_channels".to_owned()))? .into_inner(); - let channels = response + let height = self.query_chain_latest_height()?; + + let channels: Vec = response .channels .into_iter() .filter_map(|ch| { @@ -1677,7 +1686,27 @@ impl ChainEndpoint for CosmosSdkChain { }) .ok() }) + .map(|mut channel| { + // If the channel is open, look for an upgrade in order to correctly set the + // state to Open(Upgrading) or Open(NotUpgrading) + if channel.channel_end.is_open() + && self + .query_upgrade( + QueryUpgradeRequest { + port_id: channel.port_id.to_string(), + channel_id: channel.channel_id.to_string(), + }, + height, + IncludeProof::No, + ) + .is_ok() + { + channel.channel_end.state = State::Open(UpgradeState::Upgrading); + } + channel + }) .collect(); + Ok(channels) } @@ -1713,6 +1742,8 @@ impl ChainEndpoint for CosmosSdkChain { .map_err(|e| Error::grpc_status(e, "query_channels".to_owned()))? .into_inner(); + let height = self.query_chain_latest_height()?; + let channels = response .channels .into_iter() @@ -1727,6 +1758,25 @@ impl ChainEndpoint for CosmosSdkChain { }) .ok() }) + .map(|mut channel| { + // If the channel is open, look for an upgrade in order to correctly set the + // state to Open(Upgrading) or Open(NotUpgrading) + if channel.channel_end.is_open() + && self + .query_upgrade( + QueryUpgradeRequest { + port_id: channel.port_id.to_string(), + channel_id: channel.channel_id.to_string(), + }, + height, + IncludeProof::No, + ) + .is_ok() + { + channel.channel_end.state = State::Open(UpgradeState::Upgrading); + } + channel + }) .collect(); Ok(channels) @@ -1746,12 +1796,34 @@ impl ChainEndpoint for CosmosSdkChain { crate::telemetry!(query, self.id(), "query_channel"); let res = self.query( - ChannelEndsPath(request.port_id, request.channel_id), + ChannelEndsPath(request.port_id.clone(), request.channel_id.clone()), request.height, matches!(include_proof, IncludeProof::Yes), )?; - let channel_end = ChannelEnd::decode_vec(&res.value).map_err(Error::decode)?; + let mut channel_end = ChannelEnd::decode_vec(&res.value).map_err(Error::decode)?; + + if channel_end.is_open() { + let height = match request.height { + QueryHeight::Latest => self.query_chain_latest_height()?, + QueryHeight::Specific(height) => height, + }; + // In order to determine if the channel is Open upgrading or not the Upgrade is queried. + // If an upgrade is ongoing then the query will succeed in finding an Upgrade. + if self + .query_upgrade( + QueryUpgradeRequest { + port_id: request.port_id.to_string(), + channel_id: request.channel_id.to_string(), + }, + height, + IncludeProof::No, + ) + .is_ok() + { + channel_end.state = State::Open(UpgradeState::Upgrading); + } + } match include_proof { IncludeProof::Yes => { @@ -2378,6 +2450,64 @@ impl ChainEndpoint for CosmosSdkChain { Ok(result) } + + fn query_upgrade( + &self, + request: QueryUpgradeRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(Upgrade, Option), Error> { + let port_id = PortId::from_str(&request.port_id) + .map_err(|_| Error::invalid_port_string(request.port_id))?; + let channel_id = ChannelId::from_str(&request.channel_id) + .map_err(|_| Error::invalid_channel_string(request.channel_id))?; + let res = self.query( + ChannelUpgradePath { + port_id, + channel_id, + }, + QueryHeight::Specific(height), + true, + )?; + let upgrade = Upgrade::decode_vec(&res.value).map_err(Error::decode)?; + + match include_proof { + IncludeProof::Yes => { + let proof = res.proof.ok_or_else(Error::empty_response_proof)?; + Ok((upgrade, Some(proof))) + } + IncludeProof::No => Ok((upgrade, None)), + } + } + + fn query_upgrade_error( + &self, + request: QueryUpgradeErrorRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(ErrorReceipt, Option), Error> { + let port_id = PortId::from_str(&request.port_id) + .map_err(|_| Error::invalid_port_string(request.port_id))?; + let channel_id = ChannelId::from_str(&request.channel_id) + .map_err(|_| Error::invalid_channel_string(request.channel_id))?; + let res = self.query( + ChannelUpgradeErrorPath { + port_id, + channel_id, + }, + QueryHeight::Specific(height), + true, + )?; + let error_receipt = ErrorReceipt::decode_vec(&res.value).map_err(Error::decode)?; + + match include_proof { + IncludeProof::Yes => { + let proof = res.proof.ok_or_else(Error::empty_response_proof)?; + Ok((error_receipt, Some(proof))) + } + IncludeProof::No => Ok((error_receipt, None)), + } + } } fn sort_events_by_sequence(events: &mut [IbcEventWithHeight]) { diff --git a/crates/relayer/src/chain/cosmos/types/events/channel.rs b/crates/relayer/src/chain/cosmos/types/events/channel.rs index 6849fab285..7a1313ae00 100644 --- a/crates/relayer/src/chain/cosmos/types/events/channel.rs +++ b/crates/relayer/src/chain/cosmos/types/events/channel.rs @@ -5,10 +5,11 @@ use ibc_relayer_types::core::ics02_client::height::HeightErrorDetail; use ibc_relayer_types::core::ics04_channel::error::Error; use ibc_relayer_types::core::ics04_channel::events::{ AcknowledgePacket, Attributes, CloseConfirm, CloseInit, EventType, OpenAck, OpenConfirm, - OpenInit, OpenTry, SendPacket, TimeoutPacket, WriteAcknowledgement, PKT_ACK_ATTRIBUTE_KEY, - PKT_DATA_ATTRIBUTE_KEY, PKT_DST_CHANNEL_ATTRIBUTE_KEY, PKT_DST_PORT_ATTRIBUTE_KEY, - PKT_SEQ_ATTRIBUTE_KEY, PKT_SRC_CHANNEL_ATTRIBUTE_KEY, PKT_SRC_PORT_ATTRIBUTE_KEY, - PKT_TIMEOUT_HEIGHT_ATTRIBUTE_KEY, PKT_TIMEOUT_TIMESTAMP_ATTRIBUTE_KEY, + OpenInit, OpenTry, SendPacket, TimeoutPacket, UpgradeAttributes, UpgradeInit, + WriteAcknowledgement, PKT_ACK_ATTRIBUTE_KEY, PKT_DATA_ATTRIBUTE_KEY, + PKT_DST_CHANNEL_ATTRIBUTE_KEY, PKT_DST_PORT_ATTRIBUTE_KEY, PKT_SEQ_ATTRIBUTE_KEY, + PKT_SRC_CHANNEL_ATTRIBUTE_KEY, PKT_SRC_PORT_ATTRIBUTE_KEY, PKT_TIMEOUT_HEIGHT_ATTRIBUTE_KEY, + PKT_TIMEOUT_TIMESTAMP_ATTRIBUTE_KEY, }; use ibc_relayer_types::core::ics04_channel::events::{ReceivePacket, TimeoutOnClosePacket}; use ibc_relayer_types::core::ics04_channel::packet::Packet; @@ -41,6 +42,46 @@ fn extract_attributes(object: &RawObject<'_>, namespace: &str) -> Result, + namespace: &str, +) -> Result { + Ok(UpgradeAttributes { + port_id: extract_attribute(object, &format!("{namespace}.port_id"))? + .parse() + .map_err(EventError::parse)?, + channel_id: extract_attribute(object, &format!("{namespace}.channel_id"))? + .parse() + .map_err(EventError::parse)?, + counterparty_port_id: extract_attribute( + object, + &format!("{namespace}.counterparty_port_id"), + )? + .parse() + .map_err(EventError::parse)?, + counterparty_channel_id: maybe_extract_attribute( + object, + &format!("{namespace}.counterparty_channel_id"), + ) + .and_then(|v| v.parse().ok()), + upgrade_sequence: extract_attribute(object, &format!("{namespace}.upgrade_sequence"))? + .parse() + .map_err(|_| EventError::missing_action_string())?, + upgrade_timeout_height: maybe_extract_attribute( + object, + &format!("{namespace}.timeout_height"), + ) + .and_then(|v| v.parse().ok()), + upgrade_timeout_timestamp: maybe_extract_attribute( + object, + &format!("{namespace}.timeout_timestamp"), + ) + .and_then(|v| v.parse().ok()), + error_receipt: maybe_extract_attribute(object, &format!("{namespace}.error_receipt")) + .and_then(|v| v.parse().ok()), + }) +} + macro_rules! impl_try_from_raw_obj_for_event { ($($event:ty),+) => { $(impl TryFrom> for $event { @@ -99,6 +140,14 @@ impl TryFrom> for WriteAcknowledgement { } } +impl TryFrom> for UpgradeInit { + type Error = EventError; + + fn try_from(obj: RawObject<'_>) -> Result { + extract_upgrade_attributes(&obj, Self::event_type().as_str())?.try_into() + } +} + /// Parse a string into a timeout height expected to be stored in /// `Packet.timeout_height`. We need to parse the timeout height differently /// because of a quirk introduced in ibc-go. See comment in diff --git a/crates/relayer/src/chain/counterparty.rs b/crates/relayer/src/chain/counterparty.rs index b99699d3b0..0710f25a6e 100644 --- a/crates/relayer/src/chain/counterparty.rs +++ b/crates/relayer/src/chain/counterparty.rs @@ -167,7 +167,7 @@ pub fn channel_connection_client_no_checks( channel_id: channel_id.clone(), height: QueryHeight::Latest, }, - IncludeProof::No, + IncludeProof::Yes, ) .map_err(Error::relayer)?; @@ -295,7 +295,11 @@ pub fn channel_on_destination( channel_id: remote_channel_id.clone(), height: QueryHeight::Latest, }, - IncludeProof::No, + // IncludeProof::Yes forces a new query when the CachingChainHandle + // is used. + // TODO: Pass the BaseChainHandle instead of the CachingChainHandle + // to the channel worker to avoid querying for a Proof . + IncludeProof::Yes, ) .map(|(c, _)| IdentifiedChannelEnd { port_id: channel.channel_end.counterparty().port_id().clone(), diff --git a/crates/relayer/src/chain/endpoint.rs b/crates/relayer/src/chain/endpoint.rs index a65c1a345e..0a12e73341 100644 --- a/crates/relayer/src/chain/endpoint.rs +++ b/crates/relayer/src/chain/endpoint.rs @@ -1,5 +1,7 @@ use alloc::sync::Arc; +use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; +use ibc_relayer_types::core::ics02_client::height::Height; use tokio::runtime::Runtime as TokioRuntime; use ibc_proto::ibc::apps::fee::v1::{ @@ -16,6 +18,7 @@ use ibc_relayer_types::core::ics03_connection::connection::{ use ibc_relayer_types::core::ics03_connection::version::{get_compatible_versions, Version}; use ibc_relayer_types::core::ics04_channel::channel::{ChannelEnd, IdentifiedChannelEnd}; use ibc_relayer_types::core::ics04_channel::packet::{PacketMsgType, Sequence}; +use ibc_relayer_types::core::ics04_channel::upgrade::{ErrorReceipt, Upgrade}; use ibc_relayer_types::core::ics23_commitment::commitment::{ CommitmentPrefix, CommitmentProofBytes, }; @@ -686,4 +689,18 @@ pub trait ChainEndpoint: Sized { ) -> Result; fn query_consumer_chains(&self) -> Result, Error>; + + fn query_upgrade( + &self, + request: QueryUpgradeRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(Upgrade, Option), Error>; + + fn query_upgrade_error( + &self, + request: QueryUpgradeErrorRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(ErrorReceipt, Option), Error>; } diff --git a/crates/relayer/src/chain/handle.rs b/crates/relayer/src/chain/handle.rs index 1ff6aae63f..2137821e61 100644 --- a/crates/relayer/src/chain/handle.rs +++ b/crates/relayer/src/chain/handle.rs @@ -7,6 +7,7 @@ use tracing::Span; use ibc_proto::ibc::apps::fee::v1::{ QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, }; +use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, core::{ @@ -18,6 +19,7 @@ use ibc_relayer_types::{ ics04_channel::{ channel::{ChannelEnd, IdentifiedChannelEnd}, packet::{PacketMsgType, Sequence}, + upgrade::{ErrorReceipt, Upgrade}, }, ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, @@ -371,6 +373,20 @@ pub enum ChainRequest { QueryConsumerChains { reply_to: ReplyTo>, }, + + QueryUpgrade { + request: QueryUpgradeRequest, + height: Height, + include_proof: IncludeProof, + reply_to: ReplyTo<(Upgrade, Option)>, + }, + + QueryUpgradeError { + request: QueryUpgradeErrorRequest, + height: Height, + include_proof: IncludeProof, + reply_to: ReplyTo<(ErrorReceipt, Option)>, + }, } pub trait ChainHandle: Clone + Display + Send + Sync + Debug + 'static { @@ -684,4 +700,18 @@ pub trait ChainHandle: Clone + Display + Send + Sync + Debug + 'static { ) -> Result; fn query_consumer_chains(&self) -> Result, Error>; + + fn query_upgrade( + &self, + request: QueryUpgradeRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(Upgrade, Option), Error>; + + fn query_upgrade_error( + &self, + request: QueryUpgradeErrorRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(ErrorReceipt, Option), Error>; } diff --git a/crates/relayer/src/chain/handle/base.rs b/crates/relayer/src/chain/handle/base.rs index 220c9ce7a3..0898269281 100644 --- a/crates/relayer/src/chain/handle/base.rs +++ b/crates/relayer/src/chain/handle/base.rs @@ -3,8 +3,9 @@ use core::fmt::{Debug, Display, Error as FmtError, Formatter}; use crossbeam_channel as channel; use tracing::Span; -use ibc_proto::ibc::apps::fee::v1::{ - QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, +use ibc_proto::ibc::{ + apps::fee::v1::{QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse}, + core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}, }; use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, @@ -13,7 +14,10 @@ use ibc_relayer_types::{ ics03_connection::connection::{ConnectionEnd, IdentifiedConnectionEnd}, ics03_connection::version::Version, ics04_channel::channel::{ChannelEnd, IdentifiedChannelEnd}, - ics04_channel::packet::{PacketMsgType, Sequence}, + ics04_channel::{ + packet::{PacketMsgType, Sequence}, + upgrade::{ErrorReceipt, Upgrade}, + }, ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, ics24_host::identifier::ChainId, ics24_host::identifier::ChannelId, @@ -521,4 +525,32 @@ impl ChainHandle for BaseChainHandle { fn query_consumer_chains(&self) -> Result, Error> { self.send(|reply_to| ChainRequest::QueryConsumerChains { reply_to }) } + + fn query_upgrade( + &self, + request: QueryUpgradeRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(Upgrade, Option), Error> { + self.send(|reply_to| ChainRequest::QueryUpgrade { + request, + height, + include_proof, + reply_to, + }) + } + + fn query_upgrade_error( + &self, + request: QueryUpgradeErrorRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(ErrorReceipt, Option), Error> { + self.send(|reply_to| ChainRequest::QueryUpgradeError { + request, + height, + include_proof, + reply_to, + }) + } } diff --git a/crates/relayer/src/chain/handle/cache.rs b/crates/relayer/src/chain/handle/cache.rs index 3c4762b3ae..6a1731f903 100644 --- a/crates/relayer/src/chain/handle/cache.rs +++ b/crates/relayer/src/chain/handle/cache.rs @@ -1,10 +1,12 @@ use core::fmt::{Display, Error as FmtError, Formatter}; use crossbeam_channel as channel; use ibc_relayer_types::core::ics02_client::header::AnyHeader; +use ibc_relayer_types::core::ics04_channel::upgrade::ErrorReceipt; use tracing::Span; use ibc_proto::ibc::apps::fee::v1::QueryIncentivizedPacketRequest; use ibc_proto::ibc::apps::fee::v1::QueryIncentivizedPacketResponse; +use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; use ibc_relayer_types::applications::ics31_icq::response::CrossChainQueryResponse; use ibc_relayer_types::core::ics02_client::events::UpdateClient; use ibc_relayer_types::core::ics03_connection::connection::ConnectionEnd; @@ -13,6 +15,7 @@ use ibc_relayer_types::core::ics03_connection::version::Version; use ibc_relayer_types::core::ics04_channel::channel::ChannelEnd; use ibc_relayer_types::core::ics04_channel::channel::IdentifiedChannelEnd; use ibc_relayer_types::core::ics04_channel::packet::{PacketMsgType, Sequence}; +use ibc_relayer_types::core::ics04_channel::upgrade::Upgrade; use ibc_relayer_types::core::ics23_commitment::commitment::CommitmentPrefix; use ibc_relayer_types::core::ics23_commitment::merkle::MerkleProof; use ibc_relayer_types::core::ics24_host::identifier::{ @@ -515,4 +518,23 @@ impl ChainHandle for CachingChainHandle { fn query_consumer_chains(&self) -> Result, Error> { self.inner.query_consumer_chains() } + + fn query_upgrade( + &self, + request: QueryUpgradeRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(Upgrade, Option), Error> { + self.inner.query_upgrade(request, height, include_proof) + } + + fn query_upgrade_error( + &self, + request: QueryUpgradeErrorRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(ErrorReceipt, Option), Error> { + self.inner + .query_upgrade_error(request, height, include_proof) + } } diff --git a/crates/relayer/src/chain/handle/counting.rs b/crates/relayer/src/chain/handle/counting.rs index 2211cc3551..1096e1b0bf 100644 --- a/crates/relayer/src/chain/handle/counting.rs +++ b/crates/relayer/src/chain/handle/counting.rs @@ -3,6 +3,8 @@ use std::collections::HashMap; use std::sync::{Arc, RwLock, RwLockReadGuard}; use crossbeam_channel as channel; +use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; +use ibc_relayer_types::core::ics04_channel::upgrade::{ErrorReceipt, Upgrade}; use tracing::{debug, Span}; use ibc_proto::ibc::apps::fee::v1::{ @@ -509,4 +511,25 @@ impl ChainHandle for CountingChainHandle { self.inc_metric("query_consumer_chains"); self.inner.query_consumer_chains() } + + fn query_upgrade( + &self, + request: QueryUpgradeRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(Upgrade, Option), Error> { + self.inc_metric("query_upgrade"); + self.inner.query_upgrade(request, height, include_proof) + } + + fn query_upgrade_error( + &self, + request: QueryUpgradeErrorRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(ErrorReceipt, Option), Error> { + self.inc_metric("query_upgrade_error"); + self.inner + .query_upgrade_error(request, height, include_proof) + } } diff --git a/crates/relayer/src/chain/runtime.rs b/crates/relayer/src/chain/runtime.rs index f6670109d6..1422f386b3 100644 --- a/crates/relayer/src/chain/runtime.rs +++ b/crates/relayer/src/chain/runtime.rs @@ -5,8 +5,9 @@ use crossbeam_channel as channel; use tokio::runtime::Runtime as TokioRuntime; use tracing::{error, Span}; -use ibc_proto::ibc::apps::fee::v1::{ - QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, +use ibc_proto::ibc::{ + apps::fee::v1::{QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse}, + core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}, }; use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, @@ -20,6 +21,7 @@ use ibc_relayer_types::{ ics04_channel::{ channel::{ChannelEnd, IdentifiedChannelEnd}, packet::{PacketMsgType, Sequence}, + upgrade::{ErrorReceipt, Upgrade}, }, ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, @@ -353,6 +355,14 @@ where ChainRequest::QueryConsumerChains { reply_to } => { self.query_consumer_chains(reply_to)? }, + + ChainRequest::QueryUpgrade { request, height, include_proof, reply_to } => { + self.query_upgrade(request, height, include_proof, reply_to)? + }, + + ChainRequest::QueryUpgradeError { request, height, include_proof, reply_to } => { + self.query_upgrade_error(request, height, include_proof, reply_to)? + }, } }, } @@ -864,4 +874,32 @@ where Ok(()) } + + fn query_upgrade( + &self, + request: QueryUpgradeRequest, + height: Height, + include_proof: IncludeProof, + reply_to: ReplyTo<(Upgrade, Option)>, + ) -> Result<(), Error> { + let result = self.chain.query_upgrade(request, height, include_proof); + reply_to.send(result).map_err(Error::send)?; + + Ok(()) + } + + fn query_upgrade_error( + &self, + request: QueryUpgradeErrorRequest, + height: Height, + include_proof: IncludeProof, + reply_to: ReplyTo<(ErrorReceipt, Option)>, + ) -> Result<(), Error> { + let result = self + .chain + .query_upgrade_error(request, height, include_proof); + reply_to.send(result).map_err(Error::send)?; + + Ok(()) + } } diff --git a/crates/relayer/src/channel.rs b/crates/relayer/src/channel.rs index ade8806fdf..eb9a5a70a6 100644 --- a/crates/relayer/src/channel.rs +++ b/crates/relayer/src/channel.rs @@ -5,9 +5,16 @@ use ibc_proto::google::protobuf::Any; use serde::Serialize; use tracing::{debug, error, info, warn}; -pub use error::ChannelError; +use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; +use ibc_relayer_types::core::ics04_channel::msgs::chan_upgrade_ack::MsgChannelUpgradeAck; +use ibc_relayer_types::core::ics04_channel::msgs::chan_upgrade_cancel::MsgChannelUpgradeCancel; +use ibc_relayer_types::core::ics04_channel::msgs::chan_upgrade_confirm::MsgChannelUpgradeConfirm; +use ibc_relayer_types::core::ics04_channel::msgs::chan_upgrade_open::MsgChannelUpgradeOpen; +use ibc_relayer_types::core::ics04_channel::msgs::chan_upgrade_timeout::MsgChannelUpgradeTimeout; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; + use ibc_relayer_types::core::ics04_channel::channel::{ - ChannelEnd, Counterparty, IdentifiedChannelEnd, Ordering, State, + ChannelEnd, Counterparty, IdentifiedChannelEnd, Ordering, State, UpgradeState, }; use ibc_relayer_types::core::ics04_channel::msgs::chan_close_confirm::MsgChannelCloseConfirm; use ibc_relayer_types::core::ics04_channel::msgs::chan_close_init::MsgChannelCloseInit; @@ -15,6 +22,8 @@ use ibc_relayer_types::core::ics04_channel::msgs::chan_open_ack::MsgChannelOpenA use ibc_relayer_types::core::ics04_channel::msgs::chan_open_confirm::MsgChannelOpenConfirm; use ibc_relayer_types::core::ics04_channel::msgs::chan_open_init::MsgChannelOpenInit; use ibc_relayer_types::core::ics04_channel::msgs::chan_open_try::MsgChannelOpenTry; +use ibc_relayer_types::core::ics04_channel::msgs::chan_upgrade_try::MsgChannelUpgradeTry; +use ibc_relayer_types::core::ics23_commitment::commitment::CommitmentProofBytes; use ibc_relayer_types::core::ics24_host::identifier::{ ChainId, ChannelId, ClientId, ConnectionId, PortId, }; @@ -38,10 +47,12 @@ use crate::util::retry::retry_with_index; use crate::util::retry::RetryResult; use crate::util::task::Next; -pub mod error; pub mod version; use version::Version; +pub mod error; +pub use error::ChannelError; + pub mod channel_handshake_retry { //! Provides utility methods and constants to configure the retry behavior //! for the channel handshake algorithm. @@ -289,16 +300,20 @@ impl Channel { chain: ChainA, counterparty_chain: ChainB, channel: WorkerChannelObject, - height: Height, + height: QueryHeight, ) -> Result<(Channel, State), ChannelError> { let (a_channel, _) = chain .query_channel( QueryChannelRequest { port_id: channel.src_port_id.clone(), channel_id: channel.src_channel_id.clone(), - height: QueryHeight::Specific(height), + height, }, - IncludeProof::No, + // IncludeProof::Yes forces a new query when the CachingChainHandle + // is used. + // TODO: Pass the BaseChainHandle instead of the CachingChainHandle + // to the channel worker to avoid querying for a Proof . + IncludeProof::Yes, ) .map_err(ChannelError::relayer)?; @@ -446,7 +461,7 @@ impl Channel { channel_id: id.clone(), height: QueryHeight::Latest, }, - IncludeProof::No, + IncludeProof::Yes, ) .map(|(channel_end, _)| channel_end) .map_err(|e| ChannelError::chain_query(self.a_chain().id(), e)) @@ -610,7 +625,7 @@ impl Channel { ); match (a_state, b_state) { - // send the Init message to chain a (source) + // send the Init message to chain A (source) (State::Uninitialized, State::Uninitialized) => { let event = self .flipped() @@ -623,7 +638,7 @@ impl Channel { self.a_side.channel_id = Some(channel_id.clone()); } - // send the Try message to chain a (source) + // send the Try message to chain A (source) (State::Uninitialized, State::Init) | (State::Init, State::Init) => { let event = self.flipped().build_chan_open_try_and_send().map_err(|e| { error!("failed ChanOpenTry {}: {}", self.a_side, e); @@ -634,7 +649,7 @@ impl Channel { self.a_side.channel_id = Some(channel_id.clone()); } - // send the Try message to chain b (destination) + // send the Try message to chain B (destination) (State::Init, State::Uninitialized) => { let event = self.build_chan_open_try_and_send().map_err(|e| { error!("failed ChanOpenTry {}: {}", self.b_side, e); @@ -645,7 +660,7 @@ impl Channel { self.b_side.channel_id = Some(channel_id.clone()); } - // send the Ack message to chain a (source) + // send the Ack message to chain A (source) (State::Init, State::TryOpen) | (State::TryOpen, State::TryOpen) => { self.flipped().build_chan_open_ack_and_send().map_err(|e| { error!("failed ChanOpenAck {}: {}", self.a_side, e); @@ -653,7 +668,7 @@ impl Channel { })?; } - // send the Ack message to chain b (destination) + // send the Ack message to chain B (destination) (State::TryOpen, State::Init) => { self.build_chan_open_ack_and_send().map_err(|e| { error!("failed ChanOpenAck {}: {}", self.b_side, e); @@ -661,16 +676,16 @@ impl Channel { })?; } - // send the Confirm message to chain b (destination) - (State::Open, State::TryOpen) => { + // send the Confirm message to chain B (destination) + (State::Open(UpgradeState::NotUpgrading), State::TryOpen) => { self.build_chan_open_confirm_and_send().map_err(|e| { error!("failed ChanOpenConfirm {}: {}", self.b_side, e); e })?; } - // send the Confirm message to chain a (source) - (State::TryOpen, State::Open) => { + // send the Confirm message to chain A (source) + (State::TryOpen, State::Open(UpgradeState::NotUpgrading)) => { self.flipped() .build_chan_open_confirm_and_send() .map_err(|e| { @@ -679,7 +694,7 @@ impl Channel { })?; } - (State::Open, State::Open) => { + (State::Open(UpgradeState::NotUpgrading), State::Open(UpgradeState::NotUpgrading)) => { info!("channel handshake already finished for {}", self); return Ok(()); } @@ -756,17 +771,58 @@ impl Channel { (State::Init, State::Init) => Some(self.build_chan_open_try_and_send()?), (State::TryOpen, State::Init) => Some(self.build_chan_open_ack_and_send()?), (State::TryOpen, State::TryOpen) => Some(self.build_chan_open_ack_and_send()?), - (State::Open, State::TryOpen) => Some(self.build_chan_open_confirm_and_send()?), - (State::Open, State::Open) => return Ok((None, Next::Abort)), + (State::Open(UpgradeState::NotUpgrading), State::TryOpen) => { + Some(self.build_chan_open_confirm_and_send()?) + } + (State::Open(UpgradeState::NotUpgrading), State::Open(UpgradeState::NotUpgrading)) => { + return Ok((None, Next::Abort)) + } // If the counterparty state is already Open but current state is TryOpen, // return anyway as the final step is to be done by the counterparty worker. - (State::TryOpen, State::Open) => return Ok((None, Next::Abort)), + (State::TryOpen, State::Open(UpgradeState::NotUpgrading)) => { + return Ok((None, Next::Abort)) + } // Close handshake steps (State::Closed, State::Closed) => return Ok((None, Next::Abort)), (State::Closed, _) => Some(self.build_chan_close_confirm_and_send()?), + // Channel Upgrade handshake steps + (State::Open(UpgradeState::Upgrading), State::Open(UpgradeState::NotUpgrading)) => { + Some(self.build_chan_upgrade_try_and_send()?) + } + (State::Open(UpgradeState::Upgrading), State::Open(UpgradeState::Upgrading)) => { + Some(self.build_chan_upgrade_try_and_send()?) + } + (State::Open(UpgradeState::NotUpgrading), State::Open(UpgradeState::Upgrading)) => { + Some(self.build_chan_upgrade_try_and_send()?) + } + (State::Flushing, State::Open(UpgradeState::Upgrading)) => { + Some(self.build_chan_upgrade_ack_and_send()?) + } + (State::Flushing, State::Flushing) => Some(self.build_chan_upgrade_ack_and_send()?), + (State::FlushComplete, State::Flushing) => { + Some(self.build_chan_upgrade_confirm_and_send()?) + } + + (State::Flushing, State::Open(UpgradeState::NotUpgrading)) => { + Some(self.flipped().build_chan_upgrade_cancel_and_send()?) + } + (State::Open(UpgradeState::NotUpgrading), State::Flushing) => { + Some(self.build_chan_upgrade_cancel_and_send()?) + } + + (State::FlushComplete, State::FlushComplete) => { + Some(self.build_chan_upgrade_open_and_send()?) + } + (State::FlushComplete, State::Open(UpgradeState::NotUpgrading)) => self + .flipped() + .build_chan_upgrade_open_or_cancel_and_send()?, + (State::Open(UpgradeState::NotUpgrading), State::FlushComplete) => { + self.build_chan_upgrade_open_or_cancel_and_send()? + } + _ => None, }; @@ -775,7 +831,10 @@ impl Channel { match event { Some(IbcEvent::OpenConfirmChannel(_)) | Some(IbcEvent::OpenAckChannel(_)) - | Some(IbcEvent::CloseConfirmChannel(_)) => Ok((event, Next::Abort)), + | Some(IbcEvent::CloseConfirmChannel(_)) + | Some(IbcEvent::UpgradeConfirmChannel(_)) + | Some(IbcEvent::UpgradeOpenChannel(_)) + | Some(IbcEvent::UpgradeCancelChannel(_)) => Ok((event, Next::Abort)), _ => Ok((event, Next::Continue)), } } @@ -806,9 +865,14 @@ impl Channel { let state = match event { IbcEvent::OpenInitChannel(_) => State::Init, IbcEvent::OpenTryChannel(_) => State::TryOpen, - IbcEvent::OpenAckChannel(_) => State::Open, - IbcEvent::OpenConfirmChannel(_) => State::Open, + IbcEvent::OpenAckChannel(_) => State::Open(UpgradeState::NotUpgrading), + IbcEvent::OpenConfirmChannel(_) => State::Open(UpgradeState::NotUpgrading), IbcEvent::CloseInitChannel(_) => State::Closed, + IbcEvent::UpgradeInitChannel(_) => State::Open(UpgradeState::Upgrading), + IbcEvent::UpgradeTryChannel(_) => State::Flushing, + IbcEvent::UpgradeAckChannel(_) => State::FlushComplete, + IbcEvent::UpgradeConfirmChannel(_) => State::FlushComplete, + IbcEvent::UpgradeOpenChannel(_) => State::Open(UpgradeState::NotUpgrading), _ => State::Uninitialized, }; @@ -859,7 +923,7 @@ impl Channel { counterparty, vec![self.dst_connection_id().clone()], version, - 0, + Sequence::from(0), ); // Build the domain type message @@ -904,7 +968,7 @@ impl Channel { } /// Retrieves the channel from destination and compares it - /// against the expected channel. built from the message type [`ChannelMsgType`]. + /// against the expected channel. Built from the message type [`ChannelMsgType`]. /// /// If the expected and the destination channels are compatible, /// returns the expected channel @@ -929,7 +993,7 @@ impl Channel { let highest_state = match msg_type { ChannelMsgType::OpenAck => State::TryOpen, ChannelMsgType::OpenConfirm => State::TryOpen, - ChannelMsgType::CloseConfirm => State::Open, + ChannelMsgType::CloseConfirm => State::Open(UpgradeState::NotUpgrading), _ => State::Uninitialized, }; @@ -939,7 +1003,7 @@ impl Channel { counterparty, vec![self.dst_connection_id().clone()], Version::empty(), - 0, + Sequence::from(0), ); // Retrieve existing channel @@ -1031,7 +1095,7 @@ impl Channel { counterparty, vec![self.dst_connection_id().clone()], version, - 0, + Sequence::from(0), ); // Get signer @@ -1384,7 +1448,8 @@ impl Channel { self.validated_expected_channel(ChannelMsgType::CloseConfirm)?; // Channel must exist on source - self.src_chain() + let (src_channel_end, _) = self + .src_chain() .query_channel( QueryChannelRequest { port_id: self.src_port_id().clone(), @@ -1416,6 +1481,8 @@ impl Channel { .build_channel_proofs(self.src_port_id(), src_channel_id, query_height) .map_err(ChannelError::channel_proof)?; + let counterparty_upgrade_sequence = src_channel_end.upgrade_sequence; + // Build message(s) to update client on destination let mut msgs = self.build_update_client_on_dst(proofs.height())?; @@ -1431,7 +1498,7 @@ impl Channel { channel_id: dst_channel_id.clone(), proofs, signer, - counterparty_upgrade_sequence: 0, + counterparty_upgrade_sequence, }; msgs.push(new_msg.to_any()); @@ -1469,6 +1536,679 @@ impl Channel { } } + pub fn build_chan_upgrade_try(&self) -> Result, ChannelError> { + let src_channel_id = self + .src_channel_id() + .ok_or_else(ChannelError::missing_local_channel_id)?; + let src_port_id = self.src_port_id(); + let src_latest_height = self + .src_chain() + .query_latest_height() + .map_err(|e| ChannelError::chain_query(self.src_chain().id(), e))?; + + let dst_channel_id = self + .dst_channel_id() + .ok_or_else(ChannelError::missing_local_channel_id)?; + let dst_port_id = self.dst_port_id(); + + // Fetch the src channel end that will be upgraded by the upgrade handshake + // Querying for the Channel End now includes the upgrade sequence number + let (channel_end, _) = self + .src_chain() + .query_channel( + QueryChannelRequest { + port_id: src_port_id.clone(), + channel_id: src_channel_id.clone(), + height: QueryHeight::Specific(src_latest_height), + }, + IncludeProof::Yes, + ) + .map_err(|e| ChannelError::query(self.src_chain().id(), e))?; + + // Building the channel proof at the queried height + let src_proof = self + .src_chain() + .build_channel_proofs( + &src_port_id.clone(), + &src_channel_id.clone(), + src_latest_height, + ) + .map_err(ChannelError::channel_proof)?; + + let (dst_channel_end, _) = self + .dst_chain() + .query_channel( + QueryChannelRequest { + port_id: dst_port_id.clone(), + channel_id: dst_channel_id.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::Yes, + ) + .map_err(|e| ChannelError::query(self.src_chain().id(), e))?; + + let (upgrade, maybe_upgrade_proof) = self + .src_chain() + .query_upgrade( + QueryUpgradeRequest { + port_id: self.src_port_id().to_string(), + channel_id: src_channel_id.to_string(), + }, + src_latest_height, + IncludeProof::Yes, + ) + .map_err(|e| ChannelError::chain_query(self.src_chain().id(), e))?; + + let upgrade_proof = maybe_upgrade_proof.ok_or(ChannelError::missing_upgrade_proof())?; + + let proof_upgrade = + CommitmentProofBytes::try_from(upgrade_proof).map_err(ChannelError::malformed_proof)?; + + if !matches!(channel_end.state, State::Open(_)) { + return Err(ChannelError::invalid_channel_upgrade_state( + State::Open(UpgradeState::NotUpgrading).to_string(), + channel_end.state.to_string(), + )); + } + + let signer = self + .dst_chain() + .get_signer() + .map_err(|e| ChannelError::fetch_signer(self.dst_chain().id(), e))?; + + // Build the domain type message + let new_msg = MsgChannelUpgradeTry { + port_id: dst_port_id.clone(), + channel_id: dst_channel_id.clone(), + proposed_upgrade_connection_hops: dst_channel_end.connection_hops, + counterparty_upgrade_fields: upgrade.fields, + counterparty_upgrade_sequence: channel_end.upgrade_sequence, + proof_channel: src_proof.object_proof().clone(), + proof_upgrade, + proof_height: src_proof.height(), + signer, + }; + + let mut chain_a_msgs = self.build_update_client_on_dst(src_proof.height())?; + + chain_a_msgs.push(new_msg.to_any()); + + Ok(chain_a_msgs) + } + + pub fn build_chan_upgrade_try_and_send(&self) -> Result { + let dst_msgs = self.build_chan_upgrade_try()?; + + let tm = TrackedMsgs::new_static(dst_msgs, "ChannelUpgradeTry"); + + let events = self + .dst_chain() + .send_messages_and_wait_commit(tm) + .map_err(|e| ChannelError::submit(self.dst_chain().id(), e))?; + + // Find the relevant event for channel upgrade try + let result = events + .into_iter() + .find(|events_with_height| { + matches!(events_with_height.event, IbcEvent::UpgradeTryChannel(_)) + || matches!(events_with_height.event, IbcEvent::UpgradeErrorChannel(_)) + || matches!(events_with_height.event, IbcEvent::ChainError(_)) + }) + .ok_or_else(|| { + ChannelError::missing_event( + "no chan upgrade try or upgrade error event was in the response".to_string(), + ) + })?; + + match result.event { + IbcEvent::UpgradeTryChannel(_) => { + info!("👋 {} => {}", self.dst_chain().id(), result); + Ok(result.event) + } + IbcEvent::UpgradeErrorChannel(ref ev) => { + warn!( + "Channel Upgrade Try failed with error: {}", + ev.error_receipt + ); + Ok(result.event) + } + IbcEvent::ChainError(e) => Err(ChannelError::tx_response(e.clone())), + _ => Err(ChannelError::invalid_event(result.event)), + } + } + + pub fn build_chan_upgrade_ack(&self) -> Result, ChannelError> { + // Destination channel ID must exist + + let src_channel_id = self + .src_channel_id() + .ok_or_else(ChannelError::missing_counterparty_channel_id)?; + + let dst_channel_id = self + .dst_channel_id() + .ok_or_else(ChannelError::missing_counterparty_channel_id)?; + + let src_port_id = self.src_port_id(); + + let dst_port_id = self.dst_port_id(); + + let src_latest_height = self + .src_chain() + .query_latest_height() + .map_err(|e| ChannelError::chain_query(self.src_chain().id(), e))?; + + let (upgrade, maybe_upgrade_proof) = self + .src_chain() + .query_upgrade( + QueryUpgradeRequest { + port_id: self.src_port_id().to_string(), + channel_id: src_channel_id.to_string(), + }, + src_latest_height, + IncludeProof::Yes, + ) + .map_err(|e| ChannelError::chain_query(self.src_chain().id(), e))?; + + let upgrade_proof = maybe_upgrade_proof.ok_or(ChannelError::missing_upgrade_proof())?; + + let proof_upgrade = + CommitmentProofBytes::try_from(upgrade_proof).map_err(ChannelError::malformed_proof)?; + + // Building the channel proof at the queried height + let proof = self + .src_chain() + .build_channel_proofs( + &src_port_id.clone(), + &src_channel_id.clone(), + src_latest_height, + ) + .map_err(ChannelError::channel_proof)?; + + let signer = self + .dst_chain() + .get_signer() + .map_err(|e| ChannelError::fetch_signer(self.dst_chain().id(), e))?; + + // Build the domain type message + let new_msg = MsgChannelUpgradeAck { + port_id: dst_port_id.clone(), + channel_id: dst_channel_id.clone(), + counterparty_upgrade: upgrade, + proof_channel: proof.object_proof().clone(), + proof_upgrade, + proof_height: proof.height(), + signer, + }; + + let mut chain_a_msgs = self.build_update_client_on_dst(proof.height())?; + + chain_a_msgs.push(new_msg.to_any()); + + Ok(chain_a_msgs) + } + + pub fn build_chan_upgrade_ack_and_send(&self) -> Result { + let dst_msgs = self.build_chan_upgrade_ack()?; + + let tm = TrackedMsgs::new_static(dst_msgs, "ChannelUpgradeAck"); + + let events = self + .dst_chain() + .send_messages_and_wait_commit(tm) + .map_err(|e| ChannelError::submit(self.dst_chain().id(), e))?; + + // Find the relevant event for channel upgrade ack + let result = events + .into_iter() + .find(|events_with_height| { + matches!(events_with_height.event, IbcEvent::UpgradeAckChannel(_)) + || matches!(events_with_height.event, IbcEvent::UpgradeErrorChannel(_)) + || matches!(events_with_height.event, IbcEvent::ChainError(_)) + }) + .ok_or_else(|| { + ChannelError::missing_event( + "no chan upgrade ack or upgrade error event was in the response".to_string(), + ) + })?; + + match result.event { + IbcEvent::UpgradeAckChannel(_) => { + info!("👋 {} => {}", self.dst_chain().id(), result); + Ok(result.event) + } + IbcEvent::UpgradeErrorChannel(ref ev) => { + warn!( + "Channel Upgrade Ack failed with error: {}", + ev.error_receipt + ); + Ok(result.event) + } + IbcEvent::ChainError(e) => Err(ChannelError::tx_response(e.clone())), + _ => Err(ChannelError::invalid_event(result.event)), + } + } + + pub fn build_chan_upgrade_confirm(&self) -> Result, ChannelError> { + // Destination channel ID must exist + + let src_channel_id = self + .src_channel_id() + .ok_or_else(ChannelError::missing_counterparty_channel_id)?; + + let dst_channel_id = self + .dst_channel_id() + .ok_or_else(ChannelError::missing_counterparty_channel_id)?; + + let src_port_id = self.src_port_id(); + + let dst_port_id = self.dst_port_id(); + + let src_latest_height = self + .src_chain() + .query_latest_height() + .map_err(|e| ChannelError::chain_query(self.src_chain().id(), e))?; + + // Fetch the src channel end that will be upgraded by the upgrade handshake + // Querying for the Channel End now includes the upgrade sequence number + let (channel_end, _) = self + .src_chain() + .query_channel( + QueryChannelRequest { + port_id: src_port_id.clone(), + channel_id: src_channel_id.clone(), + height: QueryHeight::Specific(src_latest_height), + }, + IncludeProof::Yes, + ) + .map_err(|e| ChannelError::query(self.src_chain().id(), e))?; + + let (upgrade, maybe_upgrade_proof) = self + .src_chain() + .query_upgrade( + QueryUpgradeRequest { + port_id: self.src_port_id().to_string(), + channel_id: src_channel_id.to_string(), + }, + src_latest_height, + IncludeProof::Yes, + ) + .map_err(|e| ChannelError::chain_query(self.src_chain().id(), e))?; + + let upgrade_proof = maybe_upgrade_proof.ok_or(ChannelError::missing_upgrade_proof())?; + + let proof_upgrade = + CommitmentProofBytes::try_from(upgrade_proof).map_err(ChannelError::malformed_proof)?; + + // Building the channel proof at the queried height + let proof = self + .src_chain() + .build_channel_proofs( + &src_port_id.clone(), + &src_channel_id.clone(), + src_latest_height, + ) + .map_err(ChannelError::channel_proof)?; + + let signer = self + .dst_chain() + .get_signer() + .map_err(|e| ChannelError::fetch_signer(self.dst_chain().id(), e))?; + + // Build the domain type message + let new_msg = MsgChannelUpgradeConfirm { + port_id: dst_port_id.clone(), + channel_id: dst_channel_id.clone(), + counterparty_channel_state: channel_end.state, + counterparty_upgrade: upgrade, + proof_channel: proof.object_proof().clone(), + proof_upgrade, + proof_height: proof.height(), + signer, + }; + + let mut chain_a_msgs = self.build_update_client_on_dst(proof.height())?; + + chain_a_msgs.push(new_msg.to_any()); + + Ok(chain_a_msgs) + } + + pub fn build_chan_upgrade_confirm_and_send(&self) -> Result { + let dst_msgs = self.build_chan_upgrade_confirm()?; + + let tm = TrackedMsgs::new_static(dst_msgs, "ChannelUpgradeConfirm"); + + let events = self + .dst_chain() + .send_messages_and_wait_commit(tm) + .map_err(|e| ChannelError::submit(self.dst_chain().id(), e))?; + + // Find the relevant event for channel upgrade confirm + let result = events + .into_iter() + .find(|events_with_height| { + matches!(events_with_height.event, IbcEvent::UpgradeConfirmChannel(_)) + || matches!(events_with_height.event, IbcEvent::UpgradeErrorChannel(_)) + || matches!(events_with_height.event, IbcEvent::ChainError(_)) + }) + .ok_or_else(|| { + ChannelError::missing_event( + "no chan upgrade ack or upgrade error event was in the response".to_string(), + ) + })?; + + match result.event { + IbcEvent::UpgradeConfirmChannel(_) => { + info!("👋 {} => {}", self.dst_chain().id(), result); + Ok(result.event) + } + IbcEvent::UpgradeErrorChannel(ref ev) => { + warn!( + "Channel Upgrade Confirm failed with error: {}", + ev.error_receipt + ); + Ok(result.event) + } + IbcEvent::ChainError(e) => Err(ChannelError::tx_response(e.clone())), + _ => Err(ChannelError::invalid_event(result.event)), + } + } + + pub fn build_chan_upgrade_open(&self) -> Result, ChannelError> { + // Destination channel ID must exist + let src_channel_id = self + .src_channel_id() + .ok_or_else(ChannelError::missing_counterparty_channel_id)?; + + let dst_channel_id = self + .dst_channel_id() + .ok_or_else(ChannelError::missing_counterparty_channel_id)?; + + let src_port_id = self.src_port_id(); + + let dst_port_id = self.dst_port_id(); + + let src_latest_height = self + .src_chain() + .query_latest_height() + .map_err(|e| ChannelError::chain_query(self.src_chain().id(), e))?; + + let (src_channel_end, _) = self + .src_chain() + .query_channel( + QueryChannelRequest { + port_id: src_port_id.clone(), + channel_id: src_channel_id.clone(), + height: QueryHeight::Specific(src_latest_height), + }, + IncludeProof::Yes, + ) + .map_err(|e| ChannelError::query(self.src_chain().id(), e))?; + + let counterparty_upgrade_sequence = src_channel_end.upgrade_sequence; + + // Building the channel proof at the queried height + let proofs = self + .src_chain() + .build_channel_proofs( + &src_port_id.clone(), + &src_channel_id.clone(), + src_latest_height, + ) + .map_err(ChannelError::channel_proof)?; + + // Build message(s) to update client on destination + let mut msgs = self.build_update_client_on_dst(proofs.height())?; + + let signer = self + .dst_chain() + .get_signer() + .map_err(|e| ChannelError::fetch_signer(self.dst_chain().id(), e))?; + + // Build the domain type message + let new_msg = MsgChannelUpgradeOpen { + port_id: dst_port_id.clone(), + channel_id: dst_channel_id.clone(), + counterparty_channel_state: src_channel_end.state, + counterparty_upgrade_sequence, + proof_channel: proofs.object_proof().clone(), + proof_height: proofs.height(), + signer, + }; + + msgs.push(new_msg.to_any()); + Ok(msgs) + } + + pub fn build_chan_upgrade_open_and_send(&self) -> Result { + let dst_msgs = self.build_chan_upgrade_open()?; + + let tm = TrackedMsgs::new_static(dst_msgs, "ChannelUpgradeOpen"); + + let events = self + .dst_chain() + .send_messages_and_wait_commit(tm) + .map_err(|e| ChannelError::submit(self.dst_chain().id(), e))?; + + let result = events + .into_iter() + .find(|event_with_height| { + matches!(event_with_height.event, IbcEvent::UpgradeOpenChannel(_)) + || matches!(event_with_height.event, IbcEvent::ChainError(_)) + }) + .ok_or_else(|| { + ChannelError::missing_event( + "no channel upgrade open event was in the response".to_string(), + ) + })?; + + match &result.event { + IbcEvent::UpgradeOpenChannel(_) => { + info!("👋 {} => {}", self.dst_chain().id(), result); + Ok(result.event) + } + IbcEvent::ChainError(e) => Err(ChannelError::tx_response(e.clone())), + _ => Err(ChannelError::invalid_event(result.event)), + } + } + + pub fn build_chan_upgrade_cancel(&self) -> Result, ChannelError> { + // Destination channel ID must exist + let src_channel_id = self + .src_channel_id() + .ok_or_else(ChannelError::missing_counterparty_channel_id)?; + + let dst_channel_id = self + .dst_channel_id() + .ok_or_else(ChannelError::missing_counterparty_channel_id)?; + + let src_port_id = self.src_port_id(); + + let dst_port_id = self.dst_port_id(); + + let src_latest_height = self + .src_chain() + .query_latest_height() + .map_err(|e| ChannelError::chain_query(self.src_chain().id(), e))?; + + let (error_receipt, maybe_error_receipt_proof) = self + .src_chain() + .query_upgrade_error( + QueryUpgradeErrorRequest { + port_id: src_port_id.to_string(), + channel_id: src_channel_id.to_string(), + }, + src_latest_height, + IncludeProof::Yes, + ) + .map_err(|e| ChannelError::chain_query(self.src_chain().id(), e))?; + + let error_receipt_proof = + maybe_error_receipt_proof.ok_or(ChannelError::missing_upgrade_error_receipt_proof())?; + + let proof_error_receipt = CommitmentProofBytes::try_from(error_receipt_proof) + .map_err(ChannelError::malformed_proof)?; + + // Building the channel proof at the queried height + let proofs = self + .src_chain() + .build_channel_proofs( + &src_port_id.clone(), + &src_channel_id.clone(), + src_latest_height, + ) + .map_err(ChannelError::channel_proof)?; + + // Build message(s) to update client on destination + let mut msgs = self.build_update_client_on_dst(proofs.height())?; + + let signer = self + .dst_chain() + .get_signer() + .map_err(|e| ChannelError::fetch_signer(self.dst_chain().id(), e))?; + + // Build the domain type message + let new_msg = MsgChannelUpgradeCancel { + port_id: dst_port_id.clone(), + channel_id: dst_channel_id.clone(), + error_receipt, + proof_error_receipt, + proof_height: proofs.height(), + signer, + }; + + msgs.push(new_msg.to_any()); + Ok(msgs) + } + + pub fn build_chan_upgrade_cancel_and_send(&self) -> Result { + let dst_msgs = self.build_chan_upgrade_cancel()?; + + let tm = TrackedMsgs::new_static(dst_msgs, "ChannelUpgradeCancel"); + + let events = self + .dst_chain() + .send_messages_and_wait_commit(tm) + .map_err(|e| ChannelError::submit(self.dst_chain().id(), e))?; + + let result = events + .into_iter() + .find(|event_with_height| { + matches!(event_with_height.event, IbcEvent::UpgradeCancelChannel(_)) + || matches!(event_with_height.event, IbcEvent::ChainError(_)) + }) + .ok_or_else(|| { + ChannelError::missing_event( + "no channel upgrade cancel event was in the response".to_string(), + ) + })?; + + match &result.event { + IbcEvent::UpgradeCancelChannel(_) => { + info!("👋 {} => {}", self.dst_chain().id(), result); + Ok(result.event) + } + IbcEvent::ChainError(e) => Err(ChannelError::tx_response(e.clone())), + _ => Err(ChannelError::invalid_event(result.event)), + } + } + + pub fn build_chan_upgrade_timeout(&self) -> Result, ChannelError> { + // Destination channel ID must exist + let src_channel_id = self + .src_channel_id() + .ok_or_else(ChannelError::missing_counterparty_channel_id)?; + + let dst_channel_id = self + .dst_channel_id() + .ok_or_else(ChannelError::missing_counterparty_channel_id)?; + + let src_port_id = self.src_port_id(); + + let dst_port_id = self.dst_port_id(); + + let src_latest_height = self + .src_chain() + .query_latest_height() + .map_err(|e| ChannelError::chain_query(self.src_chain().id(), e))?; + + // Retrieve counterparty channel + let (counterparty_channel, _) = self + .src_chain() + .query_channel( + QueryChannelRequest { + port_id: src_port_id.clone(), + channel_id: src_channel_id.clone(), + height: QueryHeight::Specific(src_latest_height), + }, + IncludeProof::Yes, + ) + .map_err(|e| ChannelError::query(self.src_chain().id(), e))?; + + // Building the channel proof at the queried height + let proofs = self + .src_chain() + .build_channel_proofs( + &src_port_id.clone(), + &src_channel_id.clone(), + src_latest_height, + ) + .map_err(ChannelError::channel_proof)?; + + // Build message(s) to update client on destination + let mut msgs = self.build_update_client_on_dst(proofs.height())?; + + let signer = self + .dst_chain() + .get_signer() + .map_err(|e| ChannelError::fetch_signer(self.dst_chain().id(), e))?; + + // Build the domain type message + let new_msg = MsgChannelUpgradeTimeout { + port_id: dst_port_id.clone(), + channel_id: dst_channel_id.clone(), + counterparty_channel, + proof_channel: proofs.object_proof().clone(), + proof_height: proofs.height(), + signer, + }; + + msgs.push(new_msg.to_any()); + Ok(msgs) + } + + pub fn build_chan_upgrade_timeout_and_send(&self) -> Result { + let dst_msgs = self.build_chan_upgrade_timeout()?; + + let tm = TrackedMsgs::new_static(dst_msgs, "ChannelUpgradeTimeout"); + + let events = self + .dst_chain() + .send_messages_and_wait_commit(tm) + .map_err(|e| ChannelError::submit(self.dst_chain().id(), e))?; + + let result = events + .into_iter() + .find(|event_with_height| { + matches!(event_with_height.event, IbcEvent::UpgradeTimeoutChannel(_)) + || matches!(event_with_height.event, IbcEvent::ChainError(_)) + }) + .ok_or_else(|| { + ChannelError::missing_event( + "no channel upgrade timeout event was in the response".to_string(), + ) + })?; + + match &result.event { + IbcEvent::UpgradeTimeoutChannel(_) => { + info!("👋 {} => {}", self.dst_chain().id(), result); + Ok(result.event) + } + IbcEvent::ChainError(e) => Err(ChannelError::tx_response(e.clone())), + _ => Err(ChannelError::invalid_event(result.event)), + } + } + pub fn map_chain( self, mapper_a: impl Fn(ChainA) -> ChainC, @@ -1481,6 +2221,38 @@ impl Channel { connection_delay: self.connection_delay, } } + + pub fn build_chan_upgrade_open_or_cancel_and_send( + &self, + ) -> Result, ChannelError> { + // Check if error query_upgrade_error + let height = self.a_chain().query_latest_height().unwrap(); + let upgrade_error = self + .a_chain() + .query_upgrade_error( + QueryUpgradeErrorRequest { + port_id: self.a_side.port_id.clone().to_string(), + channel_id: self.a_side.channel_id.clone().unwrap().clone().to_string(), + }, + height, + IncludeProof::No, + ) + .map_err(|_| ChannelError::missing_upgrade_error_receipt_proof()); + + let channel_end = self.b_channel(self.b_channel_id())?; + + if let Ok((upgrade_error, _)) = upgrade_error { + if upgrade_error.sequence > 0.into() + && upgrade_error.sequence == channel_end.upgrade_sequence + { + Ok(Some(self.build_chan_upgrade_cancel_and_send()?)) + } else { + Ok(Some(self.build_chan_upgrade_open_and_send()?)) + } + } else { + Ok(Some(self.build_chan_upgrade_open_and_send()?)) + } + } } pub fn extract_channel_id(event: &IbcEvent) -> Result<&ChannelId, ChannelError> { @@ -1489,6 +2261,7 @@ pub fn extract_channel_id(event: &IbcEvent) -> Result<&ChannelId, ChannelError> IbcEvent::OpenTryChannel(ev) => ev.channel_id(), IbcEvent::OpenAckChannel(ev) => ev.channel_id(), IbcEvent::OpenConfirmChannel(ev) => ev.channel_id(), + IbcEvent::UpgradeInitChannel(ev) => Some(ev.channel_id()), _ => None, } .ok_or_else(|| ChannelError::missing_event("cannot extract channel_id from result".to_string())) @@ -1512,7 +2285,9 @@ fn check_destination_channel_state( existing_channel.connection_hops() == expected_channel.connection_hops(); // TODO: Refactor into a method - let good_state = *existing_channel.state() as u32 <= *expected_channel.state() as u32; + let good_state = existing_channel + .state() + .less_or_equal_progress(*expected_channel.state()); let good_channel_port_ids = existing_channel.counterparty().channel_id().is_none() || existing_channel.counterparty().channel_id() == expected_channel.counterparty().channel_id() diff --git a/crates/relayer/src/channel/error.rs b/crates/relayer/src/channel/error.rs index c6d3b40391..e25b1898bf 100644 --- a/crates/relayer/src/channel/error.rs +++ b/crates/relayer/src/channel/error.rs @@ -3,11 +3,12 @@ use core::time::Duration; use flex_error::{define_error, ErrorMessageTracer}; use ibc_relayer_types::core::ics02_client::error::Error as ClientError; -use ibc_relayer_types::core::ics04_channel::channel::State; +use ibc_relayer_types::core::ics04_channel::channel::{Ordering, State}; use ibc_relayer_types::core::ics24_host::identifier::{ ChainId, ChannelId, ClientId, PortChannelId, PortId, }; use ibc_relayer_types::events::IbcEvent; +use ibc_relayer_types::proofs::ProofError; use crate::error::Error as RelayerError; use crate::foreign_client::{ForeignClientError, HasExpiredOrFrozenError}; @@ -34,6 +35,16 @@ define_error! { e.reason) }, + InvalidChannelUpgradeOrdering + |_| { "attempted to upgrade a channel to a more strict ordring, which is not allowed" }, + + InvalidChannelUpgradeState + { expected: String, actual: String } + |e| { format_args!("channel state should be {} but is {}", e.expected, e.actual) }, + + InvalidChannelUpgradeTimeout + |_| { "attempted to upgrade a channel without supplying at least one of timeout height or timeout timestamp" }, + MissingLocalChannelId |_| { "failed due to missing local channel id" }, @@ -53,10 +64,33 @@ define_error! { MissingChannelOnDestination |_| { "missing channel on destination chain" }, + MissingChannelProof + |_| { "missing channel proof" }, + + MissingUpgradeProof + |_| { "missing upgrade proof" }, + + MissingUpgradeErrorReceiptProof + |_| { "missing upgrade error receipt proof" }, + + MalformedProof + [ ProofError ] + |_| { "malformed proof" }, + ChannelProof [ RelayerError ] |_| { "failed to build channel proofs" }, + InvalidOrdering + { + channel_ordering: Ordering, + counterparty_ordering: Ordering, + } + | e | { + format_args!("channel ordering '{0}' does not match counterparty ordering '{1}'", + e.channel_ordering, e.counterparty_ordering) + }, + ClientOperation { client_id: ClientId, diff --git a/crates/relayer/src/connection.rs b/crates/relayer/src/connection.rs index 47b5620845..7f968bcdcf 100644 --- a/crates/relayer/src/connection.rs +++ b/crates/relayer/src/connection.rs @@ -1365,7 +1365,9 @@ fn check_destination_connection_state( && existing_connection.counterparty().client_id() == expected_connection.counterparty().client_id(); - let good_state = *existing_connection.state() as u32 <= *expected_connection.state() as u32; + let good_state = existing_connection + .state() + .less_or_equal_progress(*expected_connection.state()); let good_connection_ids = existing_connection.counterparty().connection_id().is_none() || existing_connection.counterparty().connection_id() diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index aa6e312a32..537470552c 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -622,6 +622,14 @@ define_error! { Base64Decode [ TraceError ] |_| { "Error decoding base64-encoded data" }, + + InvalidPortString + { port: String } + |e| { format!("invalid port string {}", e.port) }, + + InvalidChannelString + { channel: String } + |e| { format!("invalid channel string {}", e.channel) }, } } diff --git a/crates/relayer/src/event.rs b/crates/relayer/src/event.rs index 2a75d8fc55..f5219f4750 100644 --- a/crates/relayer/src/event.rs +++ b/crates/relayer/src/event.rs @@ -1,28 +1,37 @@ use core::fmt::{Display, Error as FmtError, Formatter}; use serde::Serialize; +use std::str::FromStr; use subtle_encoding::hex; use tendermint::abci::Event as AbciEvent; use ibc_relayer_types::{ - applications::ics29_fee::events::{DistributeFeePacket, IncentivizedPacket}, - applications::ics31_icq::events::CrossChainQueryPacket, - core::ics02_client::{ - error::Error as ClientError, - events::{self as client_events, Attributes as ClientAttributes, HEADER_ATTRIBUTE_KEY}, - header::{decode_header, AnyHeader}, - height::HeightErrorDetail, + applications::{ + ics29_fee::events::{DistributeFeePacket, IncentivizedPacket}, + ics31_icq::events::CrossChainQueryPacket, }, - core::ics03_connection::{ - error::Error as ConnectionError, - events::{self as connection_events, Attributes as ConnectionAttributes}, - }, - core::ics04_channel::{ - error::Error as ChannelError, - events::{self as channel_events, Attributes as ChannelAttributes}, - packet::Packet, - timeout::TimeoutHeight, + core::{ + ics02_client::{ + error::Error as ClientError, + events::{self as client_events, Attributes as ClientAttributes, HEADER_ATTRIBUTE_KEY}, + header::{decode_header, AnyHeader}, + height::HeightErrorDetail, + }, + ics03_connection::{ + error::Error as ConnectionError, + events::{self as connection_events, Attributes as ConnectionAttributes}, + }, + ics04_channel::{ + error::Error as ChannelError, + events::{ + self as channel_events, Attributes as ChannelAttributes, + UpgradeAttributes as ChannelUpgradeAttributes, + }, + packet::{Packet, Sequence}, + timeout::TimeoutHeight, + }, }, events::{Error as IbcEventError, IbcEvent, IbcEventType}, + timestamp::Timestamp, Height, }; @@ -109,6 +118,34 @@ pub fn ibc_event_try_from_abci_event(abci_event: &AbciEvent) -> Result Ok(IbcEvent::UpgradeInitChannel( + channel_upgrade_init_try_from_abci_event(abci_event).map_err(IbcEventError::channel)?, + )), + Ok(IbcEventType::UpgradeTryChannel) => Ok(IbcEvent::UpgradeTryChannel( + channel_upgrade_try_try_from_abci_event(abci_event).map_err(IbcEventError::channel)?, + )), + Ok(IbcEventType::UpgradeAckChannel) => Ok(IbcEvent::UpgradeAckChannel( + channel_upgrade_ack_try_from_abci_event(abci_event).map_err(IbcEventError::channel)?, + )), + Ok(IbcEventType::UpgradeConfirmChannel) => Ok(IbcEvent::UpgradeConfirmChannel( + channel_upgrade_confirm_try_from_abci_event(abci_event) + .map_err(IbcEventError::channel)?, + )), + Ok(IbcEventType::UpgradeOpenChannel) => Ok(IbcEvent::UpgradeOpenChannel( + channel_upgrade_open_try_from_abci_event(abci_event).map_err(IbcEventError::channel)?, + )), + Ok(IbcEventType::UpgradeCancelChannel) => Ok(IbcEvent::UpgradeCancelChannel( + channel_upgrade_cancelled_try_from_abci_event(abci_event) + .map_err(IbcEventError::channel)?, + )), + Ok(IbcEventType::UpgradeTimeoutChannel) => Ok(IbcEvent::UpgradeTimeoutChannel( + channel_upgrade_timeout_try_from_abci_event(abci_event) + .map_err(IbcEventError::channel)?, + )), + Ok(IbcEventType::UpgradeErrorChannel) => Ok(IbcEvent::UpgradeErrorChannel( + channel_upgrade_error_try_from_abci_event(abci_event) + .map_err(IbcEventError::channel)?, + )), Ok(IbcEventType::SendPacket) => Ok(IbcEvent::SendPacket( send_packet_try_from_abci_event(abci_event).map_err(IbcEventError::channel)?, )), @@ -250,6 +287,86 @@ pub fn channel_close_confirm_try_from_abci_event( } } +pub fn channel_upgrade_init_try_from_abci_event( + abci_event: &AbciEvent, +) -> Result { + match channel_upgrade_extract_attributes_from_tx(abci_event) { + Ok(attrs) => channel_events::UpgradeInit::try_from(attrs) + .map_err(|_| ChannelError::implementation_specific()), + Err(e) => Err(e), + } +} + +pub fn channel_upgrade_try_try_from_abci_event( + abci_event: &AbciEvent, +) -> Result { + match channel_upgrade_extract_attributes_from_tx(abci_event) { + Ok(attrs) => channel_events::UpgradeTry::try_from(attrs) + .map_err(|_| ChannelError::implementation_specific()), + Err(e) => Err(e), + } +} + +pub fn channel_upgrade_ack_try_from_abci_event( + abci_event: &AbciEvent, +) -> Result { + match channel_upgrade_extract_attributes_from_tx(abci_event) { + Ok(attrs) => channel_events::UpgradeAck::try_from(attrs) + .map_err(|_| ChannelError::implementation_specific()), + Err(e) => Err(e), + } +} + +pub fn channel_upgrade_confirm_try_from_abci_event( + abci_event: &AbciEvent, +) -> Result { + match channel_upgrade_extract_attributes_from_tx(abci_event) { + Ok(attrs) => channel_events::UpgradeConfirm::try_from(attrs) + .map_err(|_| ChannelError::implementation_specific()), + Err(e) => Err(e), + } +} + +pub fn channel_upgrade_open_try_from_abci_event( + abci_event: &AbciEvent, +) -> Result { + match channel_upgrade_extract_attributes_from_tx(abci_event) { + Ok(attrs) => channel_events::UpgradeOpen::try_from(attrs) + .map_err(|_| ChannelError::implementation_specific()), + Err(e) => Err(e), + } +} + +pub fn channel_upgrade_cancelled_try_from_abci_event( + abci_event: &AbciEvent, +) -> Result { + match channel_upgrade_extract_attributes_from_tx(abci_event) { + Ok(attrs) => channel_events::UpgradeCancel::try_from(attrs) + .map_err(|_| ChannelError::implementation_specific()), + Err(e) => Err(e), + } +} + +pub fn channel_upgrade_timeout_try_from_abci_event( + abci_event: &AbciEvent, +) -> Result { + match channel_upgrade_extract_attributes_from_tx(abci_event) { + Ok(attrs) => channel_events::UpgradeTimeout::try_from(attrs) + .map_err(|_| ChannelError::implementation_specific()), + Err(e) => Err(e), + } +} + +pub fn channel_upgrade_error_try_from_abci_event( + abci_event: &AbciEvent, +) -> Result { + match channel_upgrade_extract_attributes_from_tx(abci_event) { + Ok(attrs) => channel_events::UpgradeError::try_from(attrs) + .map_err(|_| ChannelError::implementation_specific()), + Err(e) => Err(e), + } +} + pub fn send_packet_try_from_abci_event( abci_event: &AbciEvent, ) -> Result { @@ -420,6 +537,58 @@ fn channel_extract_attributes_from_tx( Ok(attr) } +fn channel_upgrade_extract_attributes_from_tx( + event: &AbciEvent, +) -> Result { + let mut attr = ChannelUpgradeAttributes::default(); + + for tag in &event.attributes { + let key = tag + .key_str() + .map_err(|_| ChannelError::malformed_event_attribute_key())?; + + let value = tag + .value_str() + .map_err(|_| ChannelError::malformed_event_attribute_value(key.to_owned()))?; + + match key { + channel_events::PORT_ID_ATTRIBUTE_KEY => { + attr.port_id = value.parse().map_err(ChannelError::identifier)? + } + channel_events::CHANNEL_ID_ATTRIBUTE_KEY => { + attr.channel_id = value.parse().map_err(ChannelError::identifier)?; + } + channel_events::COUNTERPARTY_PORT_ID_ATTRIBUTE_KEY => { + attr.counterparty_port_id = value.parse().map_err(ChannelError::identifier)?; + } + channel_events::COUNTERPARTY_CHANNEL_ID_ATTRIBUTE_KEY => { + attr.counterparty_channel_id = value.parse().ok(); + } + channel_events::UPGRADE_SEQUENCE => { + attr.upgrade_sequence = + Sequence::from(value.parse::().map_err(|e| { + ChannelError::invalid_string_as_sequence(value.to_string(), e) + })?); + } + channel_events::UPGRADE_TIMEOUT_HEIGHT => { + let maybe_height = Height::from_str(value).ok(); + attr.upgrade_timeout_height = maybe_height; + } + channel_events::UPGRADE_TIMEOUT_TIMESTAMP => { + let maybe_timestamp = Timestamp::from_str(value).ok(); + attr.upgrade_timeout_timestamp = maybe_timestamp; + } + channel_events::UPGRADE_ERROR_RECEIPT => { + let maybe_error_receipt = value.to_string(); + attr.error_receipt = Some(maybe_error_receipt); + } + _ => {} + } + } + + Ok(attr) +} + pub fn extract_packet_and_write_ack_from_tx( event: &AbciEvent, ) -> Result<(Packet, Vec), ChannelError> { diff --git a/crates/relayer/src/event/source/websocket/extract.rs b/crates/relayer/src/event/source/websocket/extract.rs index b905c9e561..ddc692054d 100644 --- a/crates/relayer/src/event/source/websocket/extract.rs +++ b/crates/relayer/src/event/source/websocket/extract.rs @@ -235,6 +235,12 @@ fn event_is_type_channel(ev: &IbcEvent) -> bool { | IbcEvent::OpenConfirmChannel(_) | IbcEvent::CloseInitChannel(_) | IbcEvent::CloseConfirmChannel(_) + | IbcEvent::UpgradeInitChannel(_) + | IbcEvent::UpgradeTryChannel(_) + | IbcEvent::UpgradeAckChannel(_) + | IbcEvent::UpgradeConfirmChannel(_) + | IbcEvent::UpgradeOpenChannel(_) + | IbcEvent::UpgradeErrorChannel(_) | IbcEvent::SendPacket(_) | IbcEvent::ReceivePacket(_) | IbcEvent::WriteAcknowledgement(_) @@ -314,6 +320,11 @@ fn extract_block_events( extract_events(height, block_events, "channel_open_confirm", "channel_id"), height, ); + append_events::( + &mut events, + extract_events(height, block_events, "channel_upgrade_init", "channel_id"), + height, + ); append_events::( &mut events, extract_events(height, block_events, "send_packet", "packet_data_hex"), diff --git a/crates/relayer/src/link.rs b/crates/relayer/src/link.rs index bc4cf282fb..3d87499480 100644 --- a/crates/relayer/src/link.rs +++ b/crates/relayer/src/link.rs @@ -1,6 +1,7 @@ use ibc_relayer_types::core::{ ics03_connection::connection::State as ConnectionState, ics04_channel::channel::State as ChannelState, + ics04_channel::channel::UpgradeState, ics04_channel::packet::Sequence, ics24_host::identifier::{ChannelId, PortChannelId, PortId}, }; @@ -85,7 +86,10 @@ impl Link { ) })?; - if !a_channel.state_matches(&ChannelState::Open) + if !a_channel.state_matches(&ChannelState::Open(UpgradeState::NotUpgrading)) + && !a_channel.state_matches(&ChannelState::Open(UpgradeState::Upgrading)) + && !a_channel.state_matches(&ChannelState::Flushing) + && !a_channel.state_matches(&ChannelState::FlushComplete) && !a_channel.state_matches(&ChannelState::Closed) { return Err(LinkError::invalid_channel_state( diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index 511ecc383b..63abf46be3 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -354,10 +354,9 @@ impl RelayPath { } // Nothing to do if channel on destination is already closed - if self - .dst_channel(QueryHeight::Latest)? - .state_matches(&ChannelState::Closed) - { + let dst_channel = self.dst_channel(QueryHeight::Latest)?; + + if dst_channel.state_matches(&ChannelState::Closed) { return Ok(None); } @@ -367,13 +366,15 @@ impl RelayPath { .build_channel_proofs(self.src_port_id(), src_channel_id, event.height) .map_err(|e| LinkError::channel(ChannelError::channel_proof(e)))?; + let counterparty_upgrade_sequence = self.src_channel(QueryHeight::Latest)?.upgrade_sequence; + // Build the domain type message let new_msg = MsgChannelCloseConfirm { port_id: self.dst_port_id().clone(), channel_id: self.dst_channel_id().clone(), proofs, signer: self.dst_signer()?, - counterparty_upgrade_sequence: 0, + counterparty_upgrade_sequence, }; Ok(Some(new_msg.to_any())) @@ -1395,11 +1396,14 @@ impl RelayPath { ) .map_err(|e| LinkError::packet_proofs_constructor(self.dst_chain().id(), e))?; + let counterparty_upgrade_sequence = self.src_channel(QueryHeight::Latest)?.upgrade_sequence; + let msg = MsgTimeoutOnClose::new( packet.clone(), next_sequence_received, proofs.clone(), self.src_signer()?, + counterparty_upgrade_sequence, ); trace!(packet = %msg.packet, height = %proofs.height(), "built timeout on close msg"); diff --git a/crates/relayer/src/object.rs b/crates/relayer/src/object.rs index 333212c6ec..aac3efb257 100644 --- a/crates/relayer/src/object.rs +++ b/crates/relayer/src/object.rs @@ -8,7 +8,7 @@ use ibc_relayer_types::core::{ ics02_client::events::UpdateClient, ics03_connection::events::Attributes as ConnectionAttributes, ics04_channel::events::{ - Attributes, CloseInit, SendPacket, TimeoutPacket, WriteAcknowledgement, + Attributes, CloseInit, SendPacket, TimeoutPacket, UpgradeAttributes, WriteAcknowledgement, }, ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }; @@ -447,6 +447,38 @@ impl Object { .into()) } + pub fn channel_from_chan_upgrade_events( + attributes: &UpgradeAttributes, + src_chain: &impl ChainHandle, + allow_non_open_connection: bool, + ) -> Result { + let channel_id = attributes.channel_id(); + + let port_id = attributes.port_id(); + + let dst_chain_id = if allow_non_open_connection { + // Get the destination chain allowing for the possibility that the connection is not yet open. + // This is to support the optimistic channel handshake by allowing the channel worker to get + // the channel events while the connection is being established. + // The channel worker will eventually finish the channel handshake via the retry mechanism. + channel_connection_client_no_checks(src_chain, port_id, channel_id) + .map(|c| c.client.client_state.chain_id()) + .map_err(ObjectError::supervisor)? + } else { + channel_connection_client(src_chain, port_id, channel_id) + .map(|c| c.client.client_state.chain_id()) + .map_err(ObjectError::supervisor)? + }; + + Ok(Channel { + dst_chain_id, + src_chain_id: src_chain.id(), + src_channel_id: channel_id.clone(), + src_port_id: port_id.clone(), + } + .into()) + } + /// Build the object associated with the given [`SendPacket`] event. pub fn for_send_packet( e: &SendPacket, diff --git a/crates/relayer/src/supervisor.rs b/crates/relayer/src/supervisor.rs index 53661e7007..16ca340703 100644 --- a/crates/relayer/src/supervisor.rs +++ b/crates/relayer/src/supervisor.rs @@ -539,6 +539,31 @@ pub fn collect_events( || Object::client_from_chan_open_events(&attributes, src_chain).ok(), ); } + IbcEvent::UpgradeInitChannel(..) + | IbcEvent::UpgradeTryChannel(..) + | IbcEvent::UpgradeAckChannel(..) + | IbcEvent::UpgradeOpenChannel(..) + | IbcEvent::UpgradeErrorChannel(..) => { + collect_event( + &mut collected, + event_with_height.clone(), + mode.channels.enabled, + || { + event_with_height + .event + .clone() + .channel_upgrade_attributes() + .and_then(|attr| { + Object::channel_from_chan_upgrade_events( + &attr, + src_chain, + mode.connections.enabled, + ) + .ok() + }) + }, + ); + } IbcEvent::SendPacket(ref packet) => { collect_event( &mut collected, diff --git a/crates/relayer/src/supervisor/spawn.rs b/crates/relayer/src/supervisor/spawn.rs index b1b608875c..769ac2b9d3 100644 --- a/crates/relayer/src/supervisor/spawn.rs +++ b/crates/relayer/src/supervisor/spawn.rs @@ -244,9 +244,12 @@ impl<'a, Chain: ChainHandle> SpawnContext<'a, Chain> { chan_state_dst ); + let is_channel_upgrading = channel_scan.channel.channel_end.is_upgrading(); + if (mode.clients.enabled || mode.packets.enabled) && chan_state_src.is_open() && (chan_state_dst.is_open() || chan_state_dst.is_closed()) + && !is_channel_upgrading { if mode.clients.enabled { // Spawn the client worker @@ -303,7 +306,7 @@ impl<'a, Chain: ChainHandle> SpawnContext<'a, Chain> { } Ok(mode.clients.enabled) - } else if mode.channels.enabled { + } else if mode.channels.enabled && !is_channel_upgrading { let has_packets = || { !channel_scan .unreceived_packets_on_counterparty(&counterparty_chain, &chain) @@ -339,6 +342,35 @@ impl<'a, Chain: ChainHandle> SpawnContext<'a, Chain> { } else { Ok(false) } + } else if is_channel_upgrading { + let path_object = Object::Packet(Packet { + dst_chain_id: counterparty_chain.id(), + src_chain_id: chain.id(), + src_channel_id: channel_scan.channel.channel_id.clone(), + src_port_id: channel_scan.channel.port_id.clone(), + }); + + self.workers + .spawn( + chain.clone(), + counterparty_chain.clone(), + &path_object, + self.config, + ) + .then(|| info!("spawned packet worker: {}", path_object.short_name())); + + let channel_object = Object::Channel(Channel { + dst_chain_id: counterparty_chain.id(), + src_chain_id: chain.id(), + src_channel_id: channel_scan.channel.channel_id, + src_port_id: channel_scan.channel.port_id, + }); + + self.workers + .spawn(chain, counterparty_chain, &channel_object, self.config) + .then(|| info!("spawned channel worker: {}", channel_object.short_name())); + + Ok(true) } else { Ok(false) } diff --git a/crates/relayer/src/worker/channel.rs b/crates/relayer/src/worker/channel.rs index df80e9252b..5c722cb262 100644 --- a/crates/relayer/src/worker/channel.rs +++ b/crates/relayer/src/worker/channel.rs @@ -1,7 +1,9 @@ use core::time::Duration; use crossbeam_channel::Receiver; -use tracing::{debug, error_span}; +use ibc_relayer_types::events::IbcEventType; +use tracing::{debug, error_span, warn}; +use crate::chain::requests::QueryHeight; use crate::channel::{channel_handshake_retry, Channel as RelayChannel}; use crate::util::retry::RetryResult; use crate::util::task::{spawn_background_task, Next, TaskError, TaskHandle}; @@ -34,6 +36,7 @@ pub fn spawn_channel_worker( cmd_rx: Receiver, ) -> TaskHandle { let mut complete_handshake_on_new_block = true; + spawn_background_task( error_span!("worker.channel", channel = %channel.short_name()), Some(Duration::from_millis(200)), @@ -48,20 +51,68 @@ pub fn spawn_channel_worker( debug!("starts processing {:?}", last_event); complete_handshake_on_new_block = false; + if let Some(event_with_height) = last_event { - retry_with_index( - channel_handshake_retry::default_strategy(max_block_times), - |index| match RelayChannel::restore_from_event( - chains.a.clone(), - chains.b.clone(), - event_with_height.event.clone(), - ) { - Ok(mut handshake_channel) => handshake_channel - .step_event(&event_with_height.event, index), - Err(_) => RetryResult::Retry(index), - }, - ) - .map_err(|e| TaskError::Fatal(RunError::retry(e))) + match event_with_height.event.event_type() { + IbcEventType::UpgradeInitChannel + | IbcEventType::UpgradeTryChannel + | IbcEventType::UpgradeAckChannel + | IbcEventType::UpgradeConfirmChannel + | IbcEventType::UpgradeOpenChannel + | IbcEventType::UpgradeTimeoutChannel => retry_with_index( + channel_handshake_retry::default_strategy(max_block_times), + |index| match RelayChannel::restore_from_state( + chains.a.clone(), + chains.b.clone(), + channel.clone(), + QueryHeight::Latest, + ) { + Ok((mut handshake_channel, state)) => { + handshake_channel.step_state(state, index) + } + Err(_) => RetryResult::Retry(index), + }, + ) + .map_err(|e| TaskError::Fatal(RunError::retry(e))), + + IbcEventType::UpgradeErrorChannel => retry_with_index( + channel_handshake_retry::default_strategy(max_block_times), + |index| match RelayChannel::restore_from_state( + chains.a.clone(), + chains.b.clone(), + channel.clone(), + QueryHeight::Latest, + ) { + Ok((handshake_channel, _)) => { + match handshake_channel + .build_chan_upgrade_cancel_and_send() + { + Ok(_) => RetryResult::Ok(Next::Abort), + Err(e) => { + warn!("Channel upgrade cancel failed: {e}"); + RetryResult::Retry(index) + } + } + } + Err(_) => RetryResult::Retry(index), + }, + ) + .map_err(|e| TaskError::Fatal(RunError::retry(e))), + + _ => retry_with_index( + channel_handshake_retry::default_strategy(max_block_times), + |index| match RelayChannel::restore_from_event( + chains.a.clone(), + chains.b.clone(), + event_with_height.event.clone(), + ) { + Ok(mut handshake_channel) => handshake_channel + .step_event(&event_with_height.event, index), + Err(_) => RetryResult::Retry(index), + }, + ) + .map_err(|e| TaskError::Fatal(RunError::retry(e))), + } } else { Ok(Next::Continue) } @@ -73,18 +124,15 @@ pub fn spawn_channel_worker( } if complete_handshake_on_new_block => { debug!("starts processing block event at {:#?}", current_height); - let height = current_height - .decrement() - .map_err(|e| TaskError::Fatal(RunError::ics02(e)))?; - complete_handshake_on_new_block = false; + retry_with_index( channel_handshake_retry::default_strategy(max_block_times), |index| match RelayChannel::restore_from_state( chains.a.clone(), chains.b.clone(), channel.clone(), - height, + QueryHeight::Latest, ) { Ok((mut handshake_channel, state)) => { handshake_channel.step_state(state, index) diff --git a/docs/spec/relayer/Definitions.md b/docs/spec/relayer/Definitions.md index 5468807d93..ce3ad90b2f 100644 --- a/docs/spec/relayer/Definitions.md +++ b/docs/spec/relayer/Definitions.md @@ -224,7 +224,7 @@ CreateUpdateClientDatagrams(shs []SignedHeader) IBCDatagram[] // Submit given datagram to a given chain Submit(chain Chain, datagram IBCDatagram) Error -// Return the corresponding chain for a given chainID +// Return the corresponding chain for a given chainID // We assume that the relayer maintains a map of known chainIDs and the corresponding chains. GetChain(chainID String) Chain ``` diff --git a/e2e/e2e/channel.py b/e2e/e2e/channel.py index 0036ae7fa3..75b5d23dd8 100644 --- a/e2e/e2e/channel.py +++ b/e2e/e2e/channel.py @@ -472,15 +472,16 @@ def handshake( split() a_chan_end = query_channel_end(c, side_a, port_id, a_chan_id) - if a_chan_end.state != 'Open': + if str(a_chan_end.state) != 'Open': l.error( - f'Channel end with id {a_chan_id} on chain {side_a} is not in Open state, got: {a_chan_end.state}') + f"Channel end with id {a_chan_id} on chain {side_a} is not in `Open` state, got: {a_chan_end.state}") exit(1) b_chan_end = query_channel_end(c, side_b, port_id, b_chan_id) - if b_chan_end.state != 'Open': + print(b_chan_end.state) + if str(b_chan_end.state) != 'Open': l.error( - f'Channel end with id {b_chan_id} on chain {side_b} is not in Open state, got: {b_chan_end.state}') + f'Channel end with id {b_chan_id} on chain {side_b} is not in `Open` state, got: {b_chan_end.state}') exit(1) a_chan_ends = query_channel_ends(c, side_a, port_id, a_chan_id) diff --git a/guide/src/templates/commands/hermes/tx/chan-upgrade-ack_1.md b/guide/src/templates/commands/hermes/tx/chan-upgrade-ack_1.md new file mode 100644 index 0000000000..c39115bdf9 --- /dev/null +++ b/guide/src/templates/commands/hermes/tx/chan-upgrade-ack_1.md @@ -0,0 +1 @@ +[[#BINARY hermes]][[#GLOBALOPTIONS]] tx chan-upgrade-ack --dst-chain [[#DST_CHAIN_ID]] --src-chain [[#SRC_CHAIN_ID]] --dst-connection [[#DST_CONNECTION_ID]] --dst-port [[#DST_PORT_ID]] --src-port [[#SRC_PORT_ID]] --src-channel [[#SRC_CHANNEL_ID]] --dst-channel [[#DST_CHANNEL_ID]] diff --git a/guide/src/templates/commands/hermes/tx/chan-upgrade-cancel_1.md b/guide/src/templates/commands/hermes/tx/chan-upgrade-cancel_1.md new file mode 100644 index 0000000000..5f7fc7e0e1 --- /dev/null +++ b/guide/src/templates/commands/hermes/tx/chan-upgrade-cancel_1.md @@ -0,0 +1 @@ +[[#BINARY hermes]][[#GLOBALOPTIONS]] tx chan-upgrade-cancel --dst-chain [[#DST_CHAIN_ID]] --src-chain [[#SRC_CHAIN_ID]] --dst-connection [[#DST_CONNECTION_ID]] --dst-port [[#DST_PORT_ID]] --src-port [[#SRC_PORT_ID]] --src-channel [[#SRC_CHANNEL_ID]] --dst-channel [[#DST_CHANNEL_ID]] diff --git a/guide/src/templates/commands/hermes/tx/chan-upgrade-confirm_1.md b/guide/src/templates/commands/hermes/tx/chan-upgrade-confirm_1.md new file mode 100644 index 0000000000..4b9434eb3b --- /dev/null +++ b/guide/src/templates/commands/hermes/tx/chan-upgrade-confirm_1.md @@ -0,0 +1 @@ +[[#BINARY hermes]][[#GLOBALOPTIONS]] tx chan-upgrade-confirm --dst-chain [[#DST_CHAIN_ID]] --src-chain [[#SRC_CHAIN_ID]] --dst-connection [[#DST_CONNECTION_ID]] --dst-port [[#DST_PORT_ID]] --src-port [[#SRC_PORT_ID]] --src-channel [[#SRC_CHANNEL_ID]] --dst-channel [[#DST_CHANNEL_ID]] diff --git a/guide/src/templates/commands/hermes/tx/chan-upgrade-open_1.md b/guide/src/templates/commands/hermes/tx/chan-upgrade-open_1.md new file mode 100644 index 0000000000..43fe8ee75a --- /dev/null +++ b/guide/src/templates/commands/hermes/tx/chan-upgrade-open_1.md @@ -0,0 +1 @@ +[[#BINARY hermes]][[#GLOBALOPTIONS]] tx chan-upgrade-open --dst-chain [[#DST_CHAIN_ID]] --src-chain [[#SRC_CHAIN_ID]] --dst-connection [[#DST_CONNECTION_ID]] --dst-port [[#DST_PORT_ID]] --src-port [[#SRC_PORT_ID]] --src-channel [[#SRC_CHANNEL_ID]] --dst-channel [[#DST_CHANNEL_ID]] diff --git a/guide/src/templates/commands/hermes/tx/chan-upgrade-timeout_1.md b/guide/src/templates/commands/hermes/tx/chan-upgrade-timeout_1.md new file mode 100644 index 0000000000..2ccf8b5d99 --- /dev/null +++ b/guide/src/templates/commands/hermes/tx/chan-upgrade-timeout_1.md @@ -0,0 +1 @@ +[[#BINARY hermes]][[#GLOBALOPTIONS]] tx chan-upgrade-timeout --dst-chain [[#DST_CHAIN_ID]] --src-chain [[#SRC_CHAIN_ID]] --dst-connection [[#DST_CONNECTION_ID]] --dst-port [[#DST_PORT_ID]] --src-port [[#SRC_PORT_ID]] --src-channel [[#SRC_CHANNEL_ID]] --dst-channel [[#DST_CHANNEL_ID]] diff --git a/guide/src/templates/commands/hermes/tx/chan-upgrade-try_1.md b/guide/src/templates/commands/hermes/tx/chan-upgrade-try_1.md new file mode 100644 index 0000000000..a2f0e74436 --- /dev/null +++ b/guide/src/templates/commands/hermes/tx/chan-upgrade-try_1.md @@ -0,0 +1 @@ +[[#BINARY hermes]][[#GLOBALOPTIONS]] tx chan-upgrade-try --dst-chain [[#DST_CHAIN_ID]] --src-chain [[#SRC_CHAIN_ID]] --dst-connection [[#DST_CONNECTION_ID]] --dst-port [[#DST_PORT_ID]] --src-port [[#SRC_PORT_ID]] --src-channel [[#SRC_CHANNEL_ID]] --dst-channel [[#DST_CHANNEL_ID]] diff --git a/guide/src/templates/help_templates/tx.md b/guide/src/templates/help_templates/tx.md index 02590775c2..9d83c50de5 100644 --- a/guide/src/templates/help_templates/tx.md +++ b/guide/src/templates/help_templates/tx.md @@ -8,18 +8,24 @@ OPTIONS: -h, --help Print help information SUBCOMMANDS: - chan-close-confirm Confirm the closing of a channel (ChannelCloseConfirm) - chan-close-init Initiate the closing of a channel (ChannelCloseInit) - chan-open-ack Relay acknowledgment of a channel attempt (ChannelOpenAck) - chan-open-confirm Confirm opening of a channel (ChannelOpenConfirm) - chan-open-init Initialize a channel (ChannelOpenInit) - chan-open-try Relay the channel attempt (ChannelOpenTry) - conn-ack Relay acknowledgment of a connection attempt (ConnectionOpenAck) - conn-confirm Confirm opening of a connection (ConnectionOpenConfirm) - conn-init Initialize a connection (ConnectionOpenInit) - conn-try Relay the connection attempt (ConnectionOpenTry) - ft-transfer Send a fungible token transfer test transaction (ICS20 MsgTransfer) - help Print this message or the help of the given subcommand(s) - packet-ack Relay acknowledgment packets - packet-recv Relay receive or timeout packets - upgrade-chain Send an IBC upgrade plan + chan-close-confirm Confirm the closing of a channel (ChannelCloseConfirm) + chan-close-init Initiate the closing of a channel (ChannelCloseInit) + chan-open-ack Relay acknowledgment of a channel attempt (ChannelOpenAck) + chan-open-confirm Confirm opening of a channel (ChannelOpenConfirm) + chan-open-init Initialize a channel (ChannelOpenInit) + chan-open-try Relay the channel attempt (ChannelOpenTry) + chan-upgrade-ack Relay the channel upgrade attempt (ChannelUpgradeAck) + chan-upgrade-cancel Relay the channel upgrade cancellation (ChannelUpgradeCancel) + chan-upgrade-confirm Relay the channel upgrade attempt (ChannelUpgradeConfirm) + chan-upgrade-open Relay the channel upgrade attempt (ChannelUpgradeOpen) + chan-upgrade-timeout Relay the channel upgrade timeout (ChannelUpgradeTimeout) + chan-upgrade-try Relay the channel upgrade attempt (ChannelUpgradeTry) + conn-ack Relay acknowledgment of a connection attempt (ConnectionOpenAck) + conn-confirm Confirm opening of a connection (ConnectionOpenConfirm) + conn-init Initialize a connection (ConnectionOpenInit) + conn-try Relay the connection attempt (ConnectionOpenTry) + ft-transfer Send a fungible token transfer test transaction (ICS20 MsgTransfer) + help Print this message or the help of the given subcommand(s) + packet-ack Relay acknowledgment packets + packet-recv Relay receive or timeout packets + upgrade-chain Send an IBC upgrade plan diff --git a/guide/src/templates/help_templates/tx/chan-upgrade-ack.md b/guide/src/templates/help_templates/tx/chan-upgrade-ack.md new file mode 100644 index 0000000000..6c30bfa913 --- /dev/null +++ b/guide/src/templates/help_templates/tx/chan-upgrade-ack.md @@ -0,0 +1,30 @@ +DESCRIPTION: +Relay the channel upgrade attempt (ChannelUpgradeAck) + +USAGE: + hermes tx chan-upgrade-ack --dst-chain --src-chain --dst-connection --dst-port --src-port --src-channel --dst-channel + +OPTIONS: + -h, --help Print help information + +REQUIRED: + --dst-chain + Identifier of the destination chain + + --dst-channel + Identifier of the destination channel (optional) [aliases: dst-chan] + + --dst-connection + Identifier of the destination connection [aliases: dst-conn] + + --dst-port + Identifier of the destination port + + --src-chain + Identifier of the source chain + + --src-channel + Identifier of the source channel (required) [aliases: src-chan] + + --src-port + Identifier of the source port diff --git a/guide/src/templates/help_templates/tx/chan-upgrade-cancel.md b/guide/src/templates/help_templates/tx/chan-upgrade-cancel.md new file mode 100644 index 0000000000..ceb38a5f12 --- /dev/null +++ b/guide/src/templates/help_templates/tx/chan-upgrade-cancel.md @@ -0,0 +1,30 @@ +DESCRIPTION: +Relay the channel upgrade cancellation (ChannelUpgradeCancel) + +USAGE: + hermes tx chan-upgrade-cancel --dst-chain --src-chain --dst-connection --dst-port --src-port --src-channel --dst-channel + +OPTIONS: + -h, --help Print help information + +REQUIRED: + --dst-chain + Identifier of the destination chain + + --dst-channel + Identifier of the destination channel (optional) [aliases: dst-chan] + + --dst-connection + Identifier of the destination connection [aliases: dst-conn] + + --dst-port + Identifier of the destination port + + --src-chain + Identifier of the source chain + + --src-channel + Identifier of the source channel (required) [aliases: src-chan] + + --src-port + Identifier of the source port diff --git a/guide/src/templates/help_templates/tx/chan-upgrade-confirm.md b/guide/src/templates/help_templates/tx/chan-upgrade-confirm.md new file mode 100644 index 0000000000..e13588c59d --- /dev/null +++ b/guide/src/templates/help_templates/tx/chan-upgrade-confirm.md @@ -0,0 +1,30 @@ +DESCRIPTION: +Relay the channel upgrade attempt (ChannelUpgradeConfirm) + +USAGE: + hermes tx chan-upgrade-confirm --dst-chain --src-chain --dst-connection --dst-port --src-port --src-channel --dst-channel + +OPTIONS: + -h, --help Print help information + +REQUIRED: + --dst-chain + Identifier of the destination chain + + --dst-channel + Identifier of the destination channel (optional) [aliases: dst-chan] + + --dst-connection + Identifier of the destination connection [aliases: dst-conn] + + --dst-port + Identifier of the destination port + + --src-chain + Identifier of the source chain + + --src-channel + Identifier of the source channel (required) [aliases: src-chan] + + --src-port + Identifier of the source port diff --git a/guide/src/templates/help_templates/tx/chan-upgrade-open.md b/guide/src/templates/help_templates/tx/chan-upgrade-open.md new file mode 100644 index 0000000000..fb878cd41d --- /dev/null +++ b/guide/src/templates/help_templates/tx/chan-upgrade-open.md @@ -0,0 +1,30 @@ +DESCRIPTION: +Relay the channel upgrade attempt (ChannelUpgradeOpen) + +USAGE: + hermes tx chan-upgrade-open --dst-chain --src-chain --dst-connection --dst-port --src-port --src-channel --dst-channel + +OPTIONS: + -h, --help Print help information + +REQUIRED: + --dst-chain + Identifier of the destination chain + + --dst-channel + Identifier of the destination channel (optional) [aliases: dst-chan] + + --dst-connection + Identifier of the destination connection [aliases: dst-conn] + + --dst-port + Identifier of the destination port + + --src-chain + Identifier of the source chain + + --src-channel + Identifier of the source channel (required) [aliases: src-chan] + + --src-port + Identifier of the source port diff --git a/guide/src/templates/help_templates/tx/chan-upgrade-timeout.md b/guide/src/templates/help_templates/tx/chan-upgrade-timeout.md new file mode 100644 index 0000000000..3d783f1a3a --- /dev/null +++ b/guide/src/templates/help_templates/tx/chan-upgrade-timeout.md @@ -0,0 +1,30 @@ +DESCRIPTION: +Relay the channel upgrade timeout (ChannelUpgradeTimeout) + +USAGE: + hermes tx chan-upgrade-timeout --dst-chain --src-chain --dst-connection --dst-port --src-port --src-channel --dst-channel + +OPTIONS: + -h, --help Print help information + +REQUIRED: + --dst-chain + Identifier of the destination chain + + --dst-channel + Identifier of the destination channel (optional) [aliases: dst-chan] + + --dst-connection + Identifier of the destination connection [aliases: dst-conn] + + --dst-port + Identifier of the destination port + + --src-chain + Identifier of the source chain + + --src-channel + Identifier of the source channel (required) [aliases: src-chan] + + --src-port + Identifier of the source port diff --git a/guide/src/templates/help_templates/tx/chan-upgrade-try.md b/guide/src/templates/help_templates/tx/chan-upgrade-try.md new file mode 100644 index 0000000000..6a00fbc211 --- /dev/null +++ b/guide/src/templates/help_templates/tx/chan-upgrade-try.md @@ -0,0 +1,30 @@ +DESCRIPTION: +Relay the channel upgrade attempt (ChannelUpgradeTry) + +USAGE: + hermes tx chan-upgrade-try --dst-chain --src-chain --dst-connection --dst-port --src-port --src-channel --dst-channel + +OPTIONS: + -h, --help Print help information + +REQUIRED: + --dst-chain + Identifier of the destination chain + + --dst-channel + Identifier of the destination channel (optional) [aliases: dst-chan] + + --dst-connection + Identifier of the destination connection [aliases: dst-conn] + + --dst-port + Identifier of the destination port + + --src-chain + Identifier of the source chain + + --src-channel + Identifier of the source channel (required) [aliases: src-chan] + + --src-port + Identifier of the source port diff --git a/scripts/auto_gen_templates.sh b/scripts/auto_gen_templates.sh index aaf0c605d8..bbf0650a09 100755 --- a/scripts/auto_gen_templates.sh +++ b/scripts/auto_gen_templates.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # This script is used to generate the templates for the guide SCRIPT_NAME="$0" diff --git a/tools/check-guide/Cargo.lock b/tools/check-guide/Cargo.lock index df79b8288f..645b211df2 100644 --- a/tools/check-guide/Cargo.lock +++ b/tools/check-guide/Cargo.lock @@ -23,7 +23,7 @@ dependencies = [ "termcolor", "toml 0.5.11", "tracing", - "tracing-log", + "tracing-log 0.1.4", "tracing-subscriber", "wait-timeout", ] @@ -58,18 +58,18 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "ammonia" -version = "3.3.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e6d1c7838db705c9b756557ee27c384ce695a1c51a6fe528784cb1c6840170" +checksum = "1ab99eae5ee58501ab236beb6f20f6ca39be615267b014899c89b2f0bc18a459" dependencies = [ "html5ever", "maplit", @@ -95,63 +95,64 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arc-swap" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "arrayref" @@ -184,33 +185,34 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "async-tungstenite" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e9efbe14612da0a19fb983059a0b621e9cf6225d7018ecab4f9988215540dc" +checksum = "3609af4bbf701ddaf1f6bb4e6257dff4ff8932327d0e685d3f653724c258b1ac" dependencies = [ "futures-io", "futures-util", "log", "pin-project-lite", - "rustls-native-certs", + "rustls-native-certs 0.7.0", + "rustls-pki-types", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tungstenite", ] @@ -227,9 +229,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "axum" @@ -242,7 +244,7 @@ dependencies = [ "bitflags 1.3.2", "bytes", "futures-util", - "http", + "http 0.2.12", "http-body", "hyper", "itoa", @@ -272,7 +274,7 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http", + "http 0.2.12", "http-body", "mime", "rustversion", @@ -282,13 +284,13 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", "object", @@ -303,9 +305,15 @@ checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -342,9 +350,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitcoin" -version = "0.31.1" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd00f3c09b5f21fb357abe32d29946eb8bb7a0862bae62c0b5e4a692acbbe73c" +checksum = "6c85783c2fe40083ea54a33aa2f0ba58831d90fcd190f5bdc47e74e84d2a96ae" dependencies = [ "bech32 0.10.0-beta", "bitcoin-internals", @@ -383,9 +391,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "blake2" @@ -405,7 +413,7 @@ dependencies = [ "arrayref", "arrayvec", "cc", - "cfg-if 1.0.0", + "cfg-if", "constant_time_eq", ] @@ -429,29 +437,29 @@ dependencies = [ [[package]] name = "bs58" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ "tinyvec", ] [[package]] name = "bstr" -version = "1.6.2" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", - "regex-automata 0.3.9", + "regex-automata 0.4.6", "serde", ] [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byte-unit" @@ -463,32 +471,17 @@ dependencies = [ "utf8-width", ] -[[package]] -name = "bytecount" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad152d03a2c813c80bb94fedbf3a3f02b28f793e39e7c214c8a0bcc196343de7" - [[package]] name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" -dependencies = [ - "serde", -] +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] -name = "camino" -version = "1.1.6" +name = "bytes" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" dependencies = [ "serde", ] @@ -499,42 +492,11 @@ version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" -[[package]] -name = "cargo-platform" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", -] - [[package]] name = "cc" -version = "1.0.83" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" [[package]] name = "cfg-if" @@ -556,14 +518,14 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -578,30 +540,30 @@ dependencies = [ "clap_lex 0.2.4", "indexmap 1.9.3", "once_cell", - "strsim", + "strsim 0.10.0", "termcolor", "textwrap", ] [[package]] name = "clap" -version = "4.4.6" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", - "clap_lex 0.5.1", - "strsim", + "clap_lex 0.7.0", + "strsim 0.11.1", "terminal_size", ] @@ -616,11 +578,11 @@ dependencies = [ [[package]] name = "clap_complete" -version = "4.4.3" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ae8ba90b9d8b007efe66e55e48fb936272f5ca00349b5b0e89877520d35ea7" +checksum = "dd79504325bf38b10165b02e89b4347300f855f273c4cb30c4a3209e6583275e" dependencies = [ - "clap 4.4.6", + "clap 4.5.4", ] [[package]] @@ -647,15 +609,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "color-eyre" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a667583cca8c4f8436db8de46ea8233c42a7d9ae424a82d338f2e4675229204" +checksum = "55146f5e46f237f7423d74111267d4597b59b0dad0ffaf7303bce9945d843ad5" dependencies = [ "backtrace", "color-spantrace", @@ -668,9 +630,9 @@ dependencies = [ [[package]] name = "color-spantrace" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba75b3d9449ecdccb27ecbc479fdc0b87fa2dd43d2f8298f9bf0e59aacc8dce" +checksum = "cd6be1b2a7e382e2b98b43b2adcca6bb0e465af0bdd38123873ae61eb17a72c2" dependencies = [ "once_cell", "owo-colors", @@ -680,28 +642,28 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "console" -version = "0.15.7" +version = "0.15.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c926e00cc70edefdc64d3a5ff31cc65bb97a3460097762bd23afb4d8145fccf8" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" dependencies = [ "encode_unicode", "lazy_static", "libc", "unicode-width", - "windows-sys 0.45.0", + "windows-sys 0.52.0", ] [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "constant_time_eq" @@ -722,9 +684,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -732,67 +694,52 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crossbeam-channel" -version = "0.4.4" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ - "crossbeam-utils 0.7.2", - "maybe-uninit", + "crossbeam-utils", ] [[package]] -name = "crossbeam-channel" -version = "0.5.11" +name = "crossbeam-deque" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "crossbeam-utils 0.8.19", + "crossbeam-epoch", + "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" -dependencies = [ - "autocfg", - "cfg-if 1.0.0", - "crossbeam-utils 0.8.19", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "lazy_static", + "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -802,9 +749,9 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-bigint" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", "rand_core", @@ -824,11 +771,11 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", @@ -841,13 +788,13 @@ dependencies = [ [[package]] name = "curve25519-dalek-derive" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -869,8 +816,8 @@ version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ - "cfg-if 1.0.0", - "hashbrown 0.14.1", + "cfg-if", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -878,15 +825,26 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" + +[[package]] +name = "dbus" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bb21987b9fb1613058ba3843121dd18b163b254d8a6e797e144cbac14d96d1b" +dependencies = [ + "libc", + "libdbus-sys", + "winapi", +] [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", @@ -894,9 +852,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] [[package]] name = "derivation-path" @@ -955,7 +916,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -972,9 +933,9 @@ dependencies = [ [[package]] name = "ecdsa" -version = "0.16.8" +version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ "der", "digest 0.10.7", @@ -986,9 +947,9 @@ dependencies = [ [[package]] name = "ed25519" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", "serde", @@ -1010,15 +971,16 @@ dependencies = [ [[package]] name = "ed25519-dalek" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", "rand_core", "serde", "sha2 0.10.8", + "subtle", "zeroize", ] @@ -1036,9 +998,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elasticlunr-rs" @@ -1054,9 +1016,9 @@ dependencies = [ [[package]] name = "elliptic-curve" -version = "0.13.6" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ "base16ct", "crypto-bigint", @@ -1079,11 +1041,21 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", +] + +[[package]] +name = "env_filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +dependencies = [ + "log", + "regex", ] [[package]] @@ -1101,15 +1073,15 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ + "anstream", + "anstyle", + "env_filter", "humantime", - "is-terminal", "log", - "regex", - "termcolor", ] [[package]] @@ -1120,32 +1092,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ - "cc", "libc", -] - -[[package]] -name = "error-chain" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" -dependencies = [ - "version_check", + "windows-sys 0.52.0", ] [[package]] @@ -1170,9 +1122,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "ff" @@ -1186,20 +1138,20 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.1" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", ] [[package]] @@ -1229,18 +1181,21 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] [[package]] name = "fs-err" -version = "2.9.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0845fa252299212f0389d64ba26f34fa32cfe41588355f21ed507c59a0f64541" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] [[package]] name = "fsevent-sys" @@ -1263,9 +1218,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1278,9 +1233,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1288,15 +1243,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1305,38 +1260,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1363,11 +1318,11 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "libc", "wasi", @@ -1376,27 +1331,21 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" - -[[package]] -name = "glob" -version = "0.3.1" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "globset" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759c97c1e17c55525b57192c06a267cda0ac5210b222d6b82189a2338fa1c13d" +checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "fnv", "log", - "regex", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -1412,17 +1361,17 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http", - "indexmap 1.9.3", + "http 0.2.12", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -1431,15 +1380,15 @@ dependencies = [ [[package]] name = "half" -version = "1.8.2" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" [[package]] name = "handlebars" -version = "4.4.0" +version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39b3bc2a8f715298032cf5087e58573809374b08160aa7d750582bdb82d2683" +checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" dependencies = [ "log", "pest", @@ -1457,9 +1406,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hdpath" @@ -1476,10 +1425,10 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64", + "base64 0.21.7", "bytes", "headers-core", - "http", + "http 0.2.12", "httpdate", "mime", "sha1", @@ -1491,7 +1440,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http", + "http 0.2.12", ] [[package]] @@ -1511,9 +1460,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -1523,9 +1472,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-conservative" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hex_lit" @@ -1544,23 +1493,34 @@ dependencies = [ [[package]] name = "html5ever" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7" +checksum = "c13771afe0e6e846f1e67d038d4cb29998a6779f93c809212e4e9c32efd244d4" dependencies = [ "log", "mac", "markup5ever", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.65", ] [[package]] name = "http" -version = "0.2.9" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -1569,12 +1529,12 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", "pin-project-lite", ] @@ -1608,22 +1568,22 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", "h2", - "http", + "http 0.2.12", "http-body", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2", "tokio", "tower-service", "tracing", @@ -1632,16 +1592,16 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http", + "http 0.2.12", "hyper", - "rustls", + "rustls 0.21.12", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -1658,16 +1618,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows-core", ] [[package]] @@ -1686,10 +1646,10 @@ dependencies = [ "async-trait", "flex-error", "futures", - "http", + "http 0.2.12", "ibc-proto", "ibc-relayer-types", - "itertools 0.10.5", + "itertools", "reqwest", "serde", "serde_json", @@ -1700,11 +1660,11 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.42.2" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1a6f2bbf7e1d12f98d8d54d9114231b865418d0f8b619c0873180eafdee07fd" +checksum = "66080040d5a4800d52966d55b055400f86b79c34b854b935bef03c87aacda62a" dependencies = [ - "base64", + "base64 0.22.1", "bytes", "flex-error", "ics23", @@ -1727,7 +1687,7 @@ dependencies = [ "bs58", "byte-unit", "bytes", - "crossbeam-channel 0.5.11", + "crossbeam-channel", "digest 0.10.7", "dirs-next", "ed25519", @@ -1738,13 +1698,13 @@ dependencies = [ "generic-array", "hdpath", "hex", - "http", + "http 0.2.12", "humantime", "humantime-serde", "ibc-proto", "ibc-relayer-types", "ibc-telemetry", - "itertools 0.10.5", + "itertools", "moka", "num-bigint", "num-rational", @@ -1774,11 +1734,11 @@ dependencies = [ "tiny-keccak", "tokio", "tokio-stream", - "toml 0.8.8", + "toml 0.8.13", "tonic", "tracing", "tracing-subscriber", - "uuid 1.7.0", + "uuid", ] [[package]] @@ -1790,21 +1750,21 @@ dependencies = [ "clap_complete 3.2.5", "color-eyre", "console", - "crossbeam-channel 0.5.11", + "crossbeam-channel", "dialoguer", "dirs-next", "eyre", "flex-error", "futures", "hdpath", - "http", + "http 0.2.12", "humantime", "ibc-chain-registry", "ibc-relayer", "ibc-relayer-rest", "ibc-relayer-types", "ibc-telemetry", - "itertools 0.10.5", + "itertools", "oneline-eyre", "regex", "serde", @@ -1825,7 +1785,7 @@ name = "ibc-relayer-rest" version = "0.27.2" dependencies = [ "axum", - "crossbeam-channel 0.5.11", + "crossbeam-channel", "ibc-relayer", "ibc-relayer-types", "serde", @@ -1842,7 +1802,7 @@ dependencies = [ "flex-error", "ibc-proto", "ics23", - "itertools 0.10.5", + "itertools", "num-rational", "primitive-types", "prost", @@ -1855,6 +1815,7 @@ dependencies = [ "tendermint-light-client-verifier", "tendermint-proto", "time", + "tracing", "uint", ] @@ -1904,9 +1865,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1914,17 +1875,16 @@ dependencies = [ [[package]] name = "ignore" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbe7873dab538a9a44ad79ede1faf5f30d49f9a5c883ddbab48bce81b64b7492" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" dependencies = [ + "crossbeam-deque", "globset", - "lazy_static", "log", "memchr", - "regex", + "regex-automata 0.4.6", "same-file", - "thread_local", "walkdir", "winapi-util", ] @@ -1956,12 +1916,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown 0.14.5", ] [[package]] @@ -1970,7 +1930,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aa4a0980c8379295100d70854354e78df2ee1c6ca0f96ffe89afeb3140e3a3d" dependencies = [ - "base64", + "base64 0.21.7", "serde", ] @@ -1996,61 +1956,47 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" - -[[package]] -name = "is-terminal" -version = "0.4.9" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi 0.3.3", - "rustix", - "windows-sys 0.48.0", -] +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] -name = "itertools" -version = "0.10.5" +name = "is_terminal_polyfill" +version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itertools" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] [[package]] name = "k256" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "ecdsa", "elliptic-curve", "sha2 0.10.8", @@ -2058,9 +2004,9 @@ dependencies = [ [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] @@ -2093,21 +2039,41 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.155" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" + +[[package]] +name = "libdbus-sys" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06085512b750d640299b79be4bad3d2fa90a9c00b1fd9e1b46364f66f0485c72" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "libredox" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", +] [[package]] name = "linux-raw-sys" -version = "0.4.8" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2115,9 +2081,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "mac" @@ -2133,9 +2099,9 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "markup5ever" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016" +checksum = "16ce3abbeba692c8b8441d036ef91aea6df8da2c6b6e21c7e14d3c18e526be45" dependencies = [ "log", "phf", @@ -2160,25 +2126,19 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "mdbook" -version = "0.4.35" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c3f88addd34930bc5f01b9dc19f780447e51c92bf2536e3ded058018271775d" +checksum = "b45a38e19bd200220ef07c892b0157ad3d2365e5b5a267ca01ad12182491eea5" dependencies = [ "ammonia", "anyhow", "chrono", - "clap 4.4.6", - "clap_complete 4.4.3", + "clap 4.5.4", + "clap_complete 4.5.2", "elasticlunr-rs", - "env_logger 0.10.0", + "env_logger 0.11.3", "futures-util", "handlebars", "ignore", @@ -2188,6 +2148,7 @@ dependencies = [ "notify-debouncer-mini", "once_cell", "opener", + "pathdiff", "pulldown-cmark", "regex", "serde", @@ -2197,14 +2158,15 @@ dependencies = [ "tokio", "toml 0.5.11", "topological-sort", + "walkdir", "warp", ] [[package]] name = "mdbook-template" -version = "1.1.0" +version = "1.1.1+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "920f69694a682c1100d64ca342278fc289d7d89b905a60c39ca39e0ea04ce0f1" +checksum = "24ababe45effcc8453d4dc68de0d699d6858399b6f20ecfaf616a1ca2e0c6aa3" dependencies = [ "anyhow", "clap 3.2.25", @@ -2219,18 +2181,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "mime" @@ -2250,18 +2203,18 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", @@ -2271,38 +2224,37 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1911e88d5831f748a4097a43862d129e3c6fca831eecac9b8db6d01d93c9de2" +checksum = "9e0d88686dc561d743b40de8269b26eaf0dc58781bde087b0984646602021d08" dependencies = [ - "crossbeam-channel 0.5.11", + "crossbeam-channel", "crossbeam-epoch", - "crossbeam-utils 0.8.19", + "crossbeam-utils", "once_cell", "parking_lot", "quanta", "rustc_version", - "skeptic", "smallvec", "tagptr", "thiserror", "triomphe", - "uuid 1.7.0", + "uuid", ] [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "normpath" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec60c60a693226186f5d6edf073232bfb6464ed97eb22cf3b01c1e8198fd97f5" +checksum = "5831952a9476f2fed74b77d74182fa5ddc4d21c72ec45a333b250e3ed0272804" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2311,8 +2263,8 @@ version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.4.0", - "crossbeam-channel 0.5.11", + "bitflags 2.5.0", + "crossbeam-channel", "filetime", "fsevent-sys", "inotify", @@ -2326,11 +2278,12 @@ dependencies = [ [[package]] name = "notify-debouncer-mini" -version = "0.3.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55ee272914f4563a2f8b8553eb6811f3c0caea81c756346bad15b7e3ef969f0" +checksum = "5d40b221972a1fc5ef4d858a2f671fb34c75983eb385463dff3780eeff6a9d43" dependencies = [ - "crossbeam-channel 0.5.11", + "crossbeam-channel", + "log", "notify", ] @@ -2346,44 +2299,36 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", "serde", ] [[package]] -name = "num-derive" -version = "0.3.3" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-bigint", "num-integer", "num-traits", @@ -2392,9 +2337,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -2405,15 +2350,15 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -2435,19 +2380,20 @@ dependencies = [ [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "opener" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c62dcb6174f9cb326eac248f07e955d5d559c272730b6c03e396b443b562788" +checksum = "f8df34be653210fbe9ffaff41d3b92721c56ce82dfee58ee684f9afb5e3a90c0" dependencies = [ "bstr", + "dbus", "normpath", - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -2500,7 +2446,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b3a2a91fdbfdd4d212c0dcc2ab540de2c2bcbbd90be17de7a7daf8822d010c1" dependencies = [ "async-trait", - "crossbeam-channel 0.5.11", + "crossbeam-channel", "dashmap", "fnv", "futures-channel", @@ -2515,9 +2461,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.5.1" +version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" [[package]] name = "overload" @@ -2533,9 +2479,9 @@ checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -2543,22 +2489,28 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pathdiff" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "pbkdf2" @@ -2571,9 +2523,9 @@ dependencies = [ [[package]] name = "peg" -version = "0.7.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07c0b841ea54f523f7aa556956fbd293bcbe06f2e67d2eb732b7278aaf1d166a" +checksum = "8a625d12ad770914cbf7eff6f9314c3ef803bfe364a1b20bc36ddf56673e71e5" dependencies = [ "peg-macros", "peg-runtime", @@ -2581,9 +2533,9 @@ dependencies = [ [[package]] name = "peg-macros" -version = "0.7.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aa52829b8decbef693af90202711348ab001456803ba2a98eb4ec8fb70844c" +checksum = "f241d42067ed3ab6a4fece1db720838e1418f36d868585a27931f95d6bc03582" dependencies = [ "peg-runtime", "proc-macro2", @@ -2592,21 +2544,21 @@ dependencies = [ [[package]] name = "peg-runtime" -version = "0.7.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c719dcf55f09a3a7e764c6649ab594c18a177e3599c467983cdf644bfc0a4088" +checksum = "e3aeb8f54c078314c2065ee649a7241f46b9d8e418e1a9581ba0546657d7aa3a" [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.4" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c022f1e7b65d6a24c0dbbd5fb344c66881bc01f3e5ae74a1c8100f2f985d98a4" +checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" dependencies = [ "memchr", "thiserror", @@ -2615,9 +2567,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.4" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35513f630d46400a977c4cb58f78e1bfbe01434316e60c37d27b9ad6139c66d8" +checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" dependencies = [ "pest", "pest_generator", @@ -2625,22 +2577,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.4" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9fc1b9e7057baba189b5c626e2d6f40681ae5b6eb064dc7c7834101ec8123a" +checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "pest_meta" -version = "2.7.4" +version = "2.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df74e9e7ec4053ceb980e7c0c8bd3594e977fde1af91daba9c928e8e8c6708d" +checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" dependencies = [ "once_cell", "pest", @@ -2649,21 +2601,21 @@ dependencies = [ [[package]] name = "phf" -version = "0.10.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabbf1ead8a5bcbc20f5f8b939ee3f5b0f6f281b6ad3468b84656b658b455259" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "phf_shared", + "phf_shared 0.11.2", ] [[package]] name = "phf_codegen" -version = "0.10.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1c3a8bc4dd4e5cfce29b44ffc14bedd2ee294559a294e2a4d4c9e9a6a13cd" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" dependencies = [ - "phf_generator", - "phf_shared", + "phf_generator 0.11.2", + "phf_shared 0.11.2", ] [[package]] @@ -2672,7 +2624,17 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" dependencies = [ - "phf_shared", + "phf_shared 0.10.0", + "rand", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared 0.11.2", "rand", ] @@ -2685,31 +2647,40 @@ dependencies = [ "siphasher", ] +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2727,11 +2698,23 @@ dependencies = [ "spki", ] +[[package]] +name = "pkg-config" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + [[package]] name = "platforms" -version = "3.1.2" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" + +[[package]] +name = "powerfmt" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" @@ -2747,9 +2730,9 @@ checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-serde", @@ -2782,20 +2765,20 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" dependencies = [ "unicode-ident", ] [[package]] name = "prometheus" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fnv", "lazy_static", "memchr", @@ -2806,9 +2789,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", "prost-derive", @@ -2816,22 +2799,22 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.3" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.11.0", + "itertools", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "prost-types" -version = "0.12.1" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e081b29f63d83a4bc75cfc9f3fe424f9156cf92d8a4f0c9407cce9a1b67327cf" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ "prost", ] @@ -2844,22 +2827,29 @@ checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "pulldown-cmark" -version = "0.9.3" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998" +checksum = "76979bea66e7875e7509c4ec5300112b316af87fa7a252ca91c448b32dfe3993" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "memchr", + "pulldown-cmark-escape", "unicase", ] +[[package]] +name = "pulldown-cmark-escape" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd348ff538bc9caeda7ee8cad2d1d48236a1f443c1fa3913c6a02fe0043b1dd3" + [[package]] name = "quanta" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" dependencies = [ - "crossbeam-utils 0.8.19", + "crossbeam-utils", "libc", "once_cell", "raw-cpuid", @@ -2870,9 +2860,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2909,52 +2899,52 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.0.1" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" +checksum = "e29830cbb1290e404f24c73af91c5d8d631ce7e128691e9477556b540cd01ecd" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", ] [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", ] [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.9.6" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebee201405406dbf528b8b672104ae6d6d63e6d118cb10e4d51abbc7b58044ff" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.9", - "regex-syntax 0.7.5", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -2968,13 +2958,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.9" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.3", ] [[package]] @@ -2985,23 +2975,23 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "base64", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", "futures-util", "h2", - "http", + "http 0.2.12", "http-body", "hyper", "hyper-rustls", @@ -3012,15 +3002,16 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-native-certs", - "rustls-pemfile", + "rustls 0.21.12", + "rustls-native-certs 0.6.3", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -3047,17 +3038,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.16.20" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", + "getrandom", "libc", - "once_cell", "spin", "untrusted", - "web-sys", - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -3071,9 +3062,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -3092,29 +3083,43 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.17" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f25469e9ae0f3d0047ca8b93fc56843f38e6774f0914a107ff8b41be8be8e0b7" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -3122,41 +3127,81 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "schannel", "security-framework", ] [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-pemfile" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64", + "base64 0.22.1", + "rustls-pki-types", ] +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" -version = "0.101.6" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", "untrusted", ] +[[package]] +name = "rustls-webpki" +version = "0.102.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -3169,11 +3214,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3190,9 +3235,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ "ring", "untrusted", @@ -3245,11 +3290,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -3258,9 +3303,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -3268,27 +3313,27 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.197" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.12" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" dependencies = [ "serde", ] @@ -3305,20 +3350,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -3327,9 +3372,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -3337,20 +3382,20 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.16" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" +checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -3373,7 +3418,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] @@ -3385,7 +3430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" dependencies = [ "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.9.0", "opaque-debug", @@ -3397,7 +3442,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] @@ -3429,9 +3474,9 @@ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook" @@ -3445,18 +3490,18 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", "rand_core", @@ -3468,21 +3513,6 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" -[[package]] -name = "skeptic" -version = "0.13.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" -dependencies = [ - "bytecount", - "cargo_metadata", - "error-chain", - "glob", - "pulldown-cmark", - "tempfile", - "walkdir", -] - [[package]] name = "slab" version = "0.4.9" @@ -3494,41 +3524,31 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" - -[[package]] -name = "socket2" -version = "0.4.9" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" -dependencies = [ - "libc", - "winapi", -] +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der", @@ -3549,7 +3569,7 @@ dependencies = [ "new_debug_unreachable", "once_cell", "parking_lot", - "phf_shared", + "phf_shared 0.10.0", "precomputed-hash", "serde", ] @@ -3560,8 +3580,8 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bb30289b722be4ff74a408c3cc27edeaad656e06cb1fe8fa9231fa59c728988" dependencies = [ - "phf_generator", - "phf_shared", + "phf_generator 0.10.0", + "phf_shared 0.10.0", "proc-macro2", "quote", ] @@ -3572,6 +3592,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "strum" version = "0.25.0" @@ -3583,15 +3609,15 @@ dependencies = [ [[package]] name = "strum_macros" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -3628,9 +3654,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" dependencies = [ "proc-macro2", "quote", @@ -3684,22 +3710,21 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", - "redox_syscall 0.3.5", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tendermint" -version = "0.34.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc2294fa667c8b548ee27a9ba59115472d0a09c2ba255771092a7f1dcf03a789" +checksum = "8b50aae6ec24c3429149ad59b5b8d3374d7804d4c7d6125ceb97cb53907fb68d" dependencies = [ "bytes", "digest 0.10.7", @@ -3728,26 +3753,26 @@ dependencies = [ [[package]] name = "tendermint-config" -version = "0.34.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a25dbe8b953e80f3d61789fbdb83bf9ad6c0ef16df5ca6546f49912542cc137" +checksum = "e07b383dc8780ebbec04cfb603f3fdaba6ea6663d8dd861425b1ffa7761fe90d" dependencies = [ "flex-error", "serde", "serde_json", "tendermint", - "toml 0.5.11", + "toml 0.8.13", "url", ] [[package]] name = "tendermint-light-client" -version = "0.34.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94aecbdccbc4b557649b2d1b1a4bfc27ec85205e00fb8020fce044245a4c9e3f" +checksum = "331544139bbcf353acb5f56e733093d8e4bf2522cda0491b4bba7039ef0b944e" dependencies = [ "contracts", - "crossbeam-channel 0.4.4", + "crossbeam-channel", "derive_more", "flex-error", "futures", @@ -3767,12 +3792,11 @@ dependencies = [ [[package]] name = "tendermint-light-client-detector" -version = "0.34.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea83654b03e3ddc6782c9704a3fefd4d0671bd6c5e3f09d29e31fcb45e75636c" +checksum = "73d0ffaf614bd2db605c4762e3a31a536b73cd45488fa5bace050135ca348f28" dependencies = [ - "contracts", - "crossbeam-channel 0.4.4", + "crossbeam-channel", "derive_more", "flex-error", "futures", @@ -3791,9 +3815,9 @@ dependencies = [ [[package]] name = "tendermint-light-client-verifier" -version = "0.34.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74994da9de4b1144837a367ca2c60c650f5526a7c1a54760a3020959b522e474" +checksum = "4216e487165e5dbd7af79952eaa0d5f06c5bde861eb76c690acd7f2d2a19395c" dependencies = [ "derive_more", "flex-error", @@ -3804,14 +3828,12 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.34.1" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b797dd3d2beaaee91d2f065e7bdf239dc8d80bba4a183a288bc1279dd5a69a1e" +checksum = "46f193d04afde6592c20fd70788a10b8cb3823091c07456db70d8a93f5fb99c1" dependencies = [ "bytes", "flex-error", - "num-derive", - "num-traits", "prost", "prost-types", "serde", @@ -3822,9 +3844,9 @@ dependencies = [ [[package]] name = "tendermint-rpc" -version = "0.34.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfbf0a4753b46a190f367337e0163d0b552a2674a6bac54e74f9f2cdcde2969b" +checksum = "21e3c231a3632cab53f92ad4161c730c468c08cfe4f0aa5a6735b53b390aecbd" dependencies = [ "async-trait", "async-tungstenite", @@ -3834,6 +3856,7 @@ dependencies = [ "getrandom", "peg", "pin-project", + "rand", "reqwest", "semver", "serde", @@ -3849,7 +3872,7 @@ dependencies = [ "tokio", "tracing", "url", - "uuid 0.8.2", + "uuid", "walkdir", ] @@ -3866,9 +3889,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] @@ -3885,47 +3908,49 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] [[package]] name = "time" -version = "0.3.29" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -3939,10 +3964,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -3991,9 +4017,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -4003,7 +4029,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.4", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -4020,13 +4046,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] @@ -4035,15 +4061,26 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.4", + "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -4052,9 +4089,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" dependencies = [ "futures-util", "log", @@ -4064,16 +4101,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -4087,9 +4123,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ "serde", "serde_spanned", @@ -4099,20 +4135,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -4121,28 +4157,28 @@ dependencies = [ [[package]] name = "tonic" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" dependencies = [ "async-stream", "async-trait", "axum", - "base64", + "base64 0.21.7", "bytes", "h2", - "http", + "http 0.2.12", "http-body", "hyper", "hyper-timeout", "percent-encoding", "pin-project", "prost", - "rustls", - "rustls-native-certs", - "rustls-pemfile", + "rustls-native-certs 0.7.0", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tokio-stream", "tower", "tower-layer", @@ -4190,11 +4226,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if 1.0.0", "log", "pin-project-lite", "tracing-attributes", @@ -4203,20 +4238,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -4234,12 +4269,23 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] @@ -4255,9 +4301,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -4270,36 +4316,37 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.2.0", "tracing-serde", ] [[package]] name = "triomphe" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eee8098afad3fb0c54a9007aab6804558410503ad676d4633f9c2559a00ac0f" +checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 1.1.0", "httparse", "log", "rand", - "rustls", + "rustls 0.22.4", + "rustls-pki-types", "sha1", "thiserror", "url", @@ -4341,9 +4388,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -4353,18 +4400,18 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "unicode-xid" @@ -4374,15 +4421,15 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -4403,9 +4450,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8-width" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" +checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" [[package]] name = "utf8parse" @@ -4415,15 +4462,9 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" - -[[package]] -name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", ] @@ -4451,9 +4492,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -4470,28 +4511,26 @@ dependencies = [ [[package]] name = "warp" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e92e22e03ff1230c03a1a8ee37d2f89cd489e2e541b7550d6afad96faed169" +checksum = "4378d202ff965b011c64817db11d5829506d3404edeadb61f190d111da3f231c" dependencies = [ "bytes", "futures-channel", "futures-util", "headers", - "http", + "http 0.2.12", "hyper", "log", "mime", "mime_guess", "percent-encoding", "pin-project", - "rustls-pemfile", "scoped-tls", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-stream", "tokio-tungstenite", "tokio-util", "tower-service", @@ -4506,36 +4545,36 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -4543,9 +4582,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4553,28 +4592,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -4598,11 +4637,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -4612,21 +4651,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.52.5", ] [[package]] @@ -4639,18 +4669,12 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.42.2" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.52.5", ] [[package]] @@ -4669,10 +4693,20 @@ dependencies = [ ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" +name = "windows-targets" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +dependencies = [ + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", +] [[package]] name = "windows_aarch64_gnullvm" @@ -4681,10 +4715,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" +name = "windows_aarch64_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -4693,10 +4727,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] -name = "windows_i686_gnu" -version = "0.42.2" +name = "windows_aarch64_msvc" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -4705,10 +4739,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] -name = "windows_i686_msvc" -version = "0.42.2" +name = "windows_i686_gnu" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -4717,10 +4757,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" +name = "windows_i686_msvc" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -4729,10 +4769,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" +name = "windows_x86_64_gnu" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -4741,10 +4781,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" +name = "windows_x86_64_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -4752,11 +4792,17 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" + [[package]] name = "winnow" -version = "0.5.15" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ "memchr", ] @@ -4767,15 +4813,15 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "windows-sys 0.48.0", ] [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" dependencies = [ "zeroize_derive", ] @@ -4788,5 +4834,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.65", ] diff --git a/tools/check-guide/Cargo.toml b/tools/check-guide/Cargo.toml index 4239591403..e5a77be25f 100644 --- a/tools/check-guide/Cargo.toml +++ b/tools/check-guide/Cargo.toml @@ -11,4 +11,3 @@ lazy_static = "1.4.0" mdbook-template = "1.1.0" regex = "1" walkdir = "2.3.3" - diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index af3977fb9e..826c5035fe 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -29,27 +29,28 @@ toml = { workspace = true } tonic = { workspace = true, features = ["tls", "tls-roots"] } [features] -default = [] -example = [] -manual = [] -ordered = [] -ica = [] -ics29-fee = [] -experimental = [] -mbt = [] -forward-packet = [] -ics31 = [] -clean-workers = [] -fee-grant = [] +default = [] +example = [] +manual = [] +ordered = [] +ica = [] +ics29-fee = [] +experimental = [] +mbt = [] +forward-packet = [] +ics31 = [] +clean-workers = [] +fee-grant = [] +channel-upgrade = [] interchain-security = [] -celestia = [] -async-icq = [] -juno = [] -dynamic-gas-fee = [] +celestia = [] +async-icq = [] +juno = [] +dynamic-gas-fee = [] [[bin]] name = "test_setup_with_binary_channel" -doc = true +doc = true [dev-dependencies] tempfile = { workspace = true } diff --git a/tools/integration-test/src/tests/async_icq/simple_query.rs b/tools/integration-test/src/tests/async_icq/simple_query.rs index 4d2824d344..f8343d1811 100644 --- a/tools/integration-test/src/tests/async_icq/simple_query.rs +++ b/tools/integration-test/src/tests/async_icq/simple_query.rs @@ -1,6 +1,8 @@ use ibc_relayer::channel::version::Version; use ibc_relayer::config::ChainConfig; -use ibc_test_framework::chain::config::{set_max_deposit_period, set_voting_period}; +use ibc_test_framework::chain::config::{ + add_allow_message_interchainquery, set_max_deposit_period, set_voting_period, +}; use ibc_test_framework::chain::ext::async_icq::AsyncIcqMethodsExt; use ibc_test_framework::chain::ext::bootstrap::ChainBootstrapMethodsExt; use ibc_test_framework::prelude::*; @@ -30,26 +32,11 @@ impl TestOverrides for AsyncIcqTest { // Allow Oracle message on host side fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { - use serde_json::Value; - set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?; set_voting_period(genesis, VOTING_PERIOD)?; + add_allow_message_interchainquery(genesis, "/provenance.oracle.v1.Query/Oracle")?; - let allow_messages = genesis - .get_mut("app_state") - .and_then(|app_state| app_state.get_mut("interchainquery")) - .and_then(|ica| ica.get_mut("params")) - .and_then(|params| params.get_mut("allow_queries")) - .and_then(|allow_messages| allow_messages.as_array_mut()); - - if let Some(allow_messages) = allow_messages { - allow_messages.push(Value::String( - "/provenance.oracle.v1.Query/Oracle".to_string(), - )); - Ok(()) - } else { - Err(Error::generic(eyre!("failed to update genesis file"))) - } + Ok(()) } fn channel_version(&self) -> Version { @@ -109,7 +96,7 @@ impl BinaryConnectionTest for AsyncIcqTest { "1", )?; - driver.vote_proposal(&fee_denom_a.with_amount(381000000u64).to_string())?; + driver.vote_proposal(&fee_denom_a.with_amount(381000000u64).to_string(), "1")?; info!("Assert that the update oracle proposal is eventually passed"); diff --git a/tools/integration-test/src/tests/channel_upgrade/flushing.rs b/tools/integration-test/src/tests/channel_upgrade/flushing.rs new file mode 100644 index 0000000000..0e4bdf7143 --- /dev/null +++ b/tools/integration-test/src/tests/channel_upgrade/flushing.rs @@ -0,0 +1,422 @@ +//! Tests that the relayer correctly flushes in-flight packets during channel upgrade. +//! +//! - `ChannelUpgradeFlushing` tests that the channel worker will complete the +//! upgrade handshake when there are pending packets before starting the channel upgrade. +//! +//! - `ChannelUpgradeHandshakeFlushPackets` tests that the channel worker will complete the +//! upgrade handshake when packets need to be flushed during the handshake. + +use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeight}; +use ibc_relayer_types::core::ics04_channel::channel::State as ChannelState; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics04_channel::version::Version; +use ibc_test_framework::chain::config::{set_max_deposit_period, set_voting_period}; +use ibc_test_framework::prelude::*; +use ibc_test_framework::relayer::channel::{ + assert_eventually_channel_established, assert_eventually_channel_upgrade_ack, + assert_eventually_channel_upgrade_init, assert_eventually_channel_upgrade_open, + assert_eventually_channel_upgrade_try, ChannelUpgradableAttributes, +}; +use ibc_test_framework::util::random::random_u128_range; + +#[test] +fn test_channel_upgrade_simple_flushing() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeFlushing) +} + +#[test] +fn test_channel_upgrade_handshake_flush_packets() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeHandshakeFlushPackets) +} + +const MAX_DEPOSIT_PERIOD: &str = "10s"; +const VOTING_PERIOD: u64 = 10; + +pub struct ChannelUpgradeFlushing; + +impl TestOverrides for ChannelUpgradeFlushing { + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.channels.enabled = true; + config.mode.packets.auto_register_counterparty_payee = true; + config.mode.packets.clear_interval = 0; + config.mode.packets.clear_on_start = true; + + config.mode.clients.misbehaviour = false; + } + + fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { + set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?; + set_voting_period(genesis, VOTING_PERIOD)?; + Ok(()) + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +impl BinaryChannelTest for ChannelUpgradeFlushing { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let chain_driver_a = chains.node_a.chain_driver(); + let chain_driver_b = chains.node_b.chain_driver(); + + let denom_a = chains.node_a.denom(); + + let port_a = channels.port_a.as_ref(); + let channel_id_a = channels.channel_id_a.as_ref(); + + let wallets_a = chains.node_a.wallets(); + let wallets_b = chains.node_b.wallets(); + + let user_a = wallets_a.user1(); + let user_b = wallets_b.user1(); + + let send_amount = random_u128_range(1000, 2000); + + chain_driver_a.ibc_transfer_token( + &port_a, + &channel_id_a, + &user_a, + &user_b.address(), + &denom_a.with_amount(send_amount).as_ref(), + )?; + + sleep(Duration::from_secs(3)); + + chain_driver_a.ibc_transfer_token( + &port_a, + &channel_id_a, + &user_a, + &user_b.address(), + &denom_a.with_amount(send_amount).as_ref(), + )?; + + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let upgraded_attrs = ChannelUpgradableAttributes::new( + new_version.clone(), + new_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b, + Sequence::from(1), + ); + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + sleep(Duration::from_secs(5)); + + info!("Check that the channel upgrade successfully upgraded the version..."); + + relayer.with_supervisor(|| { + let denom_b = derive_ibc_denom( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &denom_a, + )?; + + chain_driver_b.assert_eventual_wallet_amount( + &user_b.address(), + &denom_b.with_amount(send_amount + send_amount).as_ref(), + )?; + + assert_eventually_channel_upgrade_open( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &upgraded_attrs, + )?; + + Ok(()) + }) + } +} + +struct ChannelUpgradeHandshakeFlushPackets; + +impl TestOverrides for ChannelUpgradeHandshakeFlushPackets { + fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { + set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?; + set_voting_period(genesis, VOTING_PERIOD)?; + Ok(()) + } + + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.channels.enabled = true; + + config.mode.clients.misbehaviour = false; + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +impl BinaryChannelTest for ChannelUpgradeHandshakeFlushPackets { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_version = channel_end_a.version; + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let old_attrs = ChannelUpgradableAttributes::new( + old_version.clone(), + old_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + let upgraded_attrs = ChannelUpgradableAttributes::new( + new_version.clone(), + new_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b, + Sequence::from(1), + ); + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Check that the step ChanUpgradeInit was correctly executed..."); + + assert_eventually_channel_upgrade_init( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &old_attrs, + )?; + + // send a IBC transfer message from chain a to chain b + // so that we have an in-flight packet and chain a + // will move to `FLUSHING` during Ack + let denom_a = chains.node_a.denom(); + let wallet_a = chains.node_a.wallets().user1().cloned(); + let wallet_b = chains.node_b.wallets().user1().cloned(); + let a_to_b_amount = random_u128_range(1000, 5000); + + info!( + "Sending IBC transfer from chain {} to chain {} with amount of {} {}", + chains.chain_id_a(), + chains.chain_id_b(), + a_to_b_amount, + denom_a + ); + + chains.node_a.chain_driver().ibc_transfer_token( + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + )?; + + // send a IBC transfer message from chain b to chain a + // so that we have an in-flight packet and chain a + // will move to `FLUSHING` during Try + let denom_b = chains.node_b.denom(); + let b_to_a_amount = random_u128_range(1000, 5000); + + info!( + "Sending IBC transfer from chain {} to chain {} with amount of {} {}", + chains.chain_id_b(), + chains.chain_id_a(), + b_to_a_amount, + denom_b + ); + + chains.node_b.chain_driver().ibc_transfer_token( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &wallet_b.as_ref(), + &wallet_a.address(), + &denom_b.with_amount(b_to_a_amount).as_ref(), + )?; + + info!("Will run ChanUpgradeTry step..."); + + channel.build_chan_upgrade_try_and_send()?; + + info!("Check that the step ChanUpgradeTry was correctly executed..."); + + assert_eventually_channel_upgrade_try( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + info!("Will run ChanUpgradeAck step..."); + + channel.flipped().build_chan_upgrade_ack_and_send()?; + + info!("Check that the step ChanUpgradeAck was correctly executed..."); + + // channel a is `FLUSHING` because the packet + // from a to b has not been cleared yet + assert_eventually_channel_upgrade_ack( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + ChannelState::Flushing, + ChannelState::Flushing, + &old_attrs, + )?; + + info!("Check that the channel upgrade successfully upgraded the version..."); + + // start supervisor to clear in-flight packets + // and move channel ends to `FLUSH_COMPLETE` + relayer.with_supervisor(|| { + let ibc_denom_a = derive_ibc_denom( + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &denom_b, + )?; + + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &wallet_a.address(), + &ibc_denom_a.with_amount(b_to_a_amount).as_ref(), + )?; + + let ibc_denom_b = derive_ibc_denom( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &denom_a, + )?; + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b.address(), + &ibc_denom_b.with_amount(a_to_b_amount).as_ref(), + )?; + + // This will assert that both channel ends are eventually + // in Open state, and that the fields targeted by the upgrade + // have been correctly updated. + assert_eventually_channel_upgrade_open( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &upgraded_attrs, + )?; + + Ok(()) + }) + } +} diff --git a/tools/integration-test/src/tests/channel_upgrade/ica.rs b/tools/integration-test/src/tests/channel_upgrade/ica.rs new file mode 100644 index 0000000000..8b738b6855 --- /dev/null +++ b/tools/integration-test/src/tests/channel_upgrade/ica.rs @@ -0,0 +1,516 @@ +//! Tests channel upgrade features: +//! +//! - `ChannelUpgradeICACloseChannel` tests that after the upgrade handshake is completed +//! and the channel version has been updated to ICS29 a packet timeout closes the channel. +//! +//! - `ChannelUpgradeICAUnordered` tests that after the after sending a packet on an ordered +//! ICA channel, the upgrade handshake is completed when the channel is upgraded to unordered. + +use serde_json as json; +use std::collections::HashMap; +use std::str::FromStr; + +use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeight}; +use ibc_relayer::chain::tracking::TrackedMsgs; +use ibc_relayer::config::{ + filter::{ChannelFilters, ChannelPolicy, FilterPattern}, + ChainConfig, PacketFilter, +}; +use ibc_relayer::event::IbcEventWithHeight; + +use ibc_relayer_types::applications::{ + ics27_ica, + ics27_ica::{ + cosmos_tx::CosmosTx, msgs::send_tx::MsgSendTx, packet_data::InterchainAccountPacketData, + }, + transfer::{msgs::send::MsgSend, Amount, Coin}, +}; +use ibc_relayer_types::bigint::U256; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics04_channel::version::Version; +use ibc_relayer_types::signer::Signer; +use ibc_relayer_types::timestamp::Timestamp; +use ibc_relayer_types::tx_msg::Msg; + +use ibc_test_framework::chain::config::{ + add_allow_message_interchainaccounts, set_max_deposit_period, set_voting_period, +}; +use ibc_test_framework::chain::ext::ica::register_interchain_account; +use ibc_test_framework::prelude::*; +use ibc_test_framework::relayer::channel::{ + assert_eventually_channel_closed, assert_eventually_channel_established, + assert_eventually_channel_upgrade_open, ChannelUpgradableAttributes, +}; + +#[test] +fn test_channel_upgrade_ica_close_channel() -> Result<(), Error> { + run_binary_connection_test(&ChannelUpgradeICACloseChannel) +} + +#[test] +fn test_channel_upgrade_ica_unordered() -> Result<(), Error> { + run_binary_connection_test(&ChannelUpgradeICAUnordered::new(PacketFilter::new( + ChannelPolicy::Allow(ChannelFilters::new(vec![( + FilterPattern::Wildcard("ica*".parse().unwrap()), + FilterPattern::Wildcard("*".parse().unwrap()), + )])), + HashMap::new(), + ))) +} + +const MAX_DEPOSIT_PERIOD: &str = "10s"; +const VOTING_PERIOD: u64 = 10; + +pub struct ChannelUpgradeICACloseChannel; + +impl TestOverrides for ChannelUpgradeICACloseChannel { + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.channels.enabled = true; + + config.mode.clients.misbehaviour = false; + } + + fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { + set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?; + set_voting_period(genesis, VOTING_PERIOD)?; + + Ok(()) + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +impl BinaryConnectionTest for ChannelUpgradeICACloseChannel { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + connection: ConnectedConnection, + ) -> Result<(), Error> { + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); + + // Run the block with supervisor in order to open and then upgrade the ICA channel + let (wallet, ica_address, controller_channel_id, controller_port_id) = relayer + .with_supervisor(|| { + // Register an interchain account on behalf of + // controller wallet `user1` where the counterparty chain is the interchain accounts host. + let (wallet, controller_channel_id, controller_port_id) = + register_interchain_account(&chains.node_a, chains.handle_a(), &connection)?; + + // Check that the corresponding ICA channel is eventually established. + let _counterparty_channel_id = assert_eventually_channel_established( + chains.handle_a(), + chains.handle_b(), + &controller_channel_id.as_ref(), + &controller_port_id.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: controller_port_id.value().clone(), + channel_id: controller_channel_id.value().clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let host_port_id = channel_end_a.remote.port_id; + let host_channel_id = channel_end_a + .remote + .channel_id + .ok_or_else(|| eyre!("expect to find counterparty channel id"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: host_port_id.clone(), + channel_id: host_channel_id.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + // Query the controller chain for the address of the ICA wallet on the host chain. + let ica_address = chains.node_a.chain_driver().query_interchain_account( + &wallet.address(), + &connection.connection_id_a.as_ref(), + )?; + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &ica_address.as_ref(), + &stake_denom.with_amount(0u64).as_ref(), + )?; + + let app_version = json::json!({ + "version": ics27_ica::VERSION, + "encoding": "proto3", + "tx_type": "sdk_multi_msg", + "address": ica_address.to_string(), + "controller_connection_id": connection.connection_id_a.0, + "host_connection_id": connection.connection_id_b.0, + }); + let new_version = Version::app_version_with_fee(&app_version.to_string()); + + let upgraded_attrs = ChannelUpgradableAttributes::new( + new_version.clone(), + new_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + controller_port_id.to_string().as_str(), + controller_channel_id.to_string().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Check that the channel upgrade successfully upgraded the version..."); + + assert_eventually_channel_upgrade_open( + &chains.handle_a, + &chains.handle_b, + &controller_channel_id.as_ref(), + &controller_port_id.as_ref(), + &upgraded_attrs, + )?; + sleep(Duration::from_secs(5)); + + Ok(( + wallet, + ica_address, + controller_channel_id, + controller_port_id, + )) + })?; + + // Create a pending ICA transfer without supervisor in order to created a timed out + // packet + + // Send funds to the interchain account. + let ica_fund = 42000u64; + + chains.node_b.chain_driver().local_transfer_token( + &chains.node_b.wallets().user1(), + &ica_address.as_ref(), + &stake_denom.with_amount(ica_fund).as_ref(), + )?; + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &ica_address.as_ref(), + &stake_denom.with_amount(ica_fund).as_ref(), + )?; + + let amount = 12345u64; + + let msg = MsgSend { + from_address: ica_address.to_string(), + to_address: chains.node_b.wallets().user2().address().to_string(), + amount: vec![Coin { + denom: stake_denom.to_string(), + amount: Amount(U256::from(amount)), + }], + }; + + let raw_msg = msg.to_any(); + + let cosmos_tx = CosmosTx { + messages: vec![raw_msg], + }; + + let raw_cosmos_tx = cosmos_tx.to_any(); + + let interchain_account_packet_data = InterchainAccountPacketData::new(raw_cosmos_tx.value); + + let signer = Signer::from_str(&wallet.address().to_string()).unwrap(); + + let balance_user2 = chains.node_b.chain_driver().query_balance( + &chains.node_b.wallets().user2().address(), + &stake_denom.as_ref(), + )?; + sleep(Duration::from_secs(5)); + + interchain_send_tx( + chains.handle_a(), + &signer, + &connection.connection_id_a.0, + interchain_account_packet_data.clone(), + Timestamp::from_nanoseconds(1000000000).unwrap(), + )?; + + sleep(Duration::from_nanos(3000000000)); + + // Start the supervisor which will relay the timed out packet and close the channel + relayer.with_supervisor(|| { + // Check that user2 has not received the sent amount. + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &chains.node_b.wallets().user2().address(), + &(balance_user2).as_ref(), + )?; + sleep(Duration::from_secs(5)); + + // Check that the ICA account's balance has not been debited the sent amount. + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &ica_address.as_ref(), + &stake_denom.with_amount(ica_fund).as_ref(), + )?; + + info!("Check that the channel closed after packet timeout..."); + + assert_eventually_channel_closed( + &chains.handle_a, + &chains.handle_b, + &controller_channel_id.as_ref(), + &controller_port_id.as_ref(), + )?; + + Ok(()) + }) + } +} + +pub struct ChannelUpgradeICAUnordered { + packet_filter: PacketFilter, +} + +impl ChannelUpgradeICAUnordered { + pub fn new(packet_filter: PacketFilter) -> Self { + Self { packet_filter } + } +} + +impl TestOverrides for ChannelUpgradeICAUnordered { + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.channels.enabled = true; + + config.mode.clients.misbehaviour = false; + + for chain in &mut config.chains { + match chain { + ChainConfig::CosmosSdk(chain_config) => { + chain_config.packet_filter = self.packet_filter.clone(); + } + } + } + } + + fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { + add_allow_message_interchainaccounts(genesis, "/cosmos.bank.v1beta1.MsgSend")?; + set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?; + set_voting_period(genesis, VOTING_PERIOD)?; + + Ok(()) + } + + fn should_spawn_supervisor(&self) -> bool { + true + } +} + +impl BinaryConnectionTest for ChannelUpgradeICAUnordered { + fn run( + &self, + _config: &TestConfig, + _relayer: RelayerDriver, + chains: ConnectedChains, + connection: ConnectedConnection, + ) -> Result<(), Error> { + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); + + info!("Will register interchain account..."); + + // Register an interchain account on behalf of + // controller wallet `user1` where the counterparty chain is the interchain accounts host. + let (wallet, controller_channel_id, controller_port_id) = + register_interchain_account(&chains.node_a, chains.handle_a(), &connection)?; + + // Check that the corresponding ICA channel is eventually established. + let _counterparty_channel_id = assert_eventually_channel_established( + chains.handle_a(), + chains.handle_b(), + &controller_channel_id.as_ref(), + &controller_port_id.as_ref(), + )?; + + // Query the controller chain for the address of the ICA wallet on the host chain. + let ica_address = chains + .node_a + .chain_driver() + .query_interchain_account(&wallet.address(), &connection.connection_id_a.as_ref())?; + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &ica_address.as_ref(), + &stake_denom.with_amount(0u64).as_ref(), + )?; + + info!("Will send a message to the interchain account..."); + + // Send funds to the interchain account. + let ica_fund = 42000u64; + + chains.node_b.chain_driver().local_transfer_token( + &chains.node_b.wallets().user1(), + &ica_address.as_ref(), + &stake_denom.with_amount(ica_fund).as_ref(), + )?; + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &ica_address.as_ref(), + &stake_denom.with_amount(ica_fund).as_ref(), + )?; + + let amount = 12345u64; + + let msg = MsgSend { + from_address: ica_address.to_string(), + to_address: chains.node_b.wallets().user2().address().to_string(), + amount: vec![Coin { + denom: stake_denom.to_string(), + amount: Amount(U256::from(amount)), + }], + }; + + let raw_msg = msg.to_any(); + + let cosmos_tx = CosmosTx { + messages: vec![raw_msg], + }; + + let raw_cosmos_tx = cosmos_tx.to_any(); + + let interchain_account_packet_data = InterchainAccountPacketData::new(raw_cosmos_tx.value); + + let signer = Signer::from_str(&wallet.address().to_string()).unwrap(); + + interchain_send_tx( + chains.handle_a(), + &signer, + &connection.connection_id_a.0, + interchain_account_packet_data.clone(), + Timestamp::from_nanoseconds(10000000000).unwrap(), + )?; + + // Check that the ICA account's balance has been debited the sent amount. + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &ica_address.as_ref(), + &stake_denom.with_amount(ica_fund - amount).as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: controller_port_id.value().clone(), + channel_id: controller_channel_id.value().clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let host_port_id = channel_end_a.remote.port_id; + let host_channel_id = channel_end_a + .remote + .channel_id + .ok_or_else(|| eyre!("expect to find counterparty channel id"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: host_port_id.clone(), + channel_id: host_channel_id.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_version_a = channel_end_a.version; + let old_version_b = channel_end_b.version; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let new_ordering = Ordering::Unordered; + + let upgraded_attrs = ChannelUpgradableAttributes::new( + old_version_a.clone(), + old_version_b.clone(), + new_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + controller_port_id.to_string().as_str(), + controller_channel_id.to_string().as_str(), + new_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&old_version_a.0).unwrap(), + &chains.node_a.wallets().user2().address().to_string(), + "1", + )?; + + info!("Check that the channel upgrade successfully upgraded the ordering..."); + + assert_eventually_channel_upgrade_open( + &chains.handle_a, + &chains.handle_b, + &controller_channel_id.as_ref(), + &controller_port_id.as_ref(), + &upgraded_attrs, + )?; + sleep(Duration::from_secs(5)); + + Ok(()) + } +} + +fn interchain_send_tx( + chain: &ChainA, + from: &Signer, + connection: &ConnectionId, + msg: InterchainAccountPacketData, + relative_timeout: Timestamp, +) -> Result, Error> { + let msg = MsgSendTx { + owner: from.clone(), + connection_id: connection.clone(), + packet_data: msg, + relative_timeout, + }; + + let msg_any = msg.to_any(); + + let tm = TrackedMsgs::new_static(vec![msg_any], "SendTx"); + + chain + .send_messages_and_wait_commit(tm) + .map_err(Error::relayer) +} diff --git a/tools/integration-test/src/tests/channel_upgrade/ics29.rs b/tools/integration-test/src/tests/channel_upgrade/ics29.rs new file mode 100644 index 0000000000..02f90b2745 --- /dev/null +++ b/tools/integration-test/src/tests/channel_upgrade/ics29.rs @@ -0,0 +1,227 @@ +//! Tests channel upgrade features: +//! +//! - `ChannelUpgradeICS29` tests that only after the upgrade handshake is completed +//! and the channel version has been updated to ICS29 can Incentivized packets be +//! relayed. + +use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeight}; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics04_channel::version::Version; +use ibc_test_framework::chain::config::{set_max_deposit_period, set_voting_period}; +use ibc_test_framework::prelude::*; +use ibc_test_framework::relayer::channel::{ + assert_eventually_channel_established, assert_eventually_channel_upgrade_open, + ChannelUpgradableAttributes, +}; +use ibc_test_framework::util::random::random_u128_range; + +#[test] +fn test_channel_upgrade_ics29() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeICS29) +} + +const MAX_DEPOSIT_PERIOD: &str = "10s"; +const VOTING_PERIOD: u64 = 10; + +pub struct ChannelUpgradeICS29; + +impl TestOverrides for ChannelUpgradeICS29 { + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.channels.enabled = true; + config.mode.packets.auto_register_counterparty_payee = true; + config.mode.packets.clear_interval = 0; + config.mode.packets.clear_on_start = false; + + config.mode.clients.misbehaviour = false; + } + + fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { + set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?; + set_voting_period(genesis, VOTING_PERIOD)?; + Ok(()) + } +} + +impl BinaryChannelTest for ChannelUpgradeICS29 { + fn run( + &self, + _config: &TestConfig, + _relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let chain_driver_a = chains.node_a.chain_driver(); + let chain_driver_b = chains.node_b.chain_driver(); + + let denom_a = chains.node_a.denom(); + + let port_a = channels.port_a.as_ref(); + let channel_id_a = channels.channel_id_a.as_ref(); + + let wallets_a = chains.node_a.wallets(); + let wallets_b = chains.node_b.wallets(); + + let relayer_a = wallets_a.relayer(); + + let user_a = wallets_a.user1(); + let user_b = wallets_b.user1(); + + let balance_a1 = chain_driver_a.query_balance(&user_a.address(), &denom_a)?; + + let relayer_balance_a = chain_driver_a.query_balance(&relayer_a.address(), &denom_a)?; + + let send_amount = random_u128_range(1000, 2000); + let receive_fee = random_u128_range(300, 400); + let ack_fee = random_u128_range(200, 300); + let timeout_fee = random_u128_range(100, 200); + + let total_sent = send_amount + receive_fee + ack_fee + timeout_fee; + + let balance_a2 = balance_a1 - total_sent; + + let ics29_transfer = chain_driver_a.ibc_token_transfer_with_fee( + &port_a, + &channel_id_a, + &user_a, + &user_b.address(), + &denom_a.with_amount(send_amount).as_ref(), + &denom_a.with_amount(receive_fee).as_ref(), + &denom_a.with_amount(ack_fee).as_ref(), + &denom_a.with_amount(timeout_fee).as_ref(), + Duration::from_secs(60), + ); + + assert!(ics29_transfer.is_err(), "{ics29_transfer:?}"); + + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let upgraded_attrs = ChannelUpgradableAttributes::new( + new_version.clone(), + new_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b, + Sequence::from(1), + ); + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Check that the channel upgrade successfully upgraded the version..."); + + assert_eventually_channel_upgrade_open( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &upgraded_attrs, + )?; + + // Since the channel has been updated to ICS29 version after the Hermes instance + // was started, the `auto_register_counterparty_payee` has not registered the + // counterparty payee. It is required to register it manually. + chain_driver_b.register_counterparty_payee( + &wallets_b.relayer(), + &relayer_a.address(), + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + { + let counterparty_payee = chain_driver_b.query_counterparty_payee( + &channels.channel_id_b.as_ref(), + &wallets_b.relayer().address(), + )?; + + assert_eq( + "counterparty address should match registered address", + &counterparty_payee, + &Some(relayer_a.address().cloned()), + )?; + } + + chain_driver_a.ibc_token_transfer_with_fee( + &port_a, + &channel_id_a, + &user_a, + &user_b.address(), + &denom_a.with_amount(send_amount).as_ref(), + &denom_a.with_amount(receive_fee).as_ref(), + &denom_a.with_amount(ack_fee).as_ref(), + &denom_a.with_amount(timeout_fee).as_ref(), + Duration::from_secs(60), + )?; + + let denom_b = derive_ibc_denom( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &denom_a, + )?; + + chain_driver_b.assert_eventual_wallet_amount( + &user_b.address(), + &denom_b.with_amount(send_amount).as_ref(), + )?; + + chain_driver_a.assert_eventual_wallet_amount( + &user_a.address(), + &(balance_a2 + timeout_fee).as_ref(), + )?; + + chain_driver_a.assert_eventual_wallet_amount( + &relayer_a.address(), + &(relayer_balance_a + ack_fee + receive_fee).as_ref(), + )?; + + Ok(()) + } +} diff --git a/tools/integration-test/src/tests/channel_upgrade/mod.rs b/tools/integration-test/src/tests/channel_upgrade/mod.rs new file mode 100644 index 0000000000..2e40d3bd5e --- /dev/null +++ b/tools/integration-test/src/tests/channel_upgrade/mod.rs @@ -0,0 +1,6 @@ +pub mod flushing; +pub mod ica; +pub mod ics29; +pub mod timeout; +pub mod upgrade_handshake; +pub mod upgrade_handshake_steps; diff --git a/tools/integration-test/src/tests/channel_upgrade/timeout.rs b/tools/integration-test/src/tests/channel_upgrade/timeout.rs new file mode 100644 index 0000000000..42bdd288ed --- /dev/null +++ b/tools/integration-test/src/tests/channel_upgrade/timeout.rs @@ -0,0 +1,1067 @@ +//! Tests channel upgrade: +//! +//! - `ChannelUpgradeTimeoutAckHandshake` tests that the channel worker will timeout the +//! upgrade handshake if too much time passes before relaying the Upgrade Ack. +//! +//! - `ChannelUpgradeTimeoutConfirmHandshake` tests that the channel worker will timeout the +//! upgrade handshake if too much time passes before relaying the Upgrade Confirm. +//! +//! - `ChannelUpgradeManualTimeoutWhenFlushingHandshake` tests that the channel upgrade can be timed out +//! and cancelled if the packets take too much time to be flushed. +//! +//! - `ChannelUpgradeHandshakeTimeoutWhenFlushing` tests that the channel worker will timeout the +//! upgrade handshake if the counterparty does not finish flushing the packets before the upgrade timeout. +//! +//! - `ChannelUpgradeHandshakeTimeoutOnAck` tests that the channel worker will cancel the +//! upgrade handshake if the Ack step fails due to an upgrade timeout. +//! +//! - `ChannelUpgradeHandshakeTimeoutOnPacketAck` tests that the channel worker will cancel the +//! upgrade handshake if the chain acknowledges a packet after the upgrade timeout expired. +//! +//! +//! +use std::thread::sleep; + +use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeight}; +use ibc_relayer_types::core::ics04_channel::channel::State as ChannelState; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics04_channel::version::Version; +use ibc_relayer_types::events::IbcEventType; +use ibc_test_framework::chain::config::{set_max_deposit_period, set_voting_period}; +use ibc_test_framework::prelude::*; +use ibc_test_framework::relayer::channel::{ + assert_eventually_channel_established, assert_eventually_channel_upgrade_ack, + assert_eventually_channel_upgrade_cancel, assert_eventually_channel_upgrade_flushing, + assert_eventually_channel_upgrade_init, assert_eventually_channel_upgrade_try, + ChannelUpgradableAttributes, +}; + +#[test] +fn test_channel_upgrade_timeout_ack_handshake() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeTimeoutAckHandshake) +} + +#[test] +fn test_channel_upgrade_timeout_confirm_handshake() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeTimeoutConfirmHandshake) +} + +#[test] +fn test_channel_upgrade_manual_timeout_when_flushing() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeManualTimeoutWhenFlushing) +} + +#[test] +fn test_channel_upgrade_handshake_timeout_when_flushing() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeHandshakeTimeoutWhenFlushing) +} + +#[test] +fn test_channel_upgrade_handshake_timeout_on_ack() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeHandshakeTimeoutOnAck) +} + +#[test] +fn test_channel_upgrade_handshake_timeout_on_packet_ack() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeHandshakeTimeoutOnPacketAck) +} + +const MAX_DEPOSIT_PERIOD: &str = "10s"; +const VOTING_PERIOD: u64 = 10; + +struct ChannelUpgradeTestOverrides; + +impl TestOverrides for ChannelUpgradeTestOverrides { + fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { + set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?; + set_voting_period(genesis, VOTING_PERIOD)?; + Ok(()) + } + + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.channels.enabled = true; + + config.mode.clients.misbehaviour = false; + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +struct ChannelUpgradeTimeoutAckHandshake; + +impl BinaryChannelTest for ChannelUpgradeTimeoutAckHandshake { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_version = channel_end_a.version; + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let old_attrs = ChannelUpgradableAttributes::new( + old_version.clone(), + old_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + info!("Will update channel params to set a short upgrade timeout..."); + + chains.node_b.chain_driver().update_channel_params( + 5000000000, + chains.handle_b().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Will run ChanUpgradeTry step..."); + + channel.build_chan_upgrade_try_and_send()?; + + info!("Check that the step ChanUpgradeTry was correctly executed..."); + + assert_eventually_channel_upgrade_try( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + std::thread::sleep(Duration::from_secs(10)); + + info!("Check that the channel upgrade was successfully cancelled..."); + + // This will assert that both channel ends are eventually + // in Open state, and that the fields have not changed. + relayer.with_supervisor(|| { + assert_eventually_channel_upgrade_cancel( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &old_attrs, + )?; + + Ok(()) + }) + } +} + +struct ChannelUpgradeTimeoutConfirmHandshake; + +impl BinaryChannelTest for ChannelUpgradeTimeoutConfirmHandshake { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_version = channel_end_a.version; + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let old_attrs = ChannelUpgradableAttributes::new( + old_version.clone(), + old_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + info!("Will update channel params to set a short upgrade timeout..."); + + chains.node_a.chain_driver().update_channel_params( + 5000000000, + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "2", + )?; + + info!("Will run ChanUpgradeTry step..."); + + channel.build_chan_upgrade_try_and_send()?; + + info!("Check that the step ChanUpgradeTry was correctly executed..."); + + assert_eventually_channel_upgrade_try( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + info!("Will run ChanUpgradeAck step..."); + + channel.flipped().build_chan_upgrade_ack_and_send()?; + + info!("Check that the step ChanUpgradeAck was correctly executed..."); + + assert_eventually_channel_upgrade_ack( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + ChannelState::FlushComplete, + ChannelState::Flushing, + &old_attrs, + )?; + + std::thread::sleep(Duration::from_secs(10)); + + info!("Check that the channel upgrade was successfully cancelled..."); + + // This will assert that both channel ends are eventually + // in Open state, and that the fields have not changed. + relayer.with_supervisor(|| { + assert_eventually_channel_upgrade_cancel( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &old_attrs, + )?; + + Ok(()) + }) + } +} + +struct ChannelUpgradeHandshakeTimeoutWhenFlushing; + +impl BinaryChannelTest for ChannelUpgradeHandshakeTimeoutWhenFlushing { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_version = channel_end_a.version; + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let old_attrs = ChannelUpgradableAttributes::new( + old_version.clone(), + old_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + info!("Will update channel params to set a shorter upgrade timeout..."); + + // the upgrade timeout should be long enough for chain a + // to complete Ack successfully so that it goes into `FLUSHING` + chains.node_b.chain_driver().update_channel_params( + 25000000000, + chains.handle_b().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Will run ChanUpgradeTry step..."); + + channel.build_chan_upgrade_try_and_send()?; + + info!("Check that the step ChanUpgradeTry was correctly executed..."); + + assert_eventually_channel_upgrade_try( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + // send a IBC transfer message from chain a to chain b + // so that we have an in-flight packet and chain a + // will move to `FLUSHING` during Ack + let denom_a = chains.node_a.denom(); + let wallet_a = chains.node_a.wallets().user1().cloned(); + let wallet_b = chains.node_b.wallets().user1().cloned(); + let a_to_b_amount = 12345u64; + + info!( + "Sending IBC transfer from chain {} to chain {} with amount of {} {}", + chains.chain_id_a(), + chains.chain_id_b(), + a_to_b_amount, + denom_a + ); + + chains.node_a.chain_driver().ibc_transfer_token( + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + )?; + + info!("Will run ChanUpgradeAck step..."); + + channel.flipped().build_chan_upgrade_ack_and_send()?; + + info!("Check that the step ChanUpgradeAck was correctly executed..."); + + assert_eventually_channel_upgrade_flushing( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &old_attrs, + )?; + + // wait enough time so that timeout expires while chain a is in FLUSHING + sleep(Duration::from_nanos(35000000000)); + + info!("Will run ChanUpgradeTimeout step..."); + + // Since the chain a has not moved to `FLUSH_COMPLETE` before the upgrade timeout + // expired, then we can submit `MsgChannelUpgradeTimeout` on chain b + // to cancel the upgrade and move the channel back to `OPEN` + let timeout_event = channel.build_chan_upgrade_timeout_and_send()?; + assert_eq!( + timeout_event.event_type(), + IbcEventType::UpgradeTimeoutChannel + ); + + relayer.with_supervisor(|| { + info!("Check that the step ChanUpgradeTimeout was correctly executed..."); + + assert_eventually_channel_upgrade_cancel( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + Ok(()) + }) + } +} + +struct ChannelUpgradeManualTimeoutWhenFlushing; + +impl BinaryChannelTest for ChannelUpgradeManualTimeoutWhenFlushing { + fn run( + &self, + _config: &TestConfig, + _relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_version = channel_end_a.version; + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let old_attrs = ChannelUpgradableAttributes::new( + old_version.clone(), + old_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + info!("Will update channel params to set a shorter upgrade timeout..."); + + // the upgrade timeout should be long enough for chain a + // to complete Ack successfully so that it goes into `FLUSHING` + chains.node_b.chain_driver().update_channel_params( + 25000000000, + chains.handle_b().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Check that the step ChanUpgradeInit was correctly executed..."); + + assert_eventually_channel_upgrade_init( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &old_attrs, + )?; + + info!("Will run ChanUpgradeTry step..."); + + channel.build_chan_upgrade_try_and_send()?; + + info!("Check that the step ChanUpgradeTry was correctly executed..."); + + assert_eventually_channel_upgrade_try( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + // send a IBC transfer message from chain a to chain b + // so that we have an in-flight packet and chain a + // will move to `FLUSHING` during Ack + let denom_a = chains.node_a.denom(); + let wallet_a = chains.node_a.wallets().user1().cloned(); + let wallet_b = chains.node_b.wallets().user1().cloned(); + let a_to_b_amount = 12345u128; + + info!( + "Sending IBC transfer from chain {} to chain {} with amount of {} {}", + chains.chain_id_a(), + chains.chain_id_b(), + a_to_b_amount, + denom_a + ); + + chains.node_a.chain_driver().ibc_transfer_token( + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + )?; + + info!("Will run ChanUpgradeAck step..."); + + channel.flipped().build_chan_upgrade_ack_and_send()?; + + info!("Check that the step ChanUpgradeAck was correctly executed..."); + + assert_eventually_channel_upgrade_flushing( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &old_attrs, + )?; + + // wait enough time so that timeout expires while chain a is in FLUSHING + sleep(Duration::from_nanos(35000000000)); + + info!("Will run ChanUpgradeTimeout step..."); + + // Since the chain a has not moved to `FLUSH_COMPLETE` before the upgrade timeout + // expired, then we can submit `MsgChannelUpgradeTimeout` on chain b + // to cancel the upgrade and move the channel back to `OPEN` + let timeout_event = channel.build_chan_upgrade_timeout_and_send()?; + assert_eq!( + timeout_event.event_type(), + IbcEventType::UpgradeTimeoutChannel + ); + + let cancel_event = channel.flipped().build_chan_upgrade_cancel_and_send()?; + assert_eq!( + cancel_event.event_type(), + IbcEventType::UpgradeCancelChannel + ); + + info!("Check that the step ChanUpgradeTimeout was correctly executed..."); + + assert_eventually_channel_upgrade_cancel( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + Ok(()) + } +} + +struct ChannelUpgradeHandshakeTimeoutOnAck; + +impl BinaryChannelTest for ChannelUpgradeHandshakeTimeoutOnAck { + fn run( + &self, + _config: &TestConfig, + _relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_version = channel_end_a.version; + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let old_attrs = ChannelUpgradableAttributes::new( + old_version.clone(), + old_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + info!("Will update channel params to set a short upgrade timeout..."); + + chains.node_b.chain_driver().update_channel_params( + 5000000000, + chains.handle_b().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Check that the step ChanUpgradeInit was correctly executed..."); + + assert_eventually_channel_upgrade_init( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &old_attrs, + )?; + + info!("Will run ChanUpgradeTry step..."); + + channel.build_chan_upgrade_try_and_send()?; + + info!("Check that the step ChanUpgradeTry was correctly executed..."); + + assert_eventually_channel_upgrade_try( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + // wait enough time so that ACK fails due to upgrade timeout + sleep(Duration::from_secs(10)); + + info!("Will run ChanUpgradeAck step..."); + + let ack_event = channel.flipped().build_chan_upgrade_ack_and_send()?; + + info!("Check that the step ChanUpgradeAck timed out..."); + + // ACK should fail because the upgrade has timed out + assert_eq!(ack_event.event_type(), IbcEventType::UpgradeErrorChannel); + + info!("Will run ChanUpgradeCancel step..."); + + // Since the following assertion checks that the fields of channel ends + // have not been updated, asserting there is a `UpgradeCancelChannel` event + // avoids having a passing test due to the Upgrade Init step failing + let cancel_event = channel.build_chan_upgrade_cancel_and_send()?; + assert_eq!( + cancel_event.event_type(), + IbcEventType::UpgradeCancelChannel + ); + + info!("Check that the step ChanUpgradeCancel was correctly executed..."); + + assert_eventually_channel_upgrade_cancel( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + Ok(()) + } +} + +struct ChannelUpgradeHandshakeTimeoutOnPacketAck; + +impl BinaryChannelTest for ChannelUpgradeHandshakeTimeoutOnPacketAck { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_version = channel_end_a.version; + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let old_attrs = ChannelUpgradableAttributes::new( + old_version.clone(), + old_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + info!("Will update channel params to set a short upgrade timeout..."); + + // the upgrade timeout should be long enough for chain a + // to complete Ack successfully so that it goes into `FLUSHING` + chains.node_b.chain_driver().update_channel_params( + 80000000000, + chains.handle_b().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Check that the step ChanUpgradeInit was correctly executed..."); + + assert_eventually_channel_upgrade_init( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &old_attrs, + )?; + + // send a IBC transfer message from chain a to chain b + // so that we have an in-flight packet and chain a + // will move to `FLUSHING` during Ack + let denom_a = chains.node_a.denom(); + let wallet_a = chains.node_a.wallets().user1().cloned(); + let wallet_b = chains.node_b.wallets().user1().cloned(); + let a_to_b_amount = 12345u128; + + info!( + "Sending IBC transfer from chain {} to chain {} with amount of {} {}", + chains.chain_id_a(), + chains.chain_id_b(), + a_to_b_amount, + denom_a + ); + + chains + .node_a + .chain_driver() + .ibc_transfer_token_with_memo_and_timeout( + &channels.port_a.as_ref(), + &channels.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + None, + Some(Duration::from_secs(600)), + )?; + + info!("Will run ChanUpgradeTry step..."); + + channel.build_chan_upgrade_try_and_send()?; + + info!("Check that the step ChanUpgradeTry was correctly executed..."); + + assert_eventually_channel_upgrade_try( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + info!("Will run ChanUpgradeAck step..."); + + channel.flipped().build_chan_upgrade_ack_and_send()?; + + info!("Check that the step ChanUpgradeAck was correctly executed..."); + + // channel a is `FLUSHING` because the packet + // from a to b has not been cleared yet + assert_eventually_channel_upgrade_ack( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + ChannelState::Flushing, + ChannelState::Flushing, + &old_attrs, + )?; + + // wait enough time so that timeout expires while chain a is in FLUSHING + // and when packet lifecycle completes with acknowledge packet on chain a + // it will abort the upgrade + sleep(Duration::from_nanos(80000000000)); + + info!("Check that the channel upgrade aborted..."); + + // start supervisor to clear in-flight packets + // and move channel ends to `FLUSH_COMPLETE` + relayer.with_supervisor(|| { + let ibc_denom_b = derive_ibc_denom( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &denom_a, + )?; + + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b.address(), + &ibc_denom_b.with_amount(a_to_b_amount).as_ref(), + )?; + + // This will assert that both channel ends are eventually + // in Open state, and that the fields targeted by the upgrade + // have NOT been correctly updated, because chain a aborted the upgrade + assert_eventually_channel_upgrade_cancel( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &old_attrs, + )?; + + Ok(()) + }) + } +} + +impl HasOverrides for ChannelUpgradeTimeoutAckHandshake { + type Overrides = ChannelUpgradeTestOverrides; + + fn get_overrides(&self) -> &ChannelUpgradeTestOverrides { + &ChannelUpgradeTestOverrides + } +} + +impl HasOverrides for ChannelUpgradeTimeoutConfirmHandshake { + type Overrides = ChannelUpgradeTestOverrides; + + fn get_overrides(&self) -> &ChannelUpgradeTestOverrides { + &ChannelUpgradeTestOverrides + } +} + +impl HasOverrides for ChannelUpgradeManualTimeoutWhenFlushing { + type Overrides = ChannelUpgradeTestOverrides; + + fn get_overrides(&self) -> &ChannelUpgradeTestOverrides { + &ChannelUpgradeTestOverrides + } +} + +impl HasOverrides for ChannelUpgradeHandshakeTimeoutWhenFlushing { + type Overrides = ChannelUpgradeTestOverrides; + + fn get_overrides(&self) -> &ChannelUpgradeTestOverrides { + &ChannelUpgradeTestOverrides + } +} + +impl HasOverrides for ChannelUpgradeHandshakeTimeoutOnAck { + type Overrides = ChannelUpgradeTestOverrides; + + fn get_overrides(&self) -> &ChannelUpgradeTestOverrides { + &ChannelUpgradeTestOverrides + } +} + +impl HasOverrides for ChannelUpgradeHandshakeTimeoutOnPacketAck { + type Overrides = ChannelUpgradeTestOverrides; + + fn get_overrides(&self) -> &ChannelUpgradeTestOverrides { + &ChannelUpgradeTestOverrides + } +} diff --git a/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs b/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs new file mode 100644 index 0000000000..1a8dbe27ed --- /dev/null +++ b/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs @@ -0,0 +1,247 @@ +//! Tests channel upgrade: +//! +//! - `ChannelUpgradeHandshake` tests that after the upgrade handshake is completed +//! after initialising the upgrade with `build_chan_upgrade_init_and_send` without +//! any in-flight packets. +//! +//! - `ChannelUpgradeClearHandshake` tests that if the upgrade handshake is initialised +//! before the relayer, the upgrade will complete upon starting the relayer. +use std::thread::sleep; + +use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeight}; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics04_channel::version::Version; +use ibc_test_framework::chain::config::{set_max_deposit_period, set_voting_period}; +use ibc_test_framework::prelude::*; +use ibc_test_framework::relayer::channel::{ + assert_eventually_channel_established, assert_eventually_channel_upgrade_open, + ChannelUpgradableAttributes, +}; + +#[test] +fn test_channel_upgrade_handshake() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeHandshake) +} + +#[test] +fn test_channel_upgrade_clear_handshake() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeClearHandshake) +} + +const MAX_DEPOSIT_PERIOD: &str = "10s"; +const VOTING_PERIOD: u64 = 10; + +pub struct ChannelUpgradeHandshake; + +impl TestOverrides for ChannelUpgradeHandshake { + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.channels.enabled = true; + config.mode.clients.misbehaviour = false; + } + + fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { + set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?; + set_voting_period(genesis, VOTING_PERIOD)?; + Ok(()) + } +} + +impl BinaryChannelTest for ChannelUpgradeHandshake { + fn run( + &self, + _config: &TestConfig, + _relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let upgraded_attrs = ChannelUpgradableAttributes::new( + new_version.clone(), + new_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b, + Sequence::from(1), + ); + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + &chains.node_a.wallets().user2().address().to_string(), + "1", + )?; + + info!("Check that the channel upgrade successfully upgraded the version..."); + + // This will assert that both channel ends are eventually + // in Open state, and that the fields targeted by the upgrade + // have been correctly updated. + assert_eventually_channel_upgrade_open( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &upgraded_attrs, + )?; + + Ok(()) + } +} + +pub struct ChannelUpgradeClearHandshake; + +impl TestOverrides for ChannelUpgradeClearHandshake { + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.channels.enabled = true; + config.mode.clients.misbehaviour = false; + } + + fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { + set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?; + set_voting_period(genesis, VOTING_PERIOD)?; + Ok(()) + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +impl BinaryChannelTest for ChannelUpgradeClearHandshake { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let upgraded_attrs = ChannelUpgradableAttributes::new( + new_version.clone(), + new_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b, + Sequence::from(1), + ); + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + // After the governance proposal, wait a few blocks before starting the Hermes instance + sleep(Duration::from_secs(5)); + + info!("Check that the channel upgrade successfully upgraded the version..."); + + relayer.with_supervisor(|| { + // This will assert that both channel ends are eventually + // in Open state, and that the fields targeted by the upgrade + // have been correctly updated. + assert_eventually_channel_upgrade_open( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &upgraded_attrs, + )?; + + Ok(()) + }) + } +} diff --git a/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake_steps.rs b/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake_steps.rs new file mode 100644 index 0000000000..31b665bc9a --- /dev/null +++ b/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake_steps.rs @@ -0,0 +1,915 @@ +//! Tests channel upgrade: +//! +//! - `ChannelUpgradeManualHandshake` tests each step of the channel upgrade manually, +//! without relaying on the supervisor. +//! +//! - `ChannelUpgradeHandshakeFromTry` tests that the channel worker will finish the +//! upgrade handshake if the channel is being upgraded and is at the Try step. +//! +//! - `ChannelUpgradeHandshakeFromAck` tests that the channel worker will finish the +//! upgrade handshake if the channel is being upgraded and is at the Ack step. +//! +//! - `ChannelUpgradeHandshakeFromConfirm` tests that the channel worker will finish the +//! upgrade handshake if the channel is being upgraded and is at the Confirm step. +//! +//! - `ChannelUpgradeHandshakeTimeoutOnAck` tests that the channel worker will cancel the +//! upgrade handshake if the Ack step fails due to an upgrade timeout. +//! +//! - `ChannelUpgradeHandshakeTimeoutWhenFlushing` tests that the channel worker will timeout the +//! upgrade handshake if the counterparty does not finish flushing the packets before the upgrade timeout. +//! +//! - `ChannelUpgradeHandshakeInitiateNewUpgrade` tests that the channel worker will +//! finish the upgrade handshake if the side that moved to `OPEN` initiates a +//! new upgrade before the counterparty moved to `OPEN`. +//! +//! - `ChannelUpgradeHandshakeTimeoutOnPacketAck` tests that the channel worker will cancel the +//! upgrade handshake if the chain acknowledges a packet after the upgrade timeout expired. + +use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeight}; +use ibc_relayer_types::core::ics04_channel::channel::{State as ChannelState, UpgradeState}; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics04_channel::version::Version; +use ibc_test_framework::chain::config::{set_max_deposit_period, set_voting_period}; +use ibc_test_framework::prelude::*; +use ibc_test_framework::relayer::channel::{ + assert_eventually_channel_established, assert_eventually_channel_upgrade_ack, + assert_eventually_channel_upgrade_confirm, assert_eventually_channel_upgrade_init, + assert_eventually_channel_upgrade_open, assert_eventually_channel_upgrade_try, + ChannelUpgradableAttributes, +}; + +#[test] +fn test_channel_upgrade_manual_handshake() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeManualHandshake) +} + +#[test] +fn test_channel_upgrade_handshake_from_try() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeHandshakeFromTry) +} + +#[test] +fn test_channel_upgrade_handshake_from_ack() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeHandshakeFromAck) +} + +#[test] +fn test_channel_upgrade_handshake_from_confirm() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeHandshakeFromConfirm) +} + +#[test] +fn test_channel_upgrade_handshake_initiate_new_upgrade() -> Result<(), Error> { + run_binary_channel_test(&ChannelUpgradeHandshakeInitiateNewUpgrade) +} + +const MAX_DEPOSIT_PERIOD: &str = "10s"; +const VOTING_PERIOD: u64 = 10; + +struct ChannelUpgradeTestOverrides; + +impl TestOverrides for ChannelUpgradeTestOverrides { + fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { + set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?; + set_voting_period(genesis, VOTING_PERIOD)?; + Ok(()) + } + + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.channels.enabled = true; + + config.mode.clients.misbehaviour = false; + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +struct ChannelUpgradeManualHandshake; + +impl BinaryChannelTest for ChannelUpgradeManualHandshake { + fn run( + &self, + _config: &TestConfig, + _relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_version = channel_end_a.version; + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let old_attrs = ChannelUpgradableAttributes::new( + old_version.clone(), + old_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + let interm_attrs = ChannelUpgradableAttributes::new( + old_version, + new_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + let upgraded_attrs = ChannelUpgradableAttributes::new( + new_version.clone(), + new_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b, + Sequence::from(1), + ); + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Check that the step ChanUpgradeInit was correctly executed..."); + + assert_eventually_channel_upgrade_init( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &old_attrs, + )?; + + info!("Will run ChanUpgradeTry step..."); + + channel.build_chan_upgrade_try_and_send()?; + + info!("Check that the step ChanUpgradeTry was correctly executed..."); + + assert_eventually_channel_upgrade_try( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + info!("Will run ChanUpgradeAck step..."); + + channel.flipped().build_chan_upgrade_ack_and_send()?; + + info!("Check that the step ChanUpgradeAck was correctly executed..."); + + assert_eventually_channel_upgrade_ack( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + ChannelState::FlushComplete, + ChannelState::Flushing, + &old_attrs, + )?; + + info!("Will run ChanUpgradeConfirm step..."); + + channel.build_chan_upgrade_confirm_and_send()?; + + info!("Check that the step ChanUpgradeConfirm was correctly executed..."); + + assert_eventually_channel_upgrade_confirm( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &interm_attrs.flipped(), + )?; + + info!("Will run ChanUpgradeOpen step..."); + + channel.flipped().build_chan_upgrade_open_and_send()?; + + info!("Check that the ChanUpgradeOpen steps were correctly executed..."); + + // This will assert that both channel ends are eventually + // in Open state, and that the fields targeted by the upgrade + // have been correctly updated. + assert_eventually_channel_upgrade_open( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &upgraded_attrs, + )?; + + Ok(()) + } +} + +struct ChannelUpgradeHandshakeFromTry; + +impl BinaryChannelTest for ChannelUpgradeHandshakeFromTry { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_version = channel_end_a.version; + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let old_attrs = ChannelUpgradableAttributes::new( + old_version.clone(), + old_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + let upgraded_attrs = ChannelUpgradableAttributes::new( + new_version.clone(), + new_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b, + Sequence::from(1), + ); + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Will run ChanUpgradeTry step..."); + + channel.build_chan_upgrade_try_and_send()?; + + info!("Check that the step ChanUpgradeTry was correctly executed..."); + + assert_eventually_channel_upgrade_try( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + info!("Check that the channel upgrade successfully upgraded the version..."); + + relayer.with_supervisor(|| { + // This will assert that both channel ends are eventually + // in Open state, and that the fields targeted by the upgrade + // have been correctly updated. + assert_eventually_channel_upgrade_open( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &upgraded_attrs, + )?; + + Ok(()) + }) + } +} + +struct ChannelUpgradeHandshakeFromAck; + +impl BinaryChannelTest for ChannelUpgradeHandshakeFromAck { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_version = channel_end_a.version; + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let old_attrs = ChannelUpgradableAttributes::new( + old_version.clone(), + old_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + let upgraded_attrs = ChannelUpgradableAttributes::new( + new_version.clone(), + new_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b, + Sequence::from(1), + ); + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Will run ChanUpgradeTry step..."); + + channel.build_chan_upgrade_try_and_send()?; + + info!("Check that the step ChanUpgradeTry was correctly executed..."); + + assert_eventually_channel_upgrade_try( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + info!("Will run ChanUpgradeAck step..."); + + channel.flipped().build_chan_upgrade_ack_and_send()?; + + info!("Check that the step ChanUpgradeAck was correctly executed..."); + + assert_eventually_channel_upgrade_ack( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + ChannelState::FlushComplete, + ChannelState::Flushing, + &old_attrs, + )?; + + info!("Check that the channel upgrade successfully upgraded the version..."); + + relayer.with_supervisor(|| { + // This will assert that both channel ends are eventually + // in Open state, and that the fields targeted by the upgrade + // have been correctly updated. + assert_eventually_channel_upgrade_open( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &upgraded_attrs, + )?; + + Ok(()) + }) + } +} +struct ChannelUpgradeHandshakeFromConfirm; + +impl BinaryChannelTest for ChannelUpgradeHandshakeFromConfirm { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let old_version = channel_end_a.version; + let old_ordering = channel_end_a.ordering; + let old_connection_hops_a = channel_end_a.connection_hops; + let old_connection_hops_b = channel_end_b.connection_hops; + + let channel = channels.channel; + let new_version = Version::ics20_with_fee(); + + let old_attrs = ChannelUpgradableAttributes::new( + old_version.clone(), + old_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + let interm_attrs = ChannelUpgradableAttributes::new( + old_version, + new_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b.clone(), + Sequence::from(1), + ); + + let upgraded_attrs = ChannelUpgradableAttributes::new( + new_version.clone(), + new_version.clone(), + old_ordering, + old_connection_hops_a.clone(), + old_connection_hops_b, + Sequence::from(1), + ); + + info!("Will initialise upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + old_ordering.as_str(), + old_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&new_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Will run ChanUpgradeTry step..."); + + channel.build_chan_upgrade_try_and_send()?; + + info!("Check that the step ChanUpgradeTry was correctly executed..."); + + assert_eventually_channel_upgrade_try( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &old_attrs.flipped(), + )?; + + info!("Will run ChanUpgradeAck step..."); + + channel.flipped().build_chan_upgrade_ack_and_send()?; + + info!("Check that the step ChanUpgradeAck was correctly executed..."); + + assert_eventually_channel_upgrade_ack( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + ChannelState::FlushComplete, + ChannelState::Flushing, + &old_attrs, + )?; + + info!("Will run ChanUpgradeConfirm step..."); + + channel.build_chan_upgrade_confirm_and_send()?; + + info!("Check that the step ChanUpgradeConfirm was correctly executed..."); + + assert_eventually_channel_upgrade_confirm( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &interm_attrs.flipped(), + )?; + + info!("Check that the channel upgrade successfully upgraded the version..."); + + relayer.with_supervisor(|| { + // This will assert that both channel ends are eventually + // in Open state, and that the fields targeted by the upgrade + // have been correctly updated. + assert_eventually_channel_upgrade_open( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &upgraded_attrs, + )?; + + Ok(()) + }) + } +} + +struct ChannelUpgradeHandshakeInitiateNewUpgrade; + +impl BinaryChannelTest for ChannelUpgradeHandshakeInitiateNewUpgrade { + fn run( + &self, + _config: &TestConfig, + _relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + info!("Check that channels are both in OPEN State"); + + assert_eventually_channel_established( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + )?; + + let mut channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + let mut channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::No, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + let pre_upgrade_1_version = channel_end_a.version; + let pre_upgrade_1_ordering = channel_end_a.ordering; + let pre_upgrade_1_connection_hops_a = channel_end_a.connection_hops.clone(); + let pre_upgrade_1_connection_hops_b = channel_end_b.connection_hops.clone(); + + let channel = channels.channel; + let post_upgrade_1_version = Version::ics20_with_fee(); + + let pre_upgrade_1_attrs = ChannelUpgradableAttributes::new( + pre_upgrade_1_version.clone(), + pre_upgrade_1_version.clone(), + pre_upgrade_1_ordering, + pre_upgrade_1_connection_hops_a.clone(), + pre_upgrade_1_connection_hops_b.clone(), + Sequence::from(1), + ); + + let interm_upgrade_1_attrs = ChannelUpgradableAttributes::new( + pre_upgrade_1_version, + post_upgrade_1_version.clone(), + pre_upgrade_1_ordering, + pre_upgrade_1_connection_hops_a.clone(), + pre_upgrade_1_connection_hops_b.clone(), + Sequence::from(1), + ); + + info!("Will initialise on chain A upgrade handshake with governance proposal..."); + + chains.node_a.chain_driver().initialise_channel_upgrade( + channel.src_port_id().as_str(), + channel.src_channel_id().unwrap().as_str(), + pre_upgrade_1_ordering.as_str(), + pre_upgrade_1_connection_hops_a.first().unwrap().as_str(), + &serde_json::to_string(&post_upgrade_1_version.0).unwrap(), + chains.handle_a().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Check that the step ChanUpgradeInit was correctly executed..."); + + assert_eventually_channel_upgrade_init( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + &pre_upgrade_1_attrs, + )?; + + info!("Will run ChanUpgradeTry step..."); + + channel.build_chan_upgrade_try_and_send()?; + + info!("Check that the step ChanUpgradeTry was correctly executed..."); + + assert_eventually_channel_upgrade_try( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &pre_upgrade_1_attrs.flipped(), + )?; + + info!("Will run ChanUpgradeAck step..."); + + channel.flipped().build_chan_upgrade_ack_and_send()?; + + info!("Check that the step ChanUpgradeAck was correctly executed..."); + + assert_eventually_channel_upgrade_ack( + &chains.handle_a, + &chains.handle_b, + &channels.channel_id_a.as_ref(), + &channels.port_a.as_ref(), + ChannelState::FlushComplete, + ChannelState::Flushing, + &pre_upgrade_1_attrs, + )?; + + info!("Will run ChanUpgradeConfirm step..."); + + channel.build_chan_upgrade_confirm_and_send()?; + + info!("Check that the step ChanUpgradeConfirm was correctly executed..."); + + assert_eventually_channel_upgrade_confirm( + &chains.handle_b, + &chains.handle_a, + &channels.channel_id_b.as_ref(), + &channels.port_b.as_ref(), + &interm_upgrade_1_attrs.flipped(), + )?; + + // ChannelEnd B is now `OPEN` (because both ends did not have in-flight packets) + // Initialise a new upgrade handshake on chain B before ChannelEnd A moves to `OPEN` + + let pre_upgrade_2_ordering = channel_end_a.ordering; + let pre_upgrade_2_connection_hops_b = channel_end_b.connection_hops.clone(); + + let post_upgrade_2_version = Version::ics20(); + + info!("Will initialise on chain B upgrade handshake with governance proposal..."); + + chains.node_b.chain_driver().initialise_channel_upgrade( + channel.dst_port_id().as_str(), + channel.dst_channel_id().unwrap().as_str(), + pre_upgrade_2_ordering.as_str(), + pre_upgrade_2_connection_hops_b.first().unwrap().as_str(), + &serde_json::to_string(&post_upgrade_2_version.0).unwrap(), + chains.handle_b().get_signer().unwrap().as_ref(), + "1", + )?; + + info!("Check that the step ChanUpgradeInit was correctly executed..."); + + channel_end_b = chains + .handle_b + .query_channel( + QueryChannelRequest { + port_id: channels.port_b.0.clone(), + channel_id: channels.channel_id_b.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::Yes, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd B: {e}"))?; + + // upgrade sequence should have been incremented + let upgrade_sequence_b = Sequence::from(2); + assert_eq!( + channel_end_b.upgrade_sequence, upgrade_sequence_b, + "expected channel end B upgrade sequence to be `{}`, but it is instead `{}`", + upgrade_sequence_b, channel_end_b.upgrade_sequence + ); + + // Finish upgrade 1 on ChannelEnd A + + info!("Will run ChanUpgradeOpen step..."); + + channel.flipped().build_chan_upgrade_open_and_send()?; + + info!("Check that the step ChanUpgradeOpen was correctly executed..."); + + channel_end_a = chains + .handle_a + .query_channel( + QueryChannelRequest { + port_id: channels.port_a.0.clone(), + channel_id: channels.channel_id_a.0.clone(), + height: QueryHeight::Latest, + }, + IncludeProof::Yes, + ) + .map(|(channel_end, _)| channel_end) + .map_err(|e| eyre!("Error querying ChannelEnd A: {e}"))?; + + if !channel_end_a.is_open() { + return Err(Error::generic(eyre!( + "expected channel end A state to be `{}`, but is instead `{}`", + ChannelState::Open(UpgradeState::NotUpgrading), + channel_end_a.state() + ))); + } + + assert_eq!( + channel_end_a.version, post_upgrade_1_version, + "expected channel end A version to be `{}`, but is instead `{}`", + post_upgrade_1_version, channel_end_a.version + ); + + Ok(()) + } +} + +impl HasOverrides for ChannelUpgradeManualHandshake { + type Overrides = ChannelUpgradeTestOverrides; + + fn get_overrides(&self) -> &ChannelUpgradeTestOverrides { + &ChannelUpgradeTestOverrides + } +} + +impl HasOverrides for ChannelUpgradeHandshakeFromTry { + type Overrides = ChannelUpgradeTestOverrides; + + fn get_overrides(&self) -> &ChannelUpgradeTestOverrides { + &ChannelUpgradeTestOverrides + } +} + +impl HasOverrides for ChannelUpgradeHandshakeFromAck { + type Overrides = ChannelUpgradeTestOverrides; + + fn get_overrides(&self) -> &ChannelUpgradeTestOverrides { + &ChannelUpgradeTestOverrides + } +} + +impl HasOverrides for ChannelUpgradeHandshakeFromConfirm { + type Overrides = ChannelUpgradeTestOverrides; + + fn get_overrides(&self) -> &ChannelUpgradeTestOverrides { + &ChannelUpgradeTestOverrides + } +} + +impl HasOverrides for ChannelUpgradeHandshakeInitiateNewUpgrade { + type Overrides = ChannelUpgradeTestOverrides; + + fn get_overrides(&self) -> &ChannelUpgradeTestOverrides { + &ChannelUpgradeTestOverrides + } +} diff --git a/tools/integration-test/src/tests/client_upgrade.rs b/tools/integration-test/src/tests/client_upgrade.rs index 9cf174abff..e6f94a0336 100644 --- a/tools/integration-test/src/tests/client_upgrade.rs +++ b/tools/integration-test/src/tests/client_upgrade.rs @@ -122,7 +122,7 @@ impl BinaryChainTest for ClientUpgradeTest { .map_err(handle_generic_error)?; // Vote on the proposal so the chain will upgrade - driver.vote_proposal(&fee_denom_a.with_amount(381000000u64).to_string())?; + driver.vote_proposal(&fee_denom_a.with_amount(381000000u64).to_string(), "1")?; info!("Assert that the chain upgrade proposal is eventually passed"); @@ -281,7 +281,7 @@ impl BinaryChainTest for HeightTooHighClientUpgradeTest { .map_err(handle_generic_error)?; // Vote on the proposal so the chain will upgrade - driver.vote_proposal(&fee_denom_a.with_amount(381000000u64).to_string())?; + driver.vote_proposal(&fee_denom_a.with_amount(381000000u64).to_string(), "1")?; // The application height reports a height of 1 less than the height according to Tendermint client_upgrade_height.increment(); @@ -378,7 +378,7 @@ impl BinaryChainTest for HeightTooLowClientUpgradeTest { .map_err(handle_generic_error)?; // Vote on the proposal so the chain will upgrade - driver.vote_proposal(&fee_denom_a.with_amount(381000000u64).to_string())?; + driver.vote_proposal(&fee_denom_a.with_amount(381000000u64).to_string(), "1")?; // The application height reports a height of 1 less than the height according to Tendermint client_upgrade_height diff --git a/tools/integration-test/src/tests/ica.rs b/tools/integration-test/src/tests/ica.rs index f62c642d2e..7ed2ef38f0 100644 --- a/tools/integration-test/src/tests/ica.rs +++ b/tools/integration-test/src/tests/ica.rs @@ -16,7 +16,9 @@ use ibc_relayer_types::signer::Signer; use ibc_relayer_types::timestamp::Timestamp; use ibc_relayer_types::tx_msg::Msg; -use ibc_test_framework::chain::ext::ica::register_interchain_account; +use ibc_test_framework::chain::{ + config::add_allow_message_interchainaccounts, ext::ica::register_interchain_account, +}; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::{ assert_eventually_channel_closed, assert_eventually_channel_established, query_channel_end, @@ -75,22 +77,9 @@ impl TestOverrides for IcaFilterTestAllow { // Allow MsgSend messages over ICA fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { - use serde_json::Value; - - let allow_messages = genesis - .get_mut("app_state") - .and_then(|app_state| app_state.get_mut("interchainaccounts")) - .and_then(|ica| ica.get_mut("host_genesis_state")) - .and_then(|state| state.get_mut("params")) - .and_then(|params| params.get_mut("allow_messages")) - .and_then(|allow_messages| allow_messages.as_array_mut()); - - if let Some(allow_messages) = allow_messages { - allow_messages.push(Value::String("/cosmos.bank.v1beta1.MsgSend".to_string())); - Ok(()) - } else { - Err(Error::generic(eyre!("failed to update genesis file"))) - } + add_allow_message_interchainaccounts(genesis, "/cosmos.bank.v1beta1.MsgSend")?; + + Ok(()) } } diff --git a/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs b/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs index 56a0075ff3..ade71f8132 100644 --- a/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs +++ b/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs @@ -17,6 +17,7 @@ use ibc_relayer_types::bigint::U256; use ibc_relayer_types::signer::Signer; use ibc_relayer_types::timestamp::Timestamp; use ibc_relayer_types::tx_msg::Msg; +use ibc_test_framework::chain::config::add_allow_message_interchainaccounts; use ibc_test_framework::chain::ext::ica::register_interchain_account; use ibc_test_framework::framework::binary::channel::run_binary_interchain_security_channel_test; use ibc_test_framework::prelude::*; @@ -35,23 +36,7 @@ struct IcaOrderedChannelTest; impl TestOverrides for IcaOrderedChannelTest { fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { - use serde_json::Value; - - // Allow MsgSend messages over ICA - let allow_messages = genesis - .get_mut("app_state") - .and_then(|app_state| app_state.get_mut("interchainaccounts")) - .and_then(|ica| ica.get_mut("host_genesis_state")) - .and_then(|state| state.get_mut("params")) - .and_then(|params| params.get_mut("allow_messages")) - .and_then(|allow_messages| allow_messages.as_array_mut()); - - if let Some(allow_messages) = allow_messages { - allow_messages.push(Value::String("/cosmos.bank.v1beta1.MsgSend".to_string())); - } else { - return Err(Error::generic(eyre!("failed to update genesis file"))); - } - + add_allow_message_interchainaccounts(genesis, "/cosmos.bank.v1beta1.MsgSend")?; update_genesis_for_consumer_chain(genesis)?; Ok(()) diff --git a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs index 5377f206da..28d05cad91 100644 --- a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs +++ b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs @@ -11,6 +11,7 @@ use ibc_relayer_types::bigint::U256; use ibc_relayer_types::signer::Signer; use ibc_relayer_types::timestamp::Timestamp; use ibc_relayer_types::tx_msg::Msg; +use ibc_test_framework::chain::config::add_allow_message_interchainaccounts; use ibc_test_framework::chain::ext::ica::register_interchain_account; use ibc_test_framework::framework::binary::channel::run_binary_interchain_security_channel_test; use ibc_test_framework::prelude::*; @@ -28,23 +29,7 @@ struct InterchainSecurityIcaTransferTest; impl TestOverrides for InterchainSecurityIcaTransferTest { fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { - use serde_json::Value; - - // Allow MsgSend messages over ICA - let allow_messages = genesis - .get_mut("app_state") - .and_then(|app_state| app_state.get_mut("interchainaccounts")) - .and_then(|ica| ica.get_mut("host_genesis_state")) - .and_then(|state| state.get_mut("params")) - .and_then(|params| params.get_mut("allow_messages")) - .and_then(|allow_messages| allow_messages.as_array_mut()); - - if let Some(allow_messages) = allow_messages { - allow_messages.push(Value::String("/cosmos.bank.v1beta1.MsgSend".to_string())); - } else { - return Err(Error::generic(eyre!("failed to update genesis file"))); - } - + add_allow_message_interchainaccounts(genesis, "/cosmos.bank.v1beta1.MsgSend")?; update_genesis_for_consumer_chain(genesis)?; Ok(()) diff --git a/tools/integration-test/src/tests/mod.rs b/tools/integration-test/src/tests/mod.rs index bd1defd1bc..6fb6ac2a74 100644 --- a/tools/integration-test/src/tests/mod.rs +++ b/tools/integration-test/src/tests/mod.rs @@ -33,6 +33,9 @@ pub mod transfer; #[cfg(any(doc, feature = "async-icq"))] pub mod async_icq; +#[cfg(any(doc, feature = "channel-upgrade"))] +pub mod channel_upgrade; + #[cfg(any(doc, feature = "ics29-fee"))] pub mod fee; diff --git a/tools/test-framework/src/chain/cli/upgrade.rs b/tools/test-framework/src/chain/cli/upgrade.rs index ffb66f50b0..cef7e8df0a 100644 --- a/tools/test-framework/src/chain/cli/upgrade.rs +++ b/tools/test-framework/src/chain/cli/upgrade.rs @@ -1,8 +1,10 @@ /*! Methods for voting on a proposal. */ +use eyre::eyre; + use crate::chain::exec::simple_exec; -use crate::error::Error; +use crate::prelude::*; pub fn vote_proposal( chain_id: &str, @@ -10,6 +12,7 @@ pub fn vote_proposal( home_path: &str, rpc_listen_address: &str, fees: &str, + proposal_id: &str, ) -> Result<(), Error> { simple_exec( chain_id, @@ -20,7 +23,7 @@ pub fn vote_proposal( "tx", "gov", "vote", - "1", + proposal_id, "yes", "--chain-id", chain_id, @@ -38,3 +41,84 @@ pub fn vote_proposal( Ok(()) } + +pub fn submit_gov_proposal( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + signer: &str, + proposal_file: &str, +) -> Result<(), Error> { + let proposal_file = format!("{}/{}", home_path, proposal_file); + let output = simple_exec( + chain_id, + command_path, + &[ + "--node", + rpc_listen_address, + "tx", + "gov", + "submit-proposal", + &proposal_file, + "--chain-id", + chain_id, + "--home", + home_path, + "--keyring-backend", + "test", + "--gas", + "20000000", + "--from", + signer, + "--output", + "json", + "--yes", + ], + )?; + + let json_output: serde_json::Value = + serde_json::from_str(&output.stdout).map_err(handle_generic_error)?; + + if json_output + .get("code") + .ok_or_else(|| eyre!("expected `code` field in output"))? + .as_u64() + .ok_or_else(|| eyre!("expected `code` to be a u64"))? + != 0 + { + let raw_log = json_output + .get("raw_log") + .ok_or_else(|| eyre!("expected `code` field in output"))? + .as_str() + .ok_or_else(|| eyre!("expected `raw_log` to be a str"))?; + warn!("failed to submit governance proposal due to `{raw_log}`. Will retry..."); + simple_exec( + chain_id, + command_path, + &[ + "--node", + rpc_listen_address, + "tx", + "gov", + "submit-proposal", + &proposal_file, + "--chain-id", + chain_id, + "--home", + home_path, + "--keyring-backend", + "test", + "--gas", + "20000000", + "--from", + signer, + "--output", + "json", + "--yes", + ], + )?; + } + + Ok(()) +} diff --git a/tools/test-framework/src/chain/config.rs b/tools/test-framework/src/chain/config.rs index d22d7d2532..011fe08e37 100644 --- a/tools/test-framework/src/chain/config.rs +++ b/tools/test-framework/src/chain/config.rs @@ -190,6 +190,51 @@ pub fn set_max_deposit_period(genesis: &mut serde_json::Value, period: &str) -> Ok(()) } +pub fn add_allow_message_interchainaccounts( + genesis: &mut serde_json::Value, + message: &str, +) -> Result<(), Error> { + let allow_messages = genesis + .get_mut("app_state") + .and_then(|app_state| app_state.get_mut("interchainaccounts")) + .and_then(|ica| ica.get_mut("host_genesis_state")) + .and_then(|state| state.get_mut("params")) + .and_then(|params| params.get_mut("allow_messages")) + .and_then(|allow_messages| allow_messages.as_array_mut()) + .ok_or_else(|| { + eyre!("failed to retrieve allow_messages as a vector, in the genesis file") + })?; + + // Only add `MsgSend` if the wildcard '*' is not specified + if allow_messages.iter().all(|v| v.as_str() != Some("*")) { + allow_messages.push(serde_json::Value::String(message.to_string())); + } + + Ok(()) +} + +pub fn add_allow_message_interchainquery( + genesis: &mut serde_json::Value, + message: &str, +) -> Result<(), Error> { + let allow_messages = genesis + .get_mut("app_state") + .and_then(|app_state| app_state.get_mut("interchainquery")) + .and_then(|ica| ica.get_mut("params")) + .and_then(|params| params.get_mut("allow_queries")) + .and_then(|allow_messages| allow_messages.as_array_mut()) + .ok_or_else(|| { + eyre!("failed to retrieve allow_messages as a vector, in the genesis file") + })?; + + // Only add `MsgSend` if the wildcard '*' is not specified + if allow_messages.iter().all(|v| v.as_str() != Some("*")) { + allow_messages.push(serde_json::Value::String(message.to_string())); + } + + Ok(()) +} + pub fn set_min_deposit_amount( genesis: &mut serde_json::Value, min_deposit_amount: u64, diff --git a/tools/test-framework/src/chain/ext/bootstrap.rs b/tools/test-framework/src/chain/ext/bootstrap.rs index 0c69c1d4ee..37313be246 100644 --- a/tools/test-framework/src/chain/ext/bootstrap.rs +++ b/tools/test-framework/src/chain/ext/bootstrap.rs @@ -337,7 +337,7 @@ impl ChainBootstrapMethodsExt for ChainDriver { assert_eventually_succeed( &format!("proposal `{}` status: {}", proposal_id, status.as_str()), 10, - Duration::from_secs(2), + Duration::from_secs(3), || match query_gov_proposal( chain_id, command_path, diff --git a/tools/test-framework/src/chain/ext/proposal.rs b/tools/test-framework/src/chain/ext/proposal.rs index b0e5cb4c9a..aecd1a072f 100644 --- a/tools/test-framework/src/chain/ext/proposal.rs +++ b/tools/test-framework/src/chain/ext/proposal.rs @@ -7,11 +7,14 @@ use ibc_proto::cosmos::gov::v1beta1::{query_client::QueryClient, QueryProposalRe use ibc_proto::ibc::core::client::v1::{MsgIbcSoftwareUpgrade, UpgradeProposal}; use ibc_relayer::error::Error as RelayerError; -use crate::chain::cli::upgrade::vote_proposal; +use crate::chain::cli::upgrade::{submit_gov_proposal, vote_proposal}; use crate::chain::driver::ChainDriver; use crate::error::Error; -use crate::prelude::handle_generic_error; +use crate::prelude::{handle_generic_error, TaggedChainDriverExt}; use crate::types::tagged::*; +use crate::util::proposal_status::ProposalStatus; + +use super::bootstrap::ChainBootstrapMethodsExt; pub trait ChainProposalMethodsExt { fn query_upgrade_proposal_height( @@ -20,7 +23,25 @@ pub trait ChainProposalMethodsExt { proposal_id: u64, ) -> Result; - fn vote_proposal(&self, fees: &str) -> Result<(), Error>; + fn vote_proposal(&self, fees: &str, proposal_id: &str) -> Result<(), Error>; + + fn initialise_channel_upgrade( + &self, + port_id: &str, + channel_id: &str, + ordering: &str, + connection_hops: &str, + version: &str, + signer: &str, + proposal_id: &str, + ) -> Result<(), Error>; + + fn update_channel_params( + &self, + timestamp: u64, + signer: &str, + proposal_id: &str, + ) -> Result<(), Error>; } impl<'a, Chain: Send> ChainProposalMethodsExt for MonoTagged { @@ -34,16 +55,125 @@ impl<'a, Chain: Send> ChainProposalMethodsExt for MonoTagged Result<(), Error> { + fn vote_proposal(&self, fees: &str, proposal_id: &str) -> Result<(), Error> { vote_proposal( self.value().chain_id.as_str(), &self.value().command_path, &self.value().home_path, &self.value().rpc_listen_address(), fees, + proposal_id, )?; Ok(()) } + + fn initialise_channel_upgrade( + &self, + port_id: &str, + channel_id: &str, + ordering: &str, + connection_hops: &str, + version: &str, + signer: &str, + proposal_id: &str, + ) -> Result<(), Error> { + let gov_address = self.query_auth_module("gov")?; + let channel_upgrade_proposal = create_channel_upgrade_proposal( + self.value(), + port_id, + channel_id, + ordering, + connection_hops, + version, + &gov_address, + )?; + submit_gov_proposal( + self.value().chain_id.as_str(), + &self.value().command_path, + &self.value().home_path, + &self.value().rpc_listen_address(), + signer, + &channel_upgrade_proposal, + )?; + + self.value().assert_proposal_status( + self.value().chain_id.as_str(), + &self.value().command_path, + &self.value().home_path, + &self.value().rpc_listen_address(), + ProposalStatus::VotingPeriod, + proposal_id, + )?; + + vote_proposal( + self.value().chain_id.as_str(), + &self.value().command_path, + &self.value().home_path, + &self.value().rpc_listen_address(), + "1200stake", + proposal_id, + )?; + + self.value().assert_proposal_status( + self.value().chain_id.as_str(), + &self.value().command_path, + &self.value().home_path, + &self.value().rpc_listen_address(), + ProposalStatus::Passed, + proposal_id, + )?; + + Ok(()) + } + + // The timestamp is in nanoseconds + fn update_channel_params( + &self, + timestamp: u64, + signer: &str, + proposal_id: &str, + ) -> Result<(), Error> { + let gov_address = self.query_auth_module("gov")?; + let channel_update_params_proposal = + create_channel_update_params_proposal(self.value(), timestamp, &gov_address)?; + submit_gov_proposal( + self.value().chain_id.as_str(), + &self.value().command_path, + &self.value().home_path, + &self.value().rpc_listen_address(), + signer, + &channel_update_params_proposal, + )?; + + self.value().assert_proposal_status( + self.value().chain_id.as_str(), + &self.value().command_path, + &self.value().home_path, + &self.value().rpc_listen_address(), + ProposalStatus::VotingPeriod, + proposal_id, + )?; + + vote_proposal( + self.value().chain_id.as_str(), + &self.value().command_path, + &self.value().home_path, + &self.value().rpc_listen_address(), + "1200stake", + proposal_id, + )?; + + self.value().assert_proposal_status( + self.value().chain_id.as_str(), + &self.value().command_path, + &self.value().home_path, + &self.value().rpc_listen_address(), + ProposalStatus::Passed, + proposal_id, + )?; + + Ok(()) + } } /// Query the proposal with the given proposal_id, which is supposed to be an UpgradeProposal. @@ -109,3 +239,77 @@ pub async fn query_upgrade_proposal_height( Ok(height) } + +fn create_channel_upgrade_proposal( + chain_driver: &ChainDriver, + port_id: &str, + channel_id: &str, + ordering: &str, + connection_hops: &str, + version: &str, + gov_address: &str, +) -> Result { + let raw_proposal = r#" + { + "messages": [ + { + "@type": "/ibc.core.channel.v1.MsgChannelUpgradeInit", + "port_id": "{port_id}", + "channel_id": "{channel_id}", + "fields": { + "ordering": "{ordering}", + "connection_hops": ["{connection_hops}"], + "version": {version} + }, + "signer":"{signer}" + } + ], + "deposit": "10000001stake", + "title": "Channel upgrade", + "summary": "Upgrade channel version", + "expedited": false + }"#; + + let proposal = raw_proposal.replace("{port_id}", port_id); + let proposal = proposal.replace("{channel_id}", channel_id); + let proposal = proposal.replace("{ordering}", ordering); + let proposal = proposal.replace("{connection_hops}", connection_hops); + let proposal = proposal.replace("{version}", version); + let proposal = proposal.replace("{signer}", gov_address); + + chain_driver.write_file("channel_upgrade_proposal.json", &proposal)?; + Ok("channel_upgrade_proposal.json".to_owned()) +} + +fn create_channel_update_params_proposal( + chain_driver: &ChainDriver, + timestamp: u64, + gov_address: &str, +) -> Result { + let raw_proposal = r#" + { + "messages": [ + { + "@type": "/ibc.core.channel.v1.MsgUpdateParams", + "params": { + "upgrade_timeout": { + "timestamp": {timestamp} + } + }, + "authority":"{signer}" + } + ], + "deposit": "10000001stake", + "title": "Channel update params", + "summary": "Update channel params", + "expedited": false + }"#; + + let proposal = raw_proposal.replace("{timestamp}", ×tamp.to_string()); + let proposal = proposal.replace("{signer}", gov_address); + + let output_file = "channel_update_params_proposal.json"; + + chain_driver.write_file(output_file, &proposal)?; + Ok(output_file.to_owned()) +} diff --git a/tools/test-framework/src/framework/binary/ics.rs b/tools/test-framework/src/framework/binary/ics.rs index 8125a541f9..d11c8ff3e8 100644 --- a/tools/test-framework/src/framework/binary/ics.rs +++ b/tools/test-framework/src/framework/binary/ics.rs @@ -90,6 +90,7 @@ where &node_a.chain_driver.home_path, &node_a.chain_driver.rpc_listen_address(), &provider_fee, + "1", )?; node_a.chain_driver.assert_proposal_status( diff --git a/tools/test-framework/src/relayer/chain.rs b/tools/test-framework/src/relayer/chain.rs index a5c9fac652..7c68839d30 100644 --- a/tools/test-framework/src/relayer/chain.rs +++ b/tools/test-framework/src/relayer/chain.rs @@ -21,7 +21,9 @@ */ use crossbeam_channel as channel; +use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; use ibc_relayer::chain::cosmos::version::Specs; +use ibc_relayer_types::core::ics04_channel::upgrade::{ErrorReceipt, Upgrade}; use tracing::Span; use ibc_proto::ibc::apps::fee::v1::{ @@ -435,4 +437,23 @@ where fn query_consumer_chains(&self) -> Result, Error> { self.value().query_consumer_chains() } + + fn query_upgrade( + &self, + request: QueryUpgradeRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(Upgrade, Option), Error> { + self.value().query_upgrade(request, height, include_proof) + } + + fn query_upgrade_error( + &self, + request: QueryUpgradeErrorRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(ErrorReceipt, Option), Error> { + self.value() + .query_upgrade_error(request, height, include_proof) + } } diff --git a/tools/test-framework/src/relayer/channel.rs b/tools/test-framework/src/relayer/channel.rs index 2d24d00e1a..2ea35886c9 100644 --- a/tools/test-framework/src/relayer/channel.rs +++ b/tools/test-framework/src/relayer/channel.rs @@ -4,10 +4,13 @@ use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::chain::requests::{ IncludeProof, QueryChannelRequest, QueryChannelsRequest, QueryHeight, }; -use ibc_relayer::channel::version::Version; +use ibc_relayer::channel::version::Version as ChannelEndVersion; use ibc_relayer::channel::{extract_channel_id, Channel, ChannelSide}; -use ibc_relayer_types::core::ics04_channel::channel::State as ChannelState; -use ibc_relayer_types::core::ics04_channel::channel::{ChannelEnd, IdentifiedChannelEnd, Ordering}; +use ibc_relayer_types::core::ics04_channel::channel::{ + ChannelEnd, IdentifiedChannelEnd, Ordering, State as ChannelState, UpgradeState, +}; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics04_channel::version::Version; use ibc_relayer_types::core::ics24_host::identifier::ConnectionId; use crate::error::Error; @@ -36,6 +39,71 @@ impl TaggedChannelEndExt } } +/// This struct contains the attributes which can be modified with a channel upgrade +pub struct ChannelUpgradableAttributes { + version_a: Version, + version_b: Version, + ordering: Ordering, + connection_hops_a: Vec, + connection_hops_b: Vec, + upgrade_sequence: Sequence, +} + +impl ChannelUpgradableAttributes { + pub fn new( + version_a: Version, + version_b: Version, + ordering: Ordering, + connection_hops_a: Vec, + connection_hops_b: Vec, + upgrade_sequence: Sequence, + ) -> Self { + Self { + version_a, + version_b, + ordering, + connection_hops_a, + connection_hops_b, + upgrade_sequence, + } + } + + pub fn flipped(&self) -> Self { + Self { + version_a: self.version_b.clone(), + version_b: self.version_a.clone(), + ordering: self.ordering, + connection_hops_a: self.connection_hops_b.clone(), + connection_hops_b: self.connection_hops_a.clone(), + upgrade_sequence: self.upgrade_sequence, + } + } + + pub fn version_a(&self) -> &Version { + &self.version_a + } + + pub fn version_b(&self) -> &Version { + &self.version_b + } + + pub fn ordering(&self) -> &Ordering { + &self.ordering + } + + pub fn connection_hops_a(&self) -> &Vec { + &self.connection_hops_a + } + + pub fn connection_hops_b(&self) -> &Vec { + &self.connection_hops_b + } + + pub fn upgrade_sequence(&self) -> &Sequence { + &self.upgrade_sequence + } +} + pub fn init_channel( handle_a: &ChainA, handle_b: &ChainB, @@ -83,7 +151,7 @@ pub fn init_channel_version( connection_id_b: &TaggedConnectionIdRef, src_port_id: &TaggedPortIdRef, dst_port_id: &TaggedPortIdRef, - version: Version, + version: ChannelEndVersion, ) -> Result<(TaggedChannelId, Channel), Error> { let channel = Channel { connection_delay: Default::default(), @@ -183,7 +251,7 @@ pub fn query_channel_end( channel_id: channel_id.into_value().clone(), height: QueryHeight::Latest, }, - IncludeProof::No, + IncludeProof::Yes, )?; Ok(DualTagged::new(channel_end)) @@ -239,7 +307,10 @@ pub fn assert_eventually_channel_established( + handle_a: &ChainA, + handle_b: &ChainB, + channel_id_a: &TaggedChannelIdRef, + port_id_a: &TaggedPortIdRef, + upgrade_attrs: &ChannelUpgradableAttributes, +) -> Result, Error> { + assert_eventually_succeed( + "channel upgrade should be initialised", + 20, + Duration::from_secs(1), + || { + assert_eventually_succeed( + "channel upgrade should be initialised", + 20, + Duration::from_secs(1), + || { + assert_channel_upgrade_state( + ChannelState::Open(UpgradeState::Upgrading), + ChannelState::Open(UpgradeState::NotUpgrading), + handle_a, + handle_b, + channel_id_a, + port_id_a, + upgrade_attrs, + &Sequence::from(1), + &Sequence::from(0), + ) + }, + ) + }, + ) +} + +pub fn assert_eventually_channel_upgrade_try( + handle_a: &ChainA, + handle_b: &ChainB, + channel_id_a: &TaggedChannelIdRef, + port_id_a: &TaggedPortIdRef, + upgrade_attrs: &ChannelUpgradableAttributes, +) -> Result, Error> { + assert_eventually_succeed( + "channel upgrade try step should be done", + 20, + Duration::from_secs(2), + || { + assert_channel_upgrade_state( + ChannelState::Flushing, + ChannelState::Open(UpgradeState::Upgrading), + handle_a, + handle_b, + channel_id_a, + port_id_a, + upgrade_attrs, + &Sequence::from(1), + &Sequence::from(1), + ) + }, + ) +} + +pub fn assert_eventually_channel_upgrade_ack( + handle_a: &ChainA, + handle_b: &ChainB, + channel_id_a: &TaggedChannelIdRef, + port_id_a: &TaggedPortIdRef, + channel_state_a: ChannelState, + channel_state_b: ChannelState, + upgrade_attrs: &ChannelUpgradableAttributes, +) -> Result, Error> { + assert_eventually_succeed( + "channel upgrade ack step should be done", + 20, + Duration::from_secs(1), + || { + assert_channel_upgrade_state( + channel_state_a, + channel_state_b, + handle_a, + handle_b, + channel_id_a, + port_id_a, + upgrade_attrs, + &Sequence::from(1), + &Sequence::from(1), + ) + }, + ) +} + +pub fn assert_eventually_channel_upgrade_flushing( + handle_a: &ChainA, + handle_b: &ChainB, + channel_id_a: &TaggedChannelIdRef, + port_id_a: &TaggedPortIdRef, + upgrade_attrs: &ChannelUpgradableAttributes, +) -> Result, Error> { + assert_eventually_succeed( + "channel upgrade ack step should be done", + 20, + Duration::from_secs(1), + || { + assert_channel_upgrade_state( + ChannelState::Flushing, + ChannelState::Flushing, + handle_a, + handle_b, + channel_id_a, + port_id_a, + upgrade_attrs, + &Sequence::from(1), + &Sequence::from(1), + ) + }, + ) +} + +pub fn assert_eventually_channel_upgrade_confirm( + handle_a: &ChainA, + handle_b: &ChainB, + channel_id_a: &TaggedChannelIdRef, + port_id_a: &TaggedPortIdRef, + upgrade_attrs: &ChannelUpgradableAttributes, +) -> Result, Error> { + assert_eventually_succeed( + "channel upgrade confirm step should be done", + 20, + Duration::from_secs(1), + || { + assert_channel_upgrade_state( + ChannelState::Open(UpgradeState::NotUpgrading), + ChannelState::FlushComplete, + handle_a, + handle_b, + channel_id_a, + port_id_a, + upgrade_attrs, + &Sequence::from(1), + &Sequence::from(1), + ) + }, + ) +} + +pub fn assert_eventually_channel_upgrade_open( + handle_a: &ChainA, + handle_b: &ChainB, + channel_id_a: &TaggedChannelIdRef, + port_id_a: &TaggedPortIdRef, + upgrade_attrs: &ChannelUpgradableAttributes, +) -> Result, Error> { + assert_eventually_succeed( + "channel upgrade open step should be done", + 20, + Duration::from_secs(1), + || { + assert_channel_upgrade_state( + ChannelState::Open(UpgradeState::NotUpgrading), + ChannelState::Open(UpgradeState::NotUpgrading), + handle_a, + handle_b, + channel_id_a, + port_id_a, + upgrade_attrs, + &Sequence::from(1), + &Sequence::from(1), + ) + }, + ) +} + +pub fn assert_eventually_channel_upgrade_cancel( + handle_a: &ChainA, + handle_b: &ChainB, + channel_id_a: &TaggedChannelIdRef, + port_id_a: &TaggedPortIdRef, + upgrade_attrs: &ChannelUpgradableAttributes, +) -> Result, Error> { + assert_eventually_succeed( + "channel upgrade cancel step should be done", + 20, + Duration::from_secs(1), + || { + assert_channel_upgrade_state( + ChannelState::Open(UpgradeState::NotUpgrading), + ChannelState::Open(UpgradeState::NotUpgrading), + handle_a, + handle_b, + channel_id_a, + port_id_a, + upgrade_attrs, + &Sequence::from(1), + &Sequence::from(1), + ) + }, + ) +} + +/// Note that the field modified by the channel upgrade are only updated when +/// the channel returns in the OPEN State +fn assert_channel_upgrade_state( + a_side_state: ChannelState, + b_side_state: ChannelState, + handle_a: &ChainA, + handle_b: &ChainB, + channel_id_a: &TaggedChannelIdRef, + port_id_a: &TaggedPortIdRef, + upgrade_attrs: &ChannelUpgradableAttributes, + upgrade_sequence_a: &Sequence, + upgrade_sequence_b: &Sequence, +) -> Result, Error> { + let channel_end_a = query_channel_end(handle_a, channel_id_a, port_id_a)?; + + if !channel_end_a.value().state_matches(&a_side_state) { + return Err(Error::generic(eyre!( + "expected channel end A state to be `{}`, but is instead `{}`", + a_side_state, + channel_end_a.value().state() + ))); + } + + if !channel_end_a + .value() + .version_matches(upgrade_attrs.version_a()) + { + return Err(Error::generic(eyre!( + "expected channel end A version to be `{}`, but it is instead `{}`", + upgrade_attrs.version_a(), + channel_end_a.value().version() + ))); + } + + if !channel_end_a + .value() + .order_matches(upgrade_attrs.ordering()) + { + return Err(Error::generic(eyre!( + "expected channel end A ordering to be `{}`, but it is instead `{}`", + upgrade_attrs.ordering(), + channel_end_a.value().ordering() + ))); + } + + if !channel_end_a + .value() + .connection_hops_matches(upgrade_attrs.connection_hops_a()) + { + return Err(Error::generic(eyre!( + "expected channel end A connection hops to be `{:?}`, but it is instead `{:?}`", + upgrade_attrs.connection_hops_a(), + channel_end_a.value().connection_hops() + ))); + } + + if !channel_end_a + .value() + .upgrade_sequence + .eq(upgrade_sequence_a) + { + return Err(Error::generic(eyre!( + "expected channel end A upgrade sequence to be `{}`, but it is instead `{}`", + upgrade_sequence_a, + channel_end_a.value().upgrade_sequence + ))); + } + + let channel_id_b = channel_end_a + .tagged_counterparty_channel_id() + .ok_or_else(|| eyre!("expected counterparty channel id to present on open channel"))?; + + let port_id_b = channel_end_a.tagged_counterparty_port_id(); + + let channel_end_b = query_channel_end(handle_b, &channel_id_b.as_ref(), &port_id_b.as_ref())?; + + if !channel_end_b.value().state_matches(&b_side_state) { + return Err(Error::generic(eyre!( + "expected channel end B state to be `{}`, but is instead `{}`", + b_side_state, + channel_end_b.value().state() + ))); + } + + if !channel_end_b + .value() + .version_matches(upgrade_attrs.version_b()) + { + return Err(Error::generic(eyre!( + "expected channel end B version to be `{}`, but it is instead `{}`", + upgrade_attrs.version_b(), + channel_end_b.value().version() + ))); + } + + if !channel_end_b + .value() + .order_matches(upgrade_attrs.ordering()) + { + return Err(Error::generic(eyre!( + "expected channel end B ordering to be `{}`, but it is instead `{}`", + upgrade_attrs.ordering(), + channel_end_b.value().ordering() + ))); + } + + if !channel_end_b + .value() + .connection_hops_matches(upgrade_attrs.connection_hops_b()) + { + return Err(Error::generic(eyre!( + "expected channel end B connection hops to be `{:?}`, but it is instead `{:?}`", + upgrade_attrs.connection_hops_b(), + channel_end_b.value().connection_hops() + ))); + } + + if !channel_end_b + .value() + .upgrade_sequence + .eq(upgrade_sequence_b) + { + return Err(Error::generic(eyre!( + "expected channel end B upgrade sequence to be `{}`, but it is instead `{}`", + upgrade_sequence_b, + channel_end_b.value().upgrade_sequence + ))); + } + + Ok(channel_id_b) +} From b448aa6480bde9c03e3e1fb821e10b5e24eb177a Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 3 Jun 2024 13:21:55 +0200 Subject: [PATCH 114/200] Update ibc go simapp v8 used in CI (#4010) * Nix flake update * Add changelog entry and fix typo in other changelog entries * Fix test for closing ordered ICA channel on timeout by using non-legacy message * Apply github suggestions * Fix ICA channel upgrade test by registering with ordered channel configuration --- .../3959-update-juno-to-v21.md | 2 +- .../3960-update-migaloo-to-v4.md | 2 +- .../3961-update-wasmd-to-v0-50.md | 2 +- .../4009-update-ibc-go-v8-ci.md | 3 + .github/workflows/integration.yaml | 2 +- flake.lock | 20 ++--- tools/integration-test/Cargo.toml | 39 ++++----- .../src/tests/channel_upgrade/ica.rs | 10 ++- tools/integration-test/src/tests/ica.rs | 10 ++- tools/test-framework/src/chain/ext/ica.rs | 79 ++++++++++++++++++- 10 files changed, 127 insertions(+), 42 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md b/.changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md index 295947659d..17a9b17a68 100644 --- a/.changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md +++ b/.changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md @@ -1,2 +1,2 @@ -- Update the version of Juno running the integraiton tests in the CI from `v17.1.1` +- Update the version of Juno running the integration tests in the CI from `v17.1.1` to `v21.0.0` ([\#3959](https://github.com/informalsystems/hermes/issues/3959)) \ No newline at end of file diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md b/.changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md index 3484257822..447e299663 100644 --- a/.changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md +++ b/.changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md @@ -1,3 +1,3 @@ - Update the version of Migaloo Chain running the - integraiton tests in the CI from `v3.0.2` to `v4.1.3` + integration tests in the CI from `v3.0.2` to `v4.1.3` ([\#3960](https://github.com/informalsystems/hermes/issues/3960)) \ No newline at end of file diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md b/.changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md index 40b8f62a0b..b1847636bd 100644 --- a/.changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md +++ b/.changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md @@ -1,3 +1,3 @@ - Update the version of `wasmd` running the - integraiton tests in the CI from `v0.30.0` to `v0.50.0` + integration tests in the CI from `v0.30.0` to `v0.50.0` ([\#3961](https://github.com/informalsystems/hermes/issues/3961)) \ No newline at end of file diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md b/.changelog/unreleased/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md new file mode 100644 index 0000000000..ce8c7ee27e --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md @@ -0,0 +1,3 @@ +- Update the version of ibc-go simapp running the + integration tests in the CI from `v8.2.0` to `v8.3.1` + ([\#4009](https://github.com/informalsystems/hermes/issues/4009)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 65a2c9df70..8fc11af9bd 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -64,7 +64,7 @@ jobs: command: simd account_prefix: cosmos native_token: stake - features: ica,ics29-fee,channel-upgrade + features: ica,ics29-fee,new-register-interchain-account,channel-upgrade - package: wasmd command: wasmd account_prefix: wasm diff --git a/flake.lock b/flake.lock index 2d34b775ad..fbf9d60412 100644 --- a/flake.lock +++ b/flake.lock @@ -212,11 +212,11 @@ "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" }, "locked": { - "lastModified": 1713771294, - "narHash": "sha256-vBfFaW06np8dtxq1lNmo2zA26/8kf82g2CMEhgyqxw4=", + "lastModified": 1717072229, + "narHash": "sha256-166ggriJPlTWZ/xR6YfbPd3kveJ6Hhj0BclEL0DzDYA=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "e68f2d5e7121c10e956fda7f6c0a564becd3a7e0", + "rev": "9a18b54abb037e832a6854f053e274a7ba367074", "type": "github" }, "original": { @@ -930,16 +930,16 @@ "ibc-go-v8-src": { "flake": false, "locked": { - "lastModified": 1712305073, - "narHash": "sha256-J/tuv2U6cW+y51gUi4aXzR39lJD/8J/36lf7h2242sU=", + "lastModified": 1716359952, + "narHash": "sha256-KTjyHwmXA/jgppDKRe85XfRmh8O7AHFKhDyyOb9VROU=", "owner": "cosmos", "repo": "ibc-go", - "rev": "a2f3d7a78d21641178043341de96c3ecf06fa47b", + "rev": "9b6567bf818198ded336490d5f2d89c9d42fd87b", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v8.2.0", + "ref": "v8.3.1", "repo": "ibc-go", "type": "github" } @@ -1338,11 +1338,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1713687659, - "narHash": "sha256-Yd8KuOBpZ0Slau/NxFhMPJI0gBxeax0vq/FD0rqKwuQ=", + "lastModified": 1716977081, + "narHash": "sha256-pFe5jLeIPlKEln5n2h998d7cpzXFdbrBMRe3suz4K1o=", "owner": "nixos", "repo": "nixpkgs", - "rev": "f2d7a289c5a5ece8521dd082b81ac7e4a57c2c5c", + "rev": "ac82a513e55582291805d6f09d35b6d8b60637a1", "type": "github" }, "original": { diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 826c5035fe..a9056faf4d 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -29,28 +29,29 @@ toml = { workspace = true } tonic = { workspace = true, features = ["tls", "tls-roots"] } [features] -default = [] -example = [] -manual = [] -ordered = [] -ica = [] -ics29-fee = [] -experimental = [] -mbt = [] -forward-packet = [] -ics31 = [] -clean-workers = [] -fee-grant = [] -channel-upgrade = [] -interchain-security = [] -celestia = [] -async-icq = [] -juno = [] -dynamic-gas-fee = [] +default = [] +example = [] +manual = [] +ordered = [] +ica = [] +ics29-fee = [] +experimental = [] +mbt = [] +forward-packet = [] +ics31 = [] +clean-workers = [] +fee-grant = [] +channel-upgrade = [] +interchain-security = [] +celestia = [] +async-icq = [] +juno = [] +dynamic-gas-fee = [] +new-register-interchain-account = [] [[bin]] name = "test_setup_with_binary_channel" -doc = true +doc = true [dev-dependencies] tempfile = { workspace = true } diff --git a/tools/integration-test/src/tests/channel_upgrade/ica.rs b/tools/integration-test/src/tests/channel_upgrade/ica.rs index 8b738b6855..4b26c9d37b 100644 --- a/tools/integration-test/src/tests/channel_upgrade/ica.rs +++ b/tools/integration-test/src/tests/channel_upgrade/ica.rs @@ -35,7 +35,7 @@ use ibc_relayer_types::tx_msg::Msg; use ibc_test_framework::chain::config::{ add_allow_message_interchainaccounts, set_max_deposit_period, set_voting_period, }; -use ibc_test_framework::chain::ext::ica::register_interchain_account; +use ibc_test_framework::chain::ext::ica::register_ordered_interchain_account; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::{ assert_eventually_channel_closed, assert_eventually_channel_established, @@ -98,7 +98,11 @@ impl BinaryConnectionTest for ChannelUpgradeICACloseChannel { // Register an interchain account on behalf of // controller wallet `user1` where the counterparty chain is the interchain accounts host. let (wallet, controller_channel_id, controller_port_id) = - register_interchain_account(&chains.node_a, chains.handle_a(), &connection)?; + register_ordered_interchain_account( + &chains.node_a, + chains.handle_a(), + &connection, + )?; // Check that the corresponding ICA channel is eventually established. let _counterparty_channel_id = assert_eventually_channel_established( @@ -343,7 +347,7 @@ impl BinaryConnectionTest for ChannelUpgradeICAUnordered { // Register an interchain account on behalf of // controller wallet `user1` where the counterparty chain is the interchain accounts host. let (wallet, controller_channel_id, controller_port_id) = - register_interchain_account(&chains.node_a, chains.handle_a(), &connection)?; + register_ordered_interchain_account(&chains.node_a, chains.handle_a(), &connection)?; // Check that the corresponding ICA channel is eventually established. let _counterparty_channel_id = assert_eventually_channel_established( diff --git a/tools/integration-test/src/tests/ica.rs b/tools/integration-test/src/tests/ica.rs index 7ed2ef38f0..a6b8427a89 100644 --- a/tools/integration-test/src/tests/ica.rs +++ b/tools/integration-test/src/tests/ica.rs @@ -17,7 +17,8 @@ use ibc_relayer_types::timestamp::Timestamp; use ibc_relayer_types::tx_msg::Msg; use ibc_test_framework::chain::{ - config::add_allow_message_interchainaccounts, ext::ica::register_interchain_account, + config::add_allow_message_interchainaccounts, + ext::ica::{register_interchain_account, register_ordered_interchain_account}, }; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::{ @@ -46,6 +47,7 @@ fn test_ica_filter_deny() -> Result<(), Error> { run_binary_connection_test(&IcaFilterTestDeny) } +#[cfg(any(doc, feature = "new-register-interchain-account"))] #[test] fn test_ica_close_channel() -> Result<(), Error> { run_binary_connection_test(&ICACloseChannelTest) @@ -251,7 +253,11 @@ impl BinaryConnectionTest for ICACloseChannelTest { // Register an interchain account on behalf of // controller wallet `user1` where the counterparty chain is the interchain accounts host. let (wallet, controller_channel_id, controller_port_id) = - register_interchain_account(&chains.node_a, chains.handle_a(), &connection)?; + register_ordered_interchain_account( + &chains.node_a, + chains.handle_a(), + &connection, + )?; // Check that the corresponding ICA channel is eventually established. let _counterparty_channel_id = assert_eventually_channel_established( diff --git a/tools/test-framework/src/chain/ext/ica.rs b/tools/test-framework/src/chain/ext/ica.rs index c54c252b43..b90b5bb881 100644 --- a/tools/test-framework/src/chain/ext/ica.rs +++ b/tools/test-framework/src/chain/ext/ica.rs @@ -1,5 +1,9 @@ +use serde_json::json; + use ibc_relayer::chain::tracking::TrackedMsgs; -use ibc_relayer_types::applications::ics27_ica::msgs::register::LegacyMsgRegisterInterchainAccount; +use ibc_relayer_types::applications::ics27_ica::msgs::register::{ + LegacyMsgRegisterInterchainAccount, MsgRegisterInterchainAccount, +}; use ibc_relayer_types::core::ics04_channel::version::Version; use ibc_relayer_types::events::IbcEvent; use ibc_relayer_types::tx_msg::Msg; @@ -75,11 +79,75 @@ pub fn register_interchain_account( + chain: &MonoTagged, + handle: &Chain, + connection: &ConnectedConnection, +) -> Result< + ( + MonoTagged, + TaggedChannelId, + TaggedPortId, + ), + Error, +> { + let wallet = chain.wallets().relayer().cloned(); + + let owner = handle.get_signer()?; + + let version_obj = json!({ + "version": "ics27-1", + "encoding": "proto3", + "tx_type": "sdk_multi_msg", + "controller_connection_id": connection.connection_id_a.0, + "host_connection_id": connection.connection_id_b.0 + }); + + let msg = MsgRegisterInterchainAccount { + owner, + connection_id: connection.connection_id_a.0.clone(), + version: Version::new(version_obj.to_string()), + ordering: Ordering::Ordered, }; let msg_any = msg.to_any(); @@ -92,7 +160,10 @@ pub fn register_interchain_account Date: Mon, 3 Jun 2024 15:08:02 +0200 Subject: [PATCH 115/200] Release Hermes v1.9.0 (#4014) * Create v1.9.0 section in CHANGELOG.md * create .changelog for v1.9.0 * Update versions in repository * Fix typos * Update Cargo.lock * Fix test-stable * Update msrv * Update MSRV in README * Update CHANGELOG.md Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * Reordered changelog sections to be Breaking Changes, Features, Improvements and then Bug Fixes --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi --- .../3878-remove-telemetry-flag.md | 2 +- .../3893-fix-min-gas-price-healthcheck.md | 0 .../ibc-relayer-cli/3910-fix-subscribe-bug.md | 0 .../3999-duplicate-vote-fix-query.md | 0 .../3817-deserialize-block-results.md | 0 .../3954-interchainquery-missed-events.md | 0 .../ibc-relayer/2547-channel-upgrades.md | 0 .../3894-continue-event-sourcing.md | 2 +- .../3959-update-juno-to-v21.md | 0 .../3960-update-migaloo-to-v4.md | 0 .../3961-update-wasmd-to-v0-50.md | 0 .../4009-update-ibc-go-v8-ci.md | 0 .../ibc-relayer-cli/3913-config-auto-pull.md | 0 .../ibc-relayer/3895-tendermint-rs-0.35.md | 0 .../ibc-relayer/3921-packet-ack-hex.md | 0 .../ibc-relayer/3966-tendermint-rs-0.36.md | 0 .../4000-update-dynamic-gas-fee.md | 0 .changelog/v1.9.0/summary.md | 11 + CHANGELOG.md | 75 ++++ Cargo.lock | 346 +++++++++--------- Cargo.toml | 16 +- README.md | 6 +- clippy.toml | 2 +- crates/chain-registry/Cargo.toml | 2 +- crates/relayer-cli/Cargo.toml | 4 +- crates/relayer-rest/Cargo.toml | 2 +- crates/relayer-rest/tests/mock.rs | 2 +- crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 2 +- crates/relayer/src/lib.rs | 2 +- crates/telemetry/Cargo.toml | 2 +- tools/integration-test/Cargo.toml | 2 +- tools/test-framework/Cargo.toml | 2 +- .../src/docs/walkthroughs/memo.rs | 8 +- 34 files changed, 293 insertions(+), 197 deletions(-) rename .changelog/{unreleased => v1.9.0}/breaking-changes/ibc-telemetry/3878-remove-telemetry-flag.md (75%) rename .changelog/{unreleased => v1.9.0}/bug-fixes/ibc-relayer-cli/3893-fix-min-gas-price-healthcheck.md (100%) rename .changelog/{unreleased => v1.9.0}/bug-fixes/ibc-relayer-cli/3910-fix-subscribe-bug.md (100%) rename .changelog/{unreleased => v1.9.0}/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md (100%) rename .changelog/{unreleased => v1.9.0}/bug-fixes/ibc-relayer/3817-deserialize-block-results.md (100%) rename .changelog/{unreleased => v1.9.0}/bug-fixes/ibc-relayer/3954-interchainquery-missed-events.md (100%) rename .changelog/{unreleased => v1.9.0}/features/ibc-relayer/2547-channel-upgrades.md (100%) rename .changelog/{unreleased => v1.9.0}/features/ibc-relayer/3894-continue-event-sourcing.md (69%) rename .changelog/{unreleased => v1.9.0}/improvements/ibc-integration-test/3959-update-juno-to-v21.md (100%) rename .changelog/{unreleased => v1.9.0}/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md (100%) rename .changelog/{unreleased => v1.9.0}/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md (100%) rename .changelog/{unreleased => v1.9.0}/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md (100%) rename .changelog/{unreleased => v1.9.0}/improvements/ibc-relayer-cli/3913-config-auto-pull.md (100%) rename .changelog/{unreleased => v1.9.0}/improvements/ibc-relayer/3895-tendermint-rs-0.35.md (100%) rename .changelog/{unreleased => v1.9.0}/improvements/ibc-relayer/3921-packet-ack-hex.md (100%) rename .changelog/{unreleased => v1.9.0}/improvements/ibc-relayer/3966-tendermint-rs-0.36.md (100%) rename .changelog/{unreleased => v1.9.0}/improvements/ibc-relayer/4000-update-dynamic-gas-fee.md (100%) create mode 100644 .changelog/v1.9.0/summary.md diff --git a/.changelog/unreleased/breaking-changes/ibc-telemetry/3878-remove-telemetry-flag.md b/.changelog/v1.9.0/breaking-changes/ibc-telemetry/3878-remove-telemetry-flag.md similarity index 75% rename from .changelog/unreleased/breaking-changes/ibc-telemetry/3878-remove-telemetry-flag.md rename to .changelog/v1.9.0/breaking-changes/ibc-telemetry/3878-remove-telemetry-flag.md index 4f0d3f5646..aac1189638 100644 --- a/.changelog/unreleased/breaking-changes/ibc-telemetry/3878-remove-telemetry-flag.md +++ b/.changelog/v1.9.0/breaking-changes/ibc-telemetry/3878-remove-telemetry-flag.md @@ -1,3 +1,3 @@ - Remove the `telemetry` and `rest-server` feature flags, ensuring Hermes is always built with telemetry and REST support. - Both servers can still be disabled in the configuration file, by setting `telemtry.enabled = false` and `rest.enabled = false`, respectively. + Both servers can still be disabled in the configuration file, by setting `telemetry.enabled = false` and `rest.enabled = false`, respectively. ([\#3878](https://github.com/informalsystems/hermes/pull/3878)) diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3893-fix-min-gas-price-healthcheck.md b/.changelog/v1.9.0/bug-fixes/ibc-relayer-cli/3893-fix-min-gas-price-healthcheck.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer-cli/3893-fix-min-gas-price-healthcheck.md rename to .changelog/v1.9.0/bug-fixes/ibc-relayer-cli/3893-fix-min-gas-price-healthcheck.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3910-fix-subscribe-bug.md b/.changelog/v1.9.0/bug-fixes/ibc-relayer-cli/3910-fix-subscribe-bug.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer-cli/3910-fix-subscribe-bug.md rename to .changelog/v1.9.0/bug-fixes/ibc-relayer-cli/3910-fix-subscribe-bug.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md b/.changelog/v1.9.0/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md rename to .changelog/v1.9.0/bug-fixes/ibc-relayer-cli/3999-duplicate-vote-fix-query.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/3817-deserialize-block-results.md b/.changelog/v1.9.0/bug-fixes/ibc-relayer/3817-deserialize-block-results.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer/3817-deserialize-block-results.md rename to .changelog/v1.9.0/bug-fixes/ibc-relayer/3817-deserialize-block-results.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/3954-interchainquery-missed-events.md b/.changelog/v1.9.0/bug-fixes/ibc-relayer/3954-interchainquery-missed-events.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer/3954-interchainquery-missed-events.md rename to .changelog/v1.9.0/bug-fixes/ibc-relayer/3954-interchainquery-missed-events.md diff --git a/.changelog/unreleased/features/ibc-relayer/2547-channel-upgrades.md b/.changelog/v1.9.0/features/ibc-relayer/2547-channel-upgrades.md similarity index 100% rename from .changelog/unreleased/features/ibc-relayer/2547-channel-upgrades.md rename to .changelog/v1.9.0/features/ibc-relayer/2547-channel-upgrades.md diff --git a/.changelog/unreleased/features/ibc-relayer/3894-continue-event-sourcing.md b/.changelog/v1.9.0/features/ibc-relayer/3894-continue-event-sourcing.md similarity index 69% rename from .changelog/unreleased/features/ibc-relayer/3894-continue-event-sourcing.md rename to .changelog/v1.9.0/features/ibc-relayer/3894-continue-event-sourcing.md index 9fcff6427e..f71ef4007e 100644 --- a/.changelog/unreleased/features/ibc-relayer/3894-continue-event-sourcing.md +++ b/.changelog/v1.9.0/features/ibc-relayer/3894-continue-event-sourcing.md @@ -1,4 +1,4 @@ -- Improve reliabily of event source in `pull` mode by proceeding to next block even if Hermes cannot parse the current block. +- Improve reliability of event source in `pull` mode by proceeding to next block even if Hermes cannot parse the current block. Add new configuration option to `event_source` setting: `max_retries` defines how many times Hermes should attempt to pull a block over RPC. ```toml event_source = { mode = 'pull', interval = '1s', max_retries = 4 } diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md b/.changelog/v1.9.0/improvements/ibc-integration-test/3959-update-juno-to-v21.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/3959-update-juno-to-v21.md rename to .changelog/v1.9.0/improvements/ibc-integration-test/3959-update-juno-to-v21.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md b/.changelog/v1.9.0/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md rename to .changelog/v1.9.0/improvements/ibc-integration-test/3960-update-migaloo-to-v4.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md b/.changelog/v1.9.0/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md rename to .changelog/v1.9.0/improvements/ibc-integration-test/3961-update-wasmd-to-v0-50.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md b/.changelog/v1.9.0/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md rename to .changelog/v1.9.0/improvements/ibc-integration-test/4009-update-ibc-go-v8-ci.md diff --git a/.changelog/unreleased/improvements/ibc-relayer-cli/3913-config-auto-pull.md b/.changelog/v1.9.0/improvements/ibc-relayer-cli/3913-config-auto-pull.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer-cli/3913-config-auto-pull.md rename to .changelog/v1.9.0/improvements/ibc-relayer-cli/3913-config-auto-pull.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/3895-tendermint-rs-0.35.md b/.changelog/v1.9.0/improvements/ibc-relayer/3895-tendermint-rs-0.35.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/3895-tendermint-rs-0.35.md rename to .changelog/v1.9.0/improvements/ibc-relayer/3895-tendermint-rs-0.35.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/3921-packet-ack-hex.md b/.changelog/v1.9.0/improvements/ibc-relayer/3921-packet-ack-hex.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/3921-packet-ack-hex.md rename to .changelog/v1.9.0/improvements/ibc-relayer/3921-packet-ack-hex.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/3966-tendermint-rs-0.36.md b/.changelog/v1.9.0/improvements/ibc-relayer/3966-tendermint-rs-0.36.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/3966-tendermint-rs-0.36.md rename to .changelog/v1.9.0/improvements/ibc-relayer/3966-tendermint-rs-0.36.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4000-update-dynamic-gas-fee.md b/.changelog/v1.9.0/improvements/ibc-relayer/4000-update-dynamic-gas-fee.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/4000-update-dynamic-gas-fee.md rename to .changelog/v1.9.0/improvements/ibc-relayer/4000-update-dynamic-gas-fee.md diff --git a/.changelog/v1.9.0/summary.md b/.changelog/v1.9.0/summary.md new file mode 100644 index 0000000000..8da025760a --- /dev/null +++ b/.changelog/v1.9.0/summary.md @@ -0,0 +1,11 @@ +*May 30th, 2024* + +This v1.9.0 release introduces new features and improvements to Hermes. + +**Major Features**: + +1. Channel Upgrade Compatibility: Hermes now supports channel upgrade events introduced in ibc-go v8, ensuring smoother transitions and enhanced functionality. + +3. Dynamic Gas Fees Compatibility: Hermes is now compatible with Skip's feemarket for dynamic gas fees, in addition to Osmosis' implementation, providing more flexibility in gas fee management. + +Additionally, this release includes various bug fixes enhancing the stability and performance of Hermes. These fixes address issues with channel and connection creation on unsupported ibc-go versions, event extraction, health-check messages, and more. diff --git a/CHANGELOG.md b/CHANGELOG.md index b7a677c621..c0bf96065e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,80 @@ # CHANGELOG +## v1.9.0 + +*May 30th, 2024* + +This v1.9.0 release introduces new features and improvements to Hermes. + +**Major Features**: + +1. **Channel Upgrades:** Hermes now handles [channel upgrade](https://www.ibcprotocol.dev/blog/introducing-ibc-channel-upgradability) events introduced in ibc-go v8, helping chains opting-in to new functionality on existing channels. +2. **Dynamic Gas Fees Compatibility:** Hermes is now compatible with Skip's `x/feemarket` module for dynamic gas fees, in addition to Osmosis' implementation, providing more flexibility in gas fee management. + +Additionally, this release includes various bug fixes enhancing the stability and performance of Hermes. These fixes address issues with channel and connection creation on older ibc-go versions, event extraction, health-check messages, and more. + +### BREAKING CHANGES + +- [Telemetry & Metrics](telemetry) + - Remove the `telemetry` and `rest-server` feature flags, ensuring Hermes is always built with telemetry and REST support. + Both servers can still be disabled in the configuration file, by setting `telemetry.enabled = false` and `rest.enabled = false`, respectively. + ([\#3878](https://github.com/informalsystems/hermes/pull/3878)) + +### FEATURES + +- [Relayer Library](relayer) + - Add support for upgrading channels, as per the [ICS 004 specification](https://github.com/cosmos/ibc/blob/main/spec/core/ics-004-channel-and-packet-semantics/UPGRADES.md) ([#3228](https://github.com/informalsystems/hermes/issues/2547)) + This feature allows chains to upgrade an existing channel to take advantage of new features without having to create a new channel, thus preserving all existing packet state processed on the channel. For example, a channel could now be upgraded to enable the [ICS 029 fee middleware](https://ibc.cosmos.network/main/middleware/ics29-fee/overview), allowing relayer operators on that channel to receive fees each time they relay an incentivized packet. + - Improve reliability of event source in `pull` mode by proceeding to next block even if Hermes cannot parse the current block. + Add new configuration option to `event_source` setting: `max_retries` defines how many times Hermes should attempt to pull a block over RPC. + ```toml + event_source = { mode = 'pull', interval = '1s', max_retries = 4 } + ``` + ([\#3894](https://github.com/informalsystems/hermes/issues/3894)) + +### IMPROVEMENTS + +- [Integration Test Framework](tools/test-framework) + - Update the version of Juno running the integration tests in the CI from `v17.1.1` + to `v21.0.0` ([\#3959](https://github.com/informalsystems/hermes/issues/3959)) + - Update the version of Migaloo Chain running the + integration tests in the CI from `v3.0.2` to `v4.1.3` + ([\#3960](https://github.com/informalsystems/hermes/issues/3960)) + - Update the version of `wasmd` running the + integration tests in the CI from `v0.30.0` to `v0.50.0` + ([\#3961](https://github.com/informalsystems/hermes/issues/3961)) + - Update the version of ibc-go simapp running the + integration tests in the CI from `v8.2.0` to `v8.3.1` + ([\#4009](https://github.com/informalsystems/hermes/issues/4009)) +- [Relayer Library](relayer) + - Update to tendermint-rs v0.35.0 + ([\#3895](https://github.com/informalsystems/hermes/issues/3895)) + - Use `packet_ack_hex` event attribute instead of deprecated `packet_ack` attribute to decode `WriteAck` event + ([\#3921](https://github.com/informalsystems/hermes/issues/3921)) + - Update to tendermint-rs v0.36.0 + ([\#3966](https://github.com/informalsystems/hermes/issues/3966)) + - Add support for dynamic gas fee for chains using Skip's [`x/feemarket`](https://github.com/skip-mev/feemarket) module, while keeping compatibility with Osmosis' bespoke implementation + ([\#4000](https://github.com/informalsystems/hermes/issues/4000)) +- [Relayer CLI](relayer-cli) + - Use RPC (pull) event source instead of WebSocket (push) when generating configuration with `hermes config auto` + ([\#3913](https://github.com/informalsystems/hermes/issues/3913)) + +### BUG FIXES + +- [Relayer Library](relayer) + - Fix creation of channels and connection on chains + using an unsupported version of ibc-go, eg. Sei + ([\#3817](https://github.com/informalsystems/hermes/issues/3817)) + - Fix a bug where Hermes would only ever extract the first emitted ICS 031 CrossChain Query event, which would cause it to miss the other CCQ events. + ([\#3954](https://github.com/informalsystems/hermes/issues/3954)) +- [Relayer CLI](relayer-cli) + - Fixed `minimum-gas-prices` health-check messages and make it more verbose and legible + ([\#3893](https://github.com/informalsystems/hermes/issues/3893)) + - Set `compat_mode` for pull mode in `hermes listen` command + ([\#3910](https://github.com/informalsystems/hermes/issues/3910)) + - Fixed the trusted height consensus state query when submitting the double vote evidence + ([\#3999](https://github.com/informalsystems/hermes/issues/3999)) + ## v1.8.3 *May 28th, 2024* diff --git a/Cargo.lock b/Cargo.lock index 4c0b3b5613..2a401e1ae8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,47 +67,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -156,7 +157,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -167,7 +168,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -200,9 +201,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "axum" @@ -282,9 +283,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" @@ -439,9 +440,9 @@ checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" [[package]] name = "cc" -version = "1.0.95" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" [[package]] name = "cfg-if" @@ -526,9 +527,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "console" @@ -593,9 +594,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -611,9 +612,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -668,7 +669,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -691,7 +692,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -699,9 +700,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "der" @@ -861,9 +862,9 @@ dependencies = [ [[package]] name = "either" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "elliptic-curve" @@ -930,9 +931,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -950,9 +951,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "ff" @@ -966,9 +967,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c007b1ae3abe1cb6f85a16305acd418b7ca6343b953633fee2b76d8f108b830f" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "fixed-hash" @@ -1069,7 +1070,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -1115,9 +1116,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -1196,9 +1197,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hdpath" @@ -1238,9 +1239,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hex-conservative" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed443af458ccb6d81c1e7e661545f94d3176752fb1df2f543b902a1e0f51e2" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" [[package]] name = "hex_lit" @@ -1351,7 +1352,7 @@ dependencies = [ "futures-util", "http 0.2.12", "hyper", - "rustls 0.21.11", + "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", ] @@ -1370,7 +1371,7 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.27.3" +version = "0.28.0" dependencies = [ "async-trait", "flex-error", @@ -1389,7 +1390,7 @@ dependencies = [ [[package]] name = "ibc-integration-test" -version = "0.27.3" +version = "0.28.0" dependencies = [ "byte-unit", "http 0.2.12", @@ -1403,7 +1404,7 @@ dependencies = [ "tendermint", "tendermint-rpc", "time", - "toml 0.8.12", + "toml 0.8.13", "tonic", ] @@ -1413,7 +1414,7 @@ version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66080040d5a4800d52966d55b055400f86b79c34b854b935bef03c87aacda62a" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "bytes", "flex-error", "ics23", @@ -1427,7 +1428,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.27.3" +version = "0.28.0" dependencies = [ "anyhow", "async-stream", @@ -1487,7 +1488,7 @@ dependencies = [ "tiny-keccak", "tokio", "tokio-stream", - "toml 0.8.12", + "toml 0.8.13", "tonic", "tracing", "tracing-subscriber", @@ -1496,7 +1497,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "1.8.3" +version = "1.9.0" dependencies = [ "abscissa_core", "clap", @@ -1537,7 +1538,7 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.27.3" +version = "0.28.0" dependencies = [ "axum", "crossbeam-channel", @@ -1546,13 +1547,13 @@ dependencies = [ "reqwest", "serde", "tokio", - "toml 0.8.12", + "toml 0.8.13", "tracing", ] [[package]] name = "ibc-relayer-types" -version = "0.27.3" +version = "0.28.0" dependencies = [ "bytes", "derive_more", @@ -1583,7 +1584,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.27.3" +version = "0.28.0" dependencies = [ "axum", "dashmap", @@ -1602,7 +1603,7 @@ dependencies = [ [[package]] name = "ibc-test-framework" -version = "0.27.3" +version = "0.28.0" dependencies = [ "color-eyre", "crossbeam-channel", @@ -1627,7 +1628,7 @@ dependencies = [ "subtle-encoding", "tendermint-rpc", "tokio", - "toml 0.8.12", + "toml 0.8.13", "tonic", "tracing", "tracing-subscriber", @@ -1700,7 +1701,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -1719,6 +1720,12 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.12.1" @@ -1772,9 +1779,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libredox" @@ -1788,15 +1795,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -1837,9 +1844,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -1887,11 +1894,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", "serde", @@ -1914,11 +1920,10 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-bigint", "num-integer", "num-traits", @@ -1927,9 +1932,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -2057,9 +2062,9 @@ checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -2067,22 +2072,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pbkdf2" @@ -2095,9 +2100,9 @@ dependencies = [ [[package]] name = "peg" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "400bcab7d219c38abf8bd7cc2054eb9bbbd4312d66f6a5557d572a203f646f61" +checksum = "8a625d12ad770914cbf7eff6f9314c3ef803bfe364a1b20bc36ddf56673e71e5" dependencies = [ "peg-macros", "peg-runtime", @@ -2105,9 +2110,9 @@ dependencies = [ [[package]] name = "peg-macros" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46e61cce859b76d19090f62da50a9fe92bab7c2a5f09e183763559a2ac392c90" +checksum = "f241d42067ed3ab6a4fece1db720838e1418f36d868585a27931f95d6bc03582" dependencies = [ "peg-runtime", "proc-macro2", @@ -2116,9 +2121,9 @@ dependencies = [ [[package]] name = "peg-runtime" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36bae92c60fa2398ce4678b98b2c4b5a7c61099961ca1fa305aec04a9ad28922" +checksum = "e3aeb8f54c078314c2065ee649a7241f46b9d8e418e1a9581ba0546657d7aa3a" [[package]] name = "percent-encoding" @@ -2143,7 +2148,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -2223,9 +2228,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] @@ -2265,14 +2270,14 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] name = "prost-types" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3235c33eb02c1f1e212abdbe34c78b264b038fb58ca612664343271e36e55ffe" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ "prost", ] @@ -2339,20 +2344,20 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.0.1" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" +checksum = "e29830cbb1290e404f24c73af91c5d8d631ce7e128691e9477556b540cd01ecd" dependencies = [ "bitflags 2.5.0", ] [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", ] [[package]] @@ -2433,7 +2438,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.11", + "rustls 0.21.12", "rustls-native-certs 0.6.3", "rustls-pemfile 1.0.4", "serde", @@ -2493,9 +2498,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -2514,9 +2519,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.33" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3cc72858054fcff6d7dea32df2aeaee6a7c24227366d7ea429aada2f26b16ad" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", "errno", @@ -2527,9 +2532,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.11" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring", @@ -2546,7 +2551,7 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki 0.102.4", "subtle", "zeroize", ] @@ -2591,15 +2596,15 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.4.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" @@ -2613,9 +2618,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring", "rustls-pki-types", @@ -2624,15 +2629,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -2645,9 +2650,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96560eea317a9cc4e0bb1f6a2c93c09a19b8c4fc5cb3fcc0ec1c094cd783e2" +checksum = "76ad2bbb0ae5100a07b7a6f2ed7ab5fd0045551a4c507989b7a620046ea3efdc" dependencies = [ "sdd", ] @@ -2730,11 +2735,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -2743,9 +2748,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -2753,9 +2758,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -2796,7 +2801,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -2828,14 +2833,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -2887,7 +2892,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -3002,9 +3007,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3057,7 +3062,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -3094,9 +3099,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -3201,7 +3206,7 @@ dependencies = [ "serde", "serde_json", "tendermint", - "toml 0.8.12", + "toml 0.8.13", "url", ] @@ -3343,9 +3348,9 @@ dependencies = [ [[package]] name = "test-log" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b319995299c65d522680decf80f2c108d85b861d81dfe340a10d16cee29d9e6" +checksum = "3dffced63c2b5c7be278154d76b479f9f9920ed34e7574201407f0b14e2bbb93" dependencies = [ "env_logger", "test-log-macros", @@ -3354,13 +3359,13 @@ dependencies = [ [[package]] name = "test-log-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8f546451eaa38373f549093fe9fd05e7d2bade739e2ddf834b9968621d60107" +checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -3386,7 +3391,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -3474,9 +3479,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -3503,13 +3508,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -3518,7 +3523,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.11", + "rustls 0.21.12", "tokio", ] @@ -3546,16 +3551,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -3569,9 +3573,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ "serde", "serde_spanned", @@ -3581,18 +3585,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ "indexmap 2.2.6", "serde", @@ -3684,7 +3688,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] [[package]] @@ -3762,9 +3766,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" +checksum = "1b2cb4fbb9995eeb36ac86fadf24031ccd58f99d6b4b2d7b911db70bddb80d90" [[package]] name = "try-lock" @@ -3834,9 +3838,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "unicode-xid" @@ -3967,7 +3971,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", "wasm-bindgen-shared", ] @@ -4001,7 +4005,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4040,11 +4044,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -4194,9 +4198,9 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.6" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +checksum = "86c949fede1d13936a99f14fafd3e76fd642b556dd2ce96287fbe2e0151bfac6" dependencies = [ "memchr", ] @@ -4213,9 +4217,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -4228,5 +4232,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.66", ] diff --git a/Cargo.toml b/Cargo.toml index f2dd104e12..6f8bbf44b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,14 +20,14 @@ exclude = [ [workspace.dependencies] # Hermes dependencies -ibc-relayer-cli = { version = "1.8.2", path = "crates/relayer-cli" } -ibc-relayer = { version = "0.27.2", path = "crates/relayer" } -ibc-relayer-rest = { version = "0.27.2", path = "crates/relayer-rest" } -ibc-relayer-types = { version = "0.27.2", path = "crates/relayer-types" } -ibc-chain-registry = { version = "0.27.2", path = "crates/chain-registry" } -ibc-telemetry = { version = "0.27.2", path = "crates/telemetry" } -ibc-test-framework = { version = "0.27.2", path = "tools/test-framework" } -ibc-integration-test = { version = "0.27.2", path = "tools/integration-test" } +ibc-relayer-cli = { version = "1.9.0", path = "crates/relayer-cli" } +ibc-relayer = { version = "0.28.0", path = "crates/relayer" } +ibc-relayer-rest = { version = "0.28.0", path = "crates/relayer-rest" } +ibc-relayer-types = { version = "0.28.0", path = "crates/relayer-types" } +ibc-chain-registry = { version = "0.28.0", path = "crates/chain-registry" } +ibc-telemetry = { version = "0.28.0", path = "crates/telemetry" } +ibc-test-framework = { version = "0.28.0", path = "tools/test-framework" } +ibc-integration-test = { version = "0.28.0", path = "tools/integration-test" } # Tendermint dependencies tendermint = { version = "0.36.0", default-features = false } diff --git a/README.md b/README.md index 883079cb00..0bf292f2e1 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Integration tests][test-image]][test-link] [![Apache 2.0 Licensed][license-image]][license-link] ![Rust Stable][rustc-image] -![Rust 1.71.1+][rustc-version] +![Rust 1.76+][rustc-version] Rust implementation of an Inter-Blockchain Communication (IBC) relayer. @@ -48,7 +48,7 @@ The repository also includes [TLA+ specifications](docs/spec). ## Requirements -The crates in this project require Rust `1.71.1`. +The crates in this project require Rust `1.76.0`. ## Hermes Guide @@ -123,7 +123,7 @@ Unless required by applicable law or agreed to in writing, software distributed [license-image]: https://img.shields.io/badge/license-Apache_2.0-blue.svg [license-link]: https://github.com/informalsystems/hermes/blob/master/LICENSE [rustc-image]: https://img.shields.io/badge/rustc-stable-blue.svg -[rustc-version]: https://img.shields.io/badge/rustc-1.71.1+-blue.svg +[rustc-version]: https://img.shields.io/badge/rustc-1.76+-blue.svg [cosmos-shield]: https://img.shields.io/static/v1?label=&labelColor=1B1E36&color=1B1E36&message=cosmos%20ecosystem&style=for-the-badge&logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI0LjMuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAyNTAwIDI1MDAiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDI1MDAgMjUwMDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiM2RjczOTA7fQoJLnN0MXtmaWxsOiNCN0I5Qzg7fQo8L3N0eWxlPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMTI1Mi42LDE1OS41Yy0xMzQuOSwwLTI0NC4zLDQ4OS40LTI0NC4zLDEwOTMuMXMxMDkuNCwxMDkzLjEsMjQ0LjMsMTA5My4xczI0NC4zLTQ4OS40LDI0NC4zLTEwOTMuMQoJUzEzODcuNSwxNTkuNSwxMjUyLjYsMTU5LjV6IE0xMjY5LjQsMjI4NGMtMTUuNCwyMC42LTMwLjksNS4xLTMwLjksNS4xYy02Mi4xLTcyLTkzLjItMjA1LjgtOTMuMi0yMDUuOAoJYy0xMDguNy0zNDkuOC04Mi44LTExMDAuOC04Mi44LTExMDAuOGM1MS4xLTU5Ni4yLDE0NC03MzcuMSwxNzUuNi03NjguNGM2LjctNi42LDE3LjEtNy40LDI0LjctMmM0NS45LDMyLjUsODQuNCwxNjguNSw4NC40LDE2OC41CgljMTEzLjYsNDIxLjgsMTAzLjMsODE3LjksMTAzLjMsODE3LjljMTAuMywzNDQuNy01Ni45LDczMC41LTU2LjksNzMwLjVDMTM0MS45LDIyMjIuMiwxMjY5LjQsMjI4NCwxMjY5LjQsMjI4NHoiLz4KPHBhdGggY2xhc3M9InN0MCIgZD0iTTIyMDAuNyw3MDguNmMtNjcuMi0xMTcuMS01NDYuMSwzMS42LTEwNzAsMzMycy04OTMuNSw2MzguOS04MjYuMyw3NTUuOXM1NDYuMS0zMS42LDEwNzAtMzMyCglTMjI2Ny44LDgyNS42LDIyMDAuNyw3MDguNkwyMjAwLjcsNzA4LjZ6IE0zNjYuNCwxNzgwLjRjLTI1LjctMy4yLTE5LjktMjQuNC0xOS45LTI0LjRjMzEuNi04OS43LDEzMi0xODMuMiwxMzItMTgzLjIKCWMyNDkuNC0yNjguNCw5MTMuOC02MTkuNyw5MTMuOC02MTkuN2M1NDIuNS0yNTIuNCw3MTEuMS0yNDEuOCw3NTMuOC0yMzBjOS4xLDIuNSwxNSwxMS4yLDE0LDIwLjZjLTUuMSw1Ni0xMDQuMiwxNTctMTA0LjIsMTU3CgljLTMwOS4xLDMwOC42LTY1Ny44LDQ5Ni44LTY1Ny44LDQ5Ni44Yy0yOTMuOCwxODAuNS02NjEuOSwzMTQuMS02NjEuOSwzMTQuMUM0NTYsMTgxMi42LDM2Ni40LDE3ODAuNCwzNjYuNCwxNzgwLjRMMzY2LjQsMTc4MC40CglMMzY2LjQsMTc4MC40eiIvPgo8cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjE5OC40LDE4MDAuNGM2Ny43LTExNi44LTMwMC45LTQ1Ni44LTgyMy03NTkuNVMzNzQuNCw1ODcuOCwzMDYuOCw3MDQuN3MzMDAuOSw0NTYuOCw4MjMuMyw3NTkuNQoJUzIxMzAuNywxOTE3LjQsMjE5OC40LDE4MDAuNHogTTM1MS42LDc0OS44Yy0xMC0yMy43LDExLjEtMjkuNCwxMS4xLTI5LjRjOTMuNS0xNy42LDIyNC43LDIyLjYsMjI0LjcsMjIuNgoJYzM1Ny4yLDgxLjMsOTk0LDQ4MC4yLDk5NCw0ODAuMmM0OTAuMywzNDMuMSw1NjUuNSw0OTQuMiw1NzYuOCw1MzcuMWMyLjQsOS4xLTIuMiwxOC42LTEwLjcsMjIuNGMtNTEuMSwyMy40LTE4OC4xLTExLjUtMTg4LjEtMTEuNQoJYy00MjIuMS0xMTMuMi03NTkuNi0zMjAuNS03NTkuNi0zMjAuNWMtMzAzLjMtMTYzLjYtNjAzLjItNDE1LjMtNjAzLjItNDE1LjNjLTIyNy45LTE5MS45LTI0NS0yODUuNC0yNDUtMjg1LjRMMzUxLjYsNzQ5Ljh6Ii8+CjxjaXJjbGUgY2xhc3M9InN0MSIgY3g9IjEyNTAiIGN5PSIxMjUwIiByPSIxMjguNiIvPgo8ZWxsaXBzZSBjbGFzcz0ic3QxIiBjeD0iMTc3Ny4zIiBjeT0iNzU2LjIiIHJ4PSI3NC42IiByeT0iNzcuMiIvPgo8ZWxsaXBzZSBjbGFzcz0ic3QxIiBjeD0iNTUzIiBjeT0iMTAxOC41IiByeD0iNzQuNiIgcnk9Ijc3LjIiLz4KPGVsbGlwc2UgY2xhc3M9InN0MSIgY3g9IjEwOTguMiIgY3k9IjE5NjUiIHJ4PSI3NC42IiByeT0iNzcuMiIvPgo8L3N2Zz4K [cosmos-link]: https://cosmos.network diff --git a/clippy.toml b/clippy.toml index f634529786..7372c60ff2 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.71.1" +msrv = "1.76.0" diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index 20d832db47..cd515800ae 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-chain-registry" -version = "0.27.3" +version = "0.28.0" edition = "2021" license = "Apache-2.0" keywords = ["cosmos", "ibc", "relayer", "chain", "registry"] diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index 40522b3843..11e64b42b9 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-cli" -version = "1.8.3" +version = "1.9.0" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -8,7 +8,7 @@ keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] homepage = "https://hermes.informal.systems/" repository = "https://github.com/informalsystems/hermes" authors = ["Informal Systems "] -rust-version = "1.71.1" +rust-version = "1.76.0" description = """ Hermes is an IBC Relayer written in Rust """ diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index 11e01da18a..d831f4bda8 100644 --- a/crates/relayer-rest/Cargo.toml +++ b/crates/relayer-rest/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-rest" -version = "0.27.3" +version = "0.28.0" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index eeeffd3f84..4029db0bc7 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -64,7 +64,7 @@ async fn version() { let rest_api_version = VersionInfo { name: "ibc-relayer-rest".to_string(), - version: "0.27.3".to_string(), + version: "0.28.0".to_string(), }; let result: JsonResult<_, ()> = JsonResult::Success(vec![version.clone(), rest_api_version]); diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 266d26d127..578d924eaf 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-types" -version = "0.27.3" +version = "0.28.0" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 9a5ed86a53..7691ca00ea 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer" -version = "0.27.3" +version = "0.28.0" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index e57f50158c..511e1a62f3 100644 --- a/crates/relayer/src/lib.rs +++ b/crates/relayer/src/lib.rs @@ -14,7 +14,7 @@ //! //! For the IBC relayer binary, please see [Hermes] (`ibc-relayer-cli` crate). //! -//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.8.3/ +//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.9.0/ extern crate alloc; diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index 26b857647e..fa5e6ef05c 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-telemetry" -version = "0.27.3" +version = "0.28.0" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index a9056faf4d..8a0a8dacf7 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-integration-test" -version = "0.27.3" +version = "0.28.0" edition = "2021" rust-version = "1.71.1" license = "Apache-2.0" diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 1153e1dc66..730d2d5892 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-test-framework" -version = "0.27.3" +version = "0.28.0" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/tools/test-framework/src/docs/walkthroughs/memo.rs b/tools/test-framework/src/docs/walkthroughs/memo.rs index c13a667df1..7c0887a76c 100644 --- a/tools/test-framework/src/docs/walkthroughs/memo.rs +++ b/tools/test-framework/src/docs/walkthroughs/memo.rs @@ -11,10 +11,12 @@ //! ```no_run //! # use serde_json as json; //! # use ibc_relayer::config::{types::Memo, Config}; +//! # use ibc_relayer::config::ChainConfig; //! # use ibc_test_framework::ibc::denom::derive_ibc_denom; //! # use ibc_test_framework::prelude::*; //! # use ibc_test_framework::util::random::{random_string, random_u128_range}; //! +//! //! #[test] //! fn test_memo() -> Result<(), Error> { //! let memo = Memo::new(random_string()).unwrap(); @@ -29,7 +31,11 @@ //! impl TestOverrides for MemoTest { //! fn modify_relayer_config(&self, config: &mut Config) { //! for mut chain in config.chains.iter_mut() { -//! chain.memo_prefix = self.memo.clone(); +//! match chain { +//! ChainConfig::CosmosSdk(chain_config) => { +//! chain_config.memo_prefix = self.memo.clone(); +//! }, +//! } //! } //! } //! } From 591a9204847dcd4cf971984ed9cf7a8412b5eefd Mon Sep 17 00:00:00 2001 From: Sergey <83376337+freak12techno@users.noreply.github.com> Date: Wed, 5 Jun 2024 08:39:03 +0300 Subject: [PATCH 116/200] Add custom User-Agent to Hermes queries (#4017) --- .../ibc-relayer/3979-add-custom-user-agent.md | 2 + Cargo.lock | 37 ++++++++++--------- Cargo.toml | 16 ++++---- crates/chain-registry/Cargo.toml | 1 + crates/chain-registry/src/querier.rs | 2 + crates/relayer-cli/src/commands/listen.rs | 10 ++++- crates/relayer/src/chain/cosmos.rs | 5 ++- crates/relayer/src/lib.rs | 2 + crates/relayer/src/light_client/tendermint.rs | 9 +++-- 9 files changed, 52 insertions(+), 32 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/3979-add-custom-user-agent.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/3979-add-custom-user-agent.md b/.changelog/unreleased/improvements/ibc-relayer/3979-add-custom-user-agent.md new file mode 100644 index 0000000000..4854632ae5 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/3979-add-custom-user-agent.md @@ -0,0 +1,2 @@ +- Use custom User-Agent for Hermes queries + ([\#3979](https://github.com/informalsystems/hermes/issues/3979)) diff --git a/Cargo.lock b/Cargo.lock index 2a401e1ae8..39c12c544c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1378,6 +1378,7 @@ dependencies = [ "futures", "http 0.2.12", "ibc-proto", + "ibc-relayer", "ibc-relayer-types", "itertools", "reqwest", @@ -1410,9 +1411,9 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.44.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66080040d5a4800d52966d55b055400f86b79c34b854b935bef03c87aacda62a" +checksum = "6cb09e0b52b8a16e98ce98845e7c15b018440f3c56defa12fa44782cd66bab65" dependencies = [ "base64 0.22.1", "bytes", @@ -3167,9 +3168,9 @@ dependencies = [ [[package]] name = "tendermint" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b50aae6ec24c3429149ad59b5b8d3374d7804d4c7d6125ceb97cb53907fb68d" +checksum = "954496fbc9716eb4446cdd6d00c071a3e2f22578d62aa03b40c7e5b4fda3ed42" dependencies = [ "bytes", "digest 0.10.7", @@ -3198,9 +3199,9 @@ dependencies = [ [[package]] name = "tendermint-config" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e07b383dc8780ebbec04cfb603f3fdaba6ea6663d8dd861425b1ffa7761fe90d" +checksum = "f84b11b57d20ee4492a1452faff85f5c520adc36ca9fe5e701066935255bb89f" dependencies = [ "flex-error", "serde", @@ -3212,9 +3213,9 @@ dependencies = [ [[package]] name = "tendermint-light-client" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "331544139bbcf353acb5f56e733093d8e4bf2522cda0491b4bba7039ef0b944e" +checksum = "4faf208913acf562b8703e8e1e5eabdc57efa88c1404f9df20338a9969f08d6b" dependencies = [ "contracts", "crossbeam-channel", @@ -3237,9 +3238,9 @@ dependencies = [ [[package]] name = "tendermint-light-client-detector" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73d0ffaf614bd2db605c4762e3a31a536b73cd45488fa5bace050135ca348f28" +checksum = "d4e7c930960f72741f9baa7fb0bb12c1cf3e4bd687e2eb2cbd7996555e9799e2" dependencies = [ "crossbeam-channel", "derive_more", @@ -3260,9 +3261,9 @@ dependencies = [ [[package]] name = "tendermint-light-client-verifier" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4216e487165e5dbd7af79952eaa0d5f06c5bde861eb76c690acd7f2d2a19395c" +checksum = "3848090df4502a09ee27cb1a00f1835e1111c8993b22c5e1e41ffb7f6f09d57e" dependencies = [ "derive_more", "flex-error", @@ -3273,9 +3274,9 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f193d04afde6592c20fd70788a10b8cb3823091c07456db70d8a93f5fb99c1" +checksum = "dc87024548c7f3da479885201e3da20ef29e85a3b13d04606b380ac4c7120d87" dependencies = [ "bytes", "flex-error", @@ -3289,9 +3290,9 @@ dependencies = [ [[package]] name = "tendermint-rpc" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e3c231a3632cab53f92ad4161c730c468c08cfe4f0aa5a6735b53b390aecbd" +checksum = "dfdc2281e271277fda184d96d874a6fe59f569b130b634289257baacfc95aa85" dependencies = [ "async-trait", "async-tungstenite", @@ -3323,9 +3324,9 @@ dependencies = [ [[package]] name = "tendermint-testgen" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b233cec83c56c413ccc346af866cb9206a14d468fcecf0255080107bc9b103c0" +checksum = "318a0e38b3b7b36b4078d78446d4284088aa9b173d519fc804c3ee4683972934" dependencies = [ "ed25519-consensus", "gumdrop", diff --git a/Cargo.toml b/Cargo.toml index 6f8bbf44b3..4cff6bfad3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,13 +30,13 @@ ibc-test-framework = { version = "0.28.0", path = "tools/test-framework" } ibc-integration-test = { version = "0.28.0", path = "tools/integration-test" } # Tendermint dependencies -tendermint = { version = "0.36.0", default-features = false } -tendermint-light-client = { version = "0.36.0", default-features = false } -tendermint-light-client-detector = { version = "0.36.0", default-features = false } -tendermint-light-client-verifier = { version = "0.36.0", default-features = false } -tendermint-proto = { version = "0.36.0" } -tendermint-rpc = { version = "0.36.0" } -tendermint-testgen = { version = "0.36.0" } +tendermint = { version = "0.37.0", default-features = false } +tendermint-light-client = { version = "0.37.0", default-features = false } +tendermint-light-client-detector = { version = "0.37.0", default-features = false } +tendermint-light-client-verifier = { version = "0.37.0", default-features = false } +tendermint-proto = { version = "0.37.0" } +tendermint-rpc = { version = "0.37.0" } +tendermint-testgen = { version = "0.37.0" } # Other dependencies abscissa_core = "=0.6.0" @@ -72,7 +72,7 @@ hex = "0.4.3" http = "0.2.9" humantime = "2.1.0" humantime-serde = "1.1.1" -ibc-proto = "0.44.0" +ibc-proto = "0.46.0" ics23 = "0.11.1" itertools = "0.12.1" moka = "0.12.5" diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index cd515800ae..c2b79fb856 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -12,6 +12,7 @@ description = """ """ [dependencies] +ibc-relayer = { workspace = true } ibc-relayer-types = { workspace = true } ibc-proto = { workspace = true, features = ["serde"] } tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } diff --git a/crates/chain-registry/src/querier.rs b/crates/chain-registry/src/querier.rs index 3102011f16..9df2504e41 100644 --- a/crates/chain-registry/src/querier.rs +++ b/crates/chain-registry/src/querier.rs @@ -13,6 +13,7 @@ use tendermint_rpc::HttpClientUrl; use tracing::{debug, info}; use ibc_proto::cosmos::bank::v1beta1::query_client::QueryClient; +use ibc_relayer::HERMES_VERSION; use tendermint_rpc::{Client, Url}; use crate::error::RegistryError; @@ -107,6 +108,7 @@ impl QueryContext for SimpleHermesRpcQuerier { .map_err(|e| RegistryError::tendermint_url_parse_error(rpc_url.clone(), e))?; let client = HttpClient::builder(url) + .user_agent(format!("hermes/{}", HERMES_VERSION)) .build() .map_err(|e| RegistryError::rpc_connect_error(rpc_url.clone(), e))?; diff --git a/crates/relayer-cli/src/commands/listen.rs b/crates/relayer-cli/src/commands/listen.rs index 101a9ab9da..121f4c6034 100644 --- a/crates/relayer-cli/src/commands/listen.rs +++ b/crates/relayer-cli/src/commands/listen.rs @@ -19,6 +19,7 @@ use ibc_relayer::{ error::Error, event::source::EventSource, util::compat_mode::compat_mode_from_version, + HERMES_VERSION, }; use ibc_relayer_types::{core::ics24_host::identifier::ChainId, events::IbcEvent}; @@ -161,7 +162,9 @@ fn subscribe( interval, max_retries, } => { - let mut rpc_client = HttpClient::new(config.rpc_addr.clone()) + let mut rpc_client = HttpClient::builder(config.rpc_addr.clone().try_into()?) + .user_agent(format!("hermes/{}", HERMES_VERSION)) + .build() .map_err(|e| Error::rpc(config.rpc_addr.clone(), e))?; rpc_client.set_compat_mode(compat_mode); @@ -191,7 +194,10 @@ fn detect_compatibility_mode( let rpc_addr = match config { ChainConfig::CosmosSdk(config) => config.rpc_addr.clone(), }; - let client = HttpClient::new(rpc_addr)?; + let client = HttpClient::builder(rpc_addr.try_into()?) + .user_agent(format!("hermes/{}", HERMES_VERSION)) + .build()?; + let status = rt.block_on(client.status())?; let compat_mode = match config { ChainConfig::CosmosSdk(config) => { diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 09cd731b77..6cd8916905 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -110,6 +110,7 @@ use crate::util::pretty::PrettySlice; use crate::util::pretty::{ PrettyIdentifiedChannel, PrettyIdentifiedClientState, PrettyIdentifiedConnection, }; +use crate::HERMES_VERSION; use self::gas::dynamic_gas_price; use self::types::app_state::GenesisAppState; @@ -980,7 +981,9 @@ impl ChainEndpoint for CosmosSdkChain { return Err(Error::config(ConfigError::wrong_type())); }; - let mut rpc_client = HttpClient::new(config.rpc_addr.clone()) + let mut rpc_client = HttpClient::builder(config.rpc_addr.clone().try_into().unwrap()) + .user_agent(format!("hermes/{}", HERMES_VERSION)) + .build() .map_err(|e| Error::rpc(config.rpc_addr.clone(), e))?; let node_info = rt.block_on(fetch_node_info(&rpc_client, &config))?; diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index 511e1a62f3..eb16353f62 100644 --- a/crates/relayer/src/lib.rs +++ b/crates/relayer/src/lib.rs @@ -47,3 +47,5 @@ pub mod transfer; pub mod upgrade_chain; pub mod util; pub mod worker; + +pub const HERMES_VERSION: &str = "1.9.0"; diff --git a/crates/relayer/src/light_client/tendermint.rs b/crates/relayer/src/light_client/tendermint.rs index bb48d8dbc4..32d31dfcdb 100644 --- a/crates/relayer/src/light_client/tendermint.rs +++ b/crates/relayer/src/light_client/tendermint.rs @@ -28,11 +28,11 @@ use ibc_relayer_types::core::ics24_host::identifier::ChainId; use ibc_relayer_types::Height as ICSHeight; use crate::{ - chain::cosmos::config::CosmosSdkConfig, - chain::cosmos::CosmosSdkChain, + chain::cosmos::{config::CosmosSdkConfig, CosmosSdkChain}, client_state::AnyClientState, error::Error, misbehaviour::{AnyMisbehaviour, MisbehaviourEvidence}, + HERMES_VERSION, }; use super::{ @@ -255,7 +255,10 @@ fn io_for_addr( peer_id: PeerId, timeout: Option, ) -> Result { - let rpc_client = rpc::HttpClient::new(addr.clone()).map_err(|e| Error::rpc(addr.clone(), e))?; + let rpc_client = rpc::HttpClient::builder(addr.clone().try_into().unwrap()) + .user_agent(format!("hermes/{}", HERMES_VERSION)) + .build() + .map_err(|e| Error::rpc(addr.clone(), e))?; Ok(ProdIo::new(peer_id, rpc_client, timeout)) } From 5425f8698a7a9cc0cbe6174098d2a6a4c8a28619 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 11:34:45 +0200 Subject: [PATCH 117/200] Bump toml from 0.8.13 to 0.8.14 (#4018) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.13 to 0.8.14. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.13...toml-v0.8.14) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> --- Cargo.lock | 18 +++++++++--------- Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 39c12c544c..553b827aac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1405,7 +1405,7 @@ dependencies = [ "tendermint", "tendermint-rpc", "time", - "toml 0.8.13", + "toml 0.8.14", "tonic", ] @@ -1489,7 +1489,7 @@ dependencies = [ "tiny-keccak", "tokio", "tokio-stream", - "toml 0.8.13", + "toml 0.8.14", "tonic", "tracing", "tracing-subscriber", @@ -1548,7 +1548,7 @@ dependencies = [ "reqwest", "serde", "tokio", - "toml 0.8.13", + "toml 0.8.14", "tracing", ] @@ -1629,7 +1629,7 @@ dependencies = [ "subtle-encoding", "tendermint-rpc", "tokio", - "toml 0.8.13", + "toml 0.8.14", "tonic", "tracing", "tracing-subscriber", @@ -3207,7 +3207,7 @@ dependencies = [ "serde", "serde_json", "tendermint", - "toml 0.8.13", + "toml 0.8.14", "url", ] @@ -3574,9 +3574,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", @@ -3595,9 +3595,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.13" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap 2.2.6", "serde", diff --git a/Cargo.toml b/Cargo.toml index 4cff6bfad3..1af8331065 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -110,7 +110,7 @@ tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } tokio = "1.26.0" tokio-stream = "0.1.14" -toml = "0.8.8" +toml = "0.8.14" tonic = "0.11" tracing = { version = "0.1.36", default-features = false } tracing-subscriber = "0.3.14" From 76f6ac197faadf22eff36d1d0b930d5bf6bab4b6 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 10 Jun 2024 12:36:53 +0200 Subject: [PATCH 118/200] Update Osmosis used in CI to v25 (#4030) * Update Nix flake to use latest Osmosis v25.0.0 * Add changelog entry --- .../4024-update-osmosis-to-v25.md | 2 ++ flake.lock | 20 +++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4024-update-osmosis-to-v25.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4024-update-osmosis-to-v25.md b/.changelog/unreleased/improvements/ibc-integration-test/4024-update-osmosis-to-v25.md new file mode 100644 index 0000000000..f1cbc137bc --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4024-update-osmosis-to-v25.md @@ -0,0 +1,2 @@ +- Update the version of Osmosis running the integration tests in the CI from `v24.0.1` + to `v25.0.0` ([\#4024](https://github.com/informalsystems/hermes/issues/4024)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index fbf9d60412..1447a0d0cb 100644 --- a/flake.lock +++ b/flake.lock @@ -212,11 +212,11 @@ "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" }, "locked": { - "lastModified": 1717072229, - "narHash": "sha256-166ggriJPlTWZ/xR6YfbPd3kveJ6Hhj0BclEL0DzDYA=", + "lastModified": 1718009224, + "narHash": "sha256-CEmfV07gctUaEPtGPIIMvW43zw+0LZi6Suf63lLaHak=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "9a18b54abb037e832a6854f053e274a7ba367074", + "rev": "8515f69bb52afc0165854f9e46e1f0918e78874b", "type": "github" }, "original": { @@ -1338,11 +1338,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1716977081, - "narHash": "sha256-pFe5jLeIPlKEln5n2h998d7cpzXFdbrBMRe3suz4K1o=", + "lastModified": 1717868076, + "narHash": "sha256-c83Y9t815Wa34khrux81j8K8ET94ESmCuwORSKm2bQY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "ac82a513e55582291805d6f09d35b6d8b60637a1", + "rev": "cd18e2ae9ab8e2a0a8d715b60c91b54c0ac35ff9", "type": "github" }, "original": { @@ -1355,16 +1355,16 @@ "osmosis-src": { "flake": false, "locked": { - "lastModified": 1712687434, - "narHash": "sha256-j1PtSv4i/3IV6hUHxxgO/5t9/bfWs28i3D/uVAkf68Q=", + "lastModified": 1715157587, + "narHash": "sha256-D/CymboICWe73MBGF036W5NT/pyaV8Wvll2bJmYNmHg=", "owner": "osmosis-labs", "repo": "osmosis", - "rev": "0021d3812a8c8d2798ab17e58991a677b82e8955", + "rev": "15566f1f2945a16af9243dd376ee58a0d691b66a", "type": "github" }, "original": { "owner": "osmosis-labs", - "ref": "v24.0.1", + "ref": "v25.0.0", "repo": "osmosis", "type": "github" } From d76f5382006b821e166ebd5f1e179c69468b1689 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 10 Jun 2024 14:15:27 +0200 Subject: [PATCH 119/200] Update Neutron used in CI to v3.0.5 (#4031) * Update nix flake * Add changelog entry --- .../4026-update-neutron-to-v305.md | 2 ++ flake.lock | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4026-update-neutron-to-v305.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4026-update-neutron-to-v305.md b/.changelog/unreleased/improvements/ibc-integration-test/4026-update-neutron-to-v305.md new file mode 100644 index 0000000000..360d0985eb --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4026-update-neutron-to-v305.md @@ -0,0 +1,2 @@ +- Update the version of Neutron running the integration tests in the CI from `v3.0.2` + to `v3.0.5` ([\#4026](https://github.com/informalsystems/hermes/issues/4026)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index 1447a0d0cb..20080b0b97 100644 --- a/flake.lock +++ b/flake.lock @@ -212,11 +212,11 @@ "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" }, "locked": { - "lastModified": 1718009224, - "narHash": "sha256-CEmfV07gctUaEPtGPIIMvW43zw+0LZi6Suf63lLaHak=", + "lastModified": 1718011615, + "narHash": "sha256-VluMd6vAPEP//hepHfE+/CDJKU8AfRRE/Sxo7cqIx3Y=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "8515f69bb52afc0165854f9e46e1f0918e78874b", + "rev": "eaf5f4da4b35d8138b2c42aa39bc314b9be89958", "type": "github" }, "original": { @@ -1124,16 +1124,16 @@ "neutron-src": { "flake": false, "locked": { - "lastModified": 1712330928, - "narHash": "sha256-3olixILNnkRcNwtpPDqQJ63cYjV5qiVYTM+fJEIH65s=", + "lastModified": 1713877185, + "narHash": "sha256-cslMi835EdyByhSUN1FG9ucXjh5tQxqs3YfCLqGwYLg=", "owner": "neutron-org", "repo": "neutron", - "rev": "d652580f204231a5d6d76c83a084d7110d981416", + "rev": "73f419c3c60a3b811b08788519063560e84d97a8", "type": "github" }, "original": { "owner": "neutron-org", - "ref": "v3.0.2", + "ref": "v3.0.5", "repo": "neutron", "type": "github" } From f0ffaf495b286f940cc11ca118e26baaf3347380 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 10 Jun 2024 15:51:23 +0200 Subject: [PATCH 120/200] Update Gaia used in CI to v17 (#4032) * Use Gaia v17.2.0 instead of v15.2.0 * Add changelog entry * Add missing fields to consumer chain gov proposal --- .../4023-update-gaia-to-v17.md | 2 ++ .github/workflows/integration.yaml | 12 +++++----- .github/workflows/misbehaviour.yml | 2 +- .github/workflows/multi-chains.yaml | 2 +- flake.lock | 24 ++++++++++++++++--- flake.nix | 2 +- .../test-framework/src/chain/ext/bootstrap.rs | 7 +++++- 7 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4023-update-gaia-to-v17.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4023-update-gaia-to-v17.md b/.changelog/unreleased/improvements/ibc-integration-test/4023-update-gaia-to-v17.md new file mode 100644 index 0000000000..4d833215f5 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4023-update-gaia-to-v17.md @@ -0,0 +1,2 @@ +- Update the version of Gaia running the integration tests in the CI from `v15.2.0` + to `v17.2.0` ([\#4023](https://github.com/informalsystems/hermes/issues/4023)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 8fc11af9bd..f17dae894f 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -45,11 +45,11 @@ jobs: fail-fast: false matrix: chain: - - package: gaia15 + - package: gaia17 command: gaiad account_prefix: cosmos native_token: stake - features: forward-packet,clean-workers + features: forward-packet,clean-workers,ica,ics29-fee - package: ibc-go-v6-simapp command: simd account_prefix: cosmos @@ -171,10 +171,10 @@ jobs: fail-fast: false matrix: chain: - - package: .#gaia15 .#stride + - package: .#gaia17 .#stride command: gaiad,strided account_prefix: cosmos,stride - - package: .#gaia15 .#neutron + - package: .#gaia17 .#neutron command: gaiad,neutrond account_prefix: cosmos,neutron steps: @@ -216,7 +216,7 @@ jobs: fail-fast: false matrix: chain: - - package: .#gaia15 .#stride-no-admin + - package: .#gaia17 .#stride-no-admin command: gaiad,strided account_prefix: cosmos,stride steps: @@ -257,7 +257,7 @@ jobs: fail-fast: false matrix: chain: - - package: .#celestia .#gaia15 + - package: .#celestia .#gaia17 command: celestia-appd,gaiad account_prefix: celestia,cosmos native_token: utia,stake diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index 77016f5354..abede42602 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -43,7 +43,7 @@ jobs: fail-fast: false matrix: chain: - - package: gaia15 + - package: gaia17 command: gaiad account_prefix: cosmos steps: diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index 9e23d3a5a2..5d74e8fe02 100644 --- a/.github/workflows/multi-chains.yaml +++ b/.github/workflows/multi-chains.yaml @@ -58,7 +58,7 @@ jobs: fail-fast: false matrix: first-package: - - package: gaia15 + - package: gaia17 command: gaiad account_prefix: cosmos - package: ibc-go-v7-simapp diff --git a/flake.lock b/flake.lock index 20080b0b97..75422a6cc2 100644 --- a/flake.lock +++ b/flake.lock @@ -153,6 +153,7 @@ "gaia13-src": "gaia13-src", "gaia14-src": "gaia14-src", "gaia15-src": "gaia15-src", + "gaia17-src": "gaia17-src", "gaia5-src": "gaia5-src", "gaia6-ordered-src": "gaia6-ordered-src", "gaia6-src": "gaia6-src", @@ -212,11 +213,11 @@ "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" }, "locked": { - "lastModified": 1718011615, - "narHash": "sha256-VluMd6vAPEP//hepHfE+/CDJKU8AfRRE/Sxo7cqIx3Y=", + "lastModified": 1718014032, + "narHash": "sha256-ModvnRvQj9NsbNF1N01Q+xMqm421/dr2Pd1EfyOV53E=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "eaf5f4da4b35d8138b2c42aa39bc314b9be89958", + "rev": "4f354f4c042519a2681cc2fefd6b276ee88815f9", "type": "github" }, "original": { @@ -608,6 +609,23 @@ "type": "github" } }, + "gaia17-src": { + "flake": false, + "locked": { + "lastModified": 1717626378, + "narHash": "sha256-FiCnGz5ZQQv2NyPW/Z7puZw6oFKcdoNsspSCK8Nkc44=", + "owner": "cosmos", + "repo": "gaia", + "rev": "17f2ba0b90d1d2884f7b67518ec08dfd37f001a7", + "type": "github" + }, + "original": { + "owner": "cosmos", + "ref": "v17.2.0", + "repo": "gaia", + "type": "github" + } + }, "gaia5-src": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 9fd05f9ce9..fd4d4f6fee 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,7 @@ cometbft evmos gaia6-ordered - gaia15 + gaia17 ibc-go-v2-simapp ibc-go-v3-simapp ibc-go-v4-simapp diff --git a/tools/test-framework/src/chain/ext/bootstrap.rs b/tools/test-framework/src/chain/ext/bootstrap.rs index 37313be246..a7344fdb5c 100644 --- a/tools/test-framework/src/chain/ext/bootstrap.rs +++ b/tools/test-framework/src/chain/ext/bootstrap.rs @@ -309,7 +309,12 @@ impl ChainBootstrapMethodsExt for ChainDriver { "transfer_timeout_period": 100000000000, "ccv_timeout_period": 100000000000, "unbonding_period": 100000000000, - "deposit": "10000001stake" + "deposit": "10000001stake", + "top_N": 95, + "validators_power_cap": 0, + "validator_set_cap": 0, + "allowlist": [], + "denylist": [] }"#; let proposal = raw_proposal.replace("{consumer_chain_id}", consumer_chain_id); From 1cb909a104cf568d16271a096d1309f640970150 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 10 Jun 2024 17:31:46 +0200 Subject: [PATCH 121/200] Update `wasmd` used in CI to v0.51.0 (#4033) * Add missing fields to consumer chain gov proposal * Update nix flake * Add changelog entry --- .../4029-update-wasmd-to-v051.md | 2 + flake.lock | 40 ++++++++++++++----- 2 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4029-update-wasmd-to-v051.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4029-update-wasmd-to-v051.md b/.changelog/unreleased/improvements/ibc-integration-test/4029-update-wasmd-to-v051.md new file mode 100644 index 0000000000..d9e00a1898 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4029-update-wasmd-to-v051.md @@ -0,0 +1,2 @@ +- Update the version of `wasmd` running the integration tests in the CI from `v0.50.0` + to `v0.51.0` ([\#4029](https://github.com/informalsystems/hermes/issues/4029)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index 75422a6cc2..0621810a47 100644 --- a/flake.lock +++ b/flake.lock @@ -210,14 +210,15 @@ "wasmvm_1_3_0-src": "wasmvm_1_3_0-src", "wasmvm_1_5_0-src": "wasmvm_1_5_0-src", "wasmvm_1_5_2-src": "wasmvm_1_5_2-src", - "wasmvm_1_beta7-src": "wasmvm_1_beta7-src" + "wasmvm_1_beta7-src": "wasmvm_1_beta7-src", + "wasmvm_2_0_0-src": "wasmvm_2_0_0-src" }, "locked": { - "lastModified": 1718014032, - "narHash": "sha256-ModvnRvQj9NsbNF1N01Q+xMqm421/dr2Pd1EfyOV53E=", + "lastModified": 1718021968, + "narHash": "sha256-R09N2AGfRtNaas++OWNwm4Nl08QebYU5cIxjG4aZyC0=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "4f354f4c042519a2681cc2fefd6b276ee88815f9", + "rev": "832ddb55eac90996c82d5a6ffe04cc3e2d8b17cf", "type": "github" }, "original": { @@ -1356,11 +1357,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1717868076, - "narHash": "sha256-c83Y9t815Wa34khrux81j8K8ET94ESmCuwORSKm2bQY=", + "lastModified": 1717893485, + "narHash": "sha256-WMU6ZRZrBgEUDIF0siu2aIyVAXcxfElSwzZtS/mSpN4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "cd18e2ae9ab8e2a0a8d715b60c91b54c0ac35ff9", + "rev": "3bcedce9f4de37570242faf16e1e143583407eab", "type": "github" }, "original": { @@ -1743,16 +1744,16 @@ "wasmd-src": { "flake": false, "locked": { - "lastModified": 1700749637, - "narHash": "sha256-rKbuaWcRdHXSI+acHrx/hCdGOx5prPd+Dmng4BVrhzs=", + "lastModified": 1713797184, + "narHash": "sha256-k7c8RdLggeM6hSQhJt0UREY/48T3ZRSSijA+TMFKhUc=", "owner": "CosmWasm", "repo": "wasmd", - "rev": "7ea00e2ea858ed599141e322bd68171998a3259a", + "rev": "7b418de3f6cf8fbac1e9cb11c57983fcc17264d0", "type": "github" }, "original": { "owner": "CosmWasm", - "ref": "v0.50.0", + "ref": "v0.51.0", "repo": "wasmd", "type": "github" } @@ -1918,6 +1919,23 @@ "repo": "wasmvm", "type": "github" } + }, + "wasmvm_2_0_0-src": { + "flake": false, + "locked": { + "lastModified": 1710250586, + "narHash": "sha256-OmETCXyhCXWOEW/emf1ZruLMPlH8iLvM8xrqFoDaxnw=", + "owner": "CosmWasm", + "repo": "wasmvm", + "rev": "5307690b77a5fef2da3747ec72abe8f29664aeca", + "type": "github" + }, + "original": { + "owner": "CosmWasm", + "ref": "v2.0.0", + "repo": "wasmvm", + "type": "github" + } } }, "root": "root", From acde3732c8e504986d141c27891e5dc350f20d29 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 10 Jun 2024 18:20:04 +0200 Subject: [PATCH 122/200] Ensure all events in a batch are processed, even when it contains events for unknown chains (#4022) * Add a filter at supervisor level for CCQ to verify if the destination chain is configured * Update all MSRVs to v1.76.0 * Add changelog entry * Renaming * Move changelog entry under bug fixes * Ensure we process all events in a batch, even when some of them are rejected by the filtering policy --------- Co-authored-by: Romain Ruetschi --- .../4034-ensure-no-dropped-events.md | 3 + .../4021-chain-level-ccq-filter.md | 2 + crates/chain-registry/Cargo.toml | 2 +- crates/relayer-rest/Cargo.toml | 2 +- crates/relayer-rest/README.md | 4 +- crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 2 +- crates/relayer/src/supervisor.rs | 56 ++++++++++++------- crates/telemetry/Cargo.toml | 2 +- tools/integration-test/Cargo.toml | 2 +- 10 files changed, 50 insertions(+), 27 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/4034-ensure-no-dropped-events.md create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer/4021-chain-level-ccq-filter.md diff --git a/.changelog/unreleased/bug-fixes/4034-ensure-no-dropped-events.md b/.changelog/unreleased/bug-fixes/4034-ensure-no-dropped-events.md new file mode 100644 index 0000000000..d0943e5245 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/4034-ensure-no-dropped-events.md @@ -0,0 +1,3 @@ +- Fix a bug where in some cases, Hermes would drop all events in a + batch that came after an event rejected by the filtering policy + ([\#4034](https://github.com/informalsystems/hermes/issues/4034)) \ No newline at end of file diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/4021-chain-level-ccq-filter.md b/.changelog/unreleased/bug-fixes/ibc-relayer/4021-chain-level-ccq-filter.md new file mode 100644 index 0000000000..d3b2c7f51f --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer/4021-chain-level-ccq-filter.md @@ -0,0 +1,2 @@ +- Discard CrossChain queries intended for unconfigured chains. + ([\#4021](https://github.com/informalsystems/hermes/issues/4021)) \ No newline at end of file diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index c2b79fb856..3b67a54933 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -6,7 +6,7 @@ license = "Apache-2.0" keywords = ["cosmos", "ibc", "relayer", "chain", "registry"] repository = "https://github.com/informalsystems/hermes" authors = ["Informal Systems "] -rust-version = "1.71.1" +rust-version = "1.76.0" description = """ Service to fetch data from the chain-registry """ diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index d831f4bda8..3a5a87630e 100644 --- a/crates/relayer-rest/Cargo.toml +++ b/crates/relayer-rest/Cargo.toml @@ -8,7 +8,7 @@ readme = "README.md" keywords = ["ibc", "rest", "api", "cosmos", "tendermint"] homepage = "https://hermes.informal.systems/" repository = "https://github.com/informalsystems/hermes" -rust-version = "1.71.1" +rust-version = "1.76.0" description = """ Rust implementation of a RESTful API server for Hermes """ diff --git a/crates/relayer-rest/README.md b/crates/relayer-rest/README.md index 82f3e7fd78..db2dd9ca9f 100644 --- a/crates/relayer-rest/README.md +++ b/crates/relayer-rest/README.md @@ -6,7 +6,7 @@ [![End to End testing][e2e-image]][e2e-link] [![Apache 2.0 Licensed][license-image]][license-link] ![Rust Stable][rustc-image] -![Rust 1.71.1+][rustc-version] +![Rust 1.76.0+][rustc-version] This is the repository for the IBC REST server for use in the Hermes IBC relayer. @@ -39,4 +39,4 @@ Unless required by applicable law or agreed to in writing, software distributed [license-image]: https://img.shields.io/badge/license-Apache2.0-blue.svg [license-link]: https://github.com/informalsystems/hermes/blob/master/LICENSE [rustc-image]: https://img.shields.io/badge/rustc-stable-blue.svg -[rustc-version]: https://img.shields.io/badge/rustc-1.71.1+-blue.svg +[rustc-version]: https://img.shields.io/badge/rustc-1.76.0+-blue.svg diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 578d924eaf..1fb982d1b9 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] repository = "https://github.com/informalsystems/hermes" authors = ["Informal Systems "] -rust-version = "1.71.1" +rust-version = "1.76.0" description = """ Implementation of the Inter-Blockchain Communication Protocol (IBC). This crate comprises the main data structures and on-chain logic. diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 7691ca00ea..4404510d12 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] repository = "https://github.com/informalsystems/hermes" authors = ["Informal Systems "] -rust-version = "1.71.1" +rust-version = "1.76.0" description = """ Implementation of an IBC Relayer in Rust, as a library """ diff --git a/crates/relayer/src/supervisor.rs b/crates/relayer/src/supervisor.rs index 16ca340703..c994ac6585 100644 --- a/crates/relayer/src/supervisor.rs +++ b/crates/relayer/src/supervisor.rs @@ -374,13 +374,15 @@ fn relay_on_object( }; // Then, apply the client filter + // If the object is a CrossChain query discard it if the destination chain + // is not configured let client_filter_outcome = match object { Object::Client(client) => client_state_filter.control_client_object(registry, client), Object::Connection(conn) => client_state_filter.control_conn_object(registry, conn), Object::Channel(chan) => client_state_filter.control_chan_object(registry, chan), Object::Packet(packet) => client_state_filter.control_packet_object(registry, packet), + Object::CrossChainQuery(_ccq) => Ok(Permission::Allow), Object::Wallet(_wallet) => Ok(Permission::Allow), - Object::CrossChainQuery(_) => Ok(Permission::Allow), }; match client_filter_outcome { @@ -814,8 +816,33 @@ fn process_batch( workers.notify_new_block(&src_chain.id(), batch.height, new_block); } - // Forward the IBC events. + // Forward the IBC events to the appropriate workers for (object, events_with_heights) in collected.per_object.into_iter() { + if events_with_heights.is_empty() { + // Event batch is empty, nothing to do + continue; + } + + let Ok(src_chain) = registry.get_or_spawn(object.src_chain_id()) else { + trace!( + "skipping events for '{}': source chain '{}' is not registered", + object.short_name(), + object.src_chain_id() + ); + + continue; + }; + + let Ok(dst_chain) = registry.get_or_spawn(object.dst_chain_id()) else { + trace!( + "skipping events for '{}': destination chain '{}' is not registered", + object.short_name(), + object.src_chain_id() + ); + + continue; + }; + if !relay_on_object( config, registry, @@ -824,32 +851,23 @@ fn process_batch( &object, ) { trace!( - "skipping events for '{}'. \ - reason: filtering is enabled and channel does not match any allowed channels", + "skipping events for '{}': rejected by filtering policy", object.short_name() ); continue; } - if events_with_heights.is_empty() { - continue; - } - - let src = registry - .get_or_spawn(object.src_chain_id()) - .map_err(Error::spawn)?; - - let dst = registry - .get_or_spawn(object.dst_chain_id()) - .map_err(Error::spawn)?; - if let Object::Packet(ref _path) = object { - // Update telemetry info - telemetry!(send_telemetry(&src, &dst, &events_with_heights, _path)); + telemetry!(send_telemetry( + &src_chain, + &dst_chain, + &events_with_heights, + _path + )); } - let worker = workers.get_or_spawn(object, src, dst, config); + let worker = workers.get_or_spawn(object, src_chain, dst_chain, config); worker.send_events( batch.height, diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index fa5e6ef05c..10454d2f25 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -7,7 +7,7 @@ readme = "README.md" keywords = ["cosmos", "ibc", "relayer", "telemetry"] repository = "https://github.com/informalsystems/hermes" authors = ["Informal Systems "] -rust-version = "1.71.1" +rust-version = "1.76.0" description = """ Telemetry service for the Hermes IBC relayer """ diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 8a0a8dacf7..3e96b65be3 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -2,7 +2,7 @@ name = "ibc-integration-test" version = "0.28.0" edition = "2021" -rust-version = "1.71.1" +rust-version = "1.76.0" license = "Apache-2.0" readme = "README.md" keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] From d3cbd9ba77dca532b25b77e66bcc31533676cc8a Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 10 Jun 2024 19:41:54 +0200 Subject: [PATCH 123/200] Update Juno used in CI to v22 (#4035) * Update nix flake * Add changelog entry --- .../4025-update-juno-to-v22.md | 2 + flake.lock | 38 ++++++++++--------- 2 files changed, 22 insertions(+), 18 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4025-update-juno-to-v22.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4025-update-juno-to-v22.md b/.changelog/unreleased/improvements/ibc-integration-test/4025-update-juno-to-v22.md new file mode 100644 index 0000000000..4744857094 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4025-update-juno-to-v22.md @@ -0,0 +1,2 @@ +- Update the version of Juno running the integration tests in the CI from `v21.0.0` + to `v22.0.0` ([\#4025](https://github.com/informalsystems/hermes/issues/4025)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index 0621810a47..0b6dcdd59b 100644 --- a/flake.lock +++ b/flake.lock @@ -35,15 +35,16 @@ "apalache-src": { "flake": false, "locked": { - "narHash": "sha256-Z/tmBMv+QshFJLo2kBgBdkqfKwF93CgURVIbYF3dwJE=", + "lastModified": 1714996894, + "narHash": "sha256-3xw7bajvhGL+wGne4MRh/HpDFdp+HGfnfzqq8YSx9tc=", "owner": "informalsystems", "repo": "apalache", - "rev": "ec979d4554360faf9d73ddf72dccf350614076d5", + "rev": "5dee24e4d05dc3476977a2e49f4963e3802fae2f", "type": "github" }, "original": { "owner": "informalsystems", - "ref": "v0.42.0", + "ref": "v0.44.11", "repo": "apalache", "type": "github" } @@ -214,11 +215,11 @@ "wasmvm_2_0_0-src": "wasmvm_2_0_0-src" }, "locked": { - "lastModified": 1718021968, - "narHash": "sha256-R09N2AGfRtNaas++OWNwm4Nl08QebYU5cIxjG4aZyC0=", + "lastModified": 1718031449, + "narHash": "sha256-P5uawZndlGCExsNIdbh0eWAXNtblbsPbX+c07Oc33P8=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "832ddb55eac90996c82d5a6ffe04cc3e2d8b17cf", + "rev": "d7f2eacb0e70c55c5499318cc9626b1fe80f338a", "type": "github" }, "original": { @@ -435,11 +436,11 @@ "systems": "systems_4" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -1078,16 +1079,16 @@ "juno-src": { "flake": false, "locked": { - "lastModified": 1709992388, - "narHash": "sha256-8VcxdvaaBNyzza6U65PELt8bUII3teruokfbu5j7i9M=", + "lastModified": 1713701044, + "narHash": "sha256-AN9g1t/zOZVs5S/ZXP4/MrIC9kN6nUGG/wLNJz5fL6E=", "owner": "CosmosContracts", "repo": "juno", - "rev": "e98863bf7112f4b117a2114e22f7482367362764", + "rev": "b0faafbd6df4bb03940d99df13030af7f7bc315b", "type": "github" }, "original": { "owner": "CosmosContracts", - "ref": "v21.0.0", + "ref": "v22.0.0", "repo": "juno", "type": "github" } @@ -1206,11 +1207,11 @@ ] }, "locked": { - "lastModified": 1708764364, - "narHash": "sha256-+pOtDvmuVTg0Gi58hKDUyrNla5NbyUvt3Xs3gLR0Fws=", + "lastModified": 1712990762, + "narHash": "sha256-hO9W3w7NcnYeX8u8cleHiSpK2YJo7ecarFTUlbybl7k=", "owner": "nlewo", "repo": "nix2container", - "rev": "c891f90d2e3c48a6b33466c96e4851e0fc0cf455", + "rev": "20aad300c925639d5d6cbe30013c8357ce9f2a2e", "type": "github" }, "original": { @@ -1311,10 +1312,11 @@ }, "nixpkgs_3": { "locked": { - "narHash": "sha256-FtPPshEpxH/ewBOsdKBNhlsL2MLEFv1hEnQ19f/bFsQ=", + "lastModified": 1717868076, + "narHash": "sha256-c83Y9t815Wa34khrux81j8K8ET94ESmCuwORSKm2bQY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "5ad9903c16126a7d949101687af0aa589b1d7d3d", + "rev": "cd18e2ae9ab8e2a0a8d715b60c91b54c0ac35ff9", "type": "github" }, "original": { From e4be3e0b0f18eb702e324fb860831db894a4b7a4 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 11 Jun 2024 08:38:10 +0200 Subject: [PATCH 124/200] Update Celestia app used in CI to v1.11.0 (#4036) * Update nix flake * Add changelog entry --- .../4027-update-celestia-to-v1-11.md | 2 ++ flake.lock | 13 +++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4027-update-celestia-to-v1-11.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4027-update-celestia-to-v1-11.md b/.changelog/unreleased/improvements/ibc-integration-test/4027-update-celestia-to-v1-11.md new file mode 100644 index 0000000000..0cd4d5746b --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4027-update-celestia-to-v1-11.md @@ -0,0 +1,2 @@ +- Update the version of Celestia app running the integration tests in the CI from `v1.4.0` + to `v1.11.0` ([\#4027](https://github.com/informalsystems/hermes/issues/4027)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index 0b6dcdd59b..024b9948d6 100644 --- a/flake.lock +++ b/flake.lock @@ -68,15 +68,16 @@ "celestia-app-src": { "flake": false, "locked": { - "narHash": "sha256-O6KrCStrZLmWy3xybQUNsWEb3O7vIRCFDE9MsEtsFro=", + "lastModified": 1717487173, + "narHash": "sha256-/17ysw5QX8hHdMPkp05eNqJFPYKU7NIn1jTFw688Fjg=", "owner": "celestiaorg", "repo": "celestia-app", - "rev": "2dbfabf1849e166974c1287c35b43e5e07727643", + "rev": "21b5bc747c8500e4888474df7d828e66c33f332d", "type": "github" }, "original": { "owner": "celestiaorg", - "ref": "v1.4.0", + "ref": "v1.11.0", "repo": "celestia-app", "type": "github" } @@ -215,11 +216,11 @@ "wasmvm_2_0_0-src": "wasmvm_2_0_0-src" }, "locked": { - "lastModified": 1718031449, - "narHash": "sha256-P5uawZndlGCExsNIdbh0eWAXNtblbsPbX+c07Oc33P8=", + "lastModified": 1718033821, + "narHash": "sha256-Y7zF1PWl6W6pSj2Hh6dl+n+udu/6jJV+ODinxk44YqU=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "d7f2eacb0e70c55c5499318cc9626b1fe80f338a", + "rev": "0475f2c4fff872218f70bae9c0c2ea49e2cfe785", "type": "github" }, "original": { From 8da7082632a7f699e689906aa4dde735bba25a72 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:52:30 +0200 Subject: [PATCH 125/200] Specify topology for n-ary chain tests (#4039) * Refactor client, connection and channel for nary chain bootstrapping in order to use a specified topology * Add changelog entry * Apply suggestions from code review Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * Move parsing of string to TopologyType outside of bootstrap_topology method * Add TwoDimHashMap struct instead of using HashMap> * Add option to override the topology for specific tests * Add cyclic topology implementation * Update changelog entry * Fix codespell * Refactor TwoDimHashMap to TwoDimMap and use BTreeMap instead of HashMap * Use TwoDimMap iter() implementation for channels * Use TwoDimMap iter() implementation for connections * Use TwoDimMap iter() implementation for foreign_clients * Remove unnecessary bool in TwoDimMap iterator * Update method docstring --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi --- .../4099-specify-topology-for-nary-tests.md | 4 + .../src/tests/forward/forward_hop_transfer.rs | 4 +- .../src/tests/forward/forward_transfer.rs | 6 +- .../src/tests/ternary_transfer.rs | 5 + .../src/bootstrap/nary/chain.rs | 53 +++-- .../src/bootstrap/nary/channel.rs | 75 +++---- .../src/bootstrap/nary/connection.rs | 59 +++--- .../src/framework/binary/chain.rs | 5 + .../src/framework/nary/chain.rs | 33 ++- .../src/framework/nary/channel.rs | 9 +- .../src/framework/nary/connection.rs | 5 +- .../test-framework/src/framework/overrides.rs | 13 ++ tools/test-framework/src/types/mod.rs | 1 + tools/test-framework/src/types/nary/chains.rs | 10 +- .../test-framework/src/types/nary/channel.rs | 99 ++++----- .../src/types/nary/connection.rs | 71 +++---- .../src/types/nary/foreign_client.rs | 48 ++--- tools/test-framework/src/types/topology.rs | 198 ++++++++++++++++++ tools/test-framework/src/util/array.rs | 62 ------ tools/test-framework/src/util/mod.rs | 1 + .../src/util/two_dim_hash_map.rs | 113 ++++++++++ 21 files changed, 567 insertions(+), 307 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4099-specify-topology-for-nary-tests.md create mode 100644 tools/test-framework/src/types/topology.rs create mode 100644 tools/test-framework/src/util/two_dim_hash_map.rs diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4099-specify-topology-for-nary-tests.md b/.changelog/unreleased/improvements/ibc-integration-test/4099-specify-topology-for-nary-tests.md new file mode 100644 index 0000000000..b920789213 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4099-specify-topology-for-nary-tests.md @@ -0,0 +1,4 @@ +- Refactored the test-framework bootstrapping for n-ary chain tests + to utilize the specified topology. + * Currently, only linear, cyclic and fully connected topologies are supported. + ([\#4038](https://github.com/informalsystems/hermes/issues/4038)) \ No newline at end of file diff --git a/tools/integration-test/src/tests/forward/forward_hop_transfer.rs b/tools/integration-test/src/tests/forward/forward_hop_transfer.rs index 931ceddd23..f42376c5b7 100644 --- a/tools/integration-test/src/tests/forward/forward_hop_transfer.rs +++ b/tools/integration-test/src/tests/forward/forward_hop_transfer.rs @@ -53,7 +53,7 @@ impl NaryChannelTest<4> for IbcForwardHopTransferTest { chains: NaryConnectedChains, channels: NaryConnectedChannels, ) -> Result<(), Error> { - let connected_chains = chains.connected_chains_at::<0, 3>()?; + let connected_chains = chains.connected_chains_at::<0, 1>()?; let node_a = chains.full_node_at::<0>()?; let node_b = chains.full_node_at::<1>()?; @@ -174,7 +174,7 @@ impl NaryChannelTest<4> for AtomicIbcForwardHopTransferTest { chains: NaryConnectedChains, channels: NaryConnectedChannels, ) -> Result<(), Error> { - let connected_chains = chains.connected_chains_at::<0, 3>()?; + let connected_chains = chains.connected_chains_at::<0, 1>()?; let node_a = chains.full_node_at::<0>()?; let node_b = chains.full_node_at::<1>()?; diff --git a/tools/integration-test/src/tests/forward/forward_transfer.rs b/tools/integration-test/src/tests/forward/forward_transfer.rs index 65827fc0d6..a9569c8528 100644 --- a/tools/integration-test/src/tests/forward/forward_transfer.rs +++ b/tools/integration-test/src/tests/forward/forward_transfer.rs @@ -73,7 +73,7 @@ impl NaryChannelTest<3> for IbcForwardTransferTest { chains: NaryConnectedChains, channels: NaryConnectedChannels, ) -> Result<(), Error> { - let connected_chains = chains.connected_chains_at::<0, 2>()?; + let connected_chains = chains.connected_chains_at::<0, 1>()?; let node_a = chains.full_node_at::<0>()?; let node_b = chains.full_node_at::<1>()?; @@ -176,7 +176,7 @@ impl NaryChannelTest<3> for MisspelledMemoFieldsIbcForwardTransferTest { chains: NaryConnectedChains, channels: NaryConnectedChannels, ) -> Result<(), Error> { - let connected_chains = chains.connected_chains_at::<0, 2>()?; + let connected_chains = chains.connected_chains_at::<0, 1>()?; let node_a = chains.full_node_at::<0>()?; let node_b = chains.full_node_at::<1>()?; @@ -422,7 +422,7 @@ impl NaryChannelTest<3> for MisspelledMemoContentIbcForwardTransferTest { chains: NaryConnectedChains, channels: NaryConnectedChannels, ) -> Result<(), Error> { - let connected_chains = chains.connected_chains_at::<0, 2>()?; + let connected_chains = chains.connected_chains_at::<0, 1>()?; let node_a = chains.full_node_at::<0>()?; let node_b = chains.full_node_at::<1>()?; diff --git a/tools/integration-test/src/tests/ternary_transfer.rs b/tools/integration-test/src/tests/ternary_transfer.rs index 8302c9b8bd..527c085629 100644 --- a/tools/integration-test/src/tests/ternary_transfer.rs +++ b/tools/integration-test/src/tests/ternary_transfer.rs @@ -1,4 +1,5 @@ use ibc_test_framework::prelude::*; +use ibc_test_framework::types::topology::TopologyType; #[test] fn test_ternary_ibc_transfer() -> Result<(), Error> { @@ -11,6 +12,10 @@ impl TestOverrides for TernaryIbcTransferTest { fn modify_relayer_config(&self, config: &mut Config) { config.mode.clients.misbehaviour = false; } + + fn topology(&self) -> Option { + Some(TopologyType::Cyclic) + } } impl PortsOverride<3> for TernaryIbcTransferTest {} diff --git a/tools/test-framework/src/bootstrap/nary/chain.rs b/tools/test-framework/src/bootstrap/nary/chain.rs index 95d0f71c78..3a758b7446 100644 --- a/tools/test-framework/src/bootstrap/nary/chain.rs +++ b/tools/test-framework/src/bootstrap/nary/chain.rs @@ -4,18 +4,17 @@ use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::config::Config; -use ibc_relayer::foreign_client::ForeignClient; use ibc_relayer::registry::SharedRegistry; use crate::bootstrap::binary::chain::{ - add_chain_config, add_keys_to_chain_handle, bootstrap_foreign_client, new_registry, - save_relayer_config, + add_chain_config, add_keys_to_chain_handle, new_registry, save_relayer_config, }; use crate::error::{handle_generic_error, Error}; use crate::relayer::driver::RelayerDriver; use crate::types::config::TestConfig; use crate::types::nary::chains::{DynamicConnectedChains, NaryConnectedChains}; use crate::types::single::node::FullNode; +use crate::types::topology::{bootstrap_topology, TopologyType}; /** Bootstrap a fixed number of chains specified by `SIZE`. @@ -23,10 +22,15 @@ use crate::types::single::node::FullNode; pub fn boostrap_chains_with_nodes( test_config: &TestConfig, full_nodes: [FullNode; SIZE], + topology_override: Option, config_modifier: impl FnOnce(&mut Config), ) -> Result<(RelayerDriver, NaryConnectedChains), Error> { - let (relayer, chains) = - boostrap_chains_with_any_nodes(test_config, full_nodes.into(), config_modifier)?; + let (relayer, chains) = boostrap_chains_with_any_nodes( + test_config, + full_nodes.into(), + topology_override, + config_modifier, + )?; Ok((relayer, chains.try_into()?)) } @@ -38,11 +42,16 @@ pub fn boostrap_chains_with_nodes( pub fn boostrap_chains_with_self_connected_node( test_config: &TestConfig, full_node: FullNode, + topology_override: Option, config_modifier: impl FnOnce(&mut Config), ) -> Result<(RelayerDriver, NaryConnectedChains), Error> { let full_nodes = vec![full_node; SIZE]; - let (relayer, chains) = - boostrap_chains_with_any_nodes(test_config, full_nodes, config_modifier)?; + let (relayer, chains) = boostrap_chains_with_any_nodes( + test_config, + full_nodes, + topology_override, + config_modifier, + )?; Ok((relayer, chains.try_into()?)) } @@ -50,10 +59,13 @@ pub fn boostrap_chains_with_self_connected_node( /** Bootstrap a dynamic number of chains, according to the number of full nodes in the `Vec`. + The topology will be retrieved and set in this method, + see [`crate::types::topology`] for more information. */ pub fn boostrap_chains_with_any_nodes( test_config: &TestConfig, full_nodes: Vec, + topology_override: Option, config_modifier: impl FnOnce(&mut Config), ) -> Result<(RelayerDriver, DynamicConnectedChains), Error> { let mut config = Config::default(); @@ -77,19 +89,24 @@ pub fn boostrap_chains_with_any_nodes( chain_handles.push(handle); } - let mut foreign_clients: Vec>> = Vec::new(); - - for handle_a in chain_handles.iter() { - let mut foreign_clients_b = Vec::new(); - - for handle_b in chain_handles.iter() { - let foreign_client = bootstrap_foreign_client(handle_a, handle_b, Default::default())?; - - foreign_clients_b.push(foreign_client); + // Retrieve the topology or fallback to the Linear topology + let topology_type = if let Some(topology_type) = topology_override { + topology_type + } else { + let topology_str = std::env::var("TOPOLOGY").unwrap_or_else(|_| "linear".to_owned()); + match topology_str.parse() { + Ok(topology_type) => topology_type, + Err(_) => { + tracing::warn!( + "Failed to parse topology type `{topology_str}`. Will fallback to Linear topology" + ); + TopologyType::Linear + } } + }; + let topology = bootstrap_topology(topology_type); - foreign_clients.push(foreign_clients_b); - } + let foreign_clients = topology.create_topology(&chain_handles)?; let relayer = RelayerDriver { config_path, diff --git a/tools/test-framework/src/bootstrap/nary/channel.rs b/tools/test-framework/src/bootstrap/nary/channel.rs index 5e8d49ec86..6c4e65f582 100644 --- a/tools/test-framework/src/bootstrap/nary/channel.rs +++ b/tools/test-framework/src/bootstrap/nary/channel.rs @@ -17,60 +17,46 @@ use crate::types::nary::chains::{DynamicConnectedChains, NaryConnectedChains}; use crate::types::nary::channel::{ConnectedChannels, DynamicConnectedChannels}; use crate::types::nary::connection::{ConnectedConnections, DynamicConnectedConnections}; use crate::types::tagged::*; -use crate::util::array::{assert_same_dimension, into_nested_vec}; +use crate::util::array::into_nested_vec; +use crate::util::two_dim_hash_map::TwoDimMap; /** Bootstrap a dynamic number of channels based on the number of connections in `DynamicConnectedConnections`. + See [`crate::types::topology`] for more information. */ pub fn bootstrap_channels_with_connections_dynamic( connections: DynamicConnectedConnections, - chains: &Vec, ports: &Vec>, order: Ordering, bootstrap_with_random_ids: bool, ) -> Result, Error> { - let size = chains.len(); - - assert_same_dimension(size, connections.connections())?; - assert_same_dimension(size, ports)?; - - let mut channels: Vec>> = Vec::new(); - - for (i, connections_b) in connections.connections().iter().enumerate() { - let mut channels_b: Vec> = Vec::new(); - - for (j, connection) in connections_b.iter().enumerate() { - if i <= j { - let chain_a = &chains[i]; - let chain_b = &chains[j]; - - let port_a = &ports[i][j]; - let port_b = &ports[j][i]; - - let bootstrap_options = BootstrapChannelOptions::default() - .order(order) - .bootstrap_with_random_ids(bootstrap_with_random_ids); - - let channel = bootstrap_channel_with_connection( - chain_a, - chain_b, - connection.clone(), - &DualTagged::new(port_a), - &DualTagged::new(port_b), - bootstrap_options, - )?; - - channels_b.push(channel); - } else { - let counter_channel = &channels[j][i]; - let channel = counter_channel.clone().flip(); - - channels_b.push(channel); - } - } - - channels.push(channels_b); + let mut channels: TwoDimMap> = TwoDimMap::new(); + + for (src_chain, dst_chain, connection) in connections.connections().iter() { + let channel = if let Some(counterparty_channel) = channels.get((dst_chain, src_chain)) { + counterparty_channel.clone().flip() + } else { + // No channel is found, will create one + let chain_a = &connection.connection.a_chain(); + let chain_b = &connection.connection.b_chain(); + let port_a = ports[src_chain][dst_chain].clone(); + let port_b = ports[dst_chain][src_chain].clone(); + + let bootstrap_options = BootstrapChannelOptions::default() + .order(order) + .bootstrap_with_random_ids(bootstrap_with_random_ids); + + bootstrap_channel_with_connection( + chain_a, + chain_b, + connection.clone(), + &DualTagged::new(&port_a), + &DualTagged::new(&port_b), + bootstrap_options, + )? + }; + channels.insert((src_chain, dst_chain), channel); } Ok(DynamicConnectedChannels::new(channels)) @@ -82,14 +68,12 @@ pub fn bootstrap_channels_with_connections_dynamic( */ pub fn bootstrap_channels_with_connections( connections: ConnectedConnections, - chains: [Handle; SIZE], ports: [[PortId; SIZE]; SIZE], order: Ordering, bootstrap_with_random_ids: bool, ) -> Result, Error> { let channels = bootstrap_channels_with_connections_dynamic( connections.into(), - &chains.into(), &into_nested_vec(ports), order, bootstrap_with_random_ids, @@ -118,7 +102,6 @@ pub fn bootstrap_channels_and_connections_dynamic( bootstrap_channels_with_connections_dynamic( connections, - chains.chain_handles(), ports, order, bootstrap_with_random_ids, diff --git a/tools/test-framework/src/bootstrap/nary/connection.rs b/tools/test-framework/src/bootstrap/nary/connection.rs index 1be22092d3..065ef1385a 100644 --- a/tools/test-framework/src/bootstrap/nary/connection.rs +++ b/tools/test-framework/src/bootstrap/nary/connection.rs @@ -3,6 +3,7 @@ */ use core::time::Duration; +use eyre::eyre; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::foreign_client::ForeignClient; @@ -12,48 +13,44 @@ use crate::types::binary::connection::ConnectedConnection; use crate::types::binary::foreign_client::ForeignClientPair; use crate::types::nary::connection::{ConnectedConnections, DynamicConnectedConnections}; use crate::types::nary::foreign_client::ForeignClientPairs; -use crate::util::array::assert_same_dimension; +use crate::util::two_dim_hash_map::TwoDimMap; /** Bootstrap a dynamic number of connections based on the - given foreign client NxN matrix. + given foreign clients. + See [`crate::types::topology`] for more information. */ pub fn bootstrap_connections_dynamic( - foreign_clients: &Vec>>, + foreign_clients: &TwoDimMap>, connection_delay: Duration, bootstrap_with_random_ids: bool, ) -> Result, Error> { - let size = foreign_clients.len(); + let mut connections: TwoDimMap> = TwoDimMap::new(); - assert_same_dimension(size, foreign_clients)?; + for (src_chain, dst_chain, foreign_client) in foreign_clients.iter() { + let connection = if let Some(counterparty_connection) = + connections.get((dst_chain, src_chain)) + { + counterparty_connection.clone().flip() + } else { + // No connection is found, will create one + let client_a_to_b = foreign_client.clone(); + let client_b_to_a = foreign_clients.get((dst_chain, src_chain)).ok_or_else(|| { + Error::generic(eyre!( + "No client entry found from chain `{}` to `{}`", + dst_chain, + src_chain, + )) + })?; + let foreign_clients = ForeignClientPair::new(client_a_to_b, client_b_to_a.clone()); - let mut connections: Vec>> = Vec::new(); + let bootstrap_options = BootstrapConnectionOptions::default() + .connection_delay(connection_delay) + .bootstrap_with_random_ids(bootstrap_with_random_ids); - for (i, foreign_clients_b) in foreign_clients.iter().enumerate() { - let mut connections_b: Vec> = Vec::new(); - - for (j, foreign_client) in foreign_clients_b.iter().enumerate() { - if i <= j { - let counter_foreign_client = &foreign_clients[j][i]; - let foreign_clients = - ForeignClientPair::new(foreign_client.clone(), counter_foreign_client.clone()); - - let bootstrap_options = BootstrapConnectionOptions::default() - .connection_delay(connection_delay) - .bootstrap_with_random_ids(bootstrap_with_random_ids); - - let connection = bootstrap_connection(&foreign_clients, bootstrap_options)?; - - connections_b.push(connection); - } else { - let counter_connection = &connections[j][i]; - let connection = counter_connection.clone().flip(); - - connections_b.push(connection); - } - } - - connections.push(connections_b); + bootstrap_connection(&foreign_clients, bootstrap_options)? + }; + connections.insert((src_chain, dst_chain), connection); } Ok(DynamicConnectedConnections::new(connections)) diff --git a/tools/test-framework/src/framework/binary/chain.rs b/tools/test-framework/src/framework/binary/chain.rs index a1a3aae940..47eed73001 100644 --- a/tools/test-framework/src/framework/binary/chain.rs +++ b/tools/test-framework/src/framework/binary/chain.rs @@ -22,6 +22,7 @@ use crate::types::binary::chains::{ConnectedChains, DropChainHandle}; use crate::types::config::TestConfig; use crate::types::env::write_env; use crate::types::single::node::FullNode; +use crate::types::topology::TopologyType; use crate::util::suspend::hang_on_error; /** @@ -113,6 +114,10 @@ pub trait RelayerConfigOverride { fn modify_relayer_config(&self, config: &mut Config); } +pub trait TopologyOverride { + fn topology(&self) -> Option; +} + /// An internal trait that can be implemented by test cases to override the /// settings for the foreign clients bootstrapped for the test. /// diff --git a/tools/test-framework/src/framework/nary/chain.rs b/tools/test-framework/src/framework/nary/chain.rs index 392114cc5e..4584ba2df7 100644 --- a/tools/test-framework/src/framework/nary/chain.rs +++ b/tools/test-framework/src/framework/nary/chain.rs @@ -11,7 +11,7 @@ use crate::bootstrap::nary::chain::{ }; use crate::error::Error; use crate::framework::base::{HasOverrides, TestConfigOverride}; -use crate::framework::binary::chain::RelayerConfigOverride; +use crate::framework::binary::chain::{RelayerConfigOverride, TopologyOverride}; use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; use crate::framework::nary::node::{run_nary_node_test, NaryNodeTest}; use crate::framework::supervisor::{RunWithSupervisor, SupervisorOverride}; @@ -48,7 +48,8 @@ where + NodeConfigOverride + NodeGenesisOverride + RelayerConfigOverride - + SupervisorOverride, + + SupervisorOverride + + TopologyOverride, { run_nary_node_test(&RunNaryChainTest::new(&RunWithSupervisor::new(test))) } @@ -77,7 +78,8 @@ where + NodeConfigOverride + NodeGenesisOverride + RelayerConfigOverride - + SupervisorOverride, + + SupervisorOverride + + TopologyOverride, { run_nary_node_test(&RunSelfConnectedNaryChainTest::new( &RunWithSupervisor::new(test), @@ -125,12 +127,17 @@ impl<'a, Test, Overrides, const SIZE: usize> NaryNodeTest for RunNaryChain where Test: NaryChainTest, Test: HasOverrides, - Overrides: RelayerConfigOverride, + Overrides: RelayerConfigOverride + TopologyOverride, { fn run(&self, config: &TestConfig, nodes: [FullNode; SIZE]) -> Result<(), Error> { - let (relayer, chains) = boostrap_chains_with_nodes(config, nodes, |config| { - self.test.get_overrides().modify_relayer_config(config); - })?; + let (relayer, chains) = boostrap_chains_with_nodes( + config, + nodes, + self.test.get_overrides().topology(), + |config| { + self.test.get_overrides().modify_relayer_config(config); + }, + )?; let env_path = config.chain_store_dir.join("nary-chains.env"); @@ -155,13 +162,17 @@ impl<'a, Test, Overrides, const SIZE: usize> NaryNodeTest<1> where Test: NaryChainTest, Test: HasOverrides, - Overrides: RelayerConfigOverride, + Overrides: RelayerConfigOverride + TopologyOverride, { fn run(&self, config: &TestConfig, nodes: [FullNode; 1]) -> Result<(), Error> { - let (relayer, chains) = - boostrap_chains_with_self_connected_node(config, nodes[0].clone(), |config| { + let (relayer, chains) = boostrap_chains_with_self_connected_node( + config, + nodes[0].clone(), + self.test.get_overrides().topology(), + |config| { self.test.get_overrides().modify_relayer_config(config); - })?; + }, + )?; let env_path = config.chain_store_dir.join("nary-chains.env"); diff --git a/tools/test-framework/src/framework/nary/channel.rs b/tools/test-framework/src/framework/nary/channel.rs index cd7ccdfe78..38896a2a2a 100644 --- a/tools/test-framework/src/framework/nary/channel.rs +++ b/tools/test-framework/src/framework/nary/channel.rs @@ -11,7 +11,7 @@ use tracing::info; use crate::bootstrap::nary::channel::bootstrap_channels_with_connections; use crate::error::Error; use crate::framework::base::{HasOverrides, TestConfigOverride}; -use crate::framework::binary::chain::RelayerConfigOverride; +use crate::framework::binary::chain::{RelayerConfigOverride, TopologyOverride}; use crate::framework::binary::channel::{BinaryChannelTest, ChannelOrderOverride}; use crate::framework::binary::connection::ConnectionDelayOverride; use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; @@ -38,7 +38,8 @@ where + SupervisorOverride + ConnectionDelayOverride + PortsOverride - + ChannelOrderOverride, + + ChannelOrderOverride + + TopologyOverride, { run_nary_node_test(&RunNaryChainTest::new(&RunNaryConnectionTest::new( &RunNaryChannelTest::new(&RunWithSupervisor::new(test)), @@ -56,7 +57,8 @@ where + SupervisorOverride + ConnectionDelayOverride + PortsOverride<2> - + ChannelOrderOverride, + + ChannelOrderOverride + + TopologyOverride, { run_nary_channel_test(&RunBinaryAsNaryChannelTest::new(test)) } @@ -175,7 +177,6 @@ where let channels = bootstrap_channels_with_connections( connections, - chains.chain_handles().clone(), port_ids, order, config.bootstrap_with_random_ids, diff --git a/tools/test-framework/src/framework/nary/connection.rs b/tools/test-framework/src/framework/nary/connection.rs index 485b2ecd1b..6870d3be9e 100644 --- a/tools/test-framework/src/framework/nary/connection.rs +++ b/tools/test-framework/src/framework/nary/connection.rs @@ -10,7 +10,7 @@ use tracing::info; use crate::bootstrap::nary::connection::bootstrap_connections; use crate::error::Error; use crate::framework::base::{HasOverrides, TestConfigOverride}; -use crate::framework::binary::chain::RelayerConfigOverride; +use crate::framework::binary::chain::{RelayerConfigOverride, TopologyOverride}; use crate::framework::binary::connection::{BinaryConnectionTest, ConnectionDelayOverride}; use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; use crate::framework::nary::chain::{NaryChainTest, RunNaryChainTest}; @@ -34,7 +34,8 @@ where + NodeGenesisOverride + RelayerConfigOverride + SupervisorOverride - + ConnectionDelayOverride, + + ConnectionDelayOverride + + TopologyOverride, { run_nary_node_test(&RunNaryChainTest::new(&RunNaryConnectionTest::new( &RunWithSupervisor::new(test), diff --git a/tools/test-framework/src/framework/overrides.rs b/tools/test-framework/src/framework/overrides.rs index 0338224469..70398de376 100644 --- a/tools/test-framework/src/framework/overrides.rs +++ b/tools/test-framework/src/framework/overrides.rs @@ -22,6 +22,9 @@ use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; use crate::framework::nary::channel::PortsOverride as NaryPortsOverride; use crate::framework::supervisor::SupervisorOverride; use crate::types::config::TestConfig; +use crate::types::topology::TopologyType; + +use super::binary::chain::TopologyOverride; /** This trait should be implemented for all test cases to allow overriding @@ -145,6 +148,10 @@ pub trait TestOverrides { fn channel_version(&self) -> Version { Version::ics20() } + + fn topology(&self) -> Option { + None + } } impl HasOverrides for Test { @@ -231,3 +238,9 @@ impl NaryPortsOverride<2> for Test { [[port_a.clone(), port_b.clone()], [port_b, port_a]] } } + +impl TopologyOverride for Test { + fn topology(&self) -> Option { + TestOverrides::topology(self) + } +} diff --git a/tools/test-framework/src/types/mod.rs b/tools/test-framework/src/types/mod.rs index a1c1db153d..a107f96d7c 100644 --- a/tools/test-framework/src/types/mod.rs +++ b/tools/test-framework/src/types/mod.rs @@ -16,4 +16,5 @@ pub mod nary; pub mod process; pub mod single; pub mod tagged; +pub mod topology; pub mod wallet; diff --git a/tools/test-framework/src/types/nary/chains.rs b/tools/test-framework/src/types/nary/chains.rs index 5602113446..9f727710a5 100644 --- a/tools/test-framework/src/types/nary/chains.rs +++ b/tools/test-framework/src/types/nary/chains.rs @@ -14,12 +14,14 @@ use crate::types::nary::foreign_client::*; use crate::types::single::node::FullNode; use crate::types::tagged::*; use crate::util::array::try_into_array; +use crate::util::two_dim_hash_map::TwoDimMap; /** A fixed-size N-ary connected chains as specified by `SIZE`. Contains `SIZE` number of [`ChainHandle`]s, `SIZE` number of - [`FullNode`]s, and `SIZE`x`SIZE` numbers of [`ForeignClient`] pairs. + [`FullNode`]s, and a numbers of [`ForeignClient`] pairs + depending on `SIZE` and the topology. A `ConnectedChains` can be constructed by first constructing a [`DynamicConnectedChains`], and then calling @@ -44,7 +46,7 @@ pub struct NaryConnectedChains { pub struct DynamicConnectedChains { chain_handles: Vec, full_nodes: Vec, - pub foreign_clients: Vec>>, + pub foreign_clients: TwoDimMap>, } /** @@ -182,7 +184,7 @@ impl DynamicConnectedChains { pub fn new( chain_handles: Vec, full_nodes: Vec, - foreign_clients: Vec>>, + foreign_clients: TwoDimMap>, ) -> Self { Self { chain_handles, @@ -199,7 +201,7 @@ impl DynamicConnectedChains { &self.full_nodes } - pub fn foreign_clients(&self) -> &Vec>> { + pub fn foreign_clients(&self) -> &TwoDimMap> { &self.foreign_clients } } diff --git a/tools/test-framework/src/types/nary/channel.rs b/tools/test-framework/src/types/nary/channel.rs index decb941fa1..097c1579d2 100644 --- a/tools/test-framework/src/types/nary/channel.rs +++ b/tools/test-framework/src/types/nary/channel.rs @@ -1,7 +1,6 @@ /*! Constructs for N-ary connected channels. */ - use eyre::eyre; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer::channel::Channel; @@ -12,26 +11,28 @@ use crate::error::Error; use crate::types::binary::channel::ConnectedChannel; use crate::types::env::{EnvWriter, ExportEnv}; use crate::types::tagged::*; -use crate::util::array::try_into_nested_array; +use crate::util::two_dim_hash_map::TwoDimMap; /** - A fixed-size N-ary connected channels as specified by `SIZE`. + A two dimensional BTreeMap of connected channels as specified by `SIZE` + and topology. - Contains `SIZE`x`SIZE` number of binary [`ConnectedChannel`]s. + The number of binary [`ConnectedChannel`]s depends on the topology. */ #[derive(Debug, Clone)] pub struct ConnectedChannels { - channels: [[ConnectedChannel; SIZE]; SIZE], + pub channels: TwoDimMap>, } /** - A dynamic-sized N-ary connected channels, consist of a nested - vector of binary [`ConnectedChannel`]s which must be of the - same length. + A two dimensional BTreeMap of connected channels as specified by `SIZE` + and topology. + + The number of binary [`ConnectedChannel`]s depends on the topology. */ #[derive(Debug, Clone)] pub struct DynamicConnectedChannels { - channels: Vec>>, + channels: TwoDimMap>, } /** @@ -70,32 +71,31 @@ impl ConnectedChannels { pub fn channel_at( &self, ) -> Result, Error> { - if CHAIN_A >= SIZE || CHAIN_B >= SIZE { - Err(Error::generic(eyre!( - "cannot get channel beyond position {}/{}", - CHAIN_A, - CHAIN_B - ))) - } else { - let raw_channel = self.channels[CHAIN_A][CHAIN_B].clone(); - - let channel = raw_channel.map_chain(MonoTagged::new, MonoTagged::new); - - Ok(channel) - } + let raw_channel = self + .channels + .get((CHAIN_A, CHAIN_B)) + .ok_or_else(|| { + Error::generic(eyre!( + "No channel entry found for chain `{CHAIN_A}` to `{CHAIN_B}`" + )) + })? + .clone(); + let channel = raw_channel.map_chain(MonoTagged::new, MonoTagged::new); + + Ok(channel) } - pub fn channels(&self) -> &[[ConnectedChannel; SIZE]; SIZE] { + pub fn channels(&self) -> &TwoDimMap> { &self.channels } } impl DynamicConnectedChannels { - pub fn new(channels: Vec>>) -> Self { + pub fn new(channels: TwoDimMap>) -> Self { Self { channels } } - pub fn channels(&self) -> &Vec>> { + pub fn channels(&self) -> &TwoDimMap> { &self.channels } } @@ -107,7 +107,7 @@ impl TryFrom) -> Result { Ok(ConnectedChannels { - channels: try_into_nested_array(channels.channels)?, + channels: channels.channels, }) } } @@ -120,38 +120,21 @@ impl From> for NthConnectedCha impl ExportEnv for ConnectedChannels { fn export_env(&self, writer: &mut impl EnvWriter) { - for (i, inner_channels) in self.channels.iter().enumerate() { - for (j, channel_i_to_j) in inner_channels.iter().enumerate() { - writer.write_env( - &format!("CONNECTION_ID_{j}_to_{i}"), - &format!("{}", channel_i_to_j.connection.connection_id_a), - ); - - writer.write_env( - &format!("CONNECTION_ID_{i}_to_{j}"), - &format!("{}", channel_i_to_j.connection.connection_id_b), - ); - - writer.write_env( - &format!("CHANNEL_ID_{j}_to_{i}"), - &format!("{}", channel_i_to_j.channel_id_a), - ); - - writer.write_env( - &format!("PORT_{j}_to_{i}"), - &format!("{}", channel_i_to_j.port_a), - ); - - writer.write_env( - &format!("CHANNEL_ID_{i}_to_{j}"), - &format!("{}", channel_i_to_j.channel_id_b), - ); - - writer.write_env( - &format!("PORT_{i}_to_{j}"), - &format!("{}", channel_i_to_j.port_b), - ); - } + for (src_chain, dst_chain, channel) in self.channels.iter() { + writer.write_env( + &format!("CONNECTION_ID_{}_to_{}", src_chain, dst_chain), + &format!("{}", channel.connection.connection_id_a), + ); + + writer.write_env( + &format!("CHANNEL_ID_{}_to_{}", src_chain, dst_chain), + &format!("{}", channel.channel_id_a), + ); + + writer.write_env( + &format!("PORT_{}_to_{}", src_chain, dst_chain), + &format!("{}", channel.port_a), + ); } } } diff --git a/tools/test-framework/src/types/nary/connection.rs b/tools/test-framework/src/types/nary/connection.rs index 87866f42d8..31c5b0e2d8 100644 --- a/tools/test-framework/src/types/nary/connection.rs +++ b/tools/test-framework/src/types/nary/connection.rs @@ -1,7 +1,6 @@ /*! Constructs for N-ary connected connections. */ - use eyre::eyre; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer_types::core::ics24_host::identifier::ConnectionId; @@ -11,26 +10,28 @@ use crate::error::Error; use crate::types::binary::connection::ConnectedConnection; use crate::types::env::{EnvWriter, ExportEnv}; use crate::types::tagged::*; -use crate::util::array::{into_nested_vec, try_into_nested_array}; +use crate::util::two_dim_hash_map::TwoDimMap; /** - A fixed-size N-ary connected connections as specified by `SIZE`. + A two dimensional BTreeMap of connected connections as specified by `SIZE` + and topology. - Contains `SIZE`x`SIZE` number of binary [`ConnectedConnection`]s. + The number of binary [`ConnectedConnection`]s depends on the topology. */ #[derive(Debug, Clone)] pub struct ConnectedConnections { - connections: [[ConnectedConnection; SIZE]; SIZE], + connections: TwoDimMap>, } /** - A dynamic-sized N-ary connected connections, made of a - nested vector of binary [`ConnectedConnection`] which must be - in the same dimension. + A two dimensional BTreeMap of connected connections as specified by `SIZE` + and topology. + + The number of binary [`ConnectedConnection`]s depends on the topology. */ #[derive(Debug, Clone)] pub struct DynamicConnectedConnections { - connections: Vec>>, + connections: TwoDimMap>, } /** @@ -55,32 +56,31 @@ impl ConnectedConnections pub fn connection_at( &self, ) -> Result, Error> { - if CHAIN_A >= SIZE || CHAIN_B >= SIZE { - Err(Error::generic(eyre!( - "cannot get connection beyond position {}/{}", - CHAIN_A, - CHAIN_B - ))) - } else { - let raw_connection = self.connections[CHAIN_A][CHAIN_B].clone(); - - let channel = raw_connection.map_chain(MonoTagged::new, MonoTagged::new); - - Ok(channel) - } + let raw_connection = self + .connections + .get((CHAIN_A, CHAIN_B)) + .ok_or_else(|| { + Error::generic(eyre!( + "No connection entry found for chain `{CHAIN_A}` to `{CHAIN_B}`" + )) + })? + .clone(); + let connection = raw_connection.map_chain(MonoTagged::new, MonoTagged::new); + + Ok(connection) } - pub fn connections(&self) -> &[[ConnectedConnection; SIZE]; SIZE] { + pub fn connections(&self) -> &TwoDimMap> { &self.connections } } impl DynamicConnectedConnections { - pub fn new(connections: Vec>>) -> Self { + pub fn new(connections: TwoDimMap>) -> Self { Self { connections } } - pub fn connections(&self) -> &Vec>> { + pub fn connections(&self) -> &TwoDimMap> { &self.connections } } @@ -90,7 +90,7 @@ impl From) -> Self { DynamicConnectedConnections { - connections: into_nested_vec(connections.connections), + connections: connections.connections, } } } @@ -102,7 +102,7 @@ impl TryFrom) -> Result { Ok(ConnectedConnections { - connections: try_into_nested_array(connections.connections)?, + connections: connections.connections, }) } } @@ -117,18 +117,11 @@ impl From> impl ExportEnv for ConnectedConnections { fn export_env(&self, writer: &mut impl EnvWriter) { - for (i, inner_connections) in self.connections.iter().enumerate() { - for (j, connection_i_to_j) in inner_connections.iter().enumerate() { - writer.write_env( - &format!("CONNECTION_ID_{j}_to_{i}"), - &format!("{}", connection_i_to_j.connection_id_a), - ); - - writer.write_env( - &format!("CONNECTION_ID_{i}_to_{j}"), - &format!("{}", connection_i_to_j.connection_id_b), - ); - } + for (src_chain, dst_chain, connection) in self.connections.iter() { + writer.write_env( + &format!("CONNECTION_ID_{}_to_{}", src_chain, dst_chain), + &format!("{}", connection.connection_id_a), + ); } } } diff --git a/tools/test-framework/src/types/nary/foreign_client.rs b/tools/test-framework/src/types/nary/foreign_client.rs index e840b1eb97..a9dfd4cd46 100644 --- a/tools/test-framework/src/types/nary/foreign_client.rs +++ b/tools/test-framework/src/types/nary/foreign_client.rs @@ -7,7 +7,7 @@ use crate::error::Error; use crate::types::binary::foreign_client::ForeignClientPair; use crate::types::env::{EnvWriter, ExportEnv}; use crate::types::tagged::*; -use crate::util::array::{into_nested_vec, try_into_nested_array}; +use crate::util::two_dim_hash_map::TwoDimMap; /** A [`ForeignClient`] that is tagged by a `Handle: ChainHandle` and @@ -21,7 +21,7 @@ pub type NthForeignClientPair = #[derive(Clone)] pub struct ForeignClientPairs { - foreign_clients: [[ForeignClient; SIZE]; SIZE], + foreign_clients: TwoDimMap>, } impl ForeignClientPairs { @@ -33,19 +33,15 @@ impl ForeignClientPairs { pub fn foreign_client_at( &self, ) -> Result, Error> { - if SRC >= SIZE || DEST >= SIZE { - Err(Error::generic(eyre!( - "cannot get foreign client beyond position {}/{}", - SRC, - DEST - ))) - } else { - let client = self.foreign_clients[SRC][DEST] - .clone() - .map_chain(MonoTagged::new, MonoTagged::new); - - Ok(client) - } + let client = self + .foreign_clients + .get((SRC, DEST)) + .ok_or_else(|| { + Error::generic(eyre!("No client entry found for chain `{SRC}` to `{DEST}`")) + })? + .clone() + .map_chain(MonoTagged::new, MonoTagged::new); + Ok(client) } pub fn foreign_client_pair_at( @@ -57,31 +53,29 @@ impl ForeignClientPairs { Ok(ForeignClientPair::new(client_a_to_b, client_b_to_a)) } - pub fn into_nested_vec(self) -> Vec>> { - into_nested_vec(self.foreign_clients) + pub fn into_nested_vec(self) -> TwoDimMap> { + self.foreign_clients } } -impl TryFrom>>> +impl TryFrom>> for ForeignClientPairs { type Error = Error; - fn try_from(clients: Vec>>) -> Result { - let foreign_clients = try_into_nested_array(clients)?; + fn try_from(clients: TwoDimMap>) -> Result { + let foreign_clients = clients; Ok(Self { foreign_clients }) } } impl ExportEnv for ForeignClientPairs { fn export_env(&self, writer: &mut impl EnvWriter) { - for (source, inner_clients) in self.foreign_clients.iter().enumerate() { - for (destination, client) in inner_clients.iter().enumerate() { - writer.write_env( - &format!("CLIENT_ID_{source}_to_{destination}"), - &format!("{}", client.id()), - ); - } + for (src_chain, dst_chain, client) in self.foreign_clients.iter() { + writer.write_env( + &format!("CLIENT_ID_{}_to_{}", src_chain, dst_chain), + &format!("{}", client.id()), + ); } } } diff --git a/tools/test-framework/src/types/topology.rs b/tools/test-framework/src/types/topology.rs new file mode 100644 index 0000000000..4fb915a834 --- /dev/null +++ b/tools/test-framework/src/types/topology.rs @@ -0,0 +1,198 @@ +/*! + The Topology defines how chains are interconnected when more than two are used in tests. + This setup is managed by the [`crate::bootstrap::nary::chain::boostrap_chains_with_any_nodes`] + function. + + Connections are established by examining the existing clients, and channels are created based + on these connections. Therefore, to define the topology of the chains, it is sufficient to + create the appropriate set of clients. + + Example: Linear Topology + + For a linear topology between chains A, B, and C, the clients are created as follows: + * Chain A: a client referencing chain B + * Chain B: a client referencing chain B and a client referencing chain C + * Chain C: a client referencing chain B + + This setup ensures that: + + * Chain A is connected to Chain B. + * Chain B is connected to both Chain A and Chain C. + * Chain C is connected to Chain B. + + Example: Fully Connected Topology + + In a fully connected topology, every chain has clients referencing all other chains. + For chains A, B, and C, the clients are created as follows: + + * Chain A: Clients referencing chains B and C + * Chain B: Clients referencing chains A and C + * Chain C: Clients referencing chains A and B + * Each chain will also have a self referencing client + + This setup ensures that every chain is directly connected to every other chain, forming + a complete graph. + + Example: Cyclic Topology + + The cyclic topology is similar to the linear topology with the addition of the first and + last chain being connected as well. + For chains A, B, C and D, the clients are created as follows: + + * Chain A: Clients referencing chains B and D + * Chain B: Clients referencing chains A and C + * Chain C: Clients referencing chains B and D + * Chain D: Clients referencing chains A and C + + By defining the appropriate set of clients, you can establish the desired topology for + your tests, whether it be linear, fully connected, or any other configuration. +*/ + +use eyre::eyre; +use std::str::FromStr; + +use ibc_relayer::chain::handle::ChainHandle; +use ibc_relayer::foreign_client::ForeignClient; + +use crate::bootstrap::binary::chain::bootstrap_foreign_client; +use crate::error::Error; +use crate::util::two_dim_hash_map::TwoDimMap; + +pub enum TopologyType { + Linear, + Full, + Cyclic, +} + +impl FromStr for TopologyType { + type Err = Error; + + fn from_str(s: &str) -> Result { + match s { + "linear" => Ok(Self::Linear), + "full" => Ok(Self::Full), + "cyclic" => Ok(Self::Cyclic), + _ => Err(Error::generic(eyre!("The topology `{s}` does not exist"))), + } + } +} + +pub trait Topology { + fn create_topology( + &self, + chain_handles: &Vec, + ) -> Result>, Error>; +} + +pub struct FullyConnectedTopology; + +impl Topology for FullyConnectedTopology { + fn create_topology( + &self, + chain_handles: &Vec, + ) -> Result>, Error> { + let mut foreign_clients: TwoDimMap> = TwoDimMap::new(); + + for (i, handle_a) in chain_handles.iter().enumerate() { + for (j, handle_b) in chain_handles.iter().enumerate() { + let foreign_client = + bootstrap_foreign_client(handle_a, handle_b, Default::default())?; + + foreign_clients.insert((i, j), foreign_client); + } + } + Ok(foreign_clients) + } +} + +pub struct LinearTopology; + +impl Topology for LinearTopology { + fn create_topology( + &self, + chain_handles: &Vec, + ) -> Result>, Error> { + let mut foreign_clients: TwoDimMap> = TwoDimMap::new(); + + let last_index = chain_handles.len() - 1; + for (i, _) in chain_handles.iter().enumerate() { + if i < last_index { + let client = bootstrap_foreign_client( + &chain_handles[i], + &chain_handles[i + 1], + Default::default(), + )?; + foreign_clients.insert((i, i + 1), client); + } + if i > 0 { + let client = bootstrap_foreign_client( + &chain_handles[i], + &chain_handles[i - 1], + Default::default(), + )?; + foreign_clients.insert((i, i - 1), client); + } + } + Ok(foreign_clients) + } +} + +pub struct CyclicTopology; + +impl Topology for CyclicTopology { + fn create_topology( + &self, + chain_handles: &Vec, + ) -> Result>, Error> { + let mut foreign_clients: TwoDimMap> = TwoDimMap::new(); + + let last_index = chain_handles.len() - 1; + for (i, _) in chain_handles.iter().enumerate() { + // Create client from first chain to last + if i == 0 { + let client = bootstrap_foreign_client( + &chain_handles[0], + &chain_handles[last_index], + Default::default(), + )?; + foreign_clients.insert((i, last_index), client); + } + // Create client from last chain to first + if i == last_index { + let client = bootstrap_foreign_client( + &chain_handles[last_index], + &chain_handles[0], + Default::default(), + )?; + foreign_clients.insert((i, 0), client); + } + if i < last_index { + let client = bootstrap_foreign_client( + &chain_handles[i], + &chain_handles[i + 1], + Default::default(), + )?; + foreign_clients.insert((i, i + 1), client); + } + if i > 0 { + let client = bootstrap_foreign_client( + &chain_handles[i], + &chain_handles[i - 1], + Default::default(), + )?; + foreign_clients.insert((i, i - 1), client); + } + } + Ok(foreign_clients) + } +} + +pub fn bootstrap_topology( + topology: TopologyType, +) -> Box> { + match topology { + TopologyType::Full => Box::new(FullyConnectedTopology), + TopologyType::Linear => Box::new(LinearTopology), + TopologyType::Cyclic => Box::new(CyclicTopology), + } +} diff --git a/tools/test-framework/src/util/array.rs b/tools/test-framework/src/util/array.rs index 17aaa451fc..df02df2a92 100644 --- a/tools/test-framework/src/util/array.rs +++ b/tools/test-framework/src/util/array.rs @@ -15,22 +15,6 @@ pub fn try_into_array(list: Vec) -> Result<[T; SIZE], E .map_err(|_| Error::generic(eyre!("vector is not of length {}", SIZE))) } -/** - Converts a dynamic-sized nested vector `Vec>` into a fixed-sized - nested array `[[T; SIZE]; SIZE]`. Fails if the nested vector is not of - `SIZE`x`SIZE` length. -*/ -pub fn try_into_nested_array( - list: Vec>, -) -> Result<[[T; SIZE]; SIZE], Error> { - let list_a = list - .into_iter() - .map(try_into_array) - .collect::, _>>()?; - - try_into_array(list_a) -} - /** Converts a fixed-sized nested array `[[T; SIZE]; SIZE]` into a nested vector `Vec>`. @@ -38,49 +22,3 @@ pub fn try_into_nested_array( pub fn into_nested_vec(array: [[T; SIZE]; SIZE]) -> Vec> { array.map(|array_b| array_b.into()).into() } - -/** - Map the elements in the fixed-sized array `[[T; SIZE]; SIZE]`. -*/ -pub fn map_nested_array( - array: [[T; SIZE]; SIZE], - mapper: impl Fn(T) -> Result, -) -> Result<[[R; SIZE]; SIZE], Error> { - let mapped = into_nested_vec(array) - .into_iter() - .map(|inner| { - inner - .into_iter() - .map(&mapper) - .collect::, _>>() - }) - .collect::, _>>()?; - - try_into_nested_array(mapped) -} - -/** - Asserts that a nested vector `Vec>` has the same dimension - in its inner vectors. -*/ -pub fn assert_same_dimension(size: usize, list: &Vec>) -> Result<(), Error> { - if list.len() != size { - return Err(Error::generic(eyre!( - "expect nested vector to have the dimension {} x {}", - size, - size - ))); - } - - for list_b in list.iter() { - if list_b.len() != size { - return Err(Error::generic(eyre!( - "expect nested vector to have the dimension {} x {}", - size, - size - ))); - } - } - - Ok(()) -} diff --git a/tools/test-framework/src/util/mod.rs b/tools/test-framework/src/util/mod.rs index 8fcd82a5dc..7db62f867e 100644 --- a/tools/test-framework/src/util/mod.rs +++ b/tools/test-framework/src/util/mod.rs @@ -10,3 +10,4 @@ pub mod proposal_status; pub mod random; pub mod retry; pub mod suspend; +pub mod two_dim_hash_map; diff --git a/tools/test-framework/src/util/two_dim_hash_map.rs b/tools/test-framework/src/util/two_dim_hash_map.rs new file mode 100644 index 0000000000..678961669f --- /dev/null +++ b/tools/test-framework/src/util/two_dim_hash_map.rs @@ -0,0 +1,113 @@ +use std::collections::{btree_map, BTreeMap}; + +#[derive(Clone, Debug)] +pub struct TwoDimMap { + pub map: BTreeMap>, +} + +impl Default for TwoDimMap { + fn default() -> Self { + TwoDimMap { + map: BTreeMap::new(), + } + } +} + +impl TwoDimMap { + pub fn new() -> Self { + Self::default() + } + pub fn get(&self, (x, y): (usize, usize)) -> Option<&T> { + self.map.get(&x).and_then(|inner| inner.get(&y)) + } + + pub fn insert(&mut self, (x, y): (usize, usize), value: T) -> Option { + if let Some(existing_values) = self.map.get_mut(&x) { + existing_values.insert(y, value) + } else { + let mut new_values = BTreeMap::new(); + new_values.insert(y, value); + self.map.insert(x, new_values); + None + } + } + + pub fn iter(&self) -> Iter { + Iter { + outer_iter: self.map.iter(), + inner_iter: None, + outer_key: 0, + } + } +} + +pub struct Iter<'a, T> { + outer_iter: btree_map::Iter<'a, usize, BTreeMap>, + inner_iter: Option>, + outer_key: usize, +} + +impl<'a, T> Iterator for Iter<'a, T> { + type Item = (usize, usize, &'a T); + + fn next(&mut self) -> Option { + loop { + if let Some(inner_iter) = &mut self.inner_iter { + if let Some((inner_key, inner_value)) = inner_iter.next() { + return Some((self.outer_key, *inner_key, inner_value)); + } + } + + if let Some((outer_key, inner_map)) = self.outer_iter.next() { + self.outer_key = *outer_key; + self.inner_iter = Some(inner_map.iter()); + } else { + return None; + } + } + } +} + +impl From>> for TwoDimMap { + fn from(map: BTreeMap>) -> Self { + Self { map } + } +} + +#[cfg(test)] +mod tests { + use std::collections::BTreeMap; + + use super::*; + + #[test] + fn test_two_dim_hash_map_iterator() { + let mut outer_hashmap = BTreeMap::new(); + let mut inner_hashmap1 = BTreeMap::new(); + let mut inner_hashmap2 = BTreeMap::new(); + let mut inner_hashmap3 = BTreeMap::new(); + + inner_hashmap1.insert(1, "a"); + + inner_hashmap2.insert(2, "c"); + inner_hashmap2.insert(0, "b"); + + inner_hashmap3.insert(1, "d"); + + outer_hashmap.insert(0, inner_hashmap1); + outer_hashmap.insert(1, inner_hashmap2); + outer_hashmap.insert(2, inner_hashmap3); + + let two_dim_hash_map = TwoDimMap::from(outer_hashmap); + let mut two_dim_hash_map_iter = two_dim_hash_map.iter(); + + assert_eq!(two_dim_hash_map_iter.next(), Some((0, 1, &"a"))); + + assert_eq!(two_dim_hash_map_iter.next(), Some((1, 0, &"b"))); + assert_eq!(two_dim_hash_map_iter.next(), Some((1, 2, &"c"))); + + assert_eq!(two_dim_hash_map_iter.next(), Some((2, 1, &"d"))); + + assert_eq!(two_dim_hash_map_iter.next(), None); + } +} From d0034de88a86ec9bc9c8c05507f3516883f555b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 12:12:29 +0200 Subject: [PATCH 126/200] Bump derive_more from 0.99.17 to 0.99.18 (#4042) Bumps [derive_more](https://github.com/JelteF/derive_more) from 0.99.17 to 0.99.18. - [Release notes](https://github.com/JelteF/derive_more/releases) - [Changelog](https://github.com/JelteF/derive_more/blob/v0.99.18/CHANGELOG.md) - [Commits](https://github.com/JelteF/derive_more/compare/v0.99.17...v0.99.18) --- updated-dependencies: - dependency-name: derive_more dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 553b827aac..f8fb171458 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -731,13 +731,13 @@ checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.66", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 1af8331065..3ce424b2a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ color-eyre = "0.6" console = "0.15.5" crossbeam-channel = "0.5.12" dashmap = "5.4.0" -derive_more = { version = "0.99.17", default-features = false } +derive_more = { version = "0.99.18", default-features = false } dialoguer = "0.11.0" digest = "0.10.6" dirs-next = "2.0.0" From 2c6cb71dfae850b711972fbfa98f62504c38c79c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:13:00 +0000 Subject: [PATCH 127/200] Bump regex from 1.10.4 to 1.10.5 (#4037) Bumps [regex](https://github.com/rust-lang/regex) from 1.10.4 to 1.10.5. - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/regex/compare/1.10.4...1.10.5) --- updated-dependencies: - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f8fb171458..65d4cc3f4e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2374,9 +2374,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 3ce424b2a9..425ebd4be6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,7 +86,7 @@ primitive-types = { version = "0.12.1", default-features = false } prometheus = "0.13.4" prost = "0.12" rand = "0.8.5" -regex = "1.10.4" +regex = "1.10.5" reqwest = { version = "0.11.27", default-features = false } retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" From 58891312c94e8be969ce91f279c5877bf6a174fc Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 18 Jun 2024 13:43:47 +0200 Subject: [PATCH 128/200] Improve channel and port filter policy parsing (#4044) * Improve channel and port filter policy parsing * Move whitespace trimming when parsing channel and port policy * Add changelog entry --- ...45-trim-whitespaces-channel-port-filter.md | 5 +++ crates/relayer/src/config/filter.rs | 37 +++++++++++++++---- 2 files changed, 34 insertions(+), 8 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/4045-trim-whitespaces-channel-port-filter.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4045-trim-whitespaces-channel-port-filter.md b/.changelog/unreleased/improvements/ibc-relayer/4045-trim-whitespaces-channel-port-filter.md new file mode 100644 index 0000000000..8cfcd2c1bc --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/4045-trim-whitespaces-channel-port-filter.md @@ -0,0 +1,5 @@ +- Updated the channel and port filter parsing to ignore whitespaces. + This will prevent unintended channel scanning due to accidental + whitespaces when exact matches are specified in the `packet_filter` + configuration. + ([\#4045](https://github.com/informalsystems/hermes/issues/4045)) \ No newline at end of file diff --git a/crates/relayer/src/config/filter.rs b/crates/relayer/src/config/filter.rs index f6ff932797..576c62a8ee 100644 --- a/crates/relayer/src/config/filter.rs +++ b/crates/relayer/src/config/filter.rs @@ -384,11 +384,13 @@ pub(crate) mod port { } fn visit_str(self, v: &str) -> Result { - if let Ok(port_id) = PortId::from_str(v) { - Ok(PortFilterMatch::Exact(port_id)) - } else { - let wildcard = v.parse().map_err(E::custom)?; + let trimmed_v = v.trim(); + if trimmed_v.contains('*') { + let wildcard = trimmed_v.parse().map_err(E::custom)?; Ok(PortFilterMatch::Wildcard(wildcard)) + } else { + let port_id = PortId::from_str(trimmed_v).map_err(E::custom)?; + Ok(PortFilterMatch::Exact(port_id)) } } @@ -411,11 +413,13 @@ pub(crate) mod channel { } fn visit_str(self, v: &str) -> Result { - if let Ok(channel_id) = ChannelId::from_str(v) { - Ok(ChannelFilterMatch::Exact(channel_id)) - } else { - let wildcard = v.parse().map_err(E::custom)?; + let trimmed_v = v.trim(); + if trimmed_v.contains('*') { + let wildcard = trimmed_v.parse().map_err(E::custom)?; Ok(ChannelFilterMatch::Wildcard(wildcard)) + } else { + let channel_id = ChannelId::from_str(trimmed_v.trim()).map_err(E::custom)?; + Ok(ChannelFilterMatch::Exact(channel_id)) } } @@ -602,4 +606,21 @@ mod tests { let wildcard = "ica*".parse::().unwrap(); assert_eq!(wildcard.to_string(), "ica*".to_string()); } + + #[test] + fn test_exact_matches() { + let allow_policy = r#" + policy = "allow" + list = [ + [ "transfer", "channel-88", ], # Standard exact match + [ "transfer", "channel-476 ", ], # Whitespace abstraction + ] + "#; + + let pf: ChannelPolicy = + toml::from_str(allow_policy).expect("could not parse filter policy"); + + let assert_allow = matches!(pf, ChannelPolicy::Allow(filters) if filters.is_exact()); + assert!(assert_allow); + } } From 240ebb7d8140f1d76b546c00bde6c43921a99d00 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Wed, 19 Jun 2024 08:24:45 +0200 Subject: [PATCH 129/200] Test relaying from `authz` (#3746) * Run codespell on CI * Only run cargo-doc when needed * Fix all typos found in the repository * Remove TLA type checker workflow * Undo wrong typo fixes * Increase timeout when asserting if a channel is eventually open in tests * Fix clippy errors * Add tests for authz * Add 'authz' feature and restrict authz tests with feature * Fix typo in comment * Align features in integration-test crate Cargo.toml * Fix authz tests by adding fees to CLIs * Remove unnecessary sleeps in authz tests * Add changelog entry --------- Co-authored-by: Romain Ruetschi --- .../ibc-integration-test/4046-test-authz.md | 3 + .github/workflows/integration.yaml | 8 +- tools/integration-test/Cargo.toml | 1 + tools/integration-test/src/tests/authz.rs | 199 ++++++++++++++++++ tools/integration-test/src/tests/mod.rs | 3 + tools/test-framework/src/chain/cli/authz.rs | 165 +++++++++++++++ tools/test-framework/src/chain/cli/mod.rs | 1 + .../test-framework/src/chain/cli/transfer.rs | 39 ++++ tools/test-framework/src/chain/ext/authz.rs | 124 +++++++++++ tools/test-framework/src/chain/ext/mod.rs | 1 + 10 files changed, 540 insertions(+), 4 deletions(-) create mode 100644 .changelog/unreleased/features/ibc-integration-test/4046-test-authz.md create mode 100644 tools/integration-test/src/tests/authz.rs create mode 100644 tools/test-framework/src/chain/cli/authz.rs create mode 100644 tools/test-framework/src/chain/ext/authz.rs diff --git a/.changelog/unreleased/features/ibc-integration-test/4046-test-authz.md b/.changelog/unreleased/features/ibc-integration-test/4046-test-authz.md new file mode 100644 index 0000000000..3082b737f2 --- /dev/null +++ b/.changelog/unreleased/features/ibc-integration-test/4046-test-authz.md @@ -0,0 +1,3 @@ +- Add tests to ensure that Hermes correctly relays transfer messages + from a grantee address with granted authorisation using `authz` module. + ([\#4046](https://github.com/informalsystems/hermes/issues/4046)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index f17dae894f..bec5a86434 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -54,17 +54,17 @@ jobs: command: simd account_prefix: cosmos native_token: stake - features: ica,ics29-fee + features: ica,ics29-fee,authz - package: ibc-go-v7-simapp command: simd account_prefix: cosmos native_token: stake - features: ica,ics29-fee + features: ica,ics29-fee,authz - package: ibc-go-v8-simapp command: simd account_prefix: cosmos native_token: stake - features: ica,ics29-fee,new-register-interchain-account,channel-upgrade + features: ica,ics29-fee,new-register-interchain-account,channel-upgrade,authz - package: wasmd command: wasmd account_prefix: wasm @@ -84,7 +84,7 @@ jobs: command: provenanced account_prefix: pb native_token: nhash - features: fee-grant,async-icq + features: fee-grant,async-icq,authz - package: migaloo command: migalood account_prefix: migaloo diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 3e96b65be3..b21a24a19b 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -48,6 +48,7 @@ async-icq = [] juno = [] dynamic-gas-fee = [] new-register-interchain-account = [] +authz = [] [[bin]] name = "test_setup_with_binary_channel" diff --git a/tools/integration-test/src/tests/authz.rs b/tools/integration-test/src/tests/authz.rs new file mode 100644 index 0000000000..7b8e9e58fa --- /dev/null +++ b/tools/integration-test/src/tests/authz.rs @@ -0,0 +1,199 @@ +//! This test tests relaying messages from authz: +//! +//! - The `AuthzTest` will grant authorization for `MsgTransfer` from `user2` (granter) +//! to `user1` (grantee). It will then execute an IBC transfer using the chain's +//! `tx authz exec` command and assert that the transfer successfully completes. +//! +//! - The `NoAuthzTest` will skip granting authorization and assert that the +//! `MsgTransfer` is not authorized and that the chain's `tx authz exec` +//! command fails. + +use ibc_test_framework::chain::ext::authz::AuthzMethodsExt; +use ibc_test_framework::prelude::*; + +#[test] +fn test_authz() -> Result<(), Error> { + run_binary_channel_test(&AuthzTest) +} + +#[test] +fn test_no_authz() -> Result<(), Error> { + run_binary_channel_test(&NoAuthzTest) +} + +struct AuthzTest; + +impl TestOverrides for AuthzTest {} + +impl BinaryChannelTest for AuthzTest { + fn run( + &self, + config: &TestConfig, + _relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + let denom_a = chains.node_a.denom(); + let fee_denom_a: MonoTagged = + MonoTagged::new(Denom::base(&config.native_tokens[0])); + let wallet_b = chains.node_b.wallets().user1().cloned(); + + let a_to_b_amount = 12345u64; + let granter = chains + .node_a + .wallets() + .user2() + .address() + .value() + .to_string(); + let grantee = chains + .node_a + .wallets() + .user1() + .address() + .value() + .to_string(); + + let fees = fee_denom_a.with_amount(390000000u64).to_string(); + + chains.node_a.chain_driver().authz_grant( + &granter, + &grantee, + "/ibc.applications.transfer.v1.MsgTransfer", + &fees, + )?; + + chains.node_a.chain_driver().assert_eventual_grant( + &granter, + &grantee, + "/ibc.applications.transfer.v1.MsgTransfer", + )?; + + let granter_balance = chains + .node_a + .chain_driver() + .query_balance(&chains.node_a.wallets().user2().address(), &denom_a)?; + + let denom_b = derive_ibc_denom( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &denom_a, + )?; + + chains.node_a.chain_driver().exec_ibc_transfer_grant( + &granter, + &grantee, + channels.port_a.value(), + channels.channel_id_a.value(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + &fees, + )?; + + // Assert that user on chain B received the tokens + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b.address(), + &denom_b.with_amount(a_to_b_amount).as_ref(), + )?; + + // Assert that user on chain A sent the tokens + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &chains.node_a.wallets().user2().address(), + &(granter_balance - a_to_b_amount).as_ref(), + )?; + + Ok(()) + } +} + +struct NoAuthzTest; + +impl TestOverrides for NoAuthzTest {} + +impl BinaryChannelTest for NoAuthzTest { + fn run( + &self, + config: &TestConfig, + _relayer: RelayerDriver, + chains: ConnectedChains, + channels: ConnectedChannel, + ) -> Result<(), Error> { + let denom_a = chains.node_a.denom(); + let fee_denom_a: MonoTagged = + MonoTagged::new(Denom::base(&config.native_tokens[0])); + let wallet_b = chains.node_b.wallets().user1().cloned(); + + let a_to_b_amount = 12345u64; + let granter = chains + .node_a + .wallets() + .user2() + .address() + .value() + .to_string(); + let grantee = chains + .node_a + .wallets() + .user1() + .address() + .value() + .to_string(); + + let denom_b = derive_ibc_denom( + &channels.port_b.as_ref(), + &channels.channel_id_b.as_ref(), + &denom_a, + )?; + + assert!( + chains + .node_a + .chain_driver() + .assert_eventual_grant( + &granter, + &grantee, + "/ibc.applications.transfer.v1.MsgTransfer", + ) + .is_err(), + "there should be no grants" + ); + + let granter_balance = chains + .node_a + .chain_driver() + .query_balance(&chains.node_a.wallets().user2().address(), &denom_a)?; + + let fees = fee_denom_a.with_amount(390000000u64).to_string(); + + assert!( + chains + .node_a + .chain_driver() + .exec_ibc_transfer_grant( + &granter, + &grantee, + channels.port_a.value(), + channels.channel_id_a.value(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + &fees, + ) + .is_err(), + "expected authz grant exec to fail" + ); + + // Assert that user on chain B has not received tokens + chains.node_b.chain_driver().assert_eventual_wallet_amount( + &wallet_b.address(), + &denom_b.with_amount(0u128).as_ref(), + )?; + + // Assert that user on chain A has not sent tokens + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &chains.node_a.wallets().user2().address(), + &granter_balance.as_ref(), + )?; + + Ok(()) + } +} diff --git a/tools/integration-test/src/tests/mod.rs b/tools/integration-test/src/tests/mod.rs index 6fb6ac2a74..34534b57f7 100644 --- a/tools/integration-test/src/tests/mod.rs +++ b/tools/integration-test/src/tests/mod.rs @@ -33,6 +33,9 @@ pub mod transfer; #[cfg(any(doc, feature = "async-icq"))] pub mod async_icq; +#[cfg(any(doc, feature = "authz"))] +pub mod authz; + #[cfg(any(doc, feature = "channel-upgrade"))] pub mod channel_upgrade; diff --git a/tools/test-framework/src/chain/cli/authz.rs b/tools/test-framework/src/chain/cli/authz.rs new file mode 100644 index 0000000000..d6bcf22a20 --- /dev/null +++ b/tools/test-framework/src/chain/cli/authz.rs @@ -0,0 +1,165 @@ +use eyre::eyre; +use std::collections::HashMap; +use std::thread; + +use crate::chain::exec::simple_exec; +use crate::error::Error; +use crate::prelude::*; + +pub fn authz_grant( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + granter: &str, + grantee: &str, + msg_type: &str, + fees: &str, +) -> Result<(), Error> { + simple_exec( + chain_id, + command_path, + &[ + "--home", + home_path, + "--node", + rpc_listen_address, + "--chain-id", + chain_id, + "--keyring-backend", + "test", + "tx", + "authz", + "grant", + grantee, + "generic", + "--msg-type", + msg_type, + "--from", + granter, + "--fees", + fees, + "--yes", + "--log_format=json", + ], + )?; + + Ok(()) +} + +pub fn query_authz_grant( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + granter: &str, + grantee: &str, + msg_type: &str, +) -> Result<(), Error> { + simple_exec( + chain_id, + command_path, + &[ + "--home", + home_path, + "--node", + rpc_listen_address, + "query", + "authz", + "grants", + granter, + grantee, + msg_type, + "--output", + "json", + ], + )?; + + Ok(()) +} + +pub fn exec_grant( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + ibc_transfer_tx: &str, + grantee: &str, + fees: &str, +) -> Result<(), Error> { + let grant_exec_output = simple_exec( + chain_id, + command_path, + &[ + "--home", + home_path, + "--node", + rpc_listen_address, + "--keyring-backend", + "test", + "--chain-id", + chain_id, + "tx", + "authz", + "exec", + ibc_transfer_tx, + "--from", + grantee, + "--fees", + fees, + "--yes", + "--output", + "json", + ], + )?; + + let json_res: HashMap = + serde_json::from_str(&grant_exec_output.stdout).map_err(handle_generic_error)?; + + let txhash = json_res + .get("txhash") + .ok_or_else(|| eyre!("expect `txhash` string field to be present in json result"))? + .as_str() + .ok_or_else(|| eyre!("expected `txhash` to be an array"))?; + + thread::sleep(Duration::from_secs(2)); + + let query_txhash_output = simple_exec( + chain_id, + command_path, + &[ + "--home", + home_path, + "--node", + rpc_listen_address, + "query", + "tx", + "--type=hash", + txhash, + "--output", + "json", + ], + )?; + + let json_res: HashMap = + serde_json::from_str(&query_txhash_output.stdout).map_err(handle_generic_error)?; + + let raw_log = json_res + .get("raw_log") + .ok_or_else(|| eyre!("expect `raw_log` string field to be present in json result"))? + .as_str() + .ok_or_else(|| eyre!("expected `raw_log` to be a string"))?; + + let code = json_res + .get("code") + .ok_or_else(|| eyre!("expect `code` string field to be present in json result"))? + .as_u64() + .ok_or_else(|| eyre!("expected `code` to be a u64"))?; + + if !raw_log.is_empty() && code != 0 { + return Err(Error::generic(eyre!( + "expected authz exec to succeed but failed with code: {code} and logs: {raw_log}" + ))); + } + Ok(()) +} diff --git a/tools/test-framework/src/chain/cli/mod.rs b/tools/test-framework/src/chain/cli/mod.rs index 5b2415d964..f1deb65c39 100644 --- a/tools/test-framework/src/chain/cli/mod.rs +++ b/tools/test-framework/src/chain/cli/mod.rs @@ -1,4 +1,5 @@ pub mod async_icq; +pub mod authz; pub mod bootstrap; pub mod fee_grant; pub mod host_zone; diff --git a/tools/test-framework/src/chain/cli/transfer.rs b/tools/test-framework/src/chain/cli/transfer.rs index 53457c04ab..cd554304f7 100644 --- a/tools/test-framework/src/chain/cli/transfer.rs +++ b/tools/test-framework/src/chain/cli/transfer.rs @@ -83,3 +83,42 @@ pub fn transfer_from_chain( Ok(()) } + +pub fn generate_transfer_from_chain_tx( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + sender: &str, + src_port: &str, + src_channel: &str, + recipient: &str, + token: &str, +) -> Result { + let output = simple_exec( + chain_id, + command_path, + &[ + "--node", + rpc_listen_address, + "tx", + "ibc-transfer", + "transfer", + src_port, + src_channel, + recipient, + token, + "--from", + sender, + "--chain-id", + chain_id, + "--home", + home_path, + "--keyring-backend", + "test", + "--generate-only", + ], + )?; + + Ok(output.stdout) +} diff --git a/tools/test-framework/src/chain/ext/authz.rs b/tools/test-framework/src/chain/ext/authz.rs new file mode 100644 index 0000000000..e6a8ad09a7 --- /dev/null +++ b/tools/test-framework/src/chain/ext/authz.rs @@ -0,0 +1,124 @@ +use crate::chain::cli::authz::{authz_grant, exec_grant, query_authz_grant}; +use crate::chain::cli::transfer::generate_transfer_from_chain_tx; +use crate::error::Error; +use crate::prelude::*; +use crate::types::tagged::MonoTagged; + +use super::bootstrap::ChainBootstrapMethodsExt; + +const WAIT_GRANT_ATTEMPTS: u16 = 5; + +pub trait AuthzMethodsExt { + fn authz_grant( + &self, + granter: &str, + grantee: &str, + msg_type: &str, + fees: &str, + ) -> Result<(), Error>; + + fn assert_eventual_grant( + &self, + granter: &str, + grantee: &str, + msg_type: &str, + ) -> Result<(), Error>; + + fn exec_ibc_transfer_grant( + &self, + granter: &str, + grantee: &str, + port: &PortId, + channel: &ChannelId, + recipient: &MonoTagged, + token: &TaggedTokenRef, + fees: &str, + ) -> Result<(), Error>; +} + +impl<'a, Chain: Send> AuthzMethodsExt for MonoTagged { + fn authz_grant( + &self, + granter: &str, + grantee: &str, + msg_type: &str, + fees: &str, + ) -> Result<(), Error> { + authz_grant( + self.value().chain_id.as_str(), + &self.value().command_path, + &self.value().home_path, + &self.value().rpc_listen_address(), + granter, + grantee, + msg_type, + fees, + ) + } + + fn assert_eventual_grant( + &self, + granter: &str, + grantee: &str, + msg_type: &str, + ) -> Result<(), Error> { + assert_eventually_succeed( + &format!("successful grant from granter {granter} to grantee {grantee}"), + WAIT_GRANT_ATTEMPTS, + Duration::from_secs(1), + || { + query_authz_grant( + self.value().chain_id.as_str(), + &self.value().command_path, + &self.value().home_path, + &self.value().rpc_listen_address(), + granter, + grantee, + msg_type, + ) + }, + )?; + + Ok(()) + } + + fn exec_ibc_transfer_grant( + &self, + granter: &str, + grantee: &str, + port: &PortId, + channel: &ChannelId, + recipient: &MonoTagged, + token: &TaggedTokenRef, + fees: &str, + ) -> Result<(), Error> { + let ibc_transfer_tx = generate_transfer_from_chain_tx( + self.value().chain_id.as_str(), + &self.value().command_path, + &self.value().home_path, + &self.value().rpc_listen_address(), + granter, + port.as_ref(), + channel.as_ref(), + recipient.value().as_str(), + &token.value().to_string(), + )?; + + let ibc_transfer_tx_filename = "ibc-transfer.json"; + + self.value() + .write_file(ibc_transfer_tx_filename, &ibc_transfer_tx)?; + + exec_grant( + self.value().chain_id.as_str(), + &self.value().command_path, + &self.value().home_path, + &self.value().rpc_listen_address(), + &format!("{}/{ibc_transfer_tx_filename}", self.value().home_path), + grantee, + fees, + )?; + + Ok(()) + } +} diff --git a/tools/test-framework/src/chain/ext/mod.rs b/tools/test-framework/src/chain/ext/mod.rs index 7910689fae..24df39928c 100644 --- a/tools/test-framework/src/chain/ext/mod.rs +++ b/tools/test-framework/src/chain/ext/mod.rs @@ -1,4 +1,5 @@ pub mod async_icq; +pub mod authz; pub mod bootstrap; pub mod crosschainquery; pub mod fee; From e5e55788c37c6d5d0785d9f78e19cd7a81b8aaab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 10:04:04 +0200 Subject: [PATCH 130/200] Bump curve25519-dalek from 4.1.2 to 4.1.3 (#4048) Bumps [curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek) from 4.1.2 to 4.1.3. - [Release notes](https://github.com/dalek-cryptography/curve25519-dalek/releases) - [Commits](https://github.com/dalek-cryptography/curve25519-dalek/compare/curve25519-4.1.2...curve25519-4.1.3) --- updated-dependencies: - dependency-name: curve25519-dalek dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 65d4cc3f4e..57252b3ba9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -646,16 +646,15 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.2" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms", "rustc_version", "subtle", "zeroize", @@ -2174,12 +2173,6 @@ dependencies = [ "spki", ] -[[package]] -name = "platforms" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" - [[package]] name = "powerfmt" version = "0.2.0" From 8afd455e51a263d45164d389a358ab9c14bf235e Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Fri, 21 Jun 2024 10:18:24 +0200 Subject: [PATCH 131/200] Improve codespell job (#4057) * Fix codespell typos * Update codespell to check hidden files * Fix typo --- .changelog/epilogue.md | 6 +++--- .../improvements/ibc-relayer/1785-clarify-ethermint-keys.md | 2 +- .changelog/v0.7.0/summary.md | 2 +- .changelog/v1.4.0/summary.md | 6 +++--- .changelog/v1.7.1/summary.md | 2 +- .github/codespell/codespell.ini | 2 +- .github/workflows/codespell.yml | 3 ++- .gitignore | 2 +- 8 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.changelog/epilogue.md b/.changelog/epilogue.md index c10d8dd22f..ac2d169412 100644 --- a/.changelog/epilogue.md +++ b/.changelog/epilogue.md @@ -504,7 +504,7 @@ This release also finalizes the initial implementation of all the ICS 004 handle - Fix for chains that don't have `cosmos` account prefix ([#416]) - Fix for building the `trusted_validator_set` for the header used in client updates ([#770]) - Don't send `MsgAcknowledgment` if channel is closed ([#675]) - - Fix a bug where the keys addresses had their account prefix overriden by the prefix in the configuration ([#751]) + - Fix a bug where the keys addresses had their account prefix overridden by the prefix in the configuration ([#751]) - [ibc-relayer-cli] - Hermes guide: improved installation guideline ([#672]) @@ -642,7 +642,7 @@ Noteworthy changes in this release include: ### FEATURES -- Continous Integration (CI) end-to-end (e2e) testing with gaia v4 ([#32], [#582], [#602]) +- Continuous Integration (CI) end-to-end (e2e) testing with gaia v4 ([#32], [#582], [#602]) - Add support for streamlining releases ([#507]) - [ibc-relayer-cli] @@ -799,7 +799,7 @@ Special thanks to external contributors for this release: @CharlyCst ([#347], [# - CLI for client update message ([#277]) - Implement the relayer CLI for connection handshake messages ([#358], [#359], [#360]) - Implement the relayer CLI for channel handshake messages ([#371], [#372], [#373], [#374]) - - Added basic client, connection, and channel lifecyle in relayer v0 ([#376], [#377], [#378]) + - Added basic client, connection, and channel lifecycle in relayer v0 ([#376], [#377], [#378]) - Implement commands to add and list keys for a chain ([#363]) - Allow overriding of peer_id, height and hash in light add command ([#428]) - [proto-compiler] diff --git a/.changelog/v0.11.0/improvements/ibc-relayer/1785-clarify-ethermint-keys.md b/.changelog/v0.11.0/improvements/ibc-relayer/1785-clarify-ethermint-keys.md index 94e4e72be4..9f337b3a5a 100644 --- a/.changelog/v0.11.0/improvements/ibc-relayer/1785-clarify-ethermint-keys.md +++ b/.changelog/v0.11.0/improvements/ibc-relayer/1785-clarify-ethermint-keys.md @@ -1,2 +1,2 @@ -- Improved documention w.r.t. keys for Ethermint-based chains +- Improved documentation w.r.t. keys for Ethermint-based chains ([#1785](https://github.com/informalsystems/ibc-rs/issues/1785)) \ No newline at end of file diff --git a/.changelog/v0.7.0/summary.md b/.changelog/v0.7.0/summary.md index e098cdbc39..33611b8472 100644 --- a/.changelog/v0.7.0/summary.md +++ b/.changelog/v0.7.0/summary.md @@ -1,3 +1,3 @@ This release of Hermes is the first to be compatible with the development version of Cosmos SDK 0.43. Hermes 0.7.0 also improves the performance and reliability of the relayer, notably by waiting asynchronously for transactions to be confirmed. -Additionnally, Hermes now includes a REST server which exposes the relayer's internal state over HTTP. +Additionally, Hermes now includes a REST server which exposes the relayer's internal state over HTTP. diff --git a/.changelog/v1.4.0/summary.md b/.changelog/v1.4.0/summary.md index ab025f4608..e4d1406036 100644 --- a/.changelog/v1.4.0/summary.md +++ b/.changelog/v1.4.0/summary.md @@ -1,16 +1,16 @@ *March 27th, 2023* Hermes v1.4.0 brings compatibility with chains based on Tendermint/CometBFT 0.37, -while retaining compatiblity with Tendermint/CometBFT 0.34. This is transparent +while retaining compatibility with Tendermint/CometBFT 0.34. This is transparent and does not require any additional configuration. The relayer now supports ICS consumer chains, which only requires operators to specify the `unbonding_period` parameter in the chain settings. This is only -a temporary requirement, in the future Hermes will seamlessy support consumer +a temporary requirement, in the future Hermes will seamlessly support consumer chains with minimal changes to the configuration. This release also deprecates support for chains based on Cosmos SDK 0.43.x and lower, -and bumps the compatiblity to Cosmos SDK 0.47.x. +and bumps the compatibility to Cosmos SDK 0.47.x. The relayer now also allows operators to filter out packets to relay based on whether or not they contain a fee, and the minimal amount of such fee. diff --git a/.changelog/v1.7.1/summary.md b/.changelog/v1.7.1/summary.md index 28905e6542..aedd51533f 100644 --- a/.changelog/v1.7.1/summary.md +++ b/.changelog/v1.7.1/summary.md @@ -3,7 +3,7 @@ at a different value for each chain, using the new per-chain `clear_interval` se The global `clear_interval` setting is used as a default value if the per-chain setting is not defined. -Additionnaly, operators can now override the CometBFT compatibility mode to be used +Additionally, operators can now override the CometBFT compatibility mode to be used for a chain by using the new `compat_mode` per-chain setting. The main use case for this is to override the automatically detected compatibility mode in case Hermes gets it wrong or encounters a non-standard version number and falls back on the wrong CometBFT version. diff --git a/.github/codespell/codespell.ini b/.github/codespell/codespell.ini index 681ebbd0f1..2e8efedbbd 100644 --- a/.github/codespell/codespell.ini +++ b/.github/codespell/codespell.ini @@ -1,3 +1,3 @@ [codespell] -skip = *.js,*.ts,*.css,*.svg,*.html,*.json,./target,./tools/integration-test/data,./tools/check-guide/target,./ci/misbehaviour/data +skip = *.js,*.ts,*.css,*.svg,*.html,*.json,./target,./tools/integration-test/data,./tools/check-guide/target,./ci/misbehaviour/data,./.git ignore-words = .github/codespell/words.txt diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index 6ad483e50d..7b82ed249f 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -17,6 +17,7 @@ jobs: - uses: actions/checkout@v4 - uses: codespell-project/actions-codespell@v2 with: - skip: '*.js,*.ts,*.css,*.svg,*.html,*.json,./target,./tools/integration-test/data,./tools/check-guide/target,./ci/misbehaviour/data' + skip: '*.js,*.ts,*.css,*.svg,*.html,*.json,./target,./tools/integration-test/data,./tools/check-guide/target,./ci/misbehaviour/data,./.git' ignore_words_file: .github/codespell/words.txt + check_hidden: true diff --git a/.gitignore b/.gitignore index edd589a061..bdda50d8a7 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,7 @@ data .mypy_cache/ __pycache__/ -# Ignore modelator aritfacts +# Ignore modelator artifacts .modelator mc.log From 513f549d23a380e12faefc416b9401c9fb156c7c Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Fri, 21 Jun 2024 10:18:53 +0200 Subject: [PATCH 132/200] Reduce ICS29 tests run time (#4054) * Improve ICS29 tests which verified escrowed ICS29 fees to check for either legacy or current values * Remove outdated comment * Add changelog entry --- .../4053-reduce-ics29-tests-run-time.md | 4 ++ .../src/tests/fee/filter_fees.rs | 60 +++++------------- .../src/tests/fee/pay_fee_async.rs | 50 +++++---------- tools/test-framework/src/chain/driver.rs | 63 ++++++++++++++++++- tools/test-framework/src/chain/tagged.rs | 34 ++++++++++ 5 files changed, 130 insertions(+), 81 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4053-reduce-ics29-tests-run-time.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4053-reduce-ics29-tests-run-time.md b/.changelog/unreleased/improvements/ibc-integration-test/4053-reduce-ics29-tests-run-time.md new file mode 100644 index 0000000000..88e727e88d --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4053-reduce-ics29-tests-run-time.md @@ -0,0 +1,4 @@ +- Reduce run time for ICS29 tests by immediately verifying if either + the legacy fees, `recv_fee + ack_fee + timeout_fee` or current + fees, `max(recv_fee + ack_fee, timeout_fee)` have been escrowed. + ([\#4053](https://github.com/informalsystems/hermes/issues/4053)) \ No newline at end of file diff --git a/tools/integration-test/src/tests/fee/filter_fees.rs b/tools/integration-test/src/tests/fee/filter_fees.rs index 6113d98c1f..218229d65f 100644 --- a/tools/integration-test/src/tests/fee/filter_fees.rs +++ b/tools/integration-test/src/tests/fee/filter_fees.rs @@ -1,4 +1,3 @@ -use std::cmp::max; use std::collections::HashMap; use ibc_relayer::config::filter::{ChannelPolicy, FeePolicy, FilterPattern, MinFee}; @@ -76,14 +75,7 @@ impl BinaryChannelTest for FilterIncentivizedFeesRelayerTest { let ack_fee = random_u128_range(200, 300); let timeout_fee = random_u128_range(100, 200); - let total_sent_fail = send_amount + receive_fee_fail + ack_fee + timeout_fee; - - // Before ibc-go v8.1.0 the amount escrowed for ICS29 fees is the sum of recv, ack and timeout fees - let balance_a2_fail = balance_a1.clone() - total_sent_fail; - - // From ibc-go v8.1+ the amount escrowed for ICS29 fees is the highest value between recv + ack fees or timeout fee - let balance_a2_fail2 = - balance_a1 - send_amount - max(receive_fee_fail + ack_fee, timeout_fee); + let balance_a2 = balance_a1.clone() - send_amount; chain_driver_a.ibc_token_transfer_with_fee( &port_a, @@ -105,31 +97,19 @@ impl BinaryChannelTest for FilterIncentivizedFeesRelayerTest { std::thread::sleep(Duration::from_secs(10)); - // This double check is required because ibc-go versions previous to v8.1.0 escrow recv, ack and timeout - // fees for ICS29. From ibc-go v8.1+ only the highest value between recv+ack and timeout is escrowed. - match chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &balance_a2_fail.as_ref()) - { - Ok(()) => {} - Err(_) => chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &balance_a2_fail2.as_ref())?, - } + chain_driver_a.assert_eventual_escrowed_amount_ics29( + &user_a.address(), + &balance_a2.as_ref(), + receive_fee_fail, + ack_fee, + timeout_fee, + )?; chain_driver_b.assert_eventual_wallet_amount( &user_b.address(), &denom_b.with_amount(0u128).as_ref(), )?; - // This double check is required because ibc-go versions previous to v8.1.0 escrow recv, ack and timeout - // fees for ICS29. From ibc-go v8.1+ only the highest value between recv+ack and timeout is escrowed. - match chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &(balance_a2_fail).as_ref()) - { - Ok(()) => {} - Err(_) => chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &balance_a2_fail2.as_ref())?, - } - chain_driver_a.assert_eventual_wallet_amount( &relayer_a.address(), &(relayer_balance_a).as_ref(), @@ -242,13 +222,7 @@ impl BinaryChannelTest for FilterByChannelIncentivizedFeesRelayerTest { let ack_fee = random_u128_range(200, 300); let timeout_fee = random_u128_range(100, 200); - let total_sent = send_amount + receive_fee + ack_fee + timeout_fee; - - // Before ibc-go v8.1.0 the amount escrowed for ICS29 fees is the sum of recv, ack and timeout fees - let balance_a2_legacy = balance_a1.clone() - total_sent; - - // From ibc-go v8.1+ the amount escrowed for ICS29 fees is the highest value between recv + ack fees or timeout fee - let balance_a2 = balance_a1.clone() - send_amount - max(receive_fee + ack_fee, timeout_fee); + let balance_a2 = balance_a1.clone() - send_amount; let denom_b = derive_ibc_denom( &channel.port_b.as_ref(), @@ -270,15 +244,13 @@ impl BinaryChannelTest for FilterByChannelIncentivizedFeesRelayerTest { Duration::from_secs(60), )?; - // This double check is required because ibc-go versions previous to v8.1.0 escrow recv, ack and timeout - // fees for ICS29. From ibc-go v8.1+ only the highest value between recv+ack and timeout is escrowed. - match chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &balance_a2_legacy.as_ref()) - { - Ok(()) => {} - Err(_) => chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &balance_a2.as_ref())?, - } + chain_driver_a.assert_eventual_escrowed_amount_ics29( + &user_a.address(), + &balance_a2.as_ref(), + receive_fee, + ack_fee, + timeout_fee, + )?; chain_driver_b.assert_eventual_wallet_amount( &user_b.address(), diff --git a/tools/integration-test/src/tests/fee/pay_fee_async.rs b/tools/integration-test/src/tests/fee/pay_fee_async.rs index 37c486c07d..dc8f5a816d 100644 --- a/tools/integration-test/src/tests/fee/pay_fee_async.rs +++ b/tools/integration-test/src/tests/fee/pay_fee_async.rs @@ -18,8 +18,6 @@ //! Finally, the test initializes the supervisor in order to relay the pending packets so that the //! balances on the two chains can be asserted. -use std::cmp::max; - use ibc_relayer_types::core::ics04_channel::version::Version; use ibc_relayer_types::events::IbcEvent; use ibc_test_framework::prelude::*; @@ -110,23 +108,15 @@ impl BinaryChannelTest for PayPacketFeeAsyncTest { Duration::from_secs(300), )?; - let total_sent = send_amount + receive_fee + ack_fee + timeout_fee; - - // Before ibc-go v8.1.0 the amount escrowed for ICS29 fees is the sum of recv, ack and timeout fees - let balance_a2_legacy = balance_a1.clone() - total_sent; - - // From ibc-go v8.1+ the amount escrowed for ICS29 fees is the highest value between recv + ack fees or timeout fee - let balance_a2 = balance_a1.clone() - send_amount - max(receive_fee + ack_fee, timeout_fee); + let balance_a2 = balance_a1.clone() - send_amount; - // This double check is required because ibc-go versions previous to v8.1.0 escrow recv, ack and timeout - // fees for ICS29. From ibc-go v8.1+ only the highest value between recv+ack and timeout is escrowed. - match chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &balance_a2_legacy.as_ref()) - { - Ok(()) => {} - Err(_) => chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &balance_a2.as_ref())?, - } + chain_driver_a.assert_eventual_escrowed_amount_ics29( + &user_a.address(), + &balance_a2.clone().as_ref(), + receive_fee, + ack_fee, + timeout_fee, + )?; let sequence = { let send_packet_event = events @@ -222,23 +212,13 @@ impl BinaryChannelTest for PayPacketFeeAsyncTest { &denom_a.with_amount(timeout_fee_2).as_ref(), )?; - let total_sent_2 = receive_fee_2 + ack_fee_2 + timeout_fee_2; - - // Before ibc-go v8.1.0 the amount escrowed for ICS29 fees is the sum of recv, ack and timeout fees - let balance_a3_legacy = balance_a2_legacy - total_sent_2; - - // From ibc-go v8.1+ the amount escrowed for ICS29 fees is the highest value between recv + ack fees or timeout fee - let balance_a3 = balance_a2 - max(receive_fee_2 + ack_fee_2, timeout_fee_2); - - // This double check is required because ibc-go versions previous to v8.1.0 escrow recv, ack and timeout - // fees for ICS29. From ibc-go v8.1+ only the highest value between recv+ack and timeout is escrowed. - match chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &balance_a3_legacy.as_ref()) - { - Ok(()) => {} - Err(_) => chain_driver_a - .assert_eventual_wallet_amount(&user_a.address(), &balance_a3.as_ref())?, - } + chain_driver_a.assert_eventual_escrowed_amount_ics29( + &user_a.address(), + &balance_a2.as_ref(), + receive_fee + receive_fee_2, + ack_fee + ack_fee_2, + timeout_fee + timeout_fee_2, + )?; { let event = events2 diff --git a/tools/test-framework/src/chain/driver.rs b/tools/test-framework/src/chain/driver.rs index 4b3414c554..9fbbddcaeb 100644 --- a/tools/test-framework/src/chain/driver.rs +++ b/tools/test-framework/src/chain/driver.rs @@ -2,11 +2,11 @@ Implementation of [`ChainDriver`]. */ -use core::time::Duration; - use alloc::sync::Arc; +use core::time::Duration; use eyre::eyre; use ibc_relayer::config::compat_mode::CompatMode; +use std::cmp::max; use tokio::runtime::Runtime; use ibc_relayer::chain::cosmos::types::config::TxConfig; @@ -232,4 +232,63 @@ impl ChainDriver { Ok(()) } + + /** + Assert that a wallet should eventually have escrowed the amount for ICS29 + fees of a given denomination. + Legacy ICS29 will escrow recv_fee + ack_fee + timeout_fee while more recent + versions will escrow max(recv_fee + ack_fee, timeout_fee). + */ + pub fn assert_eventual_escrowed_amount_ics29( + &self, + wallet: &WalletAddress, + token: &Token, + recv_fee: u128, + ack_fee: u128, + timeout_fee: u128, + ) -> Result<(), Error> { + assert_eventually_succeed( + &format!("wallet reach {wallet} amount {token}"), + WAIT_WALLET_AMOUNT_ATTEMPTS, + Duration::from_secs(1), + || { + let amount: Amount = self.query_balance(wallet, &token.denom)?; + + let legacy_escrow = token + .amount + .checked_sub(recv_fee + ack_fee + timeout_fee) + .ok_or_else(|| { + Error::generic(eyre!( + "error computing the following subtraction: {}-{}", + token.amount, + recv_fee + ack_fee + timeout_fee + )) + })?; + let escrow = token + .amount + .checked_sub(max(recv_fee + ack_fee, timeout_fee)) + .ok_or_else(|| { + Error::generic(eyre!( + "error computing the following subtraction: {}-{}", + token.amount, + max(recv_fee + ack_fee, timeout_fee) + )) + })?; + + // Assert either the legacy or current ICS29 amount has been escrowed + if amount == legacy_escrow || amount == escrow { + Ok(()) + } else { + Err(Error::generic(eyre!( + "current balance of account {} with amount {} does not match the target amount {}", + wallet, + amount, + token + ))) + } + }, + )?; + + Ok(()) + } } diff --git a/tools/test-framework/src/chain/tagged.rs b/tools/test-framework/src/chain/tagged.rs index 64b73ef171..8a17e8df55 100644 --- a/tools/test-framework/src/chain/tagged.rs +++ b/tools/test-framework/src/chain/tagged.rs @@ -71,6 +71,23 @@ pub trait TaggedChainDriverExt { token: &TaggedTokenRef, ) -> Result<(), Error>; + /** + Tagged version of [`ChainDriver::assert_eventual_escrowed_amount_ics29`]. + + Assert that a wallet should eventually have escrowed the amount for ICS29 + fees of a given denomination. + Legacy ICS29 will escrow recv_fee + ack_fee + timeout_fee while more recent + versions will escrow max(recv_fee + ack_fee, timeout_fee). + */ + fn assert_eventual_escrowed_amount_ics29( + &self, + user: &MonoTagged, + token: &TaggedTokenRef, + recv_fee: u128, + ack_fee: u128, + timeout_fee: u128, + ) -> Result<(), Error>; + /** Tagged version of [`query_recipient_transactions`]. @@ -151,6 +168,23 @@ impl<'a, Chain: Send> TaggedChainDriverExt for MonoTagged, + token: &TaggedTokenRef, + recv_fee: u128, + ack_fee: u128, + timeout_fee: u128, + ) -> Result<(), Error> { + self.value().assert_eventual_escrowed_amount_ics29( + user.value(), + token.value(), + recv_fee, + ack_fee, + timeout_fee, + ) + } + fn query_recipient_transactions( &self, recipient_address: &MonoTagged, From b9b666368ed4ec7a2a783a661180b9cfe2c532d3 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:17:17 +0200 Subject: [PATCH 133/200] Allow ranges for `excluded_sequences` config option (#4051) * Add new ExcludedSequences struct with custom deserialisation/serialisation * Use ExcludedSequences struct for 'excluded_sequences' configuration * Fix sequence_filter test * Add changelog entry * Improve example config for 'exclude_sequences' * Add default implementation to ExcludedSequences * Only allow '-' as separator for 'excluded_sequences' configuration --- .../4047-improve-excluded-sequences-config.md | 11 ++ config.toml | 12 +- crates/relayer-cli/src/chain_registry.rs | 3 +- crates/relayer/src/chain/cosmos.rs | 4 +- crates/relayer/src/chain/cosmos/config.rs | 7 +- .../relayer/src/chain/cosmos/config/error.rs | 38 ++++++ crates/relayer/src/config.rs | 36 +++++- crates/relayer/src/util.rs | 1 + crates/relayer/src/util/excluded_sequences.rs | 113 ++++++++++++++++++ .../config/fixtures/relayer_conf_example.toml | 8 +- ...nf_example_invalid_excluded_sequences.toml | 68 +++++++++++ .../src/tests/sequence_filter.rs | 7 +- tools/test-framework/src/types/single/node.rs | 3 +- 13 files changed, 291 insertions(+), 20 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/4047-improve-excluded-sequences-config.md create mode 100644 crates/relayer/src/util/excluded_sequences.rs create mode 100644 crates/relayer/tests/config/fixtures/relayer_conf_example_invalid_excluded_sequences.toml diff --git a/.changelog/unreleased/improvements/ibc-relayer/4047-improve-excluded-sequences-config.md b/.changelog/unreleased/improvements/ibc-relayer/4047-improve-excluded-sequences-config.md new file mode 100644 index 0000000000..19de3111df --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/4047-improve-excluded-sequences-config.md @@ -0,0 +1,11 @@ +- Improve the `excluded_sequences` configuration so that it now accepts + ranges of sequence values in addition to exact values. + Accepted format: + * Exact sequence, e.g. [1, 2, 3] + * "-" separator, e.g. ["1-3"] + + These can be combined making the following configurations equivalent: + * `excluded_sequences = { 'channel-0' = [1, "3-5", 7, "9-12"] }` + * `excluded_sequences = { 'channel-0' = [1, 3, 4, 5, 7, 9, 10, 11, 12] }` + + ([\#4047](https://github.com/informalsystems/hermes/issues/4047)) \ No newline at end of file diff --git a/config.toml b/config.toml index 897814008d..b7542579ca 100644 --- a/config.toml +++ b/config.toml @@ -443,15 +443,15 @@ memo_prefix = '' # Specify packet sequences which should not be cleared, per channel. # -# For each channel, specify a list of sequences which should not be cleared, eg. +# For each channel, specify a list of sequences which should not be cleared. Acceptable value +# include range of sequences with separator "-", eg. # -# excluded_sequences = [ -# ['channel-0', [1, 2, 3]], -# ['channel-1', [4, 5, 6]] -# ] +# [chains.excluded_sequences] +# channel-0 = [1, 2, "3-7", 9, 11], +# channel-1 = [4, 5, 6], # # Default: No filter -# excluded_sequences = [] +# excluded_sequences = {} [[chains]] id = 'ibc-1' diff --git a/crates/relayer-cli/src/chain_registry.rs b/crates/relayer-cli/src/chain_registry.rs index a0152b0af2..c52e6190db 100644 --- a/crates/relayer-cli/src/chain_registry.rs +++ b/crates/relayer-cli/src/chain_registry.rs @@ -24,6 +24,7 @@ use ibc_relayer::config::gas_multiplier::GasMultiplier; use ibc_relayer::config::types::{MaxMsgNum, MaxTxSize, Memo, TrustThreshold}; use ibc_relayer::config::{default, AddressType, ChainConfig, EventSourceMode, GasPrice}; use ibc_relayer::keyring::Store; +use ibc_relayer::util::excluded_sequences::ExcludedSequences; const MAX_HEALTHY_QUERY_RETRIES: u8 = 5; @@ -167,7 +168,7 @@ where extension_options: Vec::new(), compat_mode: None, clear_interval: None, - excluded_sequences: BTreeMap::new(), + excluded_sequences: ExcludedSequences::new(BTreeMap::new()), })) } diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 6cd8916905..ae1291a625 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -2567,8 +2567,8 @@ fn do_health_check(chain: &CosmosSdkChain) -> Result<(), Error> { let grpc_address = chain.grpc_addr.to_string(); let rpc_address = chain.config.rpc_addr.to_string(); - if !chain.config.excluded_sequences.is_empty() { - for (channel_id, seqs) in chain.config.excluded_sequences.iter() { + if !chain.config.excluded_sequences.map.is_empty() { + for (channel_id, seqs) in chain.config.excluded_sequences.map.iter() { if !seqs.is_empty() { warn!( "chain '{chain_id}' will not clear packets on channel '{channel_id}' with sequences: {}. \ diff --git a/crates/relayer/src/chain/cosmos/config.rs b/crates/relayer/src/chain/cosmos/config.rs index 5e85f2a11d..3993c653b9 100644 --- a/crates/relayer/src/chain/cosmos/config.rs +++ b/crates/relayer/src/chain/cosmos/config.rs @@ -1,14 +1,12 @@ use core::time::Duration; -use std::collections::BTreeMap; use std::path::PathBuf; use byte_unit::Byte; -use ibc_relayer_types::core::ics04_channel::packet::Sequence; use serde_derive::{Deserialize, Serialize}; use tendermint_rpc::Url; use ibc_relayer_types::core::ics23_commitment::specs::ProofSpecs; -use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId}; +use ibc_relayer_types::core::ics24_host::identifier::ChainId; use crate::chain::cosmos::config::error::Error as ConfigError; use crate::config::compat_mode::CompatMode; @@ -20,6 +18,7 @@ use crate::config::{ }; use crate::config::{default, RefreshRate}; use crate::keyring::Store; +use crate::util::excluded_sequences::ExcludedSequences; pub mod error; @@ -149,7 +148,7 @@ pub struct CosmosSdkConfig { pub compat_mode: Option, pub clear_interval: Option, #[serde(default)] - pub excluded_sequences: BTreeMap>, + pub excluded_sequences: ExcludedSequences, } impl CosmosSdkConfig { diff --git a/crates/relayer/src/chain/cosmos/config/error.rs b/crates/relayer/src/chain/cosmos/config/error.rs index 5980ad9ac4..545f845609 100644 --- a/crates/relayer/src/chain/cosmos/config/error.rs +++ b/crates/relayer/src/chain/cosmos/config/error.rs @@ -1,4 +1,6 @@ use flex_error::define_error; +use flex_error::TraceError; + use ibc_relayer_types::core::ics02_client::trust_threshold::TrustThreshold; use ibc_relayer_types::core::ics24_host::identifier::ChainId; @@ -28,5 +30,41 @@ define_error! { e.chain_id, e.gas_adjustment, e.gas_multiplier ) }, + + ExpectedExcludedSequencesArray + |_| { "expected excluded_sequences to be an array of values" }, + + InvalidExcludedSequencesSeparator + { separator: String } + |e| { + format!("excluded_sequences range `{}` is invalid, only '..', '..=' and '-' are valid separators", e.separator) + }, + + MissingStartExcludedSequence + { entry: String } + |e| { + format!("missing the excluded sequence value before the separator in the entry `{}`", e.entry) + }, + + MissingEndExcludedSequence + { entry: String } + |e| { + format!("missing the excluded sequence value after the separator in the entry `{}`", e.entry) + }, + + ParsingStartExcludedSequenceFailed + { entry: String } + [ TraceError ] + |e| { + format!("Error parsing starting sequence as integer in entry `{}`", e.entry) + }, + + + ParsingEndExcludedSequenceFailed + { entry: String } + [ TraceError ] + |e| { + format!("Error parsing ending sequence as integer in entry `{}`", e.entry) + }, } } diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index 973a0d400a..066bd93a97 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -719,6 +719,7 @@ impl ChainConfig { match self { Self::CosmosSdk(config) => config .excluded_sequences + .map .get(channel_id) .map(|seqs| Cow::Borrowed(seqs.as_slice())) .unwrap_or_else(|| Cow::Owned(Vec::new())), @@ -834,7 +835,7 @@ impl From for Error { mod tests { use core::str::FromStr; - use super::{load, parse_gas_prices, store_writer}; + use super::{load, parse_gas_prices, store_writer, ChainConfig}; use crate::config::GasPrice; use test_log::test; @@ -925,6 +926,39 @@ mod tests { store_writer(&config, &mut buffer).unwrap(); } + #[test] + fn serialize_valid_excluded_sequences_config() { + let path = concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/config/fixtures/relayer_conf_example.toml" + ); + + let config = load(path).expect("could not parse config"); + + let excluded_sequences1 = match config.chains.first().unwrap() { + ChainConfig::CosmosSdk(chain_config) => chain_config.excluded_sequences.clone(), + }; + + let excluded_sequences2 = match config.chains.last().unwrap() { + ChainConfig::CosmosSdk(chain_config) => chain_config.excluded_sequences.clone(), + }; + + assert_eq!(excluded_sequences1, excluded_sequences2); + + let mut buffer = Vec::new(); + store_writer(&config, &mut buffer).unwrap(); + } + + #[test] + fn serialize_invalid_excluded_sequences_config() { + let path = concat!( + env!("CARGO_MANIFEST_DIR"), + "/tests/config/fixtures/relayer_conf_example_invalid_excluded_sequences.toml" + ); + + assert!(load(path).is_err()); + } + #[test] fn gas_price_from_str() { let gp_original = GasPrice::new(10.0, "atom".to_owned()); diff --git a/crates/relayer/src/util.rs b/crates/relayer/src/util.rs index e589e8c7c8..852764ca50 100644 --- a/crates/relayer/src/util.rs +++ b/crates/relayer/src/util.rs @@ -5,6 +5,7 @@ pub mod collate; pub mod compat_mode; pub mod debug_section; pub mod diff; +pub mod excluded_sequences; pub mod iter; pub mod lock; pub mod pretty; diff --git a/crates/relayer/src/util/excluded_sequences.rs b/crates/relayer/src/util/excluded_sequences.rs new file mode 100644 index 0000000000..800a4c8c15 --- /dev/null +++ b/crates/relayer/src/util/excluded_sequences.rs @@ -0,0 +1,113 @@ +use serde::de::{Error, MapAccess, Visitor}; +use serde::ser::SerializeMap; +use serde::Deserializer; +use serde::Serializer; +use serde_derive::Deserialize; +use serde_derive::Serialize; +use std::collections::BTreeMap; +use std::fmt; +use std::str::FromStr; + +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics24_host::identifier::ChannelId; + +use crate::chain::cosmos::config::error::Error as ConfigError; + +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] +pub struct ExcludedSequences { + #[serde( + deserialize_with = "deserialize_excluded_sequences", + serialize_with = "serialize_excluded_sequences", + flatten + )] + pub map: BTreeMap>, +} + +impl ExcludedSequences { + pub fn new(map: BTreeMap>) -> Self { + Self { map } + } +} + +fn serialize_excluded_sequences( + map: &BTreeMap>, + serializer: S, +) -> Result +where + S: Serializer, +{ + let mut seq = serializer.serialize_map(Some(map.len()))?; + for (k, v) in map { + seq.serialize_entry(k, v)?; + } + seq.end() +} + +fn deserialize_excluded_sequences<'de, D>( + deserializer: D, +) -> Result>, D::Error> +where + D: Deserializer<'de>, +{ + deserializer.deserialize_map(ExcludedSequencesVisitor) +} + +struct ExcludedSequencesVisitor; + +impl<'de> Visitor<'de> for ExcludedSequencesVisitor { + type Value = BTreeMap>; + + fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { + formatter.write_str("expected list of excluded sequences") + } + + fn visit_map(self, mut access: M) -> Result + where + M: MapAccess<'de>, + { + let mut map = BTreeMap::new(); + while let Some((key, value)) = access.next_entry::()? { + let channel_id = ChannelId::from_str(&key).map_err(|e| Error::custom(e.to_string()))?; + let sequences = + parse_sequence_range(&value).map_err(|e| Error::custom(e.to_string()))?; + map.insert(channel_id, sequences); + } + Ok(map) + } +} + +fn parse_sequence_range(value: &toml::Value) -> Result, ConfigError> { + let mut res = Vec::new(); + let sequences = value + .as_array() + .ok_or_else(ConfigError::expected_excluded_sequences_array)?; + for sequence in sequences.iter() { + if let Some(seq_str) = sequence.as_str() { + let (start, end) = get_start_and_end(seq_str)?; + for i in start..=end { + let seq = Sequence::from(i); + res.push(seq); + } + } else if let Some(seq) = sequence.as_integer() { + let seq = Sequence::from(seq as u64); + res.push(seq); + } + } + Ok(res) +} + +fn get_start_and_end(value: &str) -> Result<(u64, u64), ConfigError> { + let split: Vec<&str> = value.split('-').collect(); + let start: u64 = split + .first() + .ok_or_else(|| ConfigError::missing_start_excluded_sequence(value.to_string()))? + .parse() + .map_err(|e| ConfigError::parsing_start_excluded_sequence_failed(value.to_string(), e))?; + let end: u64 = split + .last() + .ok_or_else(|| ConfigError::missing_end_excluded_sequence(value.to_string()))? + .parse() + .map_err(|e| ConfigError::parsing_end_excluded_sequence_failed(value.to_string(), e))?; + + Ok((start, end)) +} diff --git a/crates/relayer/tests/config/fixtures/relayer_conf_example.toml b/crates/relayer/tests/config/fixtures/relayer_conf_example.toml index f864efecda..6033872b07 100644 --- a/crates/relayer/tests/config/fixtures/relayer_conf_example.toml +++ b/crates/relayer/tests/config/fixtures/relayer_conf_example.toml @@ -39,7 +39,10 @@ max_tx_size = 1048576 clock_drift = '5s' trusting_period = '14days' trust_threshold = { numerator = '1', denominator = '3' } -address_type = { derivation = 'cosmos' } + +[chains.excluded_sequences] +channel-0 = [1, "3-5", 7, "9-12", 14, "17-19"] +channel-1 = ["3-6"] [chains.packet_filter] policy = 'allow' @@ -62,4 +65,5 @@ gas_price = { price = 0.001, denom = 'stake' } clock_drift = '5s' trusting_period = '14days' trust_threshold = { numerator = '1', denominator = '3' } -address_type = { derivation = 'ethermint', proto_type = { pk_type = '/injective.crypto.v1beta1.ethsecp256k1.PubKey' } } \ No newline at end of file +address_type = { derivation = 'ethermint', proto_type = { pk_type = '/injective.crypto.v1beta1.ethsecp256k1.PubKey' } } +excluded_sequences = { 'channel-0' = [1, 3, 4, 5, 7, 9, 10, 11, 12, 14, 17, 18, 19], 'channel-1' = [3, 4, 5, 6] } \ No newline at end of file diff --git a/crates/relayer/tests/config/fixtures/relayer_conf_example_invalid_excluded_sequences.toml b/crates/relayer/tests/config/fixtures/relayer_conf_example_invalid_excluded_sequences.toml new file mode 100644 index 0000000000..1e72497055 --- /dev/null +++ b/crates/relayer/tests/config/fixtures/relayer_conf_example_invalid_excluded_sequences.toml @@ -0,0 +1,68 @@ +[global] +log_level = 'error' + +[mode] + +[mode.clients] +enabled = true +refresh = true +misbehaviour = true + +[mode.connections] +enabled = false + +[mode.channels] +enabled = false + +[mode.packets] +enabled = true +clear_interval = 100 +clear_on_start = true +tx_confirmation = true +ics20_max_memo_size = { enabled = true, size = "32KiB" } +ics20_max_receiver_size = { enabled = true, size = "2KiB" } + +[[chains]] +type = "CosmosSdk" +id = 'chain_A' +rpc_addr = 'http://127.0.0.1:26657' +grpc_addr = 'http://127.0.0.1:9090' +event_source = { mode = 'push', url = 'ws://localhost:26657/websocket', batch_delay = '500ms' } +rpc_timeout = '10s' +account_prefix = 'cosmos' +key_name = 'testkey' +store_prefix = 'ibc' +max_gas = 200000 +gas_price = { price = 0.001, denom = 'stake' } +max_msg_num = 4 +max_tx_size = 1048576 +clock_drift = '5s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +excluded_sequences = [ + ['channel-0', [1, 2, 3]], + ['channel-1', [4, 5, 6]] +] + +[chains.packet_filter] +policy = 'allow' +list = [ + ['ica*', '*'], + ['transfer', 'channel-0'], +] + +[[chains]] +type = "CosmosSdk" +id = 'chain_B' +rpc_addr = 'http://127.0.0.1:26557' +grpc_addr = 'http://127.0.0.1:9090' +event_source = { mode = 'push', url = 'ws://localhost:26557/websocket', batch_delay = '500ms' } +rpc_timeout = '10s' +account_prefix = 'cosmos' +key_name = 'testkey' +store_prefix = 'ibc' +gas_price = { price = 0.001, denom = 'stake' } +clock_drift = '5s' +trusting_period = '14days' +trust_threshold = { numerator = '1', denominator = '3' } +address_type = { derivation = 'ethermint', proto_type = { pk_type = '/injective.crypto.v1beta1.ethsecp256k1.PubKey' } } \ No newline at end of file diff --git a/tools/integration-test/src/tests/sequence_filter.rs b/tools/integration-test/src/tests/sequence_filter.rs index 177773bf4a..a880f7720e 100644 --- a/tools/integration-test/src/tests/sequence_filter.rs +++ b/tools/integration-test/src/tests/sequence_filter.rs @@ -18,6 +18,7 @@ use std::collections::BTreeMap; use ibc_relayer::config::ChainConfig; +use ibc_relayer::util::excluded_sequences::ExcludedSequences; use ibc_test_framework::{ prelude::*, relayer::channel::{assert_eventually_channel_established, init_channel}, @@ -52,7 +53,7 @@ impl TestOverrides for FilterClearOnStartTest { let chain_a = &mut config.chains[0]; match chain_a { ChainConfig::CosmosSdk(chain_config) => { - chain_config.excluded_sequences = excluded_sequences; + chain_config.excluded_sequences = ExcludedSequences::new(excluded_sequences); } } config.mode.channels.enabled = true; @@ -89,7 +90,7 @@ impl TestOverrides for FilterClearIntervalTest { let chain_a = &mut config.chains[0]; match chain_a { ChainConfig::CosmosSdk(chain_config) => { - chain_config.excluded_sequences = excluded_sequences; + chain_config.excluded_sequences = ExcludedSequences::new(excluded_sequences); } } config.mode.channels.enabled = true; @@ -248,7 +249,7 @@ impl TestOverrides for StandardRelayingNoFilterTest { let chain_a = &mut config.chains[0]; match chain_a { ChainConfig::CosmosSdk(chain_config) => { - chain_config.excluded_sequences = excluded_sequences; + chain_config.excluded_sequences = ExcludedSequences::new(excluded_sequences); } } config.mode.packets.clear_on_start = true; diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index b6241c0ade..145b0a74f9 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -12,6 +12,7 @@ use ibc_relayer::config::compat_mode::CompatMode; use ibc_relayer::config::dynamic_gas::DynamicGasPrice; use ibc_relayer::config::gas_multiplier::GasMultiplier; use ibc_relayer::keyring::Store; +use ibc_relayer::util::excluded_sequences::ExcludedSequences; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use std::collections::BTreeMap; use std::sync::{Arc, RwLock}; @@ -198,7 +199,7 @@ impl FullNode { sequential_batch_tx: false, compat_mode, clear_interval: None, - excluded_sequences: BTreeMap::new(), + excluded_sequences: ExcludedSequences::new(BTreeMap::new()), })) } From 7e3f11ef38548352a5d73fd9082a0c441830d253 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:49:18 +0200 Subject: [PATCH 134/200] Allow disabling of ICS31 Cross Chain Queries (#4041) * Add configuration to disable relaying of ICS31 Cross Chain Queries * Update and add a test for ICS31 Cross Chain Queries * Add changelog entry * Add 'allow_ccq' config to example config with documentation * Add allow_ccq() method to ChainConfig --- .../ibc-relayer/4040-disable-ics31-icqs.md | 3 ++ config.toml | 7 +++++ crates/relayer-cli/src/chain_registry.rs | 1 + crates/relayer/src/chain/cosmos/config.rs | 3 ++ crates/relayer/src/config.rs | 10 ++++++ crates/relayer/src/worker.rs | 28 +++++++++++------ .../src/tests/interchain_security/icq.rs | 31 ++++++++++++++++--- .../src/chain/ext/crosschainquery.rs | 2 +- tools/test-framework/src/types/single/node.rs | 1 + 9 files changed, 71 insertions(+), 15 deletions(-) create mode 100644 .changelog/unreleased/features/ibc-relayer/4040-disable-ics31-icqs.md diff --git a/.changelog/unreleased/features/ibc-relayer/4040-disable-ics31-icqs.md b/.changelog/unreleased/features/ibc-relayer/4040-disable-ics31-icqs.md new file mode 100644 index 0000000000..98ea3ddc6d --- /dev/null +++ b/.changelog/unreleased/features/ibc-relayer/4040-disable-ics31-icqs.md @@ -0,0 +1,3 @@ +- Add a new per-chain configuration `allow_ccq` to enable or disable + relaying of ICS31 Cross Chain Query packets. + ([\#4040](https://github.com/informalsystems/hermes/issues/4040)) \ No newline at end of file diff --git a/config.toml b/config.toml index b7542579ca..ca679a9b3f 100644 --- a/config.toml +++ b/config.toml @@ -453,6 +453,13 @@ memo_prefix = '' # Default: No filter # excluded_sequences = {} +# Enable or disable relaying of ICS31 Cross Chain Query packets. +# If this configuration is set to false, Hermes will skip ICS31 +# Cross Chain Query packets. +# +# Default: true +# allow_ccq = true + [[chains]] id = 'ibc-1' rpc_addr = 'http://127.0.0.1:26557' diff --git a/crates/relayer-cli/src/chain_registry.rs b/crates/relayer-cli/src/chain_registry.rs index c52e6190db..f9fdb22d1d 100644 --- a/crates/relayer-cli/src/chain_registry.rs +++ b/crates/relayer-cli/src/chain_registry.rs @@ -169,6 +169,7 @@ where compat_mode: None, clear_interval: None, excluded_sequences: ExcludedSequences::new(BTreeMap::new()), + allow_ccq: true, })) } diff --git a/crates/relayer/src/chain/cosmos/config.rs b/crates/relayer/src/chain/cosmos/config.rs index 3993c653b9..911e147f32 100644 --- a/crates/relayer/src/chain/cosmos/config.rs +++ b/crates/relayer/src/chain/cosmos/config.rs @@ -149,6 +149,9 @@ pub struct CosmosSdkConfig { pub clear_interval: Option, #[serde(default)] pub excluded_sequences: ExcludedSequences, + + #[serde(default = "default::allow_ccq")] + pub allow_ccq: bool, } impl CosmosSdkConfig { diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index 066bd93a97..80e4923aa1 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -246,6 +246,10 @@ pub mod default { pub fn ics20_max_receiver_size() -> Ics20FieldSizeLimit { Ics20FieldSizeLimit::new(true, Byte::from_bytes(2048)) } + + pub fn allow_ccq() -> bool { + true + } } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -725,6 +729,12 @@ impl ChainConfig { .unwrap_or_else(|| Cow::Owned(Vec::new())), } } + + pub fn allow_ccq(&self) -> bool { + match self { + Self::CosmosSdk(config) => config.allow_ccq, + } + } } // /!\ Update me when adding a new chain type! diff --git a/crates/relayer/src/worker.rs b/crates/relayer/src/worker.rs index 4315c05581..2705919e6d 100644 --- a/crates/relayer/src/worker.rs +++ b/crates/relayer/src/worker.rs @@ -209,16 +209,24 @@ pub fn spawn_worker_tasks( } Object::CrossChainQuery(cross_chain_query) => { - let (cmd_tx, cmd_rx) = crossbeam_channel::unbounded(); - let cross_chain_query_task = cross_chain_query::spawn_cross_chain_query_worker( - chains.a.clone(), - chains.b, - cmd_rx, - cross_chain_query.clone(), - ); - task_handles.push(cross_chain_query_task); - - (Some(cmd_tx), None) + if config + .chains + .iter() + .any(|chain| chain.id() == &cross_chain_query.dst_chain_id && chain.allow_ccq()) + { + let (cmd_tx, cmd_rx) = crossbeam_channel::unbounded(); + let cross_chain_query_task = cross_chain_query::spawn_cross_chain_query_worker( + chains.a.clone(), + chains.b, + cmd_rx, + cross_chain_query.clone(), + ); + task_handles.push(cross_chain_query_task); + + (Some(cmd_tx), None) + } else { + (None, None) + } } }; diff --git a/tools/integration-test/src/tests/interchain_security/icq.rs b/tools/integration-test/src/tests/interchain_security/icq.rs index 3c78fbac3e..19f2a84efb 100644 --- a/tools/integration-test/src/tests/interchain_security/icq.rs +++ b/tools/integration-test/src/tests/interchain_security/icq.rs @@ -9,6 +9,7 @@ //! The test then waits for a Cross-chain Query to be pending and //! then processed. +use ibc_relayer::config::ChainConfig; use ibc_test_framework::chain::cli::host_zone::register_host_zone; use ibc_test_framework::chain::config::{ set_crisis_denom, set_mint_mint_denom, set_staking_bond_denom, set_staking_max_entries, @@ -27,10 +28,17 @@ use ibc_test_framework::util::random::random_u128_range; #[test] fn test_ics31_cross_chain_queries() -> Result<(), Error> { - run_binary_interchain_security_channel_test(&InterchainSecurityIcqTest) + run_binary_interchain_security_channel_test(&InterchainSecurityIcqTest { allow_ccq: true }) } -struct InterchainSecurityIcqTest; +#[test] +fn test_disable_ics31_cross_chain_queries() -> Result<(), Error> { + run_binary_interchain_security_channel_test(&InterchainSecurityIcqTest { allow_ccq: false }) +} + +struct InterchainSecurityIcqTest { + pub allow_ccq: bool, +} impl TestOverrides for InterchainSecurityIcqTest { fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { @@ -81,6 +89,14 @@ impl TestOverrides for InterchainSecurityIcqTest { config.mode.channels.enabled = true; update_relayer_config_for_consumer_chain(config); + + for chain in config.chains.iter_mut() { + match chain { + ChainConfig::CosmosSdk(chain_config) => { + chain_config.allow_ccq = self.allow_ccq; + } + } + } } } @@ -175,10 +191,17 @@ impl BinaryChannelTest for InterchainSecurityIcqTest { .assert_pending_cross_chain_query()?; // After there is a pending cross chain query, wait for it to be processed - chains + let processed_ccqs = chains .node_b .chain_driver() - .assert_processed_cross_chain_query()?; + .assert_processed_cross_chain_query(); + + if self.allow_ccq { + assert!(processed_ccqs.is_ok()); + } else { + assert!(processed_ccqs.is_err()); + } + Ok(()) } } diff --git a/tools/test-framework/src/chain/ext/crosschainquery.rs b/tools/test-framework/src/chain/ext/crosschainquery.rs index aca80110b8..f41f89abeb 100644 --- a/tools/test-framework/src/chain/ext/crosschainquery.rs +++ b/tools/test-framework/src/chain/ext/crosschainquery.rs @@ -14,7 +14,7 @@ use crate::types::tagged::MonoTagged; If you encounter retry error, verify the value of `stride_epoch`in the `stride_epoch` configuration in Stride's `genesis.toml` file. */ -const WAIT_CROSS_CHAIN_QUERY_ATTEMPTS: u16 = 100; +const WAIT_CROSS_CHAIN_QUERY_ATTEMPTS: u16 = 30; pub trait CrossChainQueryMethodsExt { fn assert_pending_cross_chain_query(&self) -> Result<(), Error>; diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index 145b0a74f9..fd19ebbd3f 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -200,6 +200,7 @@ impl FullNode { compat_mode, clear_interval: None, excluded_sequences: ExcludedSequences::new(BTreeMap::new()), + allow_ccq: true, })) } From ddc0dd861de05f325b19aa9e729596a01f8323a4 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Fri, 21 Jun 2024 15:31:04 +0200 Subject: [PATCH 135/200] Update UID and GID to 2000 in Hermes Dockerfile used for images (#4059) --- ci/release/hermes.Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/release/hermes.Dockerfile b/ci/release/hermes.Dockerfile index 5da3f2c6e1..8540b2446b 100644 --- a/ci/release/hermes.Dockerfile +++ b/ci/release/hermes.Dockerfile @@ -14,8 +14,8 @@ RUN cargo build --release FROM ubuntu:latest LABEL maintainer="hello@informal.systems" -ARG UID=1000 -ARG GID=1000 +ARG UID=2000 +ARG GID=2000 RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates RUN update-ca-certificates From fc998de4c77f773a699e8713235f903e5ee375ef Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:01:52 +0200 Subject: [PATCH 136/200] Release Hermes v1.10.0 (#4061) * Update changelog.md with v1.10.0 * Create .changelog entry for v1.10.0 * Bump all version references * Update Cargo.lock * Update release date for v1.10.0 --- .../4034-ensure-no-dropped-events.md | 0 .../4021-chain-level-ccq-filter.md | 0 .../ibc-integration-test/4046-test-authz.md | 0 .../ibc-relayer/4040-disable-ics31-icqs.md | 0 .../4023-update-gaia-to-v17.md | 0 .../4024-update-osmosis-to-v25.md | 0 .../4025-update-juno-to-v22.md | 0 .../4026-update-neutron-to-v305.md | 0 .../4027-update-celestia-to-v1-11.md | 0 .../4029-update-wasmd-to-v051.md | 0 .../4053-reduce-ics29-tests-run-time.md | 0 .../4099-specify-topology-for-nary-tests.md | 0 .../ibc-relayer/3979-add-custom-user-agent.md | 0 ...45-trim-whitespaces-channel-port-filter.md | 0 .../4047-improve-excluded-sequences-config.md | 0 .changelog/v1.10.0/summary.md | 11 ++ CHANGELOG.md | 78 +++++++++++ Cargo.lock | 130 +++++++++--------- Cargo.toml | 16 +-- crates/chain-registry/Cargo.toml | 2 +- crates/relayer-cli/Cargo.toml | 2 +- crates/relayer-rest/Cargo.toml | 2 +- crates/relayer-rest/tests/mock.rs | 2 +- crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 2 +- crates/relayer/src/lib.rs | 4 +- crates/telemetry/Cargo.toml | 2 +- guide/README.md | 2 +- guide/src/SUMMARY.md | 2 +- tools/integration-test/Cargo.toml | 2 +- tools/test-framework/Cargo.toml | 2 +- 31 files changed, 175 insertions(+), 86 deletions(-) rename .changelog/{unreleased => v1.10.0}/bug-fixes/4034-ensure-no-dropped-events.md (100%) rename .changelog/{unreleased => v1.10.0}/bug-fixes/ibc-relayer/4021-chain-level-ccq-filter.md (100%) rename .changelog/{unreleased => v1.10.0}/features/ibc-integration-test/4046-test-authz.md (100%) rename .changelog/{unreleased => v1.10.0}/features/ibc-relayer/4040-disable-ics31-icqs.md (100%) rename .changelog/{unreleased => v1.10.0}/improvements/ibc-integration-test/4023-update-gaia-to-v17.md (100%) rename .changelog/{unreleased => v1.10.0}/improvements/ibc-integration-test/4024-update-osmosis-to-v25.md (100%) rename .changelog/{unreleased => v1.10.0}/improvements/ibc-integration-test/4025-update-juno-to-v22.md (100%) rename .changelog/{unreleased => v1.10.0}/improvements/ibc-integration-test/4026-update-neutron-to-v305.md (100%) rename .changelog/{unreleased => v1.10.0}/improvements/ibc-integration-test/4027-update-celestia-to-v1-11.md (100%) rename .changelog/{unreleased => v1.10.0}/improvements/ibc-integration-test/4029-update-wasmd-to-v051.md (100%) rename .changelog/{unreleased => v1.10.0}/improvements/ibc-integration-test/4053-reduce-ics29-tests-run-time.md (100%) rename .changelog/{unreleased => v1.10.0}/improvements/ibc-integration-test/4099-specify-topology-for-nary-tests.md (100%) rename .changelog/{unreleased => v1.10.0}/improvements/ibc-relayer/3979-add-custom-user-agent.md (100%) rename .changelog/{unreleased => v1.10.0}/improvements/ibc-relayer/4045-trim-whitespaces-channel-port-filter.md (100%) rename .changelog/{unreleased => v1.10.0}/improvements/ibc-relayer/4047-improve-excluded-sequences-config.md (100%) create mode 100644 .changelog/v1.10.0/summary.md diff --git a/.changelog/unreleased/bug-fixes/4034-ensure-no-dropped-events.md b/.changelog/v1.10.0/bug-fixes/4034-ensure-no-dropped-events.md similarity index 100% rename from .changelog/unreleased/bug-fixes/4034-ensure-no-dropped-events.md rename to .changelog/v1.10.0/bug-fixes/4034-ensure-no-dropped-events.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/4021-chain-level-ccq-filter.md b/.changelog/v1.10.0/bug-fixes/ibc-relayer/4021-chain-level-ccq-filter.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer/4021-chain-level-ccq-filter.md rename to .changelog/v1.10.0/bug-fixes/ibc-relayer/4021-chain-level-ccq-filter.md diff --git a/.changelog/unreleased/features/ibc-integration-test/4046-test-authz.md b/.changelog/v1.10.0/features/ibc-integration-test/4046-test-authz.md similarity index 100% rename from .changelog/unreleased/features/ibc-integration-test/4046-test-authz.md rename to .changelog/v1.10.0/features/ibc-integration-test/4046-test-authz.md diff --git a/.changelog/unreleased/features/ibc-relayer/4040-disable-ics31-icqs.md b/.changelog/v1.10.0/features/ibc-relayer/4040-disable-ics31-icqs.md similarity index 100% rename from .changelog/unreleased/features/ibc-relayer/4040-disable-ics31-icqs.md rename to .changelog/v1.10.0/features/ibc-relayer/4040-disable-ics31-icqs.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4023-update-gaia-to-v17.md b/.changelog/v1.10.0/improvements/ibc-integration-test/4023-update-gaia-to-v17.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4023-update-gaia-to-v17.md rename to .changelog/v1.10.0/improvements/ibc-integration-test/4023-update-gaia-to-v17.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4024-update-osmosis-to-v25.md b/.changelog/v1.10.0/improvements/ibc-integration-test/4024-update-osmosis-to-v25.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4024-update-osmosis-to-v25.md rename to .changelog/v1.10.0/improvements/ibc-integration-test/4024-update-osmosis-to-v25.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4025-update-juno-to-v22.md b/.changelog/v1.10.0/improvements/ibc-integration-test/4025-update-juno-to-v22.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4025-update-juno-to-v22.md rename to .changelog/v1.10.0/improvements/ibc-integration-test/4025-update-juno-to-v22.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4026-update-neutron-to-v305.md b/.changelog/v1.10.0/improvements/ibc-integration-test/4026-update-neutron-to-v305.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4026-update-neutron-to-v305.md rename to .changelog/v1.10.0/improvements/ibc-integration-test/4026-update-neutron-to-v305.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4027-update-celestia-to-v1-11.md b/.changelog/v1.10.0/improvements/ibc-integration-test/4027-update-celestia-to-v1-11.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4027-update-celestia-to-v1-11.md rename to .changelog/v1.10.0/improvements/ibc-integration-test/4027-update-celestia-to-v1-11.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4029-update-wasmd-to-v051.md b/.changelog/v1.10.0/improvements/ibc-integration-test/4029-update-wasmd-to-v051.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4029-update-wasmd-to-v051.md rename to .changelog/v1.10.0/improvements/ibc-integration-test/4029-update-wasmd-to-v051.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4053-reduce-ics29-tests-run-time.md b/.changelog/v1.10.0/improvements/ibc-integration-test/4053-reduce-ics29-tests-run-time.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4053-reduce-ics29-tests-run-time.md rename to .changelog/v1.10.0/improvements/ibc-integration-test/4053-reduce-ics29-tests-run-time.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4099-specify-topology-for-nary-tests.md b/.changelog/v1.10.0/improvements/ibc-integration-test/4099-specify-topology-for-nary-tests.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4099-specify-topology-for-nary-tests.md rename to .changelog/v1.10.0/improvements/ibc-integration-test/4099-specify-topology-for-nary-tests.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/3979-add-custom-user-agent.md b/.changelog/v1.10.0/improvements/ibc-relayer/3979-add-custom-user-agent.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/3979-add-custom-user-agent.md rename to .changelog/v1.10.0/improvements/ibc-relayer/3979-add-custom-user-agent.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4045-trim-whitespaces-channel-port-filter.md b/.changelog/v1.10.0/improvements/ibc-relayer/4045-trim-whitespaces-channel-port-filter.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/4045-trim-whitespaces-channel-port-filter.md rename to .changelog/v1.10.0/improvements/ibc-relayer/4045-trim-whitespaces-channel-port-filter.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4047-improve-excluded-sequences-config.md b/.changelog/v1.10.0/improvements/ibc-relayer/4047-improve-excluded-sequences-config.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/4047-improve-excluded-sequences-config.md rename to .changelog/v1.10.0/improvements/ibc-relayer/4047-improve-excluded-sequences-config.md diff --git a/.changelog/v1.10.0/summary.md b/.changelog/v1.10.0/summary.md new file mode 100644 index 0000000000..8da54c60a8 --- /dev/null +++ b/.changelog/v1.10.0/summary.md @@ -0,0 +1,11 @@ +*June 24th, 2024* + +This release enhances filter configurations and includes the following updates: + +1. `excluded_sequences` supports sequence ranges in addition to exact values, + e.g. `[1, 2, "5-10", 13]` is now valid. +2. `packet_filter` now ignores unintended whitespace. +3. A new `allow_ccq` per-chain configuration has been added to skip the relaying of + ICS31 Cross Chain Queries. + +Additionally, various improvements to testing and bug fixes have been implemented. diff --git a/CHANGELOG.md b/CHANGELOG.md index c0bf96065e..873ec5bb35 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,83 @@ # CHANGELOG +## v1.10.0 + +*June 24th, 2024* + +This release enhances filter configurations and includes the following updates: + +1. `excluded_sequences` supports sequence ranges in addition to exact values, + e.g. `[1, 2, "5-10", 13]` is now valid. +2. `packet_filter` now ignores unintended whitespace. +3. A new `allow_ccq` per-chain configuration has been added to skip the relaying of + ICS31 Cross Chain Queries. + +Additionally, various improvements to testing and bug fixes have been implemented. + +### BUG FIXES + +- General + - Fix a bug where in some cases, Hermes would drop all events in a + batch that came after an event rejected by the filtering policy + ([\#4034](https://github.com/informalsystems/hermes/issues/4034)) +- [Relayer Library](relayer) + - Discard CrossChain queries intended for unconfigured chains. + ([\#4021](https://github.com/informalsystems/hermes/issues/4021)) + +### FEATURES + +- [Integration Test Framework](tools/test-framework) + - Add tests to ensure that Hermes correctly relays transfer messages + from a grantee address with granted authorisation using `authz` module. + ([\#4046](https://github.com/informalsystems/hermes/issues/4046)) +- [Relayer Library](relayer) + - Add a new per-chain configuration `allow_ccq` to enable or disable + relaying of ICS31 Cross Chain Query packets. + ([\#4040](https://github.com/informalsystems/hermes/issues/4040)) + +### IMPROVEMENTS + +- [Integration Test Framework](tools/test-framework) + - Update the version of Gaia running the integration tests in the CI from `v15.2.0` + to `v17.2.0` ([\#4023](https://github.com/informalsystems/hermes/issues/4023)) + - Update the version of Osmosis running the integration tests in the CI from `v24.0.1` + to `v25.0.0` ([\#4024](https://github.com/informalsystems/hermes/issues/4024)) + - Update the version of Juno running the integration tests in the CI from `v21.0.0` + to `v22.0.0` ([\#4025](https://github.com/informalsystems/hermes/issues/4025)) + - Update the version of Neutron running the integration tests in the CI from `v3.0.2` + to `v3.0.5` ([\#4026](https://github.com/informalsystems/hermes/issues/4026)) + - Update the version of Celestia app running the integration tests in the CI from `v1.4.0` + to `v1.11.0` ([\#4027](https://github.com/informalsystems/hermes/issues/4027)) + - Update the version of `wasmd` running the integration tests in the CI from `v0.50.0` + to `v0.51.0` ([\#4029](https://github.com/informalsystems/hermes/issues/4029)) + - Reduce run time for ICS29 tests by immediately verifying if either + the legacy fees, `recv_fee + ack_fee + timeout_fee` or current + fees, `max(recv_fee + ack_fee, timeout_fee)` have been escrowed. + ([\#4053](https://github.com/informalsystems/hermes/issues/4053)) + - Refactored the test-framework bootstrapping for n-ary chain tests + to utilize the specified topology. + * Currently, only linear, cyclic and fully connected topologies are supported. + ([\#4038](https://github.com/informalsystems/hermes/issues/4038)) +- [Relayer Library](relayer) + - Use custom User-Agent for Hermes queries + ([\#3979](https://github.com/informalsystems/hermes/issues/3979)) + - Updated the channel and port filter parsing to ignore whitespaces. + This will prevent unintended channel scanning due to accidental + whitespaces when exact matches are specified in the `packet_filter` + configuration. + ([\#4045](https://github.com/informalsystems/hermes/issues/4045)) + - Improve the `excluded_sequences` configuration so that it now accepts + ranges of sequence values in addition to exact values. + Accepted format: + * Exact sequence, e.g. [1, 2, 3] + * "-" separator, e.g. ["1-3"] + + These can be combined making the following configurations equivalent: + * `excluded_sequences = { 'channel-0' = [1, "3-5", 7, "9-12"] }` + * `excluded_sequences = { 'channel-0' = [1, 3, 4, 5, 7, 9, 10, 11, 12] }` + + ([\#4047](https://github.com/informalsystems/hermes/issues/4047)) + ## v1.9.0 *May 30th, 2024* diff --git a/Cargo.lock b/Cargo.lock index 57252b3ba9..e61ff701d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,9 +97,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] @@ -157,7 +157,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -168,7 +168,7 @@ checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -440,9 +440,9 @@ checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" [[package]] name = "cc" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" [[package]] name = "cfg-if" @@ -668,7 +668,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -736,7 +736,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -1069,7 +1069,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -1292,9 +1292,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -1320,9 +1320,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" dependencies = [ "bytes", "futures-channel", @@ -1370,7 +1370,7 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.28.0" +version = "0.29.0" dependencies = [ "async-trait", "flex-error", @@ -1390,7 +1390,7 @@ dependencies = [ [[package]] name = "ibc-integration-test" -version = "0.28.0" +version = "0.29.0" dependencies = [ "byte-unit", "http 0.2.12", @@ -1428,7 +1428,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.28.0" +version = "0.29.0" dependencies = [ "anyhow", "async-stream", @@ -1497,7 +1497,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "1.9.0" +version = "1.10.0" dependencies = [ "abscissa_core", "clap", @@ -1538,7 +1538,7 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.28.0" +version = "0.29.0" dependencies = [ "axum", "crossbeam-channel", @@ -1553,7 +1553,7 @@ dependencies = [ [[package]] name = "ibc-relayer-types" -version = "0.28.0" +version = "0.29.0" dependencies = [ "bytes", "derive_more", @@ -1584,7 +1584,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.28.0" +version = "0.29.0" dependencies = [ "axum", "dashmap", @@ -1603,7 +1603,7 @@ dependencies = [ [[package]] name = "ibc-test-framework" -version = "0.28.0" +version = "0.29.0" dependencies = [ "color-eyre", "crossbeam-channel", @@ -1832,9 +1832,9 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" @@ -1844,9 +1844,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -2148,7 +2148,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2222,9 +2222,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.84" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -2264,7 +2264,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2347,9 +2347,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ "bitflags 2.5.0", ] @@ -2373,8 +2373,8 @@ checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -2388,13 +2388,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -2405,9 +2405,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" @@ -2795,7 +2795,7 @@ checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2827,7 +2827,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2886,7 +2886,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -2980,9 +2980,9 @@ dependencies = [ [[package]] name = "simple-error" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8542b68b8800c3cda649d2c72d688b6907b30f1580043135d61669d4aad1c175" +checksum = "7e2accd2c41a0e920d2abd91b2badcfa1da784662f54fbc47e0e3a51f1e2e1cf" [[package]] name = "slab" @@ -3056,14 +3056,14 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" [[package]] name = "subtle-encoding" @@ -3093,9 +3093,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" dependencies = [ "proc-macro2", "quote", @@ -3359,7 +3359,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -3385,7 +3385,7 @@ checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -3508,7 +3508,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -3682,7 +3682,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] [[package]] @@ -3760,9 +3760,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b2cb4fbb9995eeb36ac86fadf24031ccd58f99d6b4b2d7b911db70bddb80d90" +checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" [[package]] name = "try-lock" @@ -3832,9 +3832,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -3856,9 +3856,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -3885,9 +3885,9 @@ checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -3965,7 +3965,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", "wasm-bindgen-shared", ] @@ -3999,7 +3999,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4192,9 +4192,9 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.9" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86c949fede1d13936a99f14fafd3e76fd642b556dd2ce96287fbe2e0151bfac6" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] @@ -4226,5 +4226,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.67", ] diff --git a/Cargo.toml b/Cargo.toml index 425ebd4be6..068cb85057 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,14 +20,14 @@ exclude = [ [workspace.dependencies] # Hermes dependencies -ibc-relayer-cli = { version = "1.9.0", path = "crates/relayer-cli" } -ibc-relayer = { version = "0.28.0", path = "crates/relayer" } -ibc-relayer-rest = { version = "0.28.0", path = "crates/relayer-rest" } -ibc-relayer-types = { version = "0.28.0", path = "crates/relayer-types" } -ibc-chain-registry = { version = "0.28.0", path = "crates/chain-registry" } -ibc-telemetry = { version = "0.28.0", path = "crates/telemetry" } -ibc-test-framework = { version = "0.28.0", path = "tools/test-framework" } -ibc-integration-test = { version = "0.28.0", path = "tools/integration-test" } +ibc-relayer-cli = { version = "1.10.0", path = "crates/relayer-cli" } +ibc-relayer = { version = "0.29.0", path = "crates/relayer" } +ibc-relayer-rest = { version = "0.29.0", path = "crates/relayer-rest" } +ibc-relayer-types = { version = "0.29.0", path = "crates/relayer-types" } +ibc-chain-registry = { version = "0.29.0", path = "crates/chain-registry" } +ibc-telemetry = { version = "0.29.0", path = "crates/telemetry" } +ibc-test-framework = { version = "0.29.0", path = "tools/test-framework" } +ibc-integration-test = { version = "0.29.0", path = "tools/integration-test" } # Tendermint dependencies tendermint = { version = "0.37.0", default-features = false } diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index 3b67a54933..e384ee88cb 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-chain-registry" -version = "0.28.0" +version = "0.29.0" edition = "2021" license = "Apache-2.0" keywords = ["cosmos", "ibc", "relayer", "chain", "registry"] diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index 11e64b42b9..9ded116107 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-cli" -version = "1.9.0" +version = "1.10.0" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index 3a5a87630e..f7ad7e9a78 100644 --- a/crates/relayer-rest/Cargo.toml +++ b/crates/relayer-rest/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-rest" -version = "0.28.0" +version = "0.29.0" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index 4029db0bc7..ddf4c7a036 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -64,7 +64,7 @@ async fn version() { let rest_api_version = VersionInfo { name: "ibc-relayer-rest".to_string(), - version: "0.28.0".to_string(), + version: "0.29.0".to_string(), }; let result: JsonResult<_, ()> = JsonResult::Success(vec![version.clone(), rest_api_version]); diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 1fb982d1b9..ef6c416300 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-types" -version = "0.28.0" +version = "0.29.0" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 4404510d12..eb2ae72040 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer" -version = "0.28.0" +version = "0.29.0" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index eb16353f62..576391b455 100644 --- a/crates/relayer/src/lib.rs +++ b/crates/relayer/src/lib.rs @@ -14,7 +14,7 @@ //! //! For the IBC relayer binary, please see [Hermes] (`ibc-relayer-cli` crate). //! -//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.9.0/ +//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.10.0/ extern crate alloc; @@ -48,4 +48,4 @@ pub mod upgrade_chain; pub mod util; pub mod worker; -pub const HERMES_VERSION: &str = "1.9.0"; +pub const HERMES_VERSION: &str = "1.10.0"; diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index 10454d2f25..f669d97192 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-telemetry" -version = "0.28.0" +version = "0.29.0" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/guide/README.md b/guide/README.md index f3cda2122f..da48d7ab98 100644 --- a/guide/README.md +++ b/guide/README.md @@ -10,7 +10,7 @@ mdBook is a utility to create modern online books from Markdown files. This guide should be permanently deployed at its latest stable version at [hermes.informal.systems](https://hermes.informal.systems). -Current version: `v1.8.3`. +Current version: `v1.10.0`. The version of this guide is aligned with the [versioning of the ibc crates](../README.md). diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index cf9b2de8c5..0368142aec 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -1,6 +1,6 @@ # Summary -# Hermes v1.8.0 +# Hermes v1.10.0 --- - [Introduction](./index.md) diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index b21a24a19b..12208449d4 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-integration-test" -version = "0.28.0" +version = "0.29.0" edition = "2021" rust-version = "1.76.0" license = "Apache-2.0" diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 730d2d5892..454c490c36 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-test-framework" -version = "0.28.0" +version = "0.29.0" edition = "2021" license = "Apache-2.0" readme = "README.md" From a69854a8e8c9cf653a44c9d88b2faab50725e07f Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:53:09 +0200 Subject: [PATCH 137/200] Fix url used for Integration badge (#4064) * Fix url used for Integration badge * Fix Integration badge to the state of branch 'master' --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0bf292f2e1..7dccced969 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ Unless required by applicable law or agreed to in writing, software distributed [build-image]: https://github.com/informalsystems/hermes/workflows/Rust/badge.svg [build-link]: https://github.com/informalsystems/hermes/actions?query=workflow%3ARust -[test-image]: https://github.com/informalsystems/hermes/workflows/Integration/badge.svg +[test-image]: https://github.com/informalsystems/hermes/actions/workflows/integration.yaml/badge.svg?branch=master [test-link]: https://github.com/informalsystems/hermes/actions?query=workflow%3A%22Integration%22 [license-image]: https://img.shields.io/badge/license-Apache_2.0-blue.svg [license-link]: https://github.com/informalsystems/hermes/blob/master/LICENSE From 1d120c43667479600f922c98c714780004c1b942 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 07:38:03 +0200 Subject: [PATCH 138/200] Bump uuid from 1.8.0 to 1.9.0 (#4065) Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.8.0 to 1.9.0. - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/1.8.0...1.9.0) --- updated-dependencies: - dependency-name: uuid dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e61ff701d7..c181cc02e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3891,9 +3891,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "3ea73390fe27785838dcbf75b91b1d84799e28f1ce71e6f372a5dc2200c80de5" dependencies = [ "getrandom", ] diff --git a/Cargo.toml b/Cargo.toml index 068cb85057..2f20984958 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -115,7 +115,7 @@ tonic = "0.11" tracing = { version = "0.1.36", default-features = false } tracing-subscriber = "0.3.14" uint = "0.9" -uuid = "1.8.0" +uuid = "1.9.0" [profile.release] overflow-checks = true From daa59e932a8dc8408a795e835b413c512aa7c24b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 25 Jun 2024 07:38:33 +0200 Subject: [PATCH 139/200] Bump docker/build-push-action from 5 to 6 (#4043) Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6. - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/v5...v6) --- updated-dependencies: - dependency-name: docker/build-push-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/docker.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bd2c49c0f2..859dfa424c 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -51,7 +51,7 @@ jobs: - name: Build and push by digest id: build - uses: docker/build-push-action@v5 + uses: docker/build-push-action@v6 with: context: . file: ./ci/release/hermes.Dockerfile From 80b16dc3626bd886fdfa9595c137adf1b82edafe Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 25 Jun 2024 08:20:26 +0200 Subject: [PATCH 140/200] Add `packet-forward` and `ica` features to tests running Osmosis (#4063) * Add '--fees' to local_transfer_token * Add packet-forward and ica features to tests running Osmosis * Add changelog entry --- .../3195-add-pfm-ica-features-to-osmosis.md | 3 +++ .github/workflows/integration.yaml | 2 +- tools/integration-test/src/mbt/handlers.rs | 2 ++ tools/integration-test/src/mbt/transfer.rs | 11 +++++++++-- .../src/tests/async_icq/simple_query.rs | 2 +- tools/integration-test/src/tests/authz.rs | 4 ++-- .../src/tests/channel_upgrade/ica.rs | 10 ++++++++-- tools/integration-test/src/tests/clear_packet.rs | 9 ++++++--- tools/integration-test/src/tests/client_upgrade.rs | 8 ++++---- tools/integration-test/src/tests/fee_grant.rs | 4 ++-- tools/integration-test/src/tests/ica.rs | 11 +++++++++-- .../interchain_security/ica_ordered_channel.rs | 5 ++++- .../src/tests/interchain_security/ica_transfer.rs | 5 ++++- tools/integration-test/src/tests/supervisor.rs | 10 ++++++++-- tools/test-framework/src/chain/cli/transfer.rs | 3 +++ tools/test-framework/src/chain/ext/transfer.rs | 3 +++ tools/test-framework/src/types/config.rs | 6 ++++++ tools/test-framework/src/types/single/node.rs | 13 ++++--------- 18 files changed, 79 insertions(+), 32 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/3195-add-pfm-ica-features-to-osmosis.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3195-add-pfm-ica-features-to-osmosis.md b/.changelog/unreleased/improvements/ibc-integration-test/3195-add-pfm-ica-features-to-osmosis.md new file mode 100644 index 0000000000..073bd29431 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/3195-add-pfm-ica-features-to-osmosis.md @@ -0,0 +1,3 @@ +- Add the features `packet-forward` and `ica` to enable + Packet Forward Middleware and ICA when running tests with Osmosis + ([\#3195](https://github.com/informalsystems/hermes/issues/3195)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index bec5a86434..05624fd340 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -74,7 +74,7 @@ jobs: command: osmosisd account_prefix: osmo native_token: stake - features: dynamic-gas-fee + features: dynamic-gas-fee,forward-packet,ica - package: juno command: junod account_prefix: juno diff --git a/tools/integration-test/src/mbt/handlers.rs b/tools/integration-test/src/mbt/handlers.rs index 32c445984e..53421f20c8 100644 --- a/tools/integration-test/src/mbt/handlers.rs +++ b/tools/integration-test/src/mbt/handlers.rs @@ -39,6 +39,7 @@ pub fn local_transfer_handler( target: u128, denom: u128, amount: u128, + fees: &TaggedTokenRef, ) -> Result<(), Error> { let wallets = node.wallets(); @@ -50,6 +51,7 @@ pub fn local_transfer_handler( &source_wallet, &target_wallet.address(), &denom.with_amount(amount).as_ref(), + fees, )?; Ok(()) diff --git a/tools/integration-test/src/mbt/transfer.rs b/tools/integration-test/src/mbt/transfer.rs index 846edc822f..9b8cfcf6a8 100644 --- a/tools/integration-test/src/mbt/transfer.rs +++ b/tools/integration-test/src/mbt/transfer.rs @@ -174,11 +174,13 @@ impl TestOverrides for IbcTransferMBT { impl BinaryChannelTest for IbcTransferMBT { fn run( &self, - _config: &TestConfig, + config: &TestConfig, relayer: RelayerDriver, chains: ConnectedChains, channels: ConnectedChannel, ) -> Result<(), Error> { + let fee_denom_a: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(0))); // relayer is spawned let mut supervisor = Some(relayer.spawn_supervisor()?); @@ -197,7 +199,12 @@ impl BinaryChannelTest for IbcTransferMBT { info!("[LocalTransfer] Init"); let node: Tagged = get_chain(&chains, *chain_id); super::handlers::local_transfer_handler( - node, *source, *target, *denom, *amount, + node, + *source, + *target, + *denom, + *amount, + &fee_denom_a.with_amount(1200u64).as_ref(), )?; info!("[LocalTransfer] Done"); } diff --git a/tools/integration-test/src/tests/async_icq/simple_query.rs b/tools/integration-test/src/tests/async_icq/simple_query.rs index f8343d1811..2efa49081f 100644 --- a/tools/integration-test/src/tests/async_icq/simple_query.rs +++ b/tools/integration-test/src/tests/async_icq/simple_query.rs @@ -53,7 +53,7 @@ impl BinaryConnectionTest for AsyncIcqTest { connection: ConnectedConnection, ) -> Result<(), Error> { let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(&config.native_tokens[0])); + MonoTagged::new(Denom::base(config.native_token(0))); let port_a = DualTagged::new(PortId::oracle()); let port_b = DualTagged::new(PortId::icqhost()); let (channel_id_b, channel_id_a) = init_channel_version( diff --git a/tools/integration-test/src/tests/authz.rs b/tools/integration-test/src/tests/authz.rs index 7b8e9e58fa..28f5c11a18 100644 --- a/tools/integration-test/src/tests/authz.rs +++ b/tools/integration-test/src/tests/authz.rs @@ -35,7 +35,7 @@ impl BinaryChannelTest for AuthzTest { ) -> Result<(), Error> { let denom_a = chains.node_a.denom(); let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(&config.native_tokens[0])); + MonoTagged::new(Denom::base(config.native_token(0))); let wallet_b = chains.node_b.wallets().user1().cloned(); let a_to_b_amount = 12345u64; @@ -120,7 +120,7 @@ impl BinaryChannelTest for NoAuthzTest { ) -> Result<(), Error> { let denom_a = chains.node_a.denom(); let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(&config.native_tokens[0])); + MonoTagged::new(Denom::base(config.native_token(0))); let wallet_b = chains.node_b.wallets().user1().cloned(); let a_to_b_amount = 12345u64; diff --git a/tools/integration-test/src/tests/channel_upgrade/ica.rs b/tools/integration-test/src/tests/channel_upgrade/ica.rs index 4b26c9d37b..1721bad2e0 100644 --- a/tools/integration-test/src/tests/channel_upgrade/ica.rs +++ b/tools/integration-test/src/tests/channel_upgrade/ica.rs @@ -85,11 +85,13 @@ impl TestOverrides for ChannelUpgradeICACloseChannel { impl BinaryConnectionTest for ChannelUpgradeICACloseChannel { fn run( &self, - _config: &TestConfig, + config: &TestConfig, relayer: RelayerDriver, chains: ConnectedChains, connection: ConnectedConnection, ) -> Result<(), Error> { + let fee_denom_host: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(1))); let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); // Run the block with supervisor in order to open and then upgrade the ICA channel @@ -219,6 +221,7 @@ impl BinaryConnectionTest for ChannelUpgradeICACloseChannel { &chains.node_b.wallets().user1(), &ica_address.as_ref(), &stake_denom.with_amount(ica_fund).as_ref(), + &fee_denom_host.with_amount(1200u64).as_ref(), )?; chains.node_b.chain_driver().assert_eventual_wallet_amount( @@ -335,11 +338,13 @@ impl TestOverrides for ChannelUpgradeICAUnordered { impl BinaryConnectionTest for ChannelUpgradeICAUnordered { fn run( &self, - _config: &TestConfig, + config: &TestConfig, _relayer: RelayerDriver, chains: ConnectedChains, connection: ConnectedConnection, ) -> Result<(), Error> { + let fee_denom_host: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(1))); let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); info!("Will register interchain account..."); @@ -377,6 +382,7 @@ impl BinaryConnectionTest for ChannelUpgradeICAUnordered { &chains.node_b.wallets().user1(), &ica_address.as_ref(), &stake_denom.with_amount(ica_fund).as_ref(), + &fee_denom_host.with_amount(1200u64).as_ref(), )?; chains.node_b.chain_driver().assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/clear_packet.rs b/tools/integration-test/src/tests/clear_packet.rs index ce9a94ada9..1bb19077ef 100644 --- a/tools/integration-test/src/tests/clear_packet.rs +++ b/tools/integration-test/src/tests/clear_packet.rs @@ -150,11 +150,13 @@ impl BinaryChannelTest for ClearPacketTest { impl BinaryChannelTest for ClearPacketRecoveryTest { fn run( &self, - _config: &TestConfig, + config: &TestConfig, relayer: RelayerDriver, chains: ConnectedChains, channel: ConnectedChannel, ) -> Result<(), Error> { + let fee_denom_b: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(1))); let denom_a = chains.node_a.denom(); let denom_b1 = chains.node_b.denom(); @@ -168,6 +170,7 @@ impl BinaryChannelTest for ClearPacketRecoveryTest { &relayer_wallet_b.as_ref(), &wallet_b.address(), &denom_b1.with_amount(100u64).as_ref(), + &fee_denom_b.with_amount(1200u64).as_ref(), )?; let amount1 = random_u128_range(1000, 5000); @@ -224,7 +227,7 @@ impl BinaryChannelTest for ClearPacketNoScanTest { channel: ConnectedChannel, ) -> Result<(), Error> { let denom_a = chains.node_a.denom(); - let fee_denom_a = MonoTagged::new(Denom::base(&config.native_tokens[0])); + let fee_denom_a = MonoTagged::new(Denom::base(config.native_token(0))); let wallet_a = chains.node_a.wallets().user1().cloned(); let wallet_b = chains.node_b.wallets().user1().cloned(); @@ -344,7 +347,7 @@ impl BinaryChannelTest for ClearPacketOverrideTest { channel: ConnectedChannel, ) -> Result<(), Error> { let denom_a = chains.node_a.denom(); - let fee_denom_a = MonoTagged::new(Denom::base(&config.native_tokens[0])); + let fee_denom_a = MonoTagged::new(Denom::base(config.native_token(0))); let wallet_a = chains.node_a.wallets().user1().cloned(); let wallet_b = chains.node_b.wallets().user1().cloned(); diff --git a/tools/integration-test/src/tests/client_upgrade.rs b/tools/integration-test/src/tests/client_upgrade.rs index e6f94a0336..9480a4a105 100644 --- a/tools/integration-test/src/tests/client_upgrade.rs +++ b/tools/integration-test/src/tests/client_upgrade.rs @@ -83,7 +83,7 @@ impl BinaryChainTest for ClientUpgradeTest { ) -> Result<(), ibc_test_framework::prelude::Error> { let upgraded_chain_id = ChainId::new("upgradedibc".to_owned(), 1); let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(&config.native_tokens[0])); + MonoTagged::new(Denom::base(config.native_token(0))); let foreign_clients = chains.clone().foreign_clients; // Create and send an chain upgrade proposal @@ -242,7 +242,7 @@ impl BinaryChainTest for HeightTooHighClientUpgradeTest { ) -> Result<(), ibc_test_framework::prelude::Error> { let upgraded_chain_id = ChainId::new("upgradedibc".to_owned(), 1); let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(&config.native_tokens[0])); + MonoTagged::new(Denom::base(config.native_token(0))); let foreign_clients = chains.clone().foreign_clients; // Create and send an chain upgrade proposal @@ -340,7 +340,7 @@ impl BinaryChainTest for HeightTooLowClientUpgradeTest { ) -> Result<(), ibc_test_framework::prelude::Error> { let upgraded_chain_id = ChainId::new("upgradedibc".to_owned(), 1); let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(&config.native_tokens[0])); + MonoTagged::new(Denom::base(config.native_token(0))); let foreign_clients = chains.clone().foreign_clients; let opts = create_upgrade_plan(config, &chains, &upgraded_chain_id)?; @@ -433,7 +433,7 @@ fn create_upgrade_plan( upgraded_chain_id: &ChainId, ) -> Result { let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(&config.native_tokens[0])); + MonoTagged::new(Denom::base(config.native_token(0))); let foreign_clients = chains.clone().foreign_clients; let src_client_id = foreign_clients.client_id_b().0.clone(); diff --git a/tools/integration-test/src/tests/fee_grant.rs b/tools/integration-test/src/tests/fee_grant.rs index f12e30a981..a936c02e20 100644 --- a/tools/integration-test/src/tests/fee_grant.rs +++ b/tools/integration-test/src/tests/fee_grant.rs @@ -42,7 +42,7 @@ impl BinaryChannelTest for FeeGrantTest { let denom_a = chains.node_a.denom(); let wallet_a = chains.node_a.wallets().user1().cloned(); let wallet_b = chains.node_b.wallets().user1().cloned(); - let fee_denom_a = MonoTagged::new(Denom::base(&config.native_tokens[0])); + let fee_denom_a = MonoTagged::new(Denom::base(config.native_token(0))); let a_to_b_amount = 12345u64; let granter = chains @@ -185,7 +185,7 @@ impl BinaryChannelTest for NoFeeGrantTest { let wallet_a = chains.node_a.wallets().user1().cloned(); let wallet_a2 = chains.node_a.wallets().user2().cloned(); let wallet_b = chains.node_b.wallets().user1().cloned(); - let fee_denom_a = MonoTagged::new(Denom::base(&config.native_tokens[0])); + let fee_denom_a = MonoTagged::new(Denom::base(config.native_token(0))); let a_to_b_amount = 12345u64; let granter = chains diff --git a/tools/integration-test/src/tests/ica.rs b/tools/integration-test/src/tests/ica.rs index a6b8427a89..8087a671a1 100644 --- a/tools/integration-test/src/tests/ica.rs +++ b/tools/integration-test/src/tests/ica.rs @@ -67,6 +67,7 @@ impl TestOverrides for IcaFilterTestAllow { // Enable channel workers and allow relaying on ICA channels fn modify_relayer_config(&self, config: &mut Config) { config.mode.channels.enabled = true; + config.mode.clients.misbehaviour = false; for chain in &mut config.chains { match chain { @@ -88,11 +89,13 @@ impl TestOverrides for IcaFilterTestAllow { impl BinaryConnectionTest for IcaFilterTestAllow { fn run( &self, - _config: &TestConfig, + config: &TestConfig, _relayer: RelayerDriver, chains: ConnectedChains, connection: ConnectedConnection, ) -> Result<(), Error> { + let fee_denom_host: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(1))); // Register an interchain account on behalf of // controller wallet `user1` where the counterparty chain is the interchain accounts host. let (wallet, channel_id, port_id) = @@ -126,6 +129,7 @@ impl BinaryConnectionTest for IcaFilterTestAllow { &chains.node_b.wallets().user1(), &ica_address.as_ref(), &stake_denom.with_amount(ica_fund).as_ref(), + &fee_denom_host.with_amount(1200u64).as_ref(), )?; chains.node_b.chain_driver().assert_eventual_wallet_amount( @@ -242,11 +246,13 @@ impl TestOverrides for ICACloseChannelTest { impl BinaryConnectionTest for ICACloseChannelTest { fn run( &self, - _config: &TestConfig, + config: &TestConfig, relayer: RelayerDriver, chains: ConnectedChains, connection: ConnectedConnection, ) -> Result<(), Error> { + let fee_denom_host: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(1))); let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); let (wallet, ica_address, controller_channel_id, controller_port_id) = relayer .with_supervisor(|| { @@ -293,6 +299,7 @@ impl BinaryConnectionTest for ICACloseChannelTest { &chains.node_b.wallets().user1(), &ica_address.as_ref(), &stake_denom.with_amount(ica_fund).as_ref(), + &fee_denom_host.with_amount(1200u64).as_ref(), )?; chains.node_b.chain_driver().assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs b/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs index ade71f8132..04fad4bcee 100644 --- a/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs +++ b/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs @@ -66,11 +66,13 @@ impl TestOverrides for IcaOrderedChannelTest { impl BinaryChannelTest for IcaOrderedChannelTest { fn run( &self, - _config: &TestConfig, + config: &TestConfig, relayer: RelayerDriver, chains: ConnectedChains, channel: ConnectedChannel, ) -> Result<(), Error> { + let fee_denom_a: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(0))); let connection_b_to_a = channel.connection.clone().flip(); let (wallet, channel_id, port_id) = register_interchain_account(&chains.node_b, chains.handle_b(), &connection_b_to_a)?; @@ -113,6 +115,7 @@ impl BinaryChannelTest for IcaOrderedChannelTest { &chains.node_a.wallets().user1(), &ica_address.as_ref(), &stake_denom.with_amount(ica_fund).as_ref(), + &fee_denom_a.with_amount(1200u64).as_ref(), )?; chains.node_a.chain_driver().assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs index 28d05cad91..b09fe79c7f 100644 --- a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs +++ b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs @@ -49,11 +49,13 @@ impl TestOverrides for InterchainSecurityIcaTransferTest { impl BinaryChannelTest for InterchainSecurityIcaTransferTest { fn run( &self, - _config: &TestConfig, + config: &TestConfig, _relayer: RelayerDriver, chains: ConnectedChains, channel: ConnectedChannel, ) -> Result<(), Error> { + let fee_denom_a: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(0))); let connection_b_to_a = channel.connection.clone().flip(); let (wallet, channel_id, port_id) = register_interchain_account(&chains.node_b, chains.handle_b(), &connection_b_to_a)?; @@ -86,6 +88,7 @@ impl BinaryChannelTest for InterchainSecurityIcaTransferTest { &chains.node_a.wallets().user1(), &ica_address.as_ref(), &stake_denom.with_amount(ica_fund).as_ref(), + &fee_denom_a.with_amount(1200u64).as_ref(), )?; chains.node_a.chain_driver().assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/supervisor.rs b/tools/integration-test/src/tests/supervisor.rs index fd24c71551..7ddd3597fb 100644 --- a/tools/integration-test/src/tests/supervisor.rs +++ b/tools/integration-test/src/tests/supervisor.rs @@ -51,10 +51,14 @@ impl TestOverrides for SupervisorTest { impl BinaryChainTest for SupervisorTest { fn run( &self, - _config: &TestConfig, + config: &TestConfig, _relayer: RelayerDriver, chains: ConnectedChains, ) -> Result<(), Error> { + let fee_denom_a: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(0))); + let fee_denom_b: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(1))); let (connection_id_b, _) = init_connection( &chains.handle_a, &chains.handle_b, @@ -112,12 +116,14 @@ impl BinaryChainTest for SupervisorTest { &chains.node_a.wallets().relayer(), &chains.node_a.wallets().user2().address(), &denom_a.with_amount(1000u64).as_ref(), + &fee_denom_a.with_amount(1200u64).as_ref(), )?; chains.node_b.chain_driver().local_transfer_token( &chains.node_b.wallets().relayer(), &chains.node_b.wallets().user2().address(), &chains.node_b.denom().with_amount(1000u64).as_ref(), + &fee_denom_b.with_amount(1200u64).as_ref(), )?; info!( @@ -193,7 +199,7 @@ impl BinaryChannelTest for SupervisorScanTest { channels: ConnectedChannel, ) -> Result<(), Error> { let denom_a = chains.node_a.denom(); - let fee_denom_a = MonoTagged::new(Denom::base(&config.native_tokens[0])); + let fee_denom_a = MonoTagged::new(Denom::base(config.native_token(0))); let denom_b = derive_ibc_denom( &channels.port_b.as_ref(), diff --git a/tools/test-framework/src/chain/cli/transfer.rs b/tools/test-framework/src/chain/cli/transfer.rs index cd554304f7..39ed3f758b 100644 --- a/tools/test-framework/src/chain/cli/transfer.rs +++ b/tools/test-framework/src/chain/cli/transfer.rs @@ -13,6 +13,7 @@ pub fn local_transfer_token( sender: &str, recipient: &str, token: &str, + fees: &str, ) -> Result<(), Error> { simple_exec( chain_id, @@ -32,6 +33,8 @@ pub fn local_transfer_token( home_path, "--keyring-backend", "test", + "--fees", + fees, "--yes", ], )?; diff --git a/tools/test-framework/src/chain/ext/transfer.rs b/tools/test-framework/src/chain/ext/transfer.rs index 94707ff8da..e1c50cd546 100644 --- a/tools/test-framework/src/chain/ext/transfer.rs +++ b/tools/test-framework/src/chain/ext/transfer.rs @@ -71,6 +71,7 @@ pub trait ChainTransferMethodsExt { sender: &MonoTagged, recipient: &MonoTagged, token: &TaggedTokenRef, + fees: &TaggedTokenRef, ) -> Result<(), Error>; fn transfer_from_chain( @@ -161,6 +162,7 @@ impl<'a, Chain: Send> ChainTransferMethodsExt for MonoTagged, recipient: &MonoTagged, token: &TaggedTokenRef, + fees: &TaggedTokenRef, ) -> Result<(), Error> { let driver = *self.value(); local_transfer_token( @@ -171,6 +173,7 @@ impl<'a, Chain: Send> ChainTransferMethodsExt for MonoTagged &String { + &self.native_tokens[id % self.native_tokens.len()] + } +} diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index fd19ebbd3f..7ec43141b9 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -132,7 +132,6 @@ impl FullNode { test_config: &TestConfig, chain_number: usize, ) -> Result { - let native_token_number = chain_number % test_config.native_tokens.len(); let hermes_keystore_dir = test_config .chain_store_dir .join("hermes_keyring") @@ -147,14 +146,10 @@ impl FullNode { // Provenance requires a very high gas price let gas_price = match chain_type { - TestedChainType::Provenance => config::GasPrice::new( - 5000.0, - test_config.native_tokens[native_token_number].clone(), - ), - _ => config::GasPrice::new( - 0.003, - test_config.native_tokens[native_token_number].clone(), - ), + TestedChainType::Provenance => { + config::GasPrice::new(5000.0, test_config.native_token(chain_number).clone()) + } + _ => config::GasPrice::new(0.003, test_config.native_token(chain_number).clone()), }; Ok(config::ChainConfig::CosmosSdk(CosmosSdkConfig { From 8596acfdbbf465943faa60723373dafe76a87a0a Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Wed, 26 Jun 2024 11:46:15 +0200 Subject: [PATCH 141/200] Test ICS29 fees with additional chains (#4066) * Add ics29-fee feature to tests running with Juno, Migaloo and Injective * Remove ics29-fee feature from injective CI job * Remove ICS29 feature from Juno tests --- .github/workflows/integration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 05624fd340..4131034910 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -89,7 +89,7 @@ jobs: command: migalood account_prefix: migaloo native_token: stake - features: '' + features: ics29-fee - package: injective command: injectived account_prefix: inj From 14a27693870ff19d101c7335530110a2c1cf4e1e Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Thu, 27 Jun 2024 15:02:31 +0200 Subject: [PATCH 142/200] Update documentation for dynamic_gas_price configuration in the example config.toml (#4070) --- config.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.toml b/config.toml index ca679a9b3f..e65d967c25 100644 --- a/config.toml +++ b/config.toml @@ -308,7 +308,8 @@ gas_multiplier = 1.1 # Useful for chains which have [EIP-1559][eip]-like dynamic gas price. # # At the moment, only chains which support the `osmosis.txfees.v1beta1.Query/GetEipBaseFee` -# query can be used with dynamic gas price enabled. +# query or have enabled Skip's `x/feemarket` module https://github.com/skip-mev/feemarket +# can be used with dynamic gas price enabled. # # See this page in the Hermes guide for more information: # https://hermes.informal.systems/documentation/configuration/dynamic-gas-fees.html From 2eabf2c49e0b74bf119f000335cf1ef18a00391f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:01:50 +0200 Subject: [PATCH 143/200] Bump num-bigint from 0.4.5 to 0.4.6 (#4076) Bumps [num-bigint](https://github.com/rust-num/num-bigint) from 0.4.5 to 0.4.6. - [Changelog](https://github.com/rust-num/num-bigint/blob/master/RELEASES.md) - [Commits](https://github.com/rust-num/num-bigint/compare/num-bigint-0.4.5...num-bigint-0.4.6) --- updated-dependencies: - dependency-name: num-bigint dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c181cc02e7..f588dfbe0e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1894,9 +1894,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", From c1bd2bdb747ea459f79285ac595f5660c2392c6e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:02:32 +0200 Subject: [PATCH 144/200] Bump serde_json from 1.0.117 to 1.0.120 (#4075) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.117 to 1.0.120. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.117...v1.0.120) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f588dfbe0e..d81c435a4d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2800,9 +2800,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", diff --git a/Cargo.toml b/Cargo.toml index 2f20984958..9213dbe3a2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ secp256k1 = "0.28.2" semver = "1.0.21" serde = "1.0.203" serde_derive = "1.0.104" -serde_json = "1.0.117" +serde_json = "1.0.120" serde_yaml = "0.9.34" serial_test = "3.1.1" sha2 = "0.10.6" From f2e6d89c85da81a5a5f04f471f26563c554c0422 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 11:03:05 +0200 Subject: [PATCH 145/200] Bump uuid from 1.9.0 to 1.9.1 (#4074) Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.9.0 to 1.9.1. - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/1.9.0...1.9.1) --- updated-dependencies: - dependency-name: uuid dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d81c435a4d..3256b90bf5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3891,9 +3891,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea73390fe27785838dcbf75b91b1d84799e28f1ce71e6f372a5dc2200c80de5" +checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" dependencies = [ "getrandom", ] diff --git a/Cargo.toml b/Cargo.toml index 9213dbe3a2..057cb5fab3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -115,7 +115,7 @@ tonic = "0.11" tracing = { version = "0.1.36", default-features = false } tracing-subscriber = "0.3.14" uint = "0.9" -uuid = "1.9.0" +uuid = "1.9.1" [profile.release] overflow-checks = true From d556c90ccc49ee6aea2dc1e09e15c42bb22f9951 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:50:28 +0200 Subject: [PATCH 146/200] Bump uuid from 1.9.1 to 1.10.0 (#4089) Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.9.1 to 1.10.0. - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/1.9.1...1.10.0) --- updated-dependencies: - dependency-name: uuid dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3256b90bf5..0f4eb4a280 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3891,9 +3891,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.9.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom", ] diff --git a/Cargo.toml b/Cargo.toml index 057cb5fab3..57875e126d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -115,7 +115,7 @@ tonic = "0.11" tracing = { version = "0.1.36", default-features = false } tracing-subscriber = "0.3.14" uint = "0.9" -uuid = "1.9.1" +uuid = "1.10.0" [profile.release] overflow-checks = true From 0b19740a4797f9c852cb0c8817104b404227d0f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:50:31 +0200 Subject: [PATCH 147/200] Bump thiserror from 1.0.61 to 1.0.62 (#4088) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.61 to 1.0.62. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.61...1.0.62) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0f4eb4a280..ea539dd6d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3370,18 +3370,18 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 57875e126d..0713120bf3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,7 +104,7 @@ strum = "0.25" subtle-encoding = "0.5.1" tempfile = "3.10.1" test-log = "0.2.14" -thiserror = "1.0.61" +thiserror = "1.0.62" time = "0.3" tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } From 058543bb9046b5b463ddb780a752ce7dd661968b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:50:34 +0200 Subject: [PATCH 148/200] Bump serde from 1.0.203 to 1.0.204 (#4083) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.203 to 1.0.204. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.204) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ea539dd6d8..ed682bde51 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2761,9 +2761,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] @@ -2789,9 +2789,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 0713120bf3..ad30e291da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,7 +92,7 @@ retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" secp256k1 = "0.28.2" semver = "1.0.21" -serde = "1.0.203" +serde = "1.0.204" serde_derive = "1.0.104" serde_json = "1.0.120" serde_yaml = "0.9.34" From e30062e809020dea4e05d4eacd38edbbbeed8da6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:50:37 +0200 Subject: [PATCH 149/200] Bump moka from 0.12.7 to 0.12.8 (#4082) Bumps [moka](https://github.com/moka-rs/moka) from 0.12.7 to 0.12.8. - [Changelog](https://github.com/moka-rs/moka/blob/main/CHANGELOG.md) - [Commits](https://github.com/moka-rs/moka/compare/v0.12.7...v0.12.8) --- updated-dependencies: - dependency-name: moka dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed682bde51..d721cb44ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1864,9 +1864,9 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e0d88686dc561d743b40de8269b26eaf0dc58781bde087b0984646602021d08" +checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f" dependencies = [ "crossbeam-channel", "crossbeam-epoch", @@ -3760,9 +3760,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.13" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" +checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" [[package]] name = "try-lock" diff --git a/Cargo.toml b/Cargo.toml index ad30e291da..fad5653353 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,7 +75,7 @@ humantime-serde = "1.1.1" ibc-proto = "0.46.0" ics23 = "0.11.1" itertools = "0.12.1" -moka = "0.12.5" +moka = "0.12.8" num-bigint = "0.4" num-rational = "0.4.1" once_cell = "1.19.0" From 824cfdf450e7fed2cdebf21d6f2b0410d2284eae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 Jul 2024 09:50:40 +0200 Subject: [PATCH 150/200] Bump async-trait from 0.1.80 to 0.1.81 (#4081) Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.80 to 0.1.81. - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.80...0.1.81) --- updated-dependencies: - dependency-name: async-trait dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d721cb44ed..f9b32d7433 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,9 +162,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index fad5653353..469b2798d4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ tendermint-testgen = { version = "0.37.0" } abscissa_core = "=0.6.0" anyhow = "1.0" async-stream = "0.3.5" -async-trait = "0.1.79" +async-trait = "0.1.81" axum = "0.6.18" bech32 = "0.9.1" bitcoin = "0.31.2" From 43f3e835a0beec4754bdcebdb76b13fefa1d7974 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:48:15 +0200 Subject: [PATCH 151/200] Add warning if no packet data was pulled when clearing packets (#4073) * Add warning if 0 packet data was pulled when clearing packets * Update filtered ICS20 packet logs from debug to warn and remove unnecessary context * Add changelog entry * Apply suggestions from code review Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * Add link to guide page when 0 packet data was pulled during packet clearing --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi --- .../ibc-relayer/4072-packet-clear-logs.md | 6 +++++ crates/relayer/src/link/packet_events.rs | 23 ++++++++++++------- crates/relayer/src/link/relay_path.rs | 8 +++---- 3 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/4072-packet-clear-logs.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4072-packet-clear-logs.md b/.changelog/unreleased/improvements/ibc-relayer/4072-packet-clear-logs.md new file mode 100644 index 0000000000..3ed50bd279 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/4072-packet-clear-logs.md @@ -0,0 +1,6 @@ +- Improve logs when clearing packet. + * When Hermes doesn't pull packet data it will now warn the user + instead of logging `pulled packet data for 0 events out of X` + * When ICS20 packets are filtered due to having a receiver or memo + field too big, the log will be at `warn` level instead of `debug`. + ([\#4072](https://github.com/informalsystems/hermes/issues/4072)) \ No newline at end of file diff --git a/crates/relayer/src/link/packet_events.rs b/crates/relayer/src/link/packet_events.rs index a1e78ad980..0d105ed645 100644 --- a/crates/relayer/src/link/packet_events.rs +++ b/crates/relayer/src/link/packet_events.rs @@ -41,14 +41,21 @@ where Ok(events) => { events_left -= chunk.len(); - info!( - events.total = %events_total, - events.left = %events_left, - "pulled packet data for {} events out of {} sequences: {};", - events.len(), - chunk.len(), - chunk.iter().copied().collated().format(", "), - ); + if events.is_empty() && !chunk.is_empty() { + warn!("no packet data was pulled at height {query_height} for sequences {}, this might be due to the data not being available on the configured endpoint. \ + Please verify that the RPC endpoint has the required packet data, for more details see https://hermes.informal.systems/advanced/troubleshooting/cross-comp-config.html#uncleared-pending-packets", + chunk.iter().copied().collated().format(", ")); + } else { + info!( + events.total = %events_total, + events.left = %events_left, + "pulled packet data for {} out of {} events: {}", + events.len(), + chunk.len(), + chunk.iter().copied().collated().format(", "), + ); + } + // Because we use the first event height to do the client update, // if the heights of the events differ, we get proof verification failures. diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index 63abf46be3..04a34947b9 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -1947,7 +1947,7 @@ impl RelayPath { } } -#[tracing::instrument(skip(data))] +#[tracing::instrument(skip_all)] fn check_ics20_fields_size( data: &[u8], memo_limit: Ics20FieldSizeLimit, @@ -1962,9 +1962,9 @@ fn check_ics20_fields_size( (ValidationResult::Valid, ValidationResult::Valid) => true, (memo_validity, receiver_validity) => { - debug!("found invalid ICS-20 packet data, not relaying packet!"); - debug!(" ICS-20 memo: {memo_validity}"); - debug!(" ICS-20 receiver: {receiver_validity}"); + warn!("found invalid ICS-20 packet data, not relaying packet!"); + warn!(" ICS-20 memo: {memo_validity}"); + warn!(" ICS-20 receiver: {receiver_validity}"); false } From 304c3cac9f3544bcb58f12bb13c258268bd1fc81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:42:33 +0200 Subject: [PATCH 152/200] Bump bytes from 1.6.0 to 1.6.1 (#4096) Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.6.0 to 1.6.1. - [Release notes](https://github.com/tokio-rs/bytes/releases) - [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/bytes/compare/v1.6.0...v1.6.1) --- updated-dependencies: - dependency-name: bytes dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f9b32d7433..413bc0ba58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -425,9 +425,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" dependencies = [ "serde", ] diff --git a/Cargo.toml b/Cargo.toml index 469b2798d4..53b932b4ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ bech32 = "0.9.1" bitcoin = "0.31.2" bs58 = "0.5.1" byte-unit = { version = "4.0.19", default-features = false } -bytes = "1.4.0" +bytes = "1.6.1" clap = "3.2" clap_complete = "3.2" color-eyre = "0.6" From 3cae8fb2766ca55b5491b3c271ac0292620a148c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:43:59 +0200 Subject: [PATCH 153/200] Bump toml from 0.8.14 to 0.8.15 (#4095) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.14 to 0.8.15. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.14...toml-v0.8.15) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 18 +++++++++--------- Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 413bc0ba58..087d62b41f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1404,7 +1404,7 @@ dependencies = [ "tendermint", "tendermint-rpc", "time", - "toml 0.8.14", + "toml 0.8.15", "tonic", ] @@ -1488,7 +1488,7 @@ dependencies = [ "tiny-keccak", "tokio", "tokio-stream", - "toml 0.8.14", + "toml 0.8.15", "tonic", "tracing", "tracing-subscriber", @@ -1547,7 +1547,7 @@ dependencies = [ "reqwest", "serde", "tokio", - "toml 0.8.14", + "toml 0.8.15", "tracing", ] @@ -1628,7 +1628,7 @@ dependencies = [ "subtle-encoding", "tendermint-rpc", "tokio", - "toml 0.8.14", + "toml 0.8.15", "tonic", "tracing", "tracing-subscriber", @@ -3200,7 +3200,7 @@ dependencies = [ "serde", "serde_json", "tendermint", - "toml 0.8.14", + "toml 0.8.15", "url", ] @@ -3567,9 +3567,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.14" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" dependencies = [ "serde", "serde_spanned", @@ -3588,9 +3588,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.14" +version = "0.22.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" +checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" dependencies = [ "indexmap 2.2.6", "serde", diff --git a/Cargo.toml b/Cargo.toml index 53b932b4ec..11a6762567 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -110,7 +110,7 @@ tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } tokio = "1.26.0" tokio-stream = "0.1.14" -toml = "0.8.14" +toml = "0.8.15" tonic = "0.11" tracing = { version = "0.1.36", default-features = false } tracing-subscriber = "0.3.14" From 4ebbc0faa8718d0507507d571845bce8c1ed866c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:44:58 +0200 Subject: [PATCH 154/200] Bump thiserror from 1.0.62 to 1.0.63 (#4094) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.62 to 1.0.63. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.62...1.0.63) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 087d62b41f..27d1f475b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3370,18 +3370,18 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.62" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.62" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 11a6762567..4916fc53da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -104,7 +104,7 @@ strum = "0.25" subtle-encoding = "0.5.1" tempfile = "3.10.1" test-log = "0.2.14" -thiserror = "1.0.62" +thiserror = "1.0.63" time = "0.3" tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } From 2dffd3d5788120fbc73b3e26fc621bf6265d92c5 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 23 Jul 2024 17:45:05 +0200 Subject: [PATCH 155/200] Bump `tendermint-rs` and `ibc-proto` versions (#4091) * Bump tendermint-rs and ibc-proto versions and required dependencies * Remove patch on `ibc-proto` * Add changelog entry * Ignore folder generated by wasm contract * Update tendermint-rs to v0.38.1 * Update changelog entry --------- Co-authored-by: Romain Ruetschi --- ...4093-update-ibc-proto-and-tendermint-rs.md | 3 + .gitignore | 3 + Cargo.lock | 303 ++++++++++++++---- Cargo.toml | 26 +- .../src/core/ics04_channel/upgrade.rs | 2 +- .../src/chain/cosmos/query/consensus_state.rs | 2 +- crates/relayer/src/worker/packet.rs | 2 +- 7 files changed, 254 insertions(+), 87 deletions(-) create mode 100644 .changelog/unreleased/breaking-changes/4093-update-ibc-proto-and-tendermint-rs.md diff --git a/.changelog/unreleased/breaking-changes/4093-update-ibc-proto-and-tendermint-rs.md b/.changelog/unreleased/breaking-changes/4093-update-ibc-proto-and-tendermint-rs.md new file mode 100644 index 0000000000..f87427d3a2 --- /dev/null +++ b/.changelog/unreleased/breaking-changes/4093-update-ibc-proto-and-tendermint-rs.md @@ -0,0 +1,3 @@ +- Bump version of `ibc-proto` from `v0.46.0` to `v0.47.0` and + version of `tendermint-rs` from `v0.37.0` to `v0.38.1`. + ([\#4093](https://github.com/informalsystems/hermes/issues/4093)) \ No newline at end of file diff --git a/.gitignore b/.gitignore index bdda50d8a7..f46e505cd9 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ mc.log # Ignore tooling Cargo.lock tools/check-guide/Cargo.lock + +# Ignore data generated from wasm contract +ibc_08-wasm_client_data \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 27d1f475b4..7da86399ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -188,6 +188,12 @@ dependencies = [ "tungstenite", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "atty" version = "0.2.14" @@ -212,13 +218,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", - "axum-core", + "axum-core 0.3.4", "bitflags 1.3.2", "bytes", "futures-util", "http 0.2.12", - "http-body", - "hyper", + "http-body 0.4.6", + "hyper 0.14.29", "itoa", "matchit", "memchr", @@ -230,13 +236,40 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "tokio", "tower", "tower-layer", "tower-service", ] +[[package]] +name = "axum" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +dependencies = [ + "async-trait", + "axum-core 0.4.3", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper 1.0.1", + "tower", + "tower-layer", + "tower-service", +] + [[package]] name = "axum-core" version = "0.3.4" @@ -247,9 +280,29 @@ dependencies = [ "bytes", "futures-util", "http 0.2.12", - "http-body", + "http-body 0.4.6", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", "mime", + "pin-project-lite", "rustversion", + "sync_wrapper 0.1.2", "tower-layer", "tower-service", ] @@ -1182,6 +1235,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", + "indexmap 2.2.6", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "half" version = "1.8.3" @@ -1290,6 +1362,29 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "pin-project-lite", +] + [[package]] name = "httparse" version = "1.9.4" @@ -1328,9 +1423,9 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", - "http-body", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -1342,6 +1437,27 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -1350,7 +1466,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper", + "hyper 0.14.29", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", @@ -1358,14 +1474,35 @@ dependencies = [ [[package]] name = "hyper-timeout" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" dependencies = [ - "hyper", + "hyper 1.4.1", + "hyper-util", "pin-project-lite", "tokio", - "tokio-io-timeout", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", ] [[package]] @@ -1375,7 +1512,7 @@ dependencies = [ "async-trait", "flex-error", "futures", - "http 0.2.12", + "http 1.1.0", "ibc-proto", "ibc-relayer", "ibc-relayer-types", @@ -1393,7 +1530,7 @@ name = "ibc-integration-test" version = "0.29.0" dependencies = [ "byte-unit", - "http 0.2.12", + "http 1.1.0", "ibc-relayer", "ibc-relayer-types", "ibc-test-framework", @@ -1410,9 +1547,9 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cb09e0b52b8a16e98ce98845e7c15b018440f3c56defa12fa44782cd66bab65" +checksum = "1678333cf68c9094ca66aaf9a271269f1f6bf5c26881161def8bd88cee831a23" dependencies = [ "base64 0.22.1", "bytes", @@ -1449,7 +1586,7 @@ dependencies = [ "generic-array", "hdpath", "hex", - "http 0.2.12", + "http 1.1.0", "humantime", "humantime-serde", "ibc-proto", @@ -1511,7 +1648,7 @@ dependencies = [ "flex-error", "futures", "hdpath", - "http 0.2.12", + "http 1.1.0", "humantime", "ibc-chain-registry", "ibc-relayer", @@ -1540,7 +1677,7 @@ dependencies = [ name = "ibc-relayer-rest" version = "0.29.0" dependencies = [ - "axum", + "axum 0.6.20", "crossbeam-channel", "ibc-relayer", "ibc-relayer-types", @@ -1586,7 +1723,7 @@ dependencies = [ name = "ibc-telemetry" version = "0.29.0" dependencies = [ - "axum", + "axum 0.6.20", "dashmap", "ibc-relayer-types", "moka", @@ -1611,7 +1748,7 @@ dependencies = [ "flex-error", "hdpath", "hex", - "http 0.2.12", + "http 1.1.0", "ibc-proto", "ibc-relayer", "ibc-relayer-cli", @@ -1636,9 +1773,9 @@ dependencies = [ [[package]] name = "ics23" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc3b8be84e7285c73b88effdc3294b552277d6b0ec728ee016c861b7b9a2c19c" +checksum = "73b17f1a5bd7d12ad30a21445cfa5f52fd7651cb3243ba866f9916b1ec112f12" dependencies = [ "anyhow", "blake2", @@ -1728,9 +1865,9 @@ checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -2246,9 +2383,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" dependencies = [ "bytes", "prost-derive", @@ -2256,9 +2393,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" dependencies = [ "anyhow", "itertools", @@ -2269,9 +2406,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.12.6" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" dependencies = [ "prost", ] @@ -2420,10 +2557,10 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", - "http-body", - "hyper", + "http-body 0.4.6", + "hyper 0.14.29", "hyper-rustls", "ipnet", "js-sys", @@ -2438,7 +2575,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-rustls 0.24.1", @@ -2550,6 +2687,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls" +version = "0.23.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -3108,6 +3260,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "synstructure" version = "0.12.6" @@ -3161,9 +3319,9 @@ dependencies = [ [[package]] name = "tendermint" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "954496fbc9716eb4446cdd6d00c071a3e2f22578d62aa03b40c7e5b4fda3ed42" +checksum = "505d9d6ffeb83b1de47c307c6e0d2dff56c6256989299010ad03cd80a8491e97" dependencies = [ "bytes", "digest 0.10.7", @@ -3192,9 +3350,9 @@ dependencies = [ [[package]] name = "tendermint-config" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84b11b57d20ee4492a1452faff85f5c520adc36ca9fe5e701066935255bb89f" +checksum = "9de111ea653b2adaef627ac2452b463c77aa615c256eaaddf279ec5a1cf9775f" dependencies = [ "flex-error", "serde", @@ -3206,9 +3364,9 @@ dependencies = [ [[package]] name = "tendermint-light-client" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4faf208913acf562b8703e8e1e5eabdc57efa88c1404f9df20338a9969f08d6b" +checksum = "d91e5abb448c65e8abdfe0e17a3a189e005a71b4169b89f36aaa2053ff239577" dependencies = [ "contracts", "crossbeam-channel", @@ -3231,9 +3389,9 @@ dependencies = [ [[package]] name = "tendermint-light-client-detector" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e7c930960f72741f9baa7fb0bb12c1cf3e4bd687e2eb2cbd7996555e9799e2" +checksum = "eb1ac1607eb7a3393313558b339c36eebeba15aa7f2d101d1d47299e65825152" dependencies = [ "crossbeam-channel", "derive_more", @@ -3254,9 +3412,9 @@ dependencies = [ [[package]] name = "tendermint-light-client-verifier" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3848090df4502a09ee27cb1a00f1835e1111c8993b22c5e1e41ffb7f6f09d57e" +checksum = "7a2674adbf0dc51aa0c8eaf8462c7d6692ec79502713e50ed5432a442002be90" dependencies = [ "derive_more", "flex-error", @@ -3267,9 +3425,9 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc87024548c7f3da479885201e3da20ef29e85a3b13d04606b380ac4c7120d87" +checksum = "8ed14abe3b0502a3afe21ca74ca5cdd6c7e8d326d982c26f98a394445eb31d6e" dependencies = [ "bytes", "flex-error", @@ -3283,9 +3441,9 @@ dependencies = [ [[package]] name = "tendermint-rpc" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfdc2281e271277fda184d96d874a6fe59f569b130b634289257baacfc95aa85" +checksum = "02f96a2b8a0d3d0b59e4024b1a6bdc1589efc6af4709d08a480a20cc4ba90f63" dependencies = [ "async-trait", "async-tungstenite", @@ -3317,9 +3475,9 @@ dependencies = [ [[package]] name = "tendermint-testgen" -version = "0.37.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "318a0e38b3b7b36b4078d78446d4284088aa9b173d519fc804c3ee4683972934" +checksum = "ae007e2918414ae96e4835426aace7538d23b8ddf96d71e23d241f58f386e877" dependencies = [ "ed25519-consensus", "gumdrop", @@ -3490,16 +3648,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-macros" version = "2.3.0" @@ -3532,6 +3680,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls 0.23.10", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.15" @@ -3601,28 +3760,30 @@ dependencies = [ [[package]] name = "tonic" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" +checksum = "38659f4a91aba8598d27821589f5db7dddd94601e7a01b1e485a50e5484c7401" dependencies = [ "async-stream", "async-trait", - "axum", - "base64 0.21.7", + "axum 0.7.5", + "base64 0.22.1", "bytes", - "h2", - "http 0.2.12", - "http-body", - "hyper", + "h2 0.4.5", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", "hyper-timeout", + "hyper-util", "percent-encoding", "pin-project", "prost", "rustls-native-certs 0.7.0", "rustls-pemfile 2.1.2", - "rustls-pki-types", + "socket2", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tokio-stream", "tower", "tower-layer", diff --git a/Cargo.toml b/Cargo.toml index 4916fc53da..1097dc8d33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,13 +30,13 @@ ibc-test-framework = { version = "0.29.0", path = "tools/test-framework" } ibc-integration-test = { version = "0.29.0", path = "tools/integration-test" } # Tendermint dependencies -tendermint = { version = "0.37.0", default-features = false } -tendermint-light-client = { version = "0.37.0", default-features = false } -tendermint-light-client-detector = { version = "0.37.0", default-features = false } -tendermint-light-client-verifier = { version = "0.37.0", default-features = false } -tendermint-proto = { version = "0.37.0" } -tendermint-rpc = { version = "0.37.0" } -tendermint-testgen = { version = "0.37.0" } +tendermint = { version = "0.38.1", default-features = false } +tendermint-light-client = { version = "0.38.1", default-features = false } +tendermint-light-client-detector = { version = "0.38.1", default-features = false } +tendermint-light-client-verifier = { version = "0.38.1", default-features = false } +tendermint-proto = { version = "0.38.1" } +tendermint-rpc = { version = "0.38.1" } +tendermint-testgen = { version = "0.38.1" } # Other dependencies abscissa_core = "=0.6.0" @@ -69,12 +69,12 @@ futures = "0.3.27" generic-array = "0.14.7" hdpath = "0.6.3" hex = "0.4.3" -http = "0.2.9" +http = "1.0.0" humantime = "2.1.0" humantime-serde = "1.1.1" -ibc-proto = "0.46.0" -ics23 = "0.11.1" -itertools = "0.12.1" +ibc-proto = "0.47.0" +ics23 = "0.12.0" +itertools = "0.13.0" moka = "0.12.8" num-bigint = "0.4" num-rational = "0.4.1" @@ -84,7 +84,7 @@ opentelemetry = "0.19.0" opentelemetry-prometheus = "0.12.0" primitive-types = { version = "0.12.1", default-features = false } prometheus = "0.13.4" -prost = "0.12" +prost = "0.13" rand = "0.8.5" regex = "1.10.5" reqwest = { version = "0.11.27", default-features = false } @@ -111,7 +111,7 @@ tiny-keccak = { version = "2.0.2", default-features = false } tokio = "1.26.0" tokio-stream = "0.1.14" toml = "0.8.15" -tonic = "0.11" +tonic = "0.12" tracing = { version = "0.1.36", default-features = false } tracing-subscriber = "0.3.14" uint = "0.9" diff --git a/crates/relayer-types/src/core/ics04_channel/upgrade.rs b/crates/relayer-types/src/core/ics04_channel/upgrade.rs index a909859cf5..6eb5b9bea2 100644 --- a/crates/relayer-types/src/core/ics04_channel/upgrade.rs +++ b/crates/relayer-types/src/core/ics04_channel/upgrade.rs @@ -27,7 +27,7 @@ impl TryFrom for Upgrade { .try_into()?; let timeout = value .timeout - .filter(|tm| Timeout::try_from(tm.clone()).is_ok()) + .filter(|tm| Timeout::try_from(*tm).is_ok()) .map(|tm| Timeout::try_from(tm).unwrap()); let next_sequence_send = value.next_sequence_send.into(); diff --git a/crates/relayer/src/chain/cosmos/query/consensus_state.rs b/crates/relayer/src/chain/cosmos/query/consensus_state.rs index 54c9f7905d..538b5cb140 100644 --- a/crates/relayer/src/chain/cosmos/query/consensus_state.rs +++ b/crates/relayer/src/chain/cosmos/query/consensus_state.rs @@ -72,7 +72,7 @@ pub async fn query_consensus_state_heights( .consensus_state_heights .into_iter() .filter_map(|h| { - Height::try_from(h.clone()) + Height::try_from(h) .map_err(|e| { warn!( "failed to parse consensus state height {}. Error: {}", diff --git a/crates/relayer/src/worker/packet.rs b/crates/relayer/src/worker/packet.rs index 98fe15c3e3..30da317290 100644 --- a/crates/relayer/src/worker/packet.rs +++ b/crates/relayer/src/worker/packet.rs @@ -377,7 +377,7 @@ fn retrieve_all_fees_from_incentivized_packet( incentivized_packet .total_recv_fee .iter() - .group_by(|a| &a.denom) + .chunk_by(|a| &a.denom) .into_iter() .map(|(key, group)| { let total_amount: Amount = group.map(|v| v.amount).sum::(); From 7a67ac51bb3338a3922801b163b4886b806d89cf Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 23 Jul 2024 19:35:03 +0200 Subject: [PATCH 156/200] Release Hermes v1.10.1 (#4100) * Create changelog for v1.10.1 * Update CHANGELOG * Bump versions * Run cargo update --- ...4093-update-ibc-proto-and-tendermint-rs.md | 0 .../3195-add-pfm-ica-features-to-osmosis.md | 0 .../ibc-relayer/4072-packet-clear-logs.md | 0 .changelog/v1.10.1/summary.md | 5 + CHANGELOG.md | 29 ++ Cargo.lock | 264 +++++++++--------- Cargo.toml | 16 +- crates/chain-registry/Cargo.toml | 2 +- crates/relayer-cli/Cargo.toml | 2 +- crates/relayer-rest/Cargo.toml | 2 +- crates/relayer-rest/tests/mock.rs | 2 +- crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 2 +- crates/relayer/src/lib.rs | 4 +- crates/telemetry/Cargo.toml | 2 +- guide/README.md | 2 +- guide/src/SUMMARY.md | 2 +- tools/integration-test/Cargo.toml | 2 +- tools/test-framework/Cargo.toml | 2 +- 19 files changed, 182 insertions(+), 158 deletions(-) rename .changelog/{unreleased => v1.10.1}/breaking-changes/4093-update-ibc-proto-and-tendermint-rs.md (100%) rename .changelog/{unreleased => v1.10.1}/improvements/ibc-integration-test/3195-add-pfm-ica-features-to-osmosis.md (100%) rename .changelog/{unreleased => v1.10.1}/improvements/ibc-relayer/4072-packet-clear-logs.md (100%) create mode 100644 .changelog/v1.10.1/summary.md diff --git a/.changelog/unreleased/breaking-changes/4093-update-ibc-proto-and-tendermint-rs.md b/.changelog/v1.10.1/breaking-changes/4093-update-ibc-proto-and-tendermint-rs.md similarity index 100% rename from .changelog/unreleased/breaking-changes/4093-update-ibc-proto-and-tendermint-rs.md rename to .changelog/v1.10.1/breaking-changes/4093-update-ibc-proto-and-tendermint-rs.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/3195-add-pfm-ica-features-to-osmosis.md b/.changelog/v1.10.1/improvements/ibc-integration-test/3195-add-pfm-ica-features-to-osmosis.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/3195-add-pfm-ica-features-to-osmosis.md rename to .changelog/v1.10.1/improvements/ibc-integration-test/3195-add-pfm-ica-features-to-osmosis.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4072-packet-clear-logs.md b/.changelog/v1.10.1/improvements/ibc-relayer/4072-packet-clear-logs.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/4072-packet-clear-logs.md rename to .changelog/v1.10.1/improvements/ibc-relayer/4072-packet-clear-logs.md diff --git a/.changelog/v1.10.1/summary.md b/.changelog/v1.10.1/summary.md new file mode 100644 index 0000000000..1d39539dad --- /dev/null +++ b/.changelog/v1.10.1/summary.md @@ -0,0 +1,5 @@ +*July 23th, 2024* + +In this release `tendermint-rs` has been updated to the latest version, addressing issues with the `/block_results` response. This ensures compatibility with CometBFT v0.38.10. + +And enhancements have been made to the logs regarding packet clearing, providing better insights and warnings for users. diff --git a/CHANGELOG.md b/CHANGELOG.md index 873ec5bb35..b5ef94e12c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,34 @@ # CHANGELOG +## v1.10.1 + +*July 23th, 2024* + +In this release `tendermint-rs` has been updated to the latest version, addressing issues with the `/block_results` response. This ensures compatibility with CometBFT v0.38.10. + +And enhancements have been made to the logs regarding packet clearing, providing better insights and warnings for users. + + +### BREAKING CHANGES + +- Bump version of `ibc-proto` from `v0.46.0` to `v0.47.0` and + version of `tendermint-rs` from `v0.37.0` to `v0.38.1`. + ([\#4093](https://github.com/informalsystems/hermes/issues/4093)) + +### IMPROVEMENTS + +- [Integration Test Framework](tools/test-framework) + - Add the features `packet-forward` and `ica` to enable + Packet Forward Middleware and ICA when running tests with Osmosis + ([\#3195](https://github.com/informalsystems/hermes/issues/3195)) +- [Relayer Library](relayer) + - Improve logs when clearing packet. + * When Hermes doesn't pull packet data it will now warn the user + instead of logging `pulled packet data for 0 events out of X` + * When ICS20 packets are filtered due to having a receiver or memo + field too big, the log will be at `warn` level instead of `debug`. + ([\#4072](https://github.com/informalsystems/hermes/issues/4072)) + ## v1.10.0 *June 24th, 2024* diff --git a/Cargo.lock b/Cargo.lock index 7da86399ed..14d9856c52 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,9 +128,9 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "arrayref" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" +checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" @@ -157,7 +157,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -168,7 +168,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -181,7 +181,7 @@ dependencies = [ "futures-util", "log", "pin-project-lite", - "rustls-native-certs 0.7.0", + "rustls-native-certs 0.7.1", "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", @@ -224,7 +224,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.29", + "hyper 0.14.30", "itoa", "matchit", "memchr", @@ -401,9 +401,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "blake2" @@ -416,9 +416,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +checksum = "e9ec96fe9a81b5e365f9db71fe00edc4fe4ca2cc7dcb7861f0603012a7caa210" dependencies = [ "arrayref", "arrayvec", @@ -493,9 +493,9 @@ checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" [[package]] name = "cc" -version = "1.0.99" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" [[package]] name = "cfg-if" @@ -721,7 +721,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -789,7 +789,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -914,9 +914,9 @@ dependencies = [ [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" @@ -954,9 +954,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +checksum = "c6dc8c8ff84895b051f07a0e65f975cf225131742531338752abfb324e4449ff" dependencies = [ "log", "regex", @@ -964,9 +964,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +checksum = "06676b12debf7bba6903559720abca942d3a66b8acb88815fd2c7c6537e9ade1" dependencies = [ "anstream", "anstyle", @@ -1122,7 +1122,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -1415,9 +1415,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.29" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f361cde2f109281a220d4307746cdfd5ee3f410da58a70377762396775634b33" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -1466,7 +1466,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.29", + "hyper 0.14.30", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", @@ -1507,7 +1507,7 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.29.0" +version = "0.29.1" dependencies = [ "async-trait", "flex-error", @@ -1527,7 +1527,7 @@ dependencies = [ [[package]] name = "ibc-integration-test" -version = "0.29.0" +version = "0.29.1" dependencies = [ "byte-unit", "http 1.1.0", @@ -1565,7 +1565,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.29.0" +version = "0.29.1" dependencies = [ "anyhow", "async-stream", @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "1.10.0" +version = "1.10.1" dependencies = [ "abscissa_core", "clap", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.29.0" +version = "0.29.1" dependencies = [ "axum 0.6.20", "crossbeam-channel", @@ -1690,7 +1690,7 @@ dependencies = [ [[package]] name = "ibc-relayer-types" -version = "0.29.0" +version = "0.29.1" dependencies = [ "bytes", "derive_more", @@ -1721,7 +1721,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.29.0" +version = "0.29.1" dependencies = [ "axum 0.6.20", "dashmap", @@ -1740,7 +1740,7 @@ dependencies = [ [[package]] name = "ibc-test-framework" -version = "0.29.0" +version = "0.29.1" dependencies = [ "color-eyre", "crossbeam-channel", @@ -1910,9 +1910,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" @@ -1926,7 +1926,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -1948,9 +1948,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "matchers" @@ -1990,13 +1990,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" dependencies = [ + "hermit-abi 0.3.9", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2076,16 +2077,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.9", - "libc", -] - [[package]] name = "object" version = "0.32.2" @@ -2217,7 +2208,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2237,9 +2228,9 @@ dependencies = [ [[package]] name = "peg" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a625d12ad770914cbf7eff6f9314c3ef803bfe364a1b20bc36ddf56673e71e5" +checksum = "295283b02df346d1ef66052a757869b2876ac29a6bb0ac3f5f7cd44aebe40e8f" dependencies = [ "peg-macros", "peg-runtime", @@ -2247,9 +2238,9 @@ dependencies = [ [[package]] name = "peg-macros" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f241d42067ed3ab6a4fece1db720838e1418f36d868585a27931f95d6bc03582" +checksum = "bdad6a1d9cf116a059582ce415d5f5566aabcd4008646779dab7fdc2a9a9d426" dependencies = [ "peg-runtime", "proc-macro2", @@ -2285,7 +2276,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -2401,7 +2392,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -2475,20 +2466,20 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.0.2" +version = "11.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e29830cbb1290e404f24c73af91c5d8d631ce7e128691e9477556b540cd01ecd" +checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] name = "redox_syscall" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -2560,7 +2551,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.29", + "hyper 0.14.30", "hyper-rustls", "ipnet", "js-sys", @@ -2654,7 +2645,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", @@ -2682,22 +2673,22 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki 0.102.4", + "rustls-webpki 0.102.6", "subtle", "zeroize", ] [[package]] name = "rustls" -version = "0.23.10" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.4", + "rustls-webpki 0.102.6", "subtle", "zeroize", ] @@ -2716,9 +2707,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" dependencies = [ "openssl-probe", "rustls-pemfile 2.1.2", @@ -2764,9 +2755,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" dependencies = [ "ring", "rustls-pki-types", @@ -2796,9 +2787,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.1" +version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ad2bbb0ae5100a07b7a6f2ed7ab5fd0045551a4c507989b7a620046ea3efdc" +checksum = "a4465c22496331e20eb047ff46e7366455bc01c0c02015c4a376de0b2cd3a1af" dependencies = [ "sdd", ] @@ -2830,9 +2821,9 @@ dependencies = [ [[package]] name = "sdd" -version = "0.2.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84345e4c9bd703274a082fb80caaa99b7612be48dfaa1dd9266577ec412309d" +checksum = "85f05a494052771fc5bd0619742363b5e24e5ad72ab3111ec2e27925b8edc5f3" [[package]] name = "sec1" @@ -2881,11 +2872,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -2894,9 +2885,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -2922,9 +2913,9 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] @@ -2947,7 +2938,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -2979,7 +2970,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -3038,7 +3029,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -3208,14 +3199,14 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] name = "subtle" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subtle-encoding" @@ -3245,9 +3236,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.67" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -3517,7 +3508,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -3543,7 +3534,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -3616,9 +3607,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -3631,32 +3622,31 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "9c3318c4fc7126c339a40fbc025927d0328ca32259f68bfe4321660644c1f626" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -3686,7 +3676,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.10", + "rustls 0.23.12", "rustls-pki-types", "tokio", ] @@ -3779,7 +3769,7 @@ dependencies = [ "percent-encoding", "pin-project", "prost", - "rustls-native-certs 0.7.0", + "rustls-native-certs 0.7.1", "rustls-pemfile 2.1.2", "socket2", "tokio", @@ -3843,7 +3833,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] [[package]] @@ -4126,7 +4116,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", "wasm-bindgen-shared", ] @@ -4160,7 +4150,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4227,7 +4217,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4247,18 +4237,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -4269,9 +4259,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -4281,9 +4271,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -4293,15 +4283,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -4311,9 +4301,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -4323,9 +4313,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -4335,9 +4325,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -4347,15 +4337,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.13" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +checksum = "557404e450152cd6795bb558bca69e43c585055f4606e3bcae5894fc6dac9ba0" dependencies = [ "memchr", ] @@ -4387,5 +4377,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.67", + "syn 2.0.72", ] diff --git a/Cargo.toml b/Cargo.toml index 1097dc8d33..3d8a2fca2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,14 +20,14 @@ exclude = [ [workspace.dependencies] # Hermes dependencies -ibc-relayer-cli = { version = "1.10.0", path = "crates/relayer-cli" } -ibc-relayer = { version = "0.29.0", path = "crates/relayer" } -ibc-relayer-rest = { version = "0.29.0", path = "crates/relayer-rest" } -ibc-relayer-types = { version = "0.29.0", path = "crates/relayer-types" } -ibc-chain-registry = { version = "0.29.0", path = "crates/chain-registry" } -ibc-telemetry = { version = "0.29.0", path = "crates/telemetry" } -ibc-test-framework = { version = "0.29.0", path = "tools/test-framework" } -ibc-integration-test = { version = "0.29.0", path = "tools/integration-test" } +ibc-relayer-cli = { version = "1.10.1", path = "crates/relayer-cli" } +ibc-relayer = { version = "0.29.1", path = "crates/relayer" } +ibc-relayer-rest = { version = "0.29.1", path = "crates/relayer-rest" } +ibc-relayer-types = { version = "0.29.1", path = "crates/relayer-types" } +ibc-chain-registry = { version = "0.29.1", path = "crates/chain-registry" } +ibc-telemetry = { version = "0.29.1", path = "crates/telemetry" } +ibc-test-framework = { version = "0.29.1", path = "tools/test-framework" } +ibc-integration-test = { version = "0.29.1", path = "tools/integration-test" } # Tendermint dependencies tendermint = { version = "0.38.1", default-features = false } diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index e384ee88cb..a828b7b38a 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-chain-registry" -version = "0.29.0" +version = "0.29.1" edition = "2021" license = "Apache-2.0" keywords = ["cosmos", "ibc", "relayer", "chain", "registry"] diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index 9ded116107..af7cc5aa23 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-cli" -version = "1.10.0" +version = "1.10.1" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index f7ad7e9a78..d22041ceeb 100644 --- a/crates/relayer-rest/Cargo.toml +++ b/crates/relayer-rest/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-rest" -version = "0.29.0" +version = "0.29.1" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index ddf4c7a036..fc639a7517 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -64,7 +64,7 @@ async fn version() { let rest_api_version = VersionInfo { name: "ibc-relayer-rest".to_string(), - version: "0.29.0".to_string(), + version: "0.29.1".to_string(), }; let result: JsonResult<_, ()> = JsonResult::Success(vec![version.clone(), rest_api_version]); diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index ef6c416300..6c20d94516 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-types" -version = "0.29.0" +version = "0.29.1" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index eb2ae72040..b470743bca 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer" -version = "0.29.0" +version = "0.29.1" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index 576391b455..91c496b04f 100644 --- a/crates/relayer/src/lib.rs +++ b/crates/relayer/src/lib.rs @@ -14,7 +14,7 @@ //! //! For the IBC relayer binary, please see [Hermes] (`ibc-relayer-cli` crate). //! -//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.10.0/ +//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.10.1/ extern crate alloc; @@ -48,4 +48,4 @@ pub mod upgrade_chain; pub mod util; pub mod worker; -pub const HERMES_VERSION: &str = "1.10.0"; +pub const HERMES_VERSION: &str = "1.10.1"; diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index f669d97192..782d5f0817 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-telemetry" -version = "0.29.0" +version = "0.29.1" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/guide/README.md b/guide/README.md index da48d7ab98..5b3e24d2ab 100644 --- a/guide/README.md +++ b/guide/README.md @@ -10,7 +10,7 @@ mdBook is a utility to create modern online books from Markdown files. This guide should be permanently deployed at its latest stable version at [hermes.informal.systems](https://hermes.informal.systems). -Current version: `v1.10.0`. +Current version: `v1.10.1`. The version of this guide is aligned with the [versioning of the ibc crates](../README.md). diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index 0368142aec..4e07270962 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -1,6 +1,6 @@ # Summary -# Hermes v1.10.0 +# Hermes v1.10.1 --- - [Introduction](./index.md) diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 12208449d4..c28ce0ba62 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-integration-test" -version = "0.29.0" +version = "0.29.1" edition = "2021" rust-version = "1.76.0" license = "Apache-2.0" diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 454c490c36..9661d0c97b 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-test-framework" -version = "0.29.0" +version = "0.29.1" edition = "2021" license = "Apache-2.0" readme = "README.md" From 3a6ff49f8633d1b9bf6293be95c22846722ad7e8 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 29 Jul 2024 20:20:22 +0200 Subject: [PATCH 157/200] Fix `memo_overwrite` configuration (#4103) * Fix clippy warnings from v1.80 * Move clippy allow mutable_key_type * Remove unnecessary clippy allow mutable_key_type * Fix overwrite memo implementation * Add changelog entry --- .../bug-fixe/4104-memo-overwrite-bug.md | 3 +++ crates/relayer-cli/src/commands/tx/channel.rs | 2 +- crates/relayer-cli/src/conclude.rs | 6 ++--- crates/relayer-cli/tests/acceptance.rs | 2 -- crates/relayer/src/chain/cosmos.rs | 26 ++++++++++++++++--- crates/relayer/src/config/filter.rs | 2 ++ crates/relayer/src/link/relay_path.rs | 2 +- .../src/tests/fee/filter_fees.rs | 2 ++ tools/integration-test/src/tests/memo.rs | 2 +- 9 files changed, 35 insertions(+), 12 deletions(-) create mode 100644 .changelog/unreleased/bug-fixe/4104-memo-overwrite-bug.md diff --git a/.changelog/unreleased/bug-fixe/4104-memo-overwrite-bug.md b/.changelog/unreleased/bug-fixe/4104-memo-overwrite-bug.md new file mode 100644 index 0000000000..785c896cc6 --- /dev/null +++ b/.changelog/unreleased/bug-fixe/4104-memo-overwrite-bug.md @@ -0,0 +1,3 @@ +- Fix the `memo_overwrite` configuration to correctly apply the + overwrite if it is configured. + ([\#4104](https://github.com/informalsystems/hermes/issues/4104)) \ No newline at end of file diff --git a/crates/relayer-cli/src/commands/tx/channel.rs b/crates/relayer-cli/src/commands/tx/channel.rs index de75a48aaf..7db47011e7 100644 --- a/crates/relayer-cli/src/commands/tx/channel.rs +++ b/crates/relayer-cli/src/commands/tx/channel.rs @@ -23,7 +23,7 @@ use crate::prelude::*; /// /// The macro takes the following arguments: /// - `$dbg_string`: a string literal that will be used to identify the subcommand -/// in debug logs +/// in debug logs /// - `$func`: the method that will be called to build and send the `Channel` message /// - `$self`: the type that `Runnable` is being implemented for /// - `$chan`: a closure that specifies how to build the `Channel` object diff --git a/crates/relayer-cli/src/conclude.rs b/crates/relayer-cli/src/conclude.rs index f2190ceb42..7ee650583c 100644 --- a/crates/relayer-cli/src/conclude.rs +++ b/crates/relayer-cli/src/conclude.rs @@ -17,9 +17,9 @@ //! ``` //! //! - Exit from a query/tx with an error of type `anomaly`: -//! In the case where the error is a complex type such as anomaly (including backtraces), it is -//! better to simplify the output and only write out the chain of error sources, which we can -//! achieve with `format!("{}", e)`. The complete solution is as follows: +//! In the case where the error is a complex type such as anomaly (including backtraces), it is +//! better to simplify the output and only write out the chain of error sources, which we can +//! achieve with `format!("{}", e)`. The complete solution is as follows: //! //! ```ignore //! let e: Error = Kind::Query.into(); diff --git a/crates/relayer-cli/tests/acceptance.rs b/crates/relayer-cli/tests/acceptance.rs index 208164e0bf..6b568ee1ef 100644 --- a/crates/relayer-cli/tests/acceptance.rs +++ b/crates/relayer-cli/tests/acceptance.rs @@ -24,7 +24,6 @@ use once_cell::sync::Lazy; pub static RUNNER: Lazy = Lazy::new(CmdRunner::default); /// Use `Config::default()` value if no config or args -#[cfg(not(tarpaulin))] #[test] fn start_no_args() { let mut runner = RUNNER.clone(); @@ -40,7 +39,6 @@ fn start_no_args() { cmd.wait().unwrap().expect_success(); } -#[cfg(not(tarpaulin))] #[test] fn example_configuration_is_valid() { let mut runner = RUNNER.clone(); diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index ae1291a625..c0f6e9c3ad 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -783,13 +783,19 @@ impl CosmosSdkChain { let account = get_or_fetch_account(&self.grpc_addr, &key_account, &mut self.account).await?; + let memo_prefix = if let Some(memo_overwrite) = &self.config.memo_overwrite { + memo_overwrite.clone() + } else { + self.config.memo_prefix.clone() + }; + if self.config.sequential_batch_tx { sequential_send_batched_messages_and_wait_commit( &self.rpc_client, &self.tx_config, &key_pair, account, - &self.config.memo_prefix, + &memo_prefix, proto_msgs, ) .await @@ -799,7 +805,7 @@ impl CosmosSdkChain { &self.tx_config, &key_pair, account, - &self.config.memo_prefix, + &memo_prefix, proto_msgs, ) .await @@ -834,12 +840,18 @@ impl CosmosSdkChain { let account = get_or_fetch_account(&self.grpc_addr, &key_account, &mut self.account).await?; + let memo_prefix = if let Some(memo_overwrite) = &self.config.memo_overwrite { + memo_overwrite.clone() + } else { + self.config.memo_prefix.clone() + }; + send_batched_messages_and_wait_check_tx( &self.rpc_client, &self.tx_config, &key_pair, account, - &self.config.memo_prefix, + &memo_prefix, proto_msgs, ) .await @@ -2379,12 +2391,18 @@ impl ChainEndpoint for CosmosSdkChain { let address = self.get_signer()?; let key_pair = self.key()?; + let memo_prefix = if let Some(memo_overwrite) = &self.config.memo_overwrite { + memo_overwrite.clone() + } else { + self.config.memo_prefix.clone() + }; + self.rt.block_on(maybe_register_counterparty_payee( &self.rpc_client, &self.tx_config, &key_pair, &mut self.account, - &self.config.memo_prefix, + &memo_prefix, channel_id, port_id, &address, diff --git a/crates/relayer/src/config/filter.rs b/crates/relayer/src/config/filter.rs index 576c62a8ee..5feb4376e1 100644 --- a/crates/relayer/src/config/filter.rs +++ b/crates/relayer/src/config/filter.rs @@ -1,5 +1,7 @@ //! Custom `serde` deserializer for `FilterMatch` +#![allow(clippy::mutable_key_type)] + use core::fmt; use core::str::FromStr; use itertools::Itertools; diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index 04a34947b9..790571f482 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -744,7 +744,7 @@ impl RelayPath { /// Return value: /// - `Some(..)`: a new operational data from which to retry sending, /// - `None`: all the events in the initial operational data were exhausted (i.e., turned - /// into timeouts), so there is nothing to retry. + /// into timeouts), so there is nothing to retry. /// /// Side effects: may schedule a new operational data targeting the source chain, comprising /// new timeout messages. diff --git a/tools/integration-test/src/tests/fee/filter_fees.rs b/tools/integration-test/src/tests/fee/filter_fees.rs index 218229d65f..963e93e2d8 100644 --- a/tools/integration-test/src/tests/fee/filter_fees.rs +++ b/tools/integration-test/src/tests/fee/filter_fees.rs @@ -1,3 +1,5 @@ +#![allow(clippy::mutable_key_type)] + use std::collections::HashMap; use ibc_relayer::config::filter::{ChannelPolicy, FeePolicy, FilterPattern, MinFee}; diff --git a/tools/integration-test/src/tests/memo.rs b/tools/integration-test/src/tests/memo.rs index a44ee417cf..cf59bb712d 100644 --- a/tools/integration-test/src/tests/memo.rs +++ b/tools/integration-test/src/tests/memo.rs @@ -23,7 +23,7 @@ fn test_memo() -> Result<(), Error> { #[test] fn test_memo_overwrite() -> Result<(), Error> { let memo = Memo::new(random_string()).unwrap(); - let test = MemoTest { memo }; + let test = MemoOverwriteTest { memo }; run_binary_channel_test(&test) } From 3a412480cbc97601fab0c38f74af5ca36495b048 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jul 2024 09:21:35 +0200 Subject: [PATCH 158/200] Bump serde_json from 1.0.120 to 1.0.121 (#4105) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.120 to 1.0.121. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.120...v1.0.121) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 5 +++-- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14d9856c52..085d135e93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2943,11 +2943,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] diff --git a/Cargo.toml b/Cargo.toml index 3d8a2fca2f..c698255ab7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ secp256k1 = "0.28.2" semver = "1.0.21" serde = "1.0.204" serde_derive = "1.0.104" -serde_json = "1.0.120" +serde_json = "1.0.121" serde_yaml = "0.9.34" serial_test = "3.1.1" sha2 = "0.10.6" From 46acb7ecdef197b19fb089632371f535904ec106 Mon Sep 17 00:00:00 2001 From: omahs <73983677+omahs@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:09:22 +0200 Subject: [PATCH 159/200] Fix typos (#4109) * fix typo Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typo Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typo Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typo Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typo Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typo Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typos Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typo Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> * fix typo Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> --------- Signed-off-by: omahs <73983677+omahs@users.noreply.github.com> --- crates/relayer-cli/src/commands.rs | 2 +- crates/relayer-cli/src/commands/query/transfer/denom_trace.rs | 2 +- crates/relayer/src/channel/version.rs | 2 +- crates/relayer/src/foreign_client.rs | 4 ++-- docs/architecture/adr-008-ics20-implementation.md | 2 +- guide/src/templates/help_templates/health-check.md | 2 +- guide/src/templates/help_templates/help.md | 2 +- tools/test-framework/src/chain/ext/crosschainquery.rs | 2 +- tools/test-framework/src/types/tagged/mod.rs | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/relayer-cli/src/commands.rs b/crates/relayer-cli/src/commands.rs index e922061029..fbd50510dd 100644 --- a/crates/relayer-cli/src/commands.rs +++ b/crates/relayer-cli/src/commands.rs @@ -100,7 +100,7 @@ pub enum CliCmd { /// The `version` subcommand, retained for backward compatibility. Version(VersionCmd), - /// Performs a health check of all chains in the the config + /// Performs a health check of all chains in the config HealthCheck(HealthCheckCmd), /// Generate auto-complete scripts for different shells. diff --git a/crates/relayer-cli/src/commands/query/transfer/denom_trace.rs b/crates/relayer-cli/src/commands/query/transfer/denom_trace.rs index 3ce25c0658..a678b93ff6 100644 --- a/crates/relayer-cli/src/commands/query/transfer/denom_trace.rs +++ b/crates/relayer-cli/src/commands/query/transfer/denom_trace.rs @@ -14,7 +14,7 @@ use crate::conclude::{exit_with_unrecoverable_error, json, Output}; /// /// `query transfer denom-trace --chain --hash ` /// -/// If successful the the base denomination and the path will be displayed. +/// If successful the base denomination and the path will be displayed. #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct DenomTraceCmd { #[clap( diff --git a/crates/relayer/src/channel/version.rs b/crates/relayer/src/channel/version.rs index 2aaf0b36ea..bbca71403e 100644 --- a/crates/relayer/src/channel/version.rs +++ b/crates/relayer/src/channel/version.rs @@ -8,7 +8,7 @@ use ibc_relayer_types::{applications::transfer, core::ics24_host::identifier::Po pub use ibc_relayer_types::core::ics04_channel::version::Version; -/// Returns the default channel version, depending on the the given [`PortId`]. +/// Returns the default channel version, depending on the given [`PortId`]. pub fn default_by_port(port_id: &PortId) -> Option { if port_id.as_str() == transfer::PORT_ID_STR { // https://github.com/cosmos/ibc/tree/master/spec/app/ics-020-fungible-token-transfer#forwards-compatibility diff --git a/crates/relayer/src/foreign_client.rs b/crates/relayer/src/foreign_client.rs index 2a3cf41d01..8fded33524 100644 --- a/crates/relayer/src/foreign_client.rs +++ b/crates/relayer/src/foreign_client.rs @@ -963,7 +963,7 @@ impl ForeignClient ForeignClient(ctx: &Ctx, data: &FungibleTokenPacketData) -> Resu refund_packet_token(ctx, data) } -/// Responds to the the success or failure of a packet +/// Responds to the success or failure of a packet /// acknowledgement written on the receiving chain. If the acknowledgement /// was a success then nothing occurs. If the acknowledgement failed, then /// the sender is refunded their tokens. diff --git a/guide/src/templates/help_templates/health-check.md b/guide/src/templates/help_templates/health-check.md index 75638bd5ee..ad6b954fa2 100644 --- a/guide/src/templates/help_templates/health-check.md +++ b/guide/src/templates/help_templates/health-check.md @@ -1,5 +1,5 @@ DESCRIPTION: -Performs a health check of all chains in the the config +Performs a health check of all chains in the config USAGE: hermes health-check diff --git a/guide/src/templates/help_templates/help.md b/guide/src/templates/help_templates/help.md index 8a0011bd76..0f0038d664 100644 --- a/guide/src/templates/help_templates/help.md +++ b/guide/src/templates/help_templates/help.md @@ -19,7 +19,7 @@ SUBCOMMANDS: create Create objects (client, connection, or channel) on chains evidence Listen to block events and handles evidence fee Interact with the fee middleware - health-check Performs a health check of all chains in the the config + health-check Performs a health check of all chains in the config help Print this message or the help of the given subcommand(s) keys Manage keys in the relayer for each chain listen Listen to and display IBC events emitted by a chain diff --git a/tools/test-framework/src/chain/ext/crosschainquery.rs b/tools/test-framework/src/chain/ext/crosschainquery.rs index f41f89abeb..dbdbaa9500 100644 --- a/tools/test-framework/src/chain/ext/crosschainquery.rs +++ b/tools/test-framework/src/chain/ext/crosschainquery.rs @@ -71,7 +71,7 @@ impl<'a, Chain: Send> CrossChainQueryMethodsExt for MonoTagged(&output) .map_err(handle_generic_error)? .get("pending_queries") diff --git a/tools/test-framework/src/types/tagged/mod.rs b/tools/test-framework/src/types/tagged/mod.rs index 50f75dc6ca..fed89701e2 100644 --- a/tools/test-framework/src/types/tagged/mod.rs +++ b/tools/test-framework/src/types/tagged/mod.rs @@ -70,7 +70,7 @@ a `ChannelId` value that is used on `ChainA` to identify a channel that is connected to `ChainB`. With the tagged identifier, it is more unlikely for us to accidentally use the `ChannelId` coming from - counterparty chain, as it would have the the type + counterparty chain, as it would have the type `DualTagged` and thus result in type error. From cc2500d46e14bde2750fa363b06a54301a2dbd41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:10:27 +0200 Subject: [PATCH 160/200] Bump toml from 0.8.15 to 0.8.16 (#4108) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.15 to 0.8.16. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.15...toml-v0.8.16) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 26 +++++++++++++------------- Cargo.toml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 085d135e93..b294d19493 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1541,7 +1541,7 @@ dependencies = [ "tendermint", "tendermint-rpc", "time", - "toml 0.8.15", + "toml 0.8.16", "tonic", ] @@ -1625,7 +1625,7 @@ dependencies = [ "tiny-keccak", "tokio", "tokio-stream", - "toml 0.8.15", + "toml 0.8.16", "tonic", "tracing", "tracing-subscriber", @@ -1684,7 +1684,7 @@ dependencies = [ "reqwest", "serde", "tokio", - "toml 0.8.15", + "toml 0.8.16", "tracing", ] @@ -1765,7 +1765,7 @@ dependencies = [ "subtle-encoding", "tendermint-rpc", "tokio", - "toml 0.8.15", + "toml 0.8.16", "tonic", "tracing", "tracing-subscriber", @@ -2976,9 +2976,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -3350,7 +3350,7 @@ dependencies = [ "serde", "serde_json", "tendermint", - "toml 0.8.15", + "toml 0.8.16", "url", ] @@ -3717,9 +3717,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" +checksum = "81967dd0dd2c1ab0bc3468bd7caecc32b8a4aa47d0c8c695d8c2b2108168d62c" dependencies = [ "serde", "serde_spanned", @@ -3729,18 +3729,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.16" +version = "0.22.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" +checksum = "8d9f8729f5aea9562aac1cc0441f5d6de3cff1ee0c5d67293eeca5eb36ee7c16" dependencies = [ "indexmap 2.2.6", "serde", diff --git a/Cargo.toml b/Cargo.toml index c698255ab7..58bd35fe84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -110,7 +110,7 @@ tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } tokio = "1.26.0" tokio-stream = "0.1.14" -toml = "0.8.15" +toml = "0.8.16" tonic = "0.12" tracing = { version = "0.1.36", default-features = false } tracing-subscriber = "0.3.14" From cd45e53b049cabdd89d84cdad095c0a9132661f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 14:11:09 +0200 Subject: [PATCH 161/200] Bump env_logger from 0.11.4 to 0.11.5 (#4106) Bumps [env_logger](https://github.com/rust-cli/env_logger) from 0.11.4 to 0.11.5. - [Release notes](https://github.com/rust-cli/env_logger/releases) - [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md) - [Commits](https://github.com/rust-cli/env_logger/compare/v0.11.4...v0.11.5) --- updated-dependencies: - dependency-name: env_logger dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b294d19493..d20910950e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -964,9 +964,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06676b12debf7bba6903559720abca942d3a66b8acb88815fd2c7c6537e9ade1" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" dependencies = [ "anstream", "anstyle", diff --git a/Cargo.toml b/Cargo.toml index 58bd35fe84..5e8958efac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ dirs-next = "2.0.0" ed25519 = "2.2.2" ed25519-dalek = "2.0.0" ed25519-dalek-bip32 = "0.3.0" -env_logger = "0.11.1" +env_logger = "0.11.5" eyre = "0.6.12" flex-error = { version = "0.4.4", default-features = false } futures = "0.3.27" From 1607f4b5ed9de4ac1460c0bbe99a80557c253489 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 09:33:02 +0200 Subject: [PATCH 162/200] Bump toml from 0.8.16 to 0.8.19 (#4128) Bumps [toml](https://github.com/toml-rs/toml) from 0.8.16 to 0.8.19. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.16...toml-v0.8.19) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 26 +++++++++++++------------- Cargo.toml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d20910950e..6b392b6afb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1541,7 +1541,7 @@ dependencies = [ "tendermint", "tendermint-rpc", "time", - "toml 0.8.16", + "toml 0.8.19", "tonic", ] @@ -1625,7 +1625,7 @@ dependencies = [ "tiny-keccak", "tokio", "tokio-stream", - "toml 0.8.16", + "toml 0.8.19", "tonic", "tracing", "tracing-subscriber", @@ -1684,7 +1684,7 @@ dependencies = [ "reqwest", "serde", "tokio", - "toml 0.8.16", + "toml 0.8.19", "tracing", ] @@ -1765,7 +1765,7 @@ dependencies = [ "subtle-encoding", "tendermint-rpc", "tokio", - "toml 0.8.16", + "toml 0.8.19", "tonic", "tracing", "tracing-subscriber", @@ -3350,7 +3350,7 @@ dependencies = [ "serde", "serde_json", "tendermint", - "toml 0.8.16", + "toml 0.8.19", "url", ] @@ -3717,9 +3717,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81967dd0dd2c1ab0bc3468bd7caecc32b8a4aa47d0c8c695d8c2b2108168d62c" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", @@ -3729,18 +3729,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.17" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9f8729f5aea9562aac1cc0441f5d6de3cff1ee0c5d67293eeca5eb36ee7c16" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ "indexmap 2.2.6", "serde", @@ -4344,9 +4344,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "557404e450152cd6795bb558bca69e43c585055f4606e3bcae5894fc6dac9ba0" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 5e8958efac..eec5931ae2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -110,7 +110,7 @@ tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } tokio = "1.26.0" tokio-stream = "0.1.14" -toml = "0.8.16" +toml = "0.8.19" tonic = "0.12" tracing = { version = "0.1.36", default-features = false } tracing-subscriber = "0.3.14" From e837cecfc540f06380a757131a0ccf67f3345a3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Aug 2024 07:34:02 +0000 Subject: [PATCH 163/200] Bump serde_json from 1.0.121 to 1.0.122 (#4127) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.121 to 1.0.122. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.121...v1.0.122) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b392b6afb..9811203489 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2943,9 +2943,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.121" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609" +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" dependencies = [ "itoa", "memchr", diff --git a/Cargo.toml b/Cargo.toml index eec5931ae2..4f23180fab 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ secp256k1 = "0.28.2" semver = "1.0.21" serde = "1.0.204" serde_derive = "1.0.104" -serde_json = "1.0.121" +serde_json = "1.0.122" serde_yaml = "0.9.34" serial_test = "3.1.1" sha2 = "0.10.6" From bd750557360716779a74363a072e97ae83482a1a Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 6 Aug 2024 09:39:12 +0200 Subject: [PATCH 164/200] Update Gaia version running in CI to v18 (#4113) * Update Nix flake and add Gaia v18 * Add new Cosmos chain type which enables dynamic fees during bootstrap * Update Gaia version running in CI to v18 * Use dynamic fee for misbehaviour test scripts * Fix chain CLIs which require fees * Add changelog entry * Increase gas_multiplier for misbehaviour test config * Fix fees for Provenance chain * Improve logs related to failed simulated gas --- .../4114-update-gaia-to-v18.md | 2 ++ .github/workflows/integration.yaml | 10 +++---- .github/workflows/misbehaviour.yml | 2 +- .github/workflows/multi-chains.yaml | 2 +- ci/misbehaviour/config.toml | 14 +++++++++ ci/misbehaviour/config_fork.toml | 18 +++++++++-- crates/relayer/src/sdk_error.rs | 2 +- flake.lock | 30 +++++++++++++++---- flake.nix | 2 +- tools/integration-test/src/mbt/transfer.rs | 2 +- .../src/tests/channel_upgrade/ica.rs | 4 +-- .../src/tests/clear_packet.rs | 2 +- tools/integration-test/src/tests/ica.rs | 4 +-- .../ica_ordered_channel.rs | 2 +- .../tests/interchain_security/ica_transfer.rs | 2 +- .../integration-test/src/tests/supervisor.rs | 6 ++-- tools/test-framework/src/chain/chain_type.rs | 21 ++++++++----- .../test-framework/src/chain/cli/provider.rs | 20 +++++++++++-- .../test-framework/src/chain/cli/transfer.rs | 29 ++++++++++++++++-- tools/test-framework/src/chain/cli/upgrade.rs | 26 +++++++++++++++- tools/test-framework/src/chain/driver.rs | 1 + .../test-framework/src/chain/ext/bootstrap.rs | 3 ++ .../src/framework/binary/ics.rs | 10 ++++--- tools/test-framework/src/relayer/tx.rs | 18 ++++++----- tools/test-framework/src/types/single/node.rs | 8 ++++- 25 files changed, 188 insertions(+), 52 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4114-update-gaia-to-v18.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4114-update-gaia-to-v18.md b/.changelog/unreleased/improvements/ibc-integration-test/4114-update-gaia-to-v18.md new file mode 100644 index 0000000000..736461adba --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4114-update-gaia-to-v18.md @@ -0,0 +1,2 @@ +- Update the version of Gaia running the integration tests in the CI from `v17.2.1` + to `v18.1.0`([\#4114](https://github.com/informalsystems/hermes/issues/4114)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 4131034910..9f44d793ee 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -45,7 +45,7 @@ jobs: fail-fast: false matrix: chain: - - package: gaia17 + - package: gaia18 command: gaiad account_prefix: cosmos native_token: stake @@ -171,10 +171,10 @@ jobs: fail-fast: false matrix: chain: - - package: .#gaia17 .#stride + - package: .#gaia18 .#stride command: gaiad,strided account_prefix: cosmos,stride - - package: .#gaia17 .#neutron + - package: .#gaia18 .#neutron command: gaiad,neutrond account_prefix: cosmos,neutron steps: @@ -216,7 +216,7 @@ jobs: fail-fast: false matrix: chain: - - package: .#gaia17 .#stride-no-admin + - package: .#gaia18 .#stride-no-admin command: gaiad,strided account_prefix: cosmos,stride steps: @@ -257,7 +257,7 @@ jobs: fail-fast: false matrix: chain: - - package: .#celestia .#gaia17 + - package: .#celestia .#gaia18 command: celestia-appd,gaiad account_prefix: celestia,cosmos native_token: utia,stake diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index abede42602..43dfc6635d 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -43,7 +43,7 @@ jobs: fail-fast: false matrix: chain: - - package: gaia17 + - package: gaia18 command: gaiad account_prefix: cosmos steps: diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index 5d74e8fe02..a4063ee878 100644 --- a/.github/workflows/multi-chains.yaml +++ b/.github/workflows/multi-chains.yaml @@ -58,7 +58,7 @@ jobs: fail-fast: false matrix: first-package: - - package: gaia17 + - package: gaia18 command: gaiad account_prefix: cosmos - package: ibc-go-v7-simapp diff --git a/ci/misbehaviour/config.toml b/ci/misbehaviour/config.toml index 92845f89ed..41b18706fd 100644 --- a/ci/misbehaviour/config.toml +++ b/ci/misbehaviour/config.toml @@ -211,6 +211,19 @@ gas_price = { price = 0.001, denom = 'stake' } # Minimum value: 1.0 gas_multiplier = 1.3 +# Query the current gas price from the chain instead of using the static `gas_price` from the config. +# Useful for chains which have [EIP-1559][eip]-like dynamic gas price. +# +# At the moment, only chains which support the `osmosis.txfees.v1beta1.Query/GetEipBaseFee` +# query or have enabled Skip's `x/feemarket` module https://github.com/skip-mev/feemarket +# can be used with dynamic gas price enabled. +# +# See this page in the Hermes guide for more information: +# https://hermes.informal.systems/documentation/configuration/dynamic-gas-fees.html +# +# Default: { enabled = false, multiplier = 1.1, max = 0.6 } +dynamic_gas_price = { enabled = true, multiplier = 1.3, max = 5.0 } + # Specify how many IBC messages at most to include in a single transaction. # Default: 30 max_msg_num = 30 @@ -314,6 +327,7 @@ default_gas = 100000 max_gas = 400000 gas_price = { price = 0.001, denom = 'stake' } gas_multiplier = 1.3 +dynamic_gas_price = { enabled = true, multiplier = 1.3, max = 5.0 } max_msg_num = 30 max_tx_size = 2097152 clock_drift = '5s' diff --git a/ci/misbehaviour/config_fork.toml b/ci/misbehaviour/config_fork.toml index 060dda1566..d637f8db48 100644 --- a/ci/misbehaviour/config_fork.toml +++ b/ci/misbehaviour/config_fork.toml @@ -208,7 +208,20 @@ gas_price = { price = 0.001, denom = 'stake' } # # Default: 1.1, ie. the gas is increased by 10% # Minimum value: 1.0 -gas_multiplier = 1.1 +gas_multiplier = 1.3 + +# Query the current gas price from the chain instead of using the static `gas_price` from the config. +# Useful for chains which have [EIP-1559][eip]-like dynamic gas price. +# +# At the moment, only chains which support the `osmosis.txfees.v1beta1.Query/GetEipBaseFee` +# query or have enabled Skip's `x/feemarket` module https://github.com/skip-mev/feemarket +# can be used with dynamic gas price enabled. +# +# See this page in the Hermes guide for more information: +# https://hermes.informal.systems/documentation/configuration/dynamic-gas-fees.html +# +# Default: { enabled = false, multiplier = 1.1, max = 0.6 } +dynamic_gas_price = { enabled = true, multiplier = 1.3, max = 5.0 } # Specify how many IBC messages at most to include in a single transaction. # Default: 30 @@ -312,7 +325,8 @@ store_prefix = 'ibc' default_gas = 100000 max_gas = 400000 gas_price = { price = 0.001, denom = 'stake' } -gas_multiplier = 1.1 +gas_multiplier = 1.3 +dynamic_gas_price = { enabled = true, multiplier = 1.3, max = 5.0 } max_msg_num = 30 max_tx_size = 2097152 clock_drift = '5s' diff --git a/crates/relayer/src/sdk_error.rs b/crates/relayer/src/sdk_error.rs index 327404b2e9..f9694716a3 100644 --- a/crates/relayer/src/sdk_error.rs +++ b/crates/relayer/src/sdk_error.rs @@ -32,7 +32,7 @@ define_error! { OutOfGasSimulated { code: u32, amount: u64 } - |e| { format_args!("the issue might have been caused by the configured max gas which binds the gas used. Please check the Hermes config.toml and increase the configured `max_gas`. Curerent value is `{}`", e.amount) }, + |e| { format_args!("the issue might have been caused by a misconfiguration of Hermes. Please check the Hermes config.toml and increase either the `max_gas` or `gas_multiplier` settings. Simulated gas was: {}", e.amount) }, InsufficientFee { code: u32 } diff --git a/flake.lock b/flake.lock index 024b9948d6..0c259e1dfc 100644 --- a/flake.lock +++ b/flake.lock @@ -156,6 +156,7 @@ "gaia14-src": "gaia14-src", "gaia15-src": "gaia15-src", "gaia17-src": "gaia17-src", + "gaia18-src": "gaia18-src", "gaia5-src": "gaia5-src", "gaia6-ordered-src": "gaia6-ordered-src", "gaia6-src": "gaia6-src", @@ -216,11 +217,11 @@ "wasmvm_2_0_0-src": "wasmvm_2_0_0-src" }, "locked": { - "lastModified": 1718033821, - "narHash": "sha256-Y7zF1PWl6W6pSj2Hh6dl+n+udu/6jJV+ODinxk44YqU=", + "lastModified": 1721927677, + "narHash": "sha256-fD8yDMOuJWx0WwlgAO07QrhbDwZ+PRl7HMVG4uwgFnk=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "0475f2c4fff872218f70bae9c0c2ea49e2cfe785", + "rev": "826b8ddd3c397306dc67de0646b27dc5656fadf9", "type": "github" }, "original": { @@ -629,6 +630,23 @@ "type": "github" } }, + "gaia18-src": { + "flake": false, + "locked": { + "lastModified": 1720430036, + "narHash": "sha256-wATunCFeMgCP9usv2TK/IKDGZIWfOKx2zWip5qWDuqk=", + "owner": "cosmos", + "repo": "gaia", + "rev": "58b4e54a95c7fc6a64272ccd0f09f46213c005ad", + "type": "github" + }, + "original": { + "owner": "cosmos", + "ref": "v18.1.0", + "repo": "gaia", + "type": "github" + } + }, "gaia5-src": { "flake": false, "locked": { @@ -1360,11 +1378,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1717893485, - "narHash": "sha256-WMU6ZRZrBgEUDIF0siu2aIyVAXcxfElSwzZtS/mSpN4=", + "lastModified": 1722640603, + "narHash": "sha256-TcXjLVNd3VeH1qKPH335Tc4RbFDbZQX+d7rqnDUoRaY=", "owner": "nixos", "repo": "nixpkgs", - "rev": "3bcedce9f4de37570242faf16e1e143583407eab", + "rev": "81610abc161d4021b29199aa464d6a1a521e0cc9", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index fd4d4f6fee..ed71fd6581 100644 --- a/flake.nix +++ b/flake.nix @@ -32,7 +32,7 @@ cometbft evmos gaia6-ordered - gaia17 + gaia18 ibc-go-v2-simapp ibc-go-v3-simapp ibc-go-v4-simapp diff --git a/tools/integration-test/src/mbt/transfer.rs b/tools/integration-test/src/mbt/transfer.rs index 9b8cfcf6a8..e10b595112 100644 --- a/tools/integration-test/src/mbt/transfer.rs +++ b/tools/integration-test/src/mbt/transfer.rs @@ -204,7 +204,7 @@ impl BinaryChannelTest for IbcTransferMBT { *target, *denom, *amount, - &fee_denom_a.with_amount(1200u64).as_ref(), + &fee_denom_a.with_amount(381000000u64).as_ref(), )?; info!("[LocalTransfer] Done"); } diff --git a/tools/integration-test/src/tests/channel_upgrade/ica.rs b/tools/integration-test/src/tests/channel_upgrade/ica.rs index 1721bad2e0..8ddd4fb5c7 100644 --- a/tools/integration-test/src/tests/channel_upgrade/ica.rs +++ b/tools/integration-test/src/tests/channel_upgrade/ica.rs @@ -221,7 +221,7 @@ impl BinaryConnectionTest for ChannelUpgradeICACloseChannel { &chains.node_b.wallets().user1(), &ica_address.as_ref(), &stake_denom.with_amount(ica_fund).as_ref(), - &fee_denom_host.with_amount(1200u64).as_ref(), + &fee_denom_host.with_amount(381000000u64).as_ref(), )?; chains.node_b.chain_driver().assert_eventual_wallet_amount( @@ -382,7 +382,7 @@ impl BinaryConnectionTest for ChannelUpgradeICAUnordered { &chains.node_b.wallets().user1(), &ica_address.as_ref(), &stake_denom.with_amount(ica_fund).as_ref(), - &fee_denom_host.with_amount(1200u64).as_ref(), + &fee_denom_host.with_amount(381000000u64).as_ref(), )?; chains.node_b.chain_driver().assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/clear_packet.rs b/tools/integration-test/src/tests/clear_packet.rs index 1bb19077ef..40f3e2c26e 100644 --- a/tools/integration-test/src/tests/clear_packet.rs +++ b/tools/integration-test/src/tests/clear_packet.rs @@ -170,7 +170,7 @@ impl BinaryChannelTest for ClearPacketRecoveryTest { &relayer_wallet_b.as_ref(), &wallet_b.address(), &denom_b1.with_amount(100u64).as_ref(), - &fee_denom_b.with_amount(1200u64).as_ref(), + &fee_denom_b.with_amount(381000000u64).as_ref(), )?; let amount1 = random_u128_range(1000, 5000); diff --git a/tools/integration-test/src/tests/ica.rs b/tools/integration-test/src/tests/ica.rs index 8087a671a1..090c18d2df 100644 --- a/tools/integration-test/src/tests/ica.rs +++ b/tools/integration-test/src/tests/ica.rs @@ -129,7 +129,7 @@ impl BinaryConnectionTest for IcaFilterTestAllow { &chains.node_b.wallets().user1(), &ica_address.as_ref(), &stake_denom.with_amount(ica_fund).as_ref(), - &fee_denom_host.with_amount(1200u64).as_ref(), + &fee_denom_host.with_amount(381000000u64).as_ref(), )?; chains.node_b.chain_driver().assert_eventual_wallet_amount( @@ -299,7 +299,7 @@ impl BinaryConnectionTest for ICACloseChannelTest { &chains.node_b.wallets().user1(), &ica_address.as_ref(), &stake_denom.with_amount(ica_fund).as_ref(), - &fee_denom_host.with_amount(1200u64).as_ref(), + &fee_denom_host.with_amount(381000000u64).as_ref(), )?; chains.node_b.chain_driver().assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs b/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs index 04fad4bcee..b54786c85c 100644 --- a/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs +++ b/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs @@ -115,7 +115,7 @@ impl BinaryChannelTest for IcaOrderedChannelTest { &chains.node_a.wallets().user1(), &ica_address.as_ref(), &stake_denom.with_amount(ica_fund).as_ref(), - &fee_denom_a.with_amount(1200u64).as_ref(), + &fee_denom_a.with_amount(381000000u64).as_ref(), )?; chains.node_a.chain_driver().assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs index b09fe79c7f..35df6a56aa 100644 --- a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs +++ b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs @@ -88,7 +88,7 @@ impl BinaryChannelTest for InterchainSecurityIcaTransferTest { &chains.node_a.wallets().user1(), &ica_address.as_ref(), &stake_denom.with_amount(ica_fund).as_ref(), - &fee_denom_a.with_amount(1200u64).as_ref(), + &fee_denom_a.with_amount(381000000u64).as_ref(), )?; chains.node_a.chain_driver().assert_eventual_wallet_amount( diff --git a/tools/integration-test/src/tests/supervisor.rs b/tools/integration-test/src/tests/supervisor.rs index 7ddd3597fb..17ee1b5af7 100644 --- a/tools/integration-test/src/tests/supervisor.rs +++ b/tools/integration-test/src/tests/supervisor.rs @@ -7,7 +7,7 @@ use ibc_test_framework::relayer::connection::{ }; #[test] -fn test_supervisor() -> Result<(), Error> { +fn test_supervisor1() -> Result<(), Error> { run_binary_chain_test(&SupervisorTest) } @@ -116,14 +116,14 @@ impl BinaryChainTest for SupervisorTest { &chains.node_a.wallets().relayer(), &chains.node_a.wallets().user2().address(), &denom_a.with_amount(1000u64).as_ref(), - &fee_denom_a.with_amount(1200u64).as_ref(), + &fee_denom_a.with_amount(381000000u64).as_ref(), )?; chains.node_b.chain_driver().local_transfer_token( &chains.node_b.wallets().relayer(), &chains.node_b.wallets().user2().address(), &chains.node_b.denom().with_amount(1000u64).as_ref(), - &fee_denom_b.with_amount(1200u64).as_ref(), + &fee_denom_b.with_amount(381000000u64).as_ref(), )?; info!( diff --git a/tools/test-framework/src/chain/chain_type.rs b/tools/test-framework/src/chain/chain_type.rs index 1eba905087..5dc727c33c 100644 --- a/tools/test-framework/src/chain/chain_type.rs +++ b/tools/test-framework/src/chain/chain_type.rs @@ -11,7 +11,7 @@ const PROVENANCE_HD_PATH: &str = "m/44'/505'/0'/0/0"; #[derive(Clone, Debug)] pub enum ChainType { - Cosmos, + Cosmos { dynamic_fee: bool }, Osmosis, Evmos, Provenance, @@ -21,7 +21,7 @@ pub enum ChainType { impl ChainType { pub fn hd_path(&self) -> &str { match self { - Self::Cosmos | Self::Osmosis => COSMOS_HD_PATH, + Self::Cosmos { dynamic_fee: _ } | Self::Osmosis => COSMOS_HD_PATH, Self::Evmos | Self::Injective => EVMOS_HD_PATH, Self::Provenance => PROVENANCE_HD_PATH, } @@ -29,7 +29,7 @@ impl ChainType { pub fn chain_id(&self, prefix: &str, use_random_id: bool) -> ChainId { match self { - Self::Cosmos => { + Self::Cosmos { dynamic_fee: _ } => { if use_random_id { ChainId::from_string(&format!("ibc-{}-{:x}", prefix, random_u32())) } else { @@ -54,7 +54,7 @@ impl ChainType { let mut res = vec![]; let json_rpc_port = random_unused_tcp_port(); match self { - Self::Cosmos | Self::Injective | Self::Provenance => {} + Self::Cosmos { dynamic_fee: _ } | Self::Injective | Self::Provenance => {} Self::Osmosis => { res.push("--reject-config-defaults".to_owned()); } @@ -70,7 +70,7 @@ impl ChainType { pub fn extra_add_genesis_account_args(&self, chain_id: &ChainId) -> Vec { let mut res = vec![]; match self { - Self::Cosmos | Self::Osmosis | Self::Evmos | Self::Provenance => {} + Self::Cosmos { dynamic_fee: _ } | Self::Osmosis | Self::Evmos | Self::Provenance => {} Self::Injective => { res.push("--chain-id".to_owned()); res.push(format!("{chain_id}")); @@ -81,7 +81,9 @@ impl ChainType { pub fn address_type(&self) -> AddressType { match self { - Self::Cosmos | Self::Osmosis | Self::Provenance => AddressType::default(), + Self::Cosmos { dynamic_fee: _ } | Self::Osmosis | Self::Provenance => { + AddressType::default() + } Self::Evmos => AddressType::Ethermint { pk_type: "/ethermint.crypto.v1.ethsecp256k1.PubKey".to_string(), }, @@ -90,6 +92,10 @@ impl ChainType { }, } } + + pub fn enable_dynamic_fee(&self) -> bool { + matches!(self, Self::Cosmos { dynamic_fee } if *dynamic_fee) + } } impl FromStr for ChainType { @@ -97,11 +103,12 @@ impl FromStr for ChainType { fn from_str(s: &str) -> Result { match s { + name if name.contains("gaiad") => Ok(ChainType::Cosmos { dynamic_fee: true }), name if name.contains("evmosd") => Ok(ChainType::Evmos), name if name.contains("injectived") => Ok(ChainType::Injective), name if name.contains("provenanced") => Ok(ChainType::Provenance), name if name.contains("osmosisd") => Ok(ChainType::Osmosis), - _ => Ok(ChainType::Cosmos), + _ => Ok(ChainType::Cosmos { dynamic_fee: false }), } } } diff --git a/tools/test-framework/src/chain/cli/provider.rs b/tools/test-framework/src/chain/cli/provider.rs index fe52c86512..2c5dc6f8cd 100644 --- a/tools/test-framework/src/chain/cli/provider.rs +++ b/tools/test-framework/src/chain/cli/provider.rs @@ -1,19 +1,21 @@ +use eyre::eyre; use std::collections::HashMap; use std::str; use crate::chain::exec::{simple_exec, ExecOutput}; -use crate::error::Error; +use crate::error::{handle_generic_error, Error}; pub fn submit_consumer_chain_proposal( chain_id: &str, command_path: &str, home_path: &str, rpc_listen_address: &str, + fees: &str, ) -> Result<(), Error> { let proposal_file = format!("{}/consumer_proposal.json", home_path); // The submission might fail silently if there is not enough gas - simple_exec( + let raw_output = simple_exec( chain_id, command_path, &[ @@ -34,10 +36,24 @@ pub fn submit_consumer_chain_proposal( "test", "--gas", "2000000", + "--fees", + fees, + "--output", + "json", "--yes", ], )?; + let output: serde_json::Value = + serde_json::from_str(&raw_output.stdout).map_err(handle_generic_error)?; + + let output_code = output.get("code").and_then(|code| code.as_u64()).ok_or_else(|| Error::generic(eyre!("failed to extract 'code' from 'tx gov submit-legacy-proposal consumer-addition' command")))?; + + if output_code != 0 { + let output_logs = output.get("raw_log").and_then(|code| code.as_str()).ok_or_else(|| Error::generic(eyre!("failed to extract 'raw_logs' from 'tx gov submit-legacy-proposal consumer-addition' command")))?; + return Err(Error::generic(eyre!("output code for commande 'tx gov submit-legacy-proposal consumer-addition' should be 0, but is instead '{output_code}'. Detail: {output_logs}", ))); + } + Ok(()) } diff --git a/tools/test-framework/src/chain/cli/transfer.rs b/tools/test-framework/src/chain/cli/transfer.rs index 39ed3f758b..b1da0efb15 100644 --- a/tools/test-framework/src/chain/cli/transfer.rs +++ b/tools/test-framework/src/chain/cli/transfer.rs @@ -1,9 +1,10 @@ /*! Methods for performing IBC token transfer on a chain. */ +use eyre::eyre; use crate::chain::exec::simple_exec; -use crate::error::Error; +use crate::error::{handle_generic_error, Error}; pub fn local_transfer_token( chain_id: &str, @@ -15,7 +16,7 @@ pub fn local_transfer_token( token: &str, fees: &str, ) -> Result<(), Error> { - simple_exec( + let raw_output = simple_exec( chain_id, command_path, &[ @@ -35,10 +36,34 @@ pub fn local_transfer_token( "test", "--fees", fees, + "--output", + "json", "--yes", ], )?; + let output: serde_json::Value = + serde_json::from_str(&raw_output.stdout).map_err(handle_generic_error)?; + + let output_code = output + .get("code") + .and_then(|code| code.as_u64()) + .ok_or_else(|| { + Error::generic(eyre!("failed to extract 'code' from 'tx gov vote' command")) + })?; + + if output_code != 0 { + let output_logs = output + .get("raw_log") + .and_then(|code| code.as_str()) + .ok_or_else(|| { + Error::generic(eyre!( + "failed to extract 'raw_logs' from 'tx gov vote' command" + )) + })?; + return Err(Error::generic(eyre!("output code for commande 'tx gov vote' should be 0, but is instead '{output_code}'. Detail: {output_logs}", ))); + } + Ok(()) } diff --git a/tools/test-framework/src/chain/cli/upgrade.rs b/tools/test-framework/src/chain/cli/upgrade.rs index cef7e8df0a..b83c6a315b 100644 --- a/tools/test-framework/src/chain/cli/upgrade.rs +++ b/tools/test-framework/src/chain/cli/upgrade.rs @@ -14,7 +14,7 @@ pub fn vote_proposal( fees: &str, proposal_id: &str, ) -> Result<(), Error> { - simple_exec( + let raw_output = simple_exec( chain_id, command_path, &[ @@ -35,10 +35,34 @@ pub fn vote_proposal( "validator", "--fees", fees, + "--output", + "json", "--yes", ], )?; + let output: serde_json::Value = + serde_json::from_str(&raw_output.stdout).map_err(handle_generic_error)?; + + let output_code = output + .get("code") + .and_then(|code| code.as_u64()) + .ok_or_else(|| { + Error::generic(eyre!("failed to extract 'code' from 'tx gov vote' command")) + })?; + + if output_code != 0 { + let output_logs = output + .get("raw_log") + .and_then(|code| code.as_str()) + .ok_or_else(|| { + Error::generic(eyre!( + "failed to extract 'raw_logs' from 'tx gov vote' command" + )) + })?; + return Err(Error::generic(eyre!("output code for commande 'tx gov vote' should be 0, but is instead '{output_code}'. Detail: {output_logs}", ))); + } + Ok(()) } diff --git a/tools/test-framework/src/chain/driver.rs b/tools/test-framework/src/chain/driver.rs index 9fbbddcaeb..85830caf5e 100644 --- a/tools/test-framework/src/chain/driver.rs +++ b/tools/test-framework/src/chain/driver.rs @@ -128,6 +128,7 @@ impl ChainDriver { ) -> Result { let tx_config = new_tx_config_for_test( chain_id.clone(), + chain_type.clone(), format!("http://localhost:{rpc_port}"), format!("http://localhost:{grpc_port}"), chain_type.address_type(), diff --git a/tools/test-framework/src/chain/ext/bootstrap.rs b/tools/test-framework/src/chain/ext/bootstrap.rs index a7344fdb5c..4fef50083d 100644 --- a/tools/test-framework/src/chain/ext/bootstrap.rs +++ b/tools/test-framework/src/chain/ext/bootstrap.rs @@ -106,6 +106,7 @@ pub trait ChainBootstrapMethodsExt { fn submit_consumer_chain_proposal( &self, consumer_chain_id: &str, + fees: &str, spawn_time: &str, ) -> Result<(), Error>; @@ -276,6 +277,7 @@ impl ChainBootstrapMethodsExt for ChainDriver { fn submit_consumer_chain_proposal( &self, consumer_chain_id: &str, + fees: &str, _spawn_time: &str, ) -> Result<(), Error> { let res = simple_exec( @@ -327,6 +329,7 @@ impl ChainBootstrapMethodsExt for ChainDriver { &self.command_path, &self.home_path, &self.rpc_listen_address(), + fees, ) } diff --git a/tools/test-framework/src/framework/binary/ics.rs b/tools/test-framework/src/framework/binary/ics.rs index d11c8ff3e8..24086eff6c 100644 --- a/tools/test-framework/src/framework/binary/ics.rs +++ b/tools/test-framework/src/framework/binary/ics.rs @@ -65,15 +65,17 @@ where 0, )?; let provider_native_token = builder.native_tokens[0].clone(); - let provider_fee = format!("1200{}", provider_native_token); + let provider_fee = format!("381000000{provider_native_token}"); // Get consumer chain id let chain_type = ChainType::from_str(&builder.command_paths[1])?; let chain_id = chain_type.chain_id("consumer", false); - node_a - .chain_driver - .submit_consumer_chain_proposal(chain_id.as_str(), "2023-05-31T12:09:47.048227Z")?; + node_a.chain_driver.submit_consumer_chain_proposal( + chain_id.as_str(), + &provider_fee, + "2023-05-31T12:09:47.048227Z", + )?; node_a.chain_driver.assert_proposal_status( node_a.chain_driver.chain_id.as_str(), diff --git a/tools/test-framework/src/relayer/tx.rs b/tools/test-framework/src/relayer/tx.rs index a2d4e41393..90f62a09fb 100644 --- a/tools/test-framework/src/relayer/tx.rs +++ b/tools/test-framework/src/relayer/tx.rs @@ -12,9 +12,10 @@ use ibc_relayer::config::{AddressType, GasPrice}; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use tendermint_rpc::Url; +use crate::chain::chain_type::ChainType; use crate::error::{handle_generic_error, Error}; -pub fn gas_config_for_test(native_token: String) -> GasConfig { +pub fn gas_config_for_test(native_token: String, chain_type: ChainType) -> GasConfig { let max_gas = 3000000; let gas_multiplier = 1.5; @@ -37,6 +38,12 @@ pub fn gas_config_for_test(native_token: String) -> GasConfig { granter: fee_granter.clone(), }; + let dynamic_gas_price = if chain_type.enable_dynamic_fee() { + DynamicGasPrice::unsafe_new(true, 1.3, 5.0) + } else { + DynamicGasPrice::disabled() + }; + GasConfig { default_gas, max_gas, @@ -44,16 +51,13 @@ pub fn gas_config_for_test(native_token: String) -> GasConfig { gas_price, max_fee, fee_granter, - dynamic_gas_price: DynamicGasPrice { - enabled: false, - multiplier: 1.0, - max: 0.6, - }, + dynamic_gas_price, } } pub fn new_tx_config_for_test( chain_id: ChainId, + chain_type: ChainType, raw_rpc_address: String, raw_grpc_address: String, address_type: AddressType, @@ -61,7 +65,7 @@ pub fn new_tx_config_for_test( ) -> Result { let rpc_address = Url::from_str(&raw_rpc_address).map_err(handle_generic_error)?; let grpc_address = Uri::from_str(&raw_grpc_address).map_err(handle_generic_error)?; - let gas_config = gas_config_for_test(native_token); + let gas_config = gas_config_for_test(native_token, chain_type); let rpc_timeout = Duration::from_secs(30); let max_msg_num = Default::default(); let max_tx_size = Default::default(); diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index 7ec43141b9..ae4d0f34bb 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -152,6 +152,12 @@ impl FullNode { _ => config::GasPrice::new(0.003, test_config.native_token(chain_number).clone()), }; + let dynamic_gas_price = if chain_type.enable_dynamic_fee() { + DynamicGasPrice::unsafe_new(true, 1.3, 5.0) + } else { + DynamicGasPrice::disabled() + }; + Ok(config::ChainConfig::CosmosSdk(CosmosSdkConfig { id: self.chain_driver.chain_id.clone(), rpc_addr: Url::from_str(&self.chain_driver.rpc_address())?, @@ -172,7 +178,7 @@ impl FullNode { max_gas: Some(3000000), gas_adjustment: None, gas_multiplier: Some(GasMultiplier::unsafe_new(1.5)), - dynamic_gas_price: DynamicGasPrice::default(), + dynamic_gas_price, fee_granter: None, max_msg_num: Default::default(), max_tx_size: Default::default(), From f49a843ffa7f7d68ca013dca1bc437fc38e27a77 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 6 Aug 2024 14:15:24 +0200 Subject: [PATCH 165/200] Update Osmosis version running in CI to v25.2.0 (#4129) * Update Nix flake to use branch with Osmosis v25.2.0 * Add changelog entry * Use main branch of Cosmos Nix * Disable async ICQ test with Provenance --- .../4116-update-osmosis-to-v25-2-0.md | 2 + .github/workflows/integration.yaml | 2 +- flake.lock | 47 +++++++++++++------ 3 files changed, 36 insertions(+), 15 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4116-update-osmosis-to-v25-2-0.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4116-update-osmosis-to-v25-2-0.md b/.changelog/unreleased/improvements/ibc-integration-test/4116-update-osmosis-to-v25-2-0.md new file mode 100644 index 0000000000..c97282cd12 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4116-update-osmosis-to-v25-2-0.md @@ -0,0 +1,2 @@ +- Update the version of Osmosis running the integration tests in the CI from `v25.0.0` + to `v25.2.0` ([\#4116](https://github.com/informalsystems/hermes/issues/4116)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 9f44d793ee..ae3612c915 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -84,7 +84,7 @@ jobs: command: provenanced account_prefix: pb native_token: nhash - features: fee-grant,async-icq,authz + features: fee-grant,authz - package: migaloo command: migalood account_prefix: migaloo diff --git a/flake.lock b/flake.lock index 0c259e1dfc..d8b005c938 100644 --- a/flake.lock +++ b/flake.lock @@ -214,14 +214,15 @@ "wasmvm_1_5_0-src": "wasmvm_1_5_0-src", "wasmvm_1_5_2-src": "wasmvm_1_5_2-src", "wasmvm_1_beta7-src": "wasmvm_1_beta7-src", - "wasmvm_2_0_0-src": "wasmvm_2_0_0-src" + "wasmvm_2_0_0-src": "wasmvm_2_0_0-src", + "wasmvm_2_1_0-src": "wasmvm_2_1_0-src" }, "locked": { - "lastModified": 1721927677, - "narHash": "sha256-fD8yDMOuJWx0WwlgAO07QrhbDwZ+PRl7HMVG4uwgFnk=", + "lastModified": 1722941076, + "narHash": "sha256-9wO1BVbpUY/aD4tpArtDTgH75x3J7HW2jSXbZTWFVMY=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "826b8ddd3c397306dc67de0646b27dc5656fadf9", + "rev": "3b2dd00097d6f3576d2e5dfd2ae70b4313de1fcc", "type": "github" }, "original": { @@ -1378,11 +1379,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1722640603, - "narHash": "sha256-TcXjLVNd3VeH1qKPH335Tc4RbFDbZQX+d7rqnDUoRaY=", + "lastModified": 1722895844, + "narHash": "sha256-kGwDuefMQgzdzMXx1BN3+pS7oKafQd6LTDG6XMwcqrU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "81610abc161d4021b29199aa464d6a1a521e0cc9", + "rev": "d3f42bd62aa840084563e3b93e4eab73cb0a0448", "type": "github" }, "original": { @@ -1395,16 +1396,16 @@ "osmosis-src": { "flake": false, "locked": { - "lastModified": 1715157587, - "narHash": "sha256-D/CymboICWe73MBGF036W5NT/pyaV8Wvll2bJmYNmHg=", + "lastModified": 1719537675, + "narHash": "sha256-8Lb2SppNfq3+JwP3uanmCxuCek6tXOO/GcG27XGxRrE=", "owner": "osmosis-labs", "repo": "osmosis", - "rev": "15566f1f2945a16af9243dd376ee58a0d691b66a", + "rev": "b973bffdf127866f45624d7e5a81f31fdc8e8e0b", "type": "github" }, "original": { "owner": "osmosis-labs", - "ref": "v25.0.0", + "ref": "v25.2.0", "repo": "osmosis", "type": "github" } @@ -1443,15 +1444,16 @@ "provenance-src": { "flake": false, "locked": { - "narHash": "sha256-dTX3kg2QUsC9SwsaommP4IFgIdQgWZrGQNtp/B+fzys=", + "lastModified": 1721946876, + "narHash": "sha256-4RAyX3ORmbojnmDlMQMWF7mdmbaiBbqegZt0SMd9cXE=", "owner": "provenance-io", "repo": "provenance", - "rev": "91b0813de2f93d03cefe8efb226dc32f02690840", + "rev": "d1119ab02c423d86a0f485a8f124e73511ec1b9b", "type": "github" }, "original": { "owner": "provenance-io", - "ref": "v1.17.0", + "ref": "v1.19.1", "repo": "provenance", "type": "github" } @@ -1957,6 +1959,23 @@ "repo": "wasmvm", "type": "github" } + }, + "wasmvm_2_1_0-src": { + "flake": false, + "locked": { + "lastModified": 1720688907, + "narHash": "sha256-Ev/2cUKT0i9ytvfrzh15Ibja4TBXjoeB7RLHn28yRCY=", + "owner": "CosmWasm", + "repo": "wasmvm", + "rev": "d7906b3030061a959c54ee57c88e3256b8e90a0c", + "type": "github" + }, + "original": { + "owner": "CosmWasm", + "ref": "v2.1.0", + "repo": "wasmvm", + "type": "github" + } } }, "root": "root", From f9b0194c4ca1ddfdf2cdd855e806bcb4e036ac6a Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 6 Aug 2024 14:16:00 +0200 Subject: [PATCH 166/200] Split packet clearing schedule from packet worker (#4080) * Split packet clearing schedule from packet worker * Rename packet clearing test to be more specific * Nit clean-up for ordered_channel test * Clear packets in packet_cmd_worker for ordered channels only * Add intermediary channel to forward cmd from clear worker to packet worker * Add changelog entry * Add new config 'clear_limit' * Apply clear_limit when clearing pending packets * Add test for clear_limit * Fix clear limit for send packets * Update changelog entry * Add 'clear_limit' to example config * Restore changelog entry deleted after merge * Apply suggestions from code review Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * Moved 'clear_limit' after 'clear_on_start' in example config.toml --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi --- .../4071-split-packet-clear-scheduling.md | 4 + config.toml | 4 + crates/relayer/src/config.rs | 7 + crates/relayer/src/link/relay_path.rs | 39 +++-- crates/relayer/src/worker.rs | 16 ++- crates/relayer/src/worker/packet.rs | 135 +++++++++++++++--- .../src/tests/clear_packet.rs | 127 +++++++++++++--- .../src/tests/execute_schedule.rs | 3 +- .../src/tests/ordered_channel.rs | 4 +- .../src/tests/ordered_channel_clear.rs | 7 +- 10 files changed, 293 insertions(+), 53 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/4071-split-packet-clear-scheduling.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4071-split-packet-clear-scheduling.md b/.changelog/unreleased/improvements/ibc-relayer/4071-split-packet-clear-scheduling.md new file mode 100644 index 0000000000..8aeec76505 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/4071-split-packet-clear-scheduling.md @@ -0,0 +1,4 @@ +- Add a new configuration `clear_limit` to specify the maximum number + of packets cleared every time packet clearing is triggered. + Defaults to 50. + ([\#4071](https://github.com/informalsystems/hermes/issues/4071)) \ No newline at end of file diff --git a/config.toml b/config.toml index e65d967c25..aeb2eff924 100644 --- a/config.toml +++ b/config.toml @@ -59,6 +59,10 @@ clear_interval = 100 # Whether or not to clear packets on start. [Default: true] clear_on_start = true +# Set the maximum number of packets to clear each time packet clearing is triggered. +# [Default: 50] +#clear_limit = 50 + # Toggle the transaction confirmation mechanism. # The tx confirmation mechanism periodically queries the `/tx_search` RPC # endpoint to check that previously-submitted transactions diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index 80e4923aa1..9494a1cc1b 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -250,6 +250,10 @@ pub mod default { pub fn allow_ccq() -> bool { true } + + pub fn clear_limit() -> usize { + 50 + } } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -424,6 +428,8 @@ pub struct Packets { pub ics20_max_memo_size: Ics20FieldSizeLimit, #[serde(default = "default::ics20_max_receiver_size")] pub ics20_max_receiver_size: Ics20FieldSizeLimit, + #[serde(default = "default::clear_limit")] + pub clear_limit: usize, #[serde(skip)] pub force_disable_clear_on_start: bool, @@ -439,6 +445,7 @@ impl Default for Packets { auto_register_counterparty_payee: default::auto_register_counterparty_payee(), ics20_max_memo_size: default::ics20_max_memo_size(), ics20_max_receiver_size: default::ics20_max_receiver_size(), + clear_limit: default::clear_limit(), force_disable_clear_on_start: false, } } diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index 790571f482..47bf6f8770 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -429,7 +429,11 @@ impl RelayPath { TrackedEvents::new(result, tracking_id) } - fn relay_pending_packets(&self, height: Option) -> Result<(), LinkError> { + fn relay_pending_packets( + &self, + height: Option, + clear_limit: usize, + ) -> Result<(), LinkError> { let _span = span!(Level::ERROR, "relay_pending_packets", ?height).entered(); let tracking_id = TrackingId::new_packet_clearing(); @@ -439,10 +443,15 @@ impl RelayPath { let chunk_size = src_config.query_packets_chunk_size(); for i in 1..=MAX_RETRIES { - let cleared_recv = - self.schedule_recv_packet_and_timeout_msgs(height, chunk_size, tracking_id); + let cleared_recv = self.schedule_recv_packet_and_timeout_msgs( + height, + chunk_size, + clear_limit, + tracking_id, + ); - let cleared_ack = self.schedule_packet_ack_msgs(height, chunk_size, tracking_id); + let cleared_ack = + self.schedule_packet_ack_msgs(height, chunk_size, clear_limit, tracking_id); match cleared_recv.and(cleared_ack) { Ok(()) => return Ok(()), @@ -458,14 +467,18 @@ impl RelayPath { /// Clears any packets that were sent before `height`. /// If no height is passed in, then the latest height of the source chain is used. - pub fn schedule_packet_clearing(&self, height: Option) -> Result<(), LinkError> { + pub fn schedule_packet_clearing( + &self, + height: Option, + clear_limit: usize, + ) -> Result<(), LinkError> { let _span = span!(Level::ERROR, "schedule_packet_clearing", ?height).entered(); let clear_height = height .map(|h| h.decrement().map_err(|e| LinkError::decrement_height(h, e))) .transpose()?; - self.relay_pending_packets(clear_height)?; + self.relay_pending_packets(clear_height, clear_limit)?; debug!(height = ?clear_height, "done relaying pending packets at clear height"); @@ -1139,6 +1152,7 @@ impl RelayPath { &self, opt_query_height: Option, chunk_size: usize, + clear_limit: usize, tracking_id: TrackingId, ) -> Result<(), LinkError> { let _span = span!( @@ -1161,11 +1175,13 @@ impl RelayPath { } // Retain only sequences which should not be filtered out - let sequences: Vec = sequences + let raw_sequences: Vec = sequences .into_iter() .filter(|sequence| !self.exclude_src_sequences.contains(sequence)) .collect(); + let sequences = &raw_sequences[..raw_sequences.len().min(clear_limit)]; + debug!( dst_chain = %self.dst_chain().id(), src_chain = %self.src_chain().id(), @@ -1177,7 +1193,7 @@ impl RelayPath { // Chunk-up the list of sequence nrs. into smaller parts, // and schedule operational data incrementally across each chunk. for events_chunk in query_packet_events_with( - &sequences, + sequences, Qualified::SmallerEqual(query_height), self.src_chain(), &self.path_id, @@ -1206,6 +1222,7 @@ impl RelayPath { &self, opt_query_height: Option, chunk_size: usize, + clear_limit: usize, tracking_id: TrackingId, ) -> Result<(), LinkError> { let _span = span!( @@ -1231,11 +1248,13 @@ impl RelayPath { } // Retain only sequences which should not be filtered out - let sequences: Vec = sequences + let raw_sequences: Vec = sequences .into_iter() .filter(|sequence| !self.exclude_src_sequences.contains(sequence)) .collect(); + let sequences = &raw_sequences[..raw_sequences.len().min(clear_limit)]; + debug!( dst_chain = %self.dst_chain().id(), src_chain = %self.src_chain().id(), @@ -1246,7 +1265,7 @@ impl RelayPath { // Incrementally process all the available sequence numbers in chunks for events_chunk in query_packet_events_with( - &sequences, + sequences, Qualified::SmallerEqual(query_height), self.src_chain(), &self.path_id, diff --git a/crates/relayer/src/worker.rs b/crates/relayer/src/worker.rs index 2705919e6d..f2ef11f533 100644 --- a/crates/relayer/src/worker.rs +++ b/crates/relayer/src/worker.rs @@ -169,19 +169,31 @@ pub fn spawn_worker_tasks( let resubmit = Resubmit::from_clear_interval(clear_interval); + let (clear_cmd_tx, clear_cmd_rx) = crossbeam_channel::unbounded(); + let clear_task = packet::spawn_clear_cmd_worker( + cmd_rx, + link.clone(), + should_clear_on_start, + clear_interval, + config.mode.packets.clear_limit, + clear_cmd_tx, + ); + task_handles.push(clear_task); + // Only spawn the incentivized worker if a fee filter is specified in the configuration let packet_task = match fee_filter { Some(filter) => packet::spawn_incentivized_packet_cmd_worker( - cmd_rx, + clear_cmd_rx, link.clone(), path.clone(), filter, ), None => packet::spawn_packet_cmd_worker( - cmd_rx, + clear_cmd_rx, link.clone(), should_clear_on_start, clear_interval, + config.mode.packets.clear_limit, path.clone(), ), }; diff --git a/crates/relayer/src/worker/packet.rs b/crates/relayer/src/worker/packet.rs index 30da317290..fdfa0022e9 100644 --- a/crates/relayer/src/worker/packet.rs +++ b/crates/relayer/src/worker/packet.rs @@ -2,7 +2,7 @@ use core::time::Duration; use std::borrow::BorrowMut; use std::sync::{Arc, Mutex}; -use crossbeam_channel::Receiver; +use crossbeam_channel::{Receiver, Sender}; use itertools::Itertools; use moka::sync::Cache; use tracing::{debug, error, error_span, info, trace, warn}; @@ -83,6 +83,7 @@ pub fn spawn_packet_cmd_worker( link: Arc>>, mut should_clear_on_start: bool, clear_interval: u64, + clear_limit: usize, path: Packet, ) -> TaskHandle { let span = { @@ -117,6 +118,7 @@ pub fn spawn_packet_cmd_worker( &mut link.lock().unwrap(), &mut should_clear_on_start, clear_interval, + clear_limit, &path, cmd, )?; @@ -182,13 +184,79 @@ pub fn spawn_incentivized_packet_cmd_worker( + cmd_rx: Receiver, + // Mutex is used to prevent race condition between the packet workers + link: Arc>>, + mut should_clear_on_start: bool, + clear_interval: u64, + clear_limit: usize, + clear_cmd_tx: Sender, +) -> TaskHandle { + let span = { + let relay_path = &link.lock().unwrap().a_to_b; + error_span!( + "worker.clear.cmd", + src_chain = %relay_path.src_chain().id(), + src_port = %relay_path.src_port_id(), + src_channel = %relay_path.src_channel_id(), + dst_chain = %relay_path.dst_chain().id(), + ) + }; + + let clear_cmd_worker_idle_timeout = if clear_interval > 0 { + clear_interval * 5 + } else { + IDLE_TIMEOUT_BLOCKS + }; + + let mut idle_worker_timer = 0; + + spawn_background_task(span, Some(Duration::from_millis(200)), move || { + if let Ok(cmd) = cmd_rx.try_recv() { + match clear_cmd_tx.send(cmd.clone()) { + Ok(_) => trace!("Successfully sent cmd to packet worker"), + Err(e) => { + error!("Failed to forward cmd from clear worker to packet worker. Cause: {e}") + } + } + let is_new_batch = cmd.is_ibc_events(); + + // Try to clear pending packets. At different levels down in `handle_clear_cmd` there + // are retries mechanisms for MAX_RETRIES (current value hardcoded at 5). + // If clearing fails after all these retries with ignorable error the task continues + // (see `handle_link_error_in_task`) and clearing is retried with the next + // (`NewBlock`) `cmd` that matches the clearing interval. + handle_clear_cmd( + &mut link.lock().unwrap(), + &mut should_clear_on_start, + clear_interval, + clear_limit, + cmd, + )?; + + if is_new_batch { + idle_worker_timer = 0; + trace!("clear worker processed an event batch, resetting idle timer"); + } else { + idle_worker_timer += 1; + trace!("clear worker has not processed an event batch after {idle_worker_timer} blocks, incrementing idle timer"); + } + + if idle_worker_timer > clear_cmd_worker_idle_timeout { + warn!("clear worker has been idle for more than {clear_cmd_worker_idle_timeout} blocks, aborting"); + + return Ok(Next::Abort); + } + } + + Ok(Next::Continue) + }) +} + /// Receives worker commands and handles them accordingly. /// -/// Given an `IbcEvent` command, updates the schedule and initiates -/// packet clearing if the `should_clear_on_start` flag has been toggled. -/// -/// Given a `NewBlock` command, checks if packet clearing should occur -/// and performs it if so. +/// Given an `IbcEvent` command, updates the schedule. /// /// Given a `ClearPendingPackets` command, clears pending packets. /// @@ -198,11 +266,13 @@ fn handle_packet_cmd( link: &mut Link, should_clear_on_start: &mut bool, clear_interval: u64, + clear_limit: usize, path: &Packet, cmd: WorkerCmd, ) -> Result<(), TaskError> { - // Handle packet clearing which is triggered from a command - let (do_clear, maybe_height) = match &cmd { + // If the channel is Ordered, verify if clearing is required before proceeding + // to relaying. + match &cmd { WorkerCmd::IbcEvents { batch } if link.a_to_b.channel().ordering == Ordering::Ordered => { let lowest_sequence = lowest_sequence(&batch.events); @@ -215,11 +285,40 @@ fn handle_packet_cmd( .ok(); if *should_clear_on_start || next_sequence < lowest_sequence { - (true, Some(batch.height)) - } else { - (false, None) + handle_clear_packet(link, clear_interval, path, Some(batch.height), clear_limit)?; } } + _ => {} + } + + // Handle command-specific task + if let WorkerCmd::IbcEvents { batch } = cmd { + handle_update_schedule(link, clear_interval, path, batch)?; + } + + Ok(()) +} + +/// Given an `IbcEvent` command, schedule packet clearing if the +/// `should_clear_on_start` flag has been toggled. +/// +/// Given a `NewBlock` command, checks if packet clearing should occur +/// and performs it if so. +fn handle_clear_cmd( + link: &mut Link, + should_clear_on_start: &mut bool, + clear_interval: u64, + clear_limit: usize, + cmd: WorkerCmd, +) -> Result<(), TaskError> { + // Handle packet clearing which is triggered from a command + let (do_clear, maybe_height) = match &cmd { + // Clearing for Ordered channels is handled by the packet_cmd_worker + WorkerCmd::IbcEvents { batch: _batch } + if link.a_to_b.channel().ordering == Ordering::Ordered => + { + (false, None) + } WorkerCmd::IbcEvents { batch } => { if *should_clear_on_start { @@ -243,7 +342,7 @@ fn handle_packet_cmd( }; if do_clear { - info!("clearing packets"); + info!("packets clearing triggered, looking for packets to clear"); // Reset the `clear_on_start` flag and attempt packet clearing once now. // More clearing will be done at clear interval. @@ -251,12 +350,9 @@ fn handle_packet_cmd( *should_clear_on_start = false; } - handle_clear_packet(link, clear_interval, path, maybe_height)?; - } - - // Handle command-specific task - if let WorkerCmd::IbcEvents { batch } = cmd { - handle_update_schedule(link, clear_interval, path, batch)?; + link.a_to_b + .schedule_packet_clearing(maybe_height, clear_limit) + .map_err(handle_link_error_in_task)?; } Ok(()) @@ -414,9 +510,10 @@ fn handle_clear_packet( clear_interval: u64, path: &Packet, height: Option, + clear_limit: usize, ) -> Result<(), TaskError> { link.a_to_b - .schedule_packet_clearing(height) + .schedule_packet_clearing(height, clear_limit) .map_err(handle_link_error_in_task)?; handle_execute_schedule(link, path, Resubmit::from_clear_interval(clear_interval)) diff --git a/tools/integration-test/src/tests/clear_packet.rs b/tools/integration-test/src/tests/clear_packet.rs index 40f3e2c26e..88878d50a1 100644 --- a/tools/integration-test/src/tests/clear_packet.rs +++ b/tools/integration-test/src/tests/clear_packet.rs @@ -7,8 +7,8 @@ use ibc_test_framework::relayer::channel::query_identified_channel_end; use ibc_test_framework::util::random::random_u128_range; #[test] -fn test_clear_packet() -> Result<(), Error> { - run_binary_channel_test(&ClearPacketTest) +fn test_disabled_clear_packet() -> Result<(), Error> { + run_binary_channel_test(&DisabledClearPacketTest) } #[test] @@ -31,13 +31,19 @@ fn test_clear_packet_sequences() -> Result<(), Error> { run_binary_channel_test(&ClearPacketSequencesTest) } -pub struct ClearPacketTest; +#[test] +fn test_limited_clear_packet() -> Result<(), Error> { + run_binary_channel_test(&LimitedClearPacketTest) +} + +pub struct DisabledClearPacketTest; pub struct ClearPacketRecoveryTest; pub struct ClearPacketNoScanTest; pub struct ClearPacketOverrideTest; pub struct ClearPacketSequencesTest; +pub struct LimitedClearPacketTest; -impl TestOverrides for ClearPacketTest { +impl TestOverrides for DisabledClearPacketTest { fn modify_relayer_config(&self, config: &mut Config) { // Disabling client workers and clear_on_start should make the relayer not // relay any packet it missed before starting. @@ -60,18 +66,7 @@ impl TestOverrides for ClearPacketTest { } } -impl TestOverrides for ClearPacketRecoveryTest { - fn modify_relayer_config(&self, config: &mut Config) { - config.mode.packets.enabled = true; - config.mode.packets.clear_on_start = true; - } - - fn should_spawn_supervisor(&self) -> bool { - false - } -} - -impl BinaryChannelTest for ClearPacketTest { +impl BinaryChannelTest for DisabledClearPacketTest { fn run( &self, _config: &TestConfig, @@ -147,6 +142,17 @@ impl BinaryChannelTest for ClearPacketTest { } } +impl TestOverrides for ClearPacketRecoveryTest { + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.packets.enabled = true; + config.mode.packets.clear_on_start = true; + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + impl BinaryChannelTest for ClearPacketRecoveryTest { fn run( &self, @@ -573,3 +579,92 @@ impl BinaryChannelTest for ClearPacketSequencesTest { Ok(()) } } + +impl TestOverrides for LimitedClearPacketTest { + fn modify_relayer_config(&self, config: &mut Config) { + // Disabling client workers and clear_on_start should make the relayer not + // relay any packet it missed before starting. + config.mode.clients.enabled = false; + config.mode.connections.enabled = false; + config.mode.channels.enabled = false; + + config.mode.packets.enabled = true; + config.mode.packets.clear_on_start = true; + config.mode.packets.clear_interval = 0; + } + + fn should_spawn_supervisor(&self) -> bool { + false + } + + // Unordered channel: will permit gaps in the sequence of relayed packets + fn channel_order(&self) -> Ordering { + Ordering::Unordered + } +} + +impl BinaryChannelTest for LimitedClearPacketTest { + fn run( + &self, + _config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channel: ConnectedChannel, + ) -> Result<(), Error> { + let denom_a = chains.node_a.denom(); + + let wallet_a = chains.node_a.wallets().user1().cloned(); + let wallet_b = chains.node_b.wallets().user1().cloned(); + + let balance_a = chains + .node_a + .chain_driver() + .query_balance(&wallet_a.address(), &denom_a)?; + + let raw_amount = random_u128_range(1000, 5000); + + let num_transfers = 70; + + let amount = denom_a.with_amount(raw_amount); + let sent_amount = denom_a.with_amount(raw_amount * num_transfers); + let cleared_amount = denom_a.with_amount(raw_amount * 50); + + info!("Performing {num_transfers} IBC transfers with amount {amount}, for a total of {sent_amount}"); + + chains.node_a.chain_driver().ibc_transfer_token_multiple( + &channel.port_a.as_ref(), + &channel.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &amount.as_ref(), + 70, + None, + )?; + + sleep(Duration::from_secs(10)); + + // Spawn the supervisor only after the first IBC transfer + relayer.with_supervisor(|| { + let amount_b = cleared_amount + .transfer(&channel.port_b.as_ref(), &channel.channel_id_b.as_ref())?; + + info!("Assert that {sent_amount} was escrowed from sending chain"); + + // Wallet on chain A should have both amount deducted. + chains.node_a.chain_driver().assert_eventual_wallet_amount( + &wallet_a.address(), + &(balance_a - sent_amount.amount()).as_ref(), + )?; + + info!("Assert that only {amount_b} was received"); + + // Wallet on chain B should only receive the second IBC transfer + chains + .node_b + .chain_driver() + .assert_eventual_wallet_amount(&wallet_b.address(), &amount_b.as_ref())?; + + Ok(()) + }) + } +} diff --git a/tools/integration-test/src/tests/execute_schedule.rs b/tools/integration-test/src/tests/execute_schedule.rs index e74c70822e..163439afad 100644 --- a/tools/integration-test/src/tests/execute_schedule.rs +++ b/tools/integration-test/src/tests/execute_schedule.rs @@ -72,7 +72,8 @@ impl BinaryChannelTest for ExecuteScheduleTest { &chains.node_a.denom().with_amount(amount1).as_ref(), )?; - relay_path_a_to_b.schedule_packet_clearing(None)?; + relay_path_a_to_b + .schedule_packet_clearing(None, relayer.config.mode.packets.clear_limit)?; info!("Performing IBC send packet with a token transfer #{} from chain A to be received by chain B", i); } diff --git a/tools/integration-test/src/tests/ordered_channel.rs b/tools/integration-test/src/tests/ordered_channel.rs index 8f36e516c8..a72126d3f2 100644 --- a/tools/integration-test/src/tests/ordered_channel.rs +++ b/tools/integration-test/src/tests/ordered_channel.rs @@ -73,11 +73,9 @@ impl BinaryChannelTest for OrderedChannelTest { &denom_a.with_amount(amount1).as_ref(), )?; - sleep(Duration::from_secs(1)); + sleep(Duration::from_secs(2)); relayer.with_supervisor(|| { - sleep(Duration::from_secs(1)); - let amount2 = random_u128_range(1000, 5000); info!( diff --git a/tools/integration-test/src/tests/ordered_channel_clear.rs b/tools/integration-test/src/tests/ordered_channel_clear.rs index 85484e42d1..ed6e124e64 100644 --- a/tools/integration-test/src/tests/ordered_channel_clear.rs +++ b/tools/integration-test/src/tests/ordered_channel_clear.rs @@ -47,6 +47,7 @@ impl OrderedChannelClearTest { impl TestOverrides for OrderedChannelClearTest { fn modify_relayer_config(&self, config: &mut Config) { config.mode.packets.tx_confirmation = self.tx_confirmation; + config.mode.packets.clear_limit = 150; { let chain_a = &mut config.chains[0]; match chain_a { @@ -149,7 +150,8 @@ impl BinaryChannelTest for OrderedChannelClearTest { // Send the transfer (recv) packets from A to B over the channel. let mut relay_path_a_to_b = chain_a_link.a_to_b; - relay_path_a_to_b.schedule_packet_clearing(None)?; + relay_path_a_to_b + .schedule_packet_clearing(None, relayer.config.mode.packets.clear_limit)?; relay_path_a_to_b.execute_schedule()?; sleep(Duration::from_secs(10)); @@ -168,7 +170,8 @@ impl BinaryChannelTest for OrderedChannelClearTest { // Send the packet acknowledgments from B to A. let mut relay_path_b_to_a = chain_b_link.a_to_b; - relay_path_b_to_a.schedule_packet_clearing(None)?; + relay_path_b_to_a + .schedule_packet_clearing(None, relayer.config.mode.packets.clear_limit)?; relay_path_b_to_a.execute_schedule()?; sleep(Duration::from_secs(10)); From a1c4659d7426b66da32245b77348c7fca7235d51 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 6 Aug 2024 16:39:23 +0200 Subject: [PATCH 167/200] Update Migaloo Chain version running in CI to v4.2.0 (#4131) * Add features to run more tests with Migaloo Chain * Update Nix flake to use branch with Migaloo v4.2.0 * Add changelog entry * Use main branch of Cosmos Nix --- .../4118-update-migaloo-to-v4-2-0.md | 2 ++ .github/workflows/integration.yaml | 2 +- flake.lock | 14 +++++++------- 3 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4118-update-migaloo-to-v4-2-0.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4118-update-migaloo-to-v4-2-0.md b/.changelog/unreleased/improvements/ibc-integration-test/4118-update-migaloo-to-v4-2-0.md new file mode 100644 index 0000000000..772a0edc72 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4118-update-migaloo-to-v4-2-0.md @@ -0,0 +1,2 @@ +- Update the version of Migaloo Chain running the integration tests in the CI from `v4.1.3` + to `v4.2.0` ([\#4118](https://github.com/informalsystems/hermes/issues/4118)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index ae3612c915..5b1eb0944e 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -89,7 +89,7 @@ jobs: command: migalood account_prefix: migaloo native_token: stake - features: ics29-fee + features: ics29-fee,ica,forward-packet - package: injective command: injectived account_prefix: inj diff --git a/flake.lock b/flake.lock index d8b005c938..524dbf1aa0 100644 --- a/flake.lock +++ b/flake.lock @@ -218,11 +218,11 @@ "wasmvm_2_1_0-src": "wasmvm_2_1_0-src" }, "locked": { - "lastModified": 1722941076, - "narHash": "sha256-9wO1BVbpUY/aD4tpArtDTgH75x3J7HW2jSXbZTWFVMY=", + "lastModified": 1722948950, + "narHash": "sha256-xEguBA7XW21btWLRQRVp/DOuHmrDedgU6feDtJbNzjY=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "3b2dd00097d6f3576d2e5dfd2ae70b4313de1fcc", + "rev": "c466493a3581c1d18b20261d1cab246683e0a828", "type": "github" }, "original": { @@ -1131,16 +1131,16 @@ "migaloo-src": { "flake": false, "locked": { - "lastModified": 1710414169, - "narHash": "sha256-BGOUAw48c92KGpUMvzStiJfd+tgJpTBYk0bAvvUNYL8=", + "lastModified": 1720168667, + "narHash": "sha256-vOzOBNGaIOhTjTnycLp6sQKGAklkPVZdJLPPqdjufnM=", "owner": "White-Whale-Defi-Platform", "repo": "migaloo-chain", - "rev": "5382bfc56173a0f57dcaef34e99c59c99cf70dda", + "rev": "076c6d12ecadcf4db42592a8340cb3be2ed23349", "type": "github" }, "original": { "owner": "White-Whale-Defi-Platform", - "ref": "v4.1.3", + "ref": "v4.2.0", "repo": "migaloo-chain", "type": "github" } From 7d6a06a9e8cbe631766c97bab1e2314be31528a2 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 6 Aug 2024 18:45:15 +0200 Subject: [PATCH 168/200] Update Juno version running in CI to v23.0.0 (#4130) * Update Nix flake to use branch with Juno v23.0.0 * Add changelog entry * Use main branch of Cosmos Nix --- .../4117-update-juno-to-v23.md | 2 ++ flake.lock | 14 +++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4117-update-juno-to-v23.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4117-update-juno-to-v23.md b/.changelog/unreleased/improvements/ibc-integration-test/4117-update-juno-to-v23.md new file mode 100644 index 0000000000..c2f08e7bec --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4117-update-juno-to-v23.md @@ -0,0 +1,2 @@ +- Update the version of Juno running the integration tests in the CI from `v22.0.0` + to `v23.0.0` ([\#4117](https://github.com/informalsystems/hermes/issues/4117)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index 524dbf1aa0..2dd79fdf82 100644 --- a/flake.lock +++ b/flake.lock @@ -218,11 +218,11 @@ "wasmvm_2_1_0-src": "wasmvm_2_1_0-src" }, "locked": { - "lastModified": 1722948950, - "narHash": "sha256-xEguBA7XW21btWLRQRVp/DOuHmrDedgU6feDtJbNzjY=", + "lastModified": 1722949131, + "narHash": "sha256-RvBm0fCRWH9LnpSfeyxAvltk10g534rK2mSAMOfcHfc=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "c466493a3581c1d18b20261d1cab246683e0a828", + "rev": "318946fc494c970d7bdf377d40997abed2fb2b0f", "type": "github" }, "original": { @@ -1099,16 +1099,16 @@ "juno-src": { "flake": false, "locked": { - "lastModified": 1713701044, - "narHash": "sha256-AN9g1t/zOZVs5S/ZXP4/MrIC9kN6nUGG/wLNJz5fL6E=", + "lastModified": 1720542396, + "narHash": "sha256-niG12wn49bt184zqctrGsT73mgKfZUPTZAzSKX+ZLVs=", "owner": "CosmosContracts", "repo": "juno", - "rev": "b0faafbd6df4bb03940d99df13030af7f7bc315b", + "rev": "bf140aa60045ba92b83d0cb7f3bc47a2661a4e7e", "type": "github" }, "original": { "owner": "CosmosContracts", - "ref": "v22.0.0", + "ref": "v23.0.0", "repo": "juno", "type": "github" } From 845cc21f78e2b52f547272f267fcb569ee311eb5 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 6 Aug 2024 20:50:11 +0200 Subject: [PATCH 169/200] Update Stride version running in CI to v23.0.1 (#4132) * Update Stride to v23.0.1 * Add changelog * Use main branch of Cosmos Nix --- .../4114-update-gaia-to-v18.md | 2 +- .../4121-update-stride-to-v23.md | 2 ++ flake.lock | 20 +++++++++---------- 3 files changed, 13 insertions(+), 11 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4121-update-stride-to-v23.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4114-update-gaia-to-v18.md b/.changelog/unreleased/improvements/ibc-integration-test/4114-update-gaia-to-v18.md index 736461adba..eeb9978ca4 100644 --- a/.changelog/unreleased/improvements/ibc-integration-test/4114-update-gaia-to-v18.md +++ b/.changelog/unreleased/improvements/ibc-integration-test/4114-update-gaia-to-v18.md @@ -1,2 +1,2 @@ - Update the version of Gaia running the integration tests in the CI from `v17.2.1` - to `v18.1.0`([\#4114](https://github.com/informalsystems/hermes/issues/4114)) \ No newline at end of file + to `v18.1.0` ([\#4114](https://github.com/informalsystems/hermes/issues/4114)) \ No newline at end of file diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4121-update-stride-to-v23.md b/.changelog/unreleased/improvements/ibc-integration-test/4121-update-stride-to-v23.md new file mode 100644 index 0000000000..d867eefd47 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4121-update-stride-to-v23.md @@ -0,0 +1,2 @@ +- Update the version of Stride running the integration tests in the CI from `v21.0.0` + to `v23.0.1` ([\#4121](https://github.com/informalsystems/hermes/issues/4121)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index 2dd79fdf82..c70f339376 100644 --- a/flake.lock +++ b/flake.lock @@ -218,11 +218,11 @@ "wasmvm_2_1_0-src": "wasmvm_2_1_0-src" }, "locked": { - "lastModified": 1722949131, - "narHash": "sha256-RvBm0fCRWH9LnpSfeyxAvltk10g534rK2mSAMOfcHfc=", + "lastModified": 1722952698, + "narHash": "sha256-CiJMYtlXzapMgsVBVI6wCxvKUIdaFva0E5wcR/KP8+Q=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "318946fc494c970d7bdf377d40997abed2fb2b0f", + "rev": "536e2e77a702d0d2be6ba5d2eebf33b4261c58d4", "type": "github" }, "original": { @@ -1379,11 +1379,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1722895844, - "narHash": "sha256-kGwDuefMQgzdzMXx1BN3+pS7oKafQd6LTDG6XMwcqrU=", + "lastModified": 1722926584, + "narHash": "sha256-sLA+lfCxTkXf4o3JVxcfe+w9kAzauGfEnJ9roNbNng8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d3f42bd62aa840084563e3b93e4eab73cb0a0448", + "rev": "d33cf80b603b3d0cddb48f9816cae707a59e2334", "type": "github" }, "original": { @@ -1647,16 +1647,16 @@ "stride-src": { "flake": false, "locked": { - "lastModified": 1711572539, - "narHash": "sha256-WOoaijuB/Xziw3RMzVcLgR1iDWv72StuLL8K5JzcdlA=", + "lastModified": 1721921071, + "narHash": "sha256-EtsK7sjzQ2XfYt3DSV85IbKj7HEMy2Apt0m8kfgCEuk=", "owner": "Stride-Labs", "repo": "stride", - "rev": "093f25e17b1c9fae38a8092f9582af7c84bbaee4", + "rev": "d6e4e686e54a6a3c41d3ca0645f91ee1dc3ec441", "type": "github" }, "original": { "owner": "Stride-Labs", - "ref": "v21.0.0", + "ref": "v23.0.1", "repo": "stride", "type": "github" } From f4b5f18b014aac912cff5e62bfcc92ca9b78b933 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Wed, 7 Aug 2024 08:53:25 +0200 Subject: [PATCH 170/200] Update Neutron version running in CI to `v4.1.0` (#4133) * Update Nix flake to use branch with Neutron v4.1.0 * Add changelog entry * Set Neutron as chain with dynamic fees in tests --- .../4122-update-neutron-to-v4.md | 2 ++ flake.lock | 14 +++++++------- tools/test-framework/src/chain/chain_type.rs | 4 +++- 3 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4122-update-neutron-to-v4.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4122-update-neutron-to-v4.md b/.changelog/unreleased/improvements/ibc-integration-test/4122-update-neutron-to-v4.md new file mode 100644 index 0000000000..009d9cc047 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4122-update-neutron-to-v4.md @@ -0,0 +1,2 @@ +- Update the version of Neutron running the integration tests in the CI from `v3.0.5` + to `v4.1.0` ([\#4122](https://github.com/informalsystems/hermes/issues/4122)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index c70f339376..43cf6f59c0 100644 --- a/flake.lock +++ b/flake.lock @@ -218,11 +218,11 @@ "wasmvm_2_1_0-src": "wasmvm_2_1_0-src" }, "locked": { - "lastModified": 1722952698, - "narHash": "sha256-CiJMYtlXzapMgsVBVI6wCxvKUIdaFva0E5wcR/KP8+Q=", + "lastModified": 1722963157, + "narHash": "sha256-P0RiHRcWfNObnRPCkaUDQ7tbU5H8k2MrDmqLoVIkqqY=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "536e2e77a702d0d2be6ba5d2eebf33b4261c58d4", + "rev": "7f693a2a13dff856f520730a7ac1d46c101e2b5d", "type": "github" }, "original": { @@ -1164,16 +1164,16 @@ "neutron-src": { "flake": false, "locked": { - "lastModified": 1713877185, - "narHash": "sha256-cslMi835EdyByhSUN1FG9ucXjh5tQxqs3YfCLqGwYLg=", + "lastModified": 1722341371, + "narHash": "sha256-dhBhWytamqp1hRsQH+xqpq1UJmPi6CRHHDQwveCQ2WQ=", "owner": "neutron-org", "repo": "neutron", - "rev": "73f419c3c60a3b811b08788519063560e84d97a8", + "rev": "db33d3302abb45ee3887a97ea3d53923241fc167", "type": "github" }, "original": { "owner": "neutron-org", - "ref": "v3.0.5", + "ref": "v4.1.0", "repo": "neutron", "type": "github" } diff --git a/tools/test-framework/src/chain/chain_type.rs b/tools/test-framework/src/chain/chain_type.rs index 5dc727c33c..309a91b00e 100644 --- a/tools/test-framework/src/chain/chain_type.rs +++ b/tools/test-framework/src/chain/chain_type.rs @@ -103,7 +103,9 @@ impl FromStr for ChainType { fn from_str(s: &str) -> Result { match s { - name if name.contains("gaiad") => Ok(ChainType::Cosmos { dynamic_fee: true }), + name if name.contains("gaiad") || name.contains("neutrond") => { + Ok(ChainType::Cosmos { dynamic_fee: true }) + } name if name.contains("evmosd") => Ok(ChainType::Evmos), name if name.contains("injectived") => Ok(ChainType::Injective), name if name.contains("provenanced") => Ok(ChainType::Provenance), From c7b7c343ef4305fbe246ebfbbdb45298967e031f Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Wed, 7 Aug 2024 12:54:03 +0200 Subject: [PATCH 171/200] Update `wasmd` version running in CI to `v0.52.0` (#4134) * Update Nix flake * Add changelog entry --- .../4120-update-wasmd-to-v0-52.md | 2 ++ flake.lock | 20 +++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4120-update-wasmd-to-v0-52.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4120-update-wasmd-to-v0-52.md b/.changelog/unreleased/improvements/ibc-integration-test/4120-update-wasmd-to-v0-52.md new file mode 100644 index 0000000000..d281b1a3ee --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4120-update-wasmd-to-v0-52.md @@ -0,0 +1,2 @@ +- Update the version of `wasmd` running the integration tests in the CI from `v0.51.0` + to `v0.52.0` ([\#4120](https://github.com/informalsystems/hermes/issues/4120)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index 43cf6f59c0..fad9651323 100644 --- a/flake.lock +++ b/flake.lock @@ -218,11 +218,11 @@ "wasmvm_2_1_0-src": "wasmvm_2_1_0-src" }, "locked": { - "lastModified": 1722963157, - "narHash": "sha256-P0RiHRcWfNObnRPCkaUDQ7tbU5H8k2MrDmqLoVIkqqY=", + "lastModified": 1723019846, + "narHash": "sha256-FcTJj2nGC9Jr9JmQPZATKxQ9kDIE5eHSwZvqqJI8Y50=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "7f693a2a13dff856f520730a7ac1d46c101e2b5d", + "rev": "fbece4c8894ff01329f401021a2b8e4c661eb79e", "type": "github" }, "original": { @@ -1379,11 +1379,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1722926584, - "narHash": "sha256-sLA+lfCxTkXf4o3JVxcfe+w9kAzauGfEnJ9roNbNng8=", + "lastModified": 1722957468, + "narHash": "sha256-SQ0TCC4aklOhN/OzcztrKqDLY8SjpIZcyvTulzhDXs0=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d33cf80b603b3d0cddb48f9816cae707a59e2334", + "rev": "2a13929e1f191b3690dd2f2db13098b04adb9043", "type": "github" }, "original": { @@ -1767,16 +1767,16 @@ "wasmd-src": { "flake": false, "locked": { - "lastModified": 1713797184, - "narHash": "sha256-k7c8RdLggeM6hSQhJt0UREY/48T3ZRSSijA+TMFKhUc=", + "lastModified": 1720696698, + "narHash": "sha256-b2u3PWtjZAgmTdm/b3UcGn9K9qVQj9DR4FMcqg67T1w=", "owner": "CosmWasm", "repo": "wasmd", - "rev": "7b418de3f6cf8fbac1e9cb11c57983fcc17264d0", + "rev": "1ff818801d4aa5dd6f483571ac7a38660c59c671", "type": "github" }, "original": { "owner": "CosmWasm", - "ref": "v0.51.0", + "ref": "v0.52.0", "repo": "wasmd", "type": "github" } From e099709718aa24764d6e1e9b1e4aef4107b80787 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 12 Aug 2024 08:47:26 +0200 Subject: [PATCH 172/200] Add pagination and timeout to commitments and ack queries (#4110) * Add pagination and timeout to query packet commitments and acknowlegements * Add limit to 1 query for commitments and acks during scanning * Add benchmarking test for query commitments * Fix issue with benchmark feature * Add changelog entry * Apply github suggestions --- .../ibc-relayer/4101-add-pagination.md | 3 + .../src/commands/query/packet/commitments.rs | 3 +- .../src/commands/query/packet/pending.rs | 19 +- .../src/commands/query/packet/pending_acks.rs | 6 +- .../commands/query/packet/pending_sends.rs | 3 +- crates/relayer/src/chain/cosmos.rs | 230 +++++++++++++++--- crates/relayer/src/chain/counterparty.rs | 21 +- crates/relayer/src/chain/requests.rs | 47 +++- crates/relayer/src/link/cli.rs | 4 +- crates/relayer/src/link/relay_path.rs | 21 +- crates/relayer/src/supervisor/scan.rs | 34 ++- tools/integration-test/Cargo.toml | 1 + tools/integration-test/src/mbt/utils.rs | 8 +- .../src/tests/benchmark/mod.rs | 1 + .../src/tests/benchmark/query_commitments.rs | 82 +++++++ .../src/tests/clear_packet.rs | 26 +- tools/integration-test/src/tests/mod.rs | 3 + .../src/tests/query_packet.rs | 26 +- 18 files changed, 452 insertions(+), 86 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/4101-add-pagination.md create mode 100644 tools/integration-test/src/tests/benchmark/mod.rs create mode 100644 tools/integration-test/src/tests/benchmark/query_commitments.rs diff --git a/.changelog/unreleased/improvements/ibc-relayer/4101-add-pagination.md b/.changelog/unreleased/improvements/ibc-relayer/4101-add-pagination.md new file mode 100644 index 0000000000..912fdd9733 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/4101-add-pagination.md @@ -0,0 +1,3 @@ +- Paginate results of `query_packet_commitments` and `query_packet_acknowledgements` + queries to speed up the scanning phase. + ([\#4101](https://github.com/informalsystems/hermes/issues/4101)) \ No newline at end of file diff --git a/crates/relayer-cli/src/commands/query/packet/commitments.rs b/crates/relayer-cli/src/commands/query/packet/commitments.rs index 4ab40143da..725b5de562 100644 --- a/crates/relayer-cli/src/commands/query/packet/commitments.rs +++ b/crates/relayer-cli/src/commands/query/packet/commitments.rs @@ -1,6 +1,7 @@ use abscissa_core::clap::Parser; use ibc_relayer::chain::counterparty::commitments_on_chain; +use ibc_relayer::chain::requests::Paginate; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use crate::cli_utils::spawn_chain_runtime; @@ -47,7 +48,7 @@ impl QueryPacketCommitmentsCmd { let chain = spawn_chain_runtime(&config, &self.chain_id)?; - commitments_on_chain(&chain, &self.port_id, &self.channel_id) + commitments_on_chain(&chain, &self.port_id, &self.channel_id, Paginate::All) .map_err(Error::supervisor) .map(|(seqs_vec, height)| PacketSeqs { height, diff --git a/crates/relayer-cli/src/commands/query/packet/pending.rs b/crates/relayer-cli/src/commands/query/packet/pending.rs index 188379969b..94434adc69 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending.rs @@ -7,6 +7,7 @@ use ibc_relayer::chain::counterparty::{ channel_on_destination, pending_packet_summary, PendingPackets, }; use ibc_relayer::chain::handle::{BaseChainHandle, ChainHandle}; +use ibc_relayer::chain::requests::Paginate; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use crate::cli_utils::spawn_chain_counterparty; @@ -130,8 +131,13 @@ impl QueryPendingPacketsCmd { self.chain_id, chan_conn_cli.channel ); - let src_summary = pending_packet_summary(&chains.src, &chains.dst, &chan_conn_cli.channel) - .map_err(Error::supervisor)?; + let src_summary = pending_packet_summary( + &chains.src, + &chains.dst, + &chan_conn_cli.channel, + Paginate::All, + ) + .map_err(Error::supervisor)?; let counterparty_channel = channel_on_destination( &chan_conn_cli.channel, @@ -141,8 +147,13 @@ impl QueryPendingPacketsCmd { .map_err(Error::supervisor)? .ok_or_else(|| Error::missing_counterparty_channel_id(chan_conn_cli.channel))?; - let dst_summary = pending_packet_summary(&chains.dst, &chains.src, &counterparty_channel) - .map_err(Error::supervisor)?; + let dst_summary = pending_packet_summary( + &chains.dst, + &chains.src, + &counterparty_channel, + Paginate::All, + ) + .map_err(Error::supervisor)?; Ok(Summary { src_chain: chains.src.id(), diff --git a/crates/relayer-cli/src/commands/query/packet/pending_acks.rs b/crates/relayer-cli/src/commands/query/packet/pending_acks.rs index d946a32422..2f332b7416 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending_acks.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending_acks.rs @@ -2,6 +2,7 @@ use abscissa_core::clap::Parser; use ibc_relayer::chain::counterparty::unreceived_acknowledgements; use ibc_relayer::chain::handle::BaseChainHandle; +use ibc_relayer::chain::requests::Paginate; use ibc_relayer::path::PathIdentifiers; use ibc_relayer::util::collate::CollatedIterExt; use ibc_relayer_types::core::ics04_channel::packet::Sequence; @@ -68,8 +69,9 @@ impl QueryPendingAcksCmd { let path_identifiers = PathIdentifiers::from_channel_end(channel.clone()) .ok_or_else(|| Error::missing_counterparty_channel_id(channel))?; - let acks = unreceived_acknowledgements(&chains.src, &chains.dst, &path_identifiers) - .map_err(Error::supervisor)?; + let acks = + unreceived_acknowledgements(&chains.src, &chains.dst, &path_identifiers, Paginate::All) + .map_err(Error::supervisor)?; Ok(acks.map_or(vec![], |(sns, _)| sns)) } diff --git a/crates/relayer-cli/src/commands/query/packet/pending_sends.rs b/crates/relayer-cli/src/commands/query/packet/pending_sends.rs index c83576f7da..8df9fbdd23 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending_sends.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending_sends.rs @@ -2,6 +2,7 @@ use abscissa_core::clap::Parser; use ibc_relayer::chain::counterparty::unreceived_packets; use ibc_relayer::chain::handle::BaseChainHandle; +use ibc_relayer::chain::requests::Paginate; use ibc_relayer::path::PathIdentifiers; use ibc_relayer::util::collate::CollatedIterExt; use ibc_relayer_types::core::ics04_channel::packet::Sequence; @@ -68,7 +69,7 @@ impl QueryPendingSendsCmd { let path_identifiers = PathIdentifiers::from_channel_end(channel.clone()) .ok_or_else(|| Error::missing_counterparty_channel_id(channel))?; - unreceived_packets(&chains.src, &chains.dst, &path_identifiers) + unreceived_packets(&chains.src, &chains.dst, &path_identifiers, Paginate::All) .map_err(Error::supervisor) .map(|(seq, _)| seq) } diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index c0f6e9c3ad..570c053213 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -1933,31 +1933,116 @@ impl ChainEndpoint for CosmosSdkChain { self.grpc_addr.clone(), ), ) + .map(|client| { + client.max_decoding_message_size( + self.config().max_grpc_decoding_size.get_bytes() as usize + ) + }) .map_err(Error::grpc_transport)?; - client = client - .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); + if request.pagination.is_enabled() { + let mut results = Vec::new(); + let mut page_key = Vec::new(); - let request = tonic::Request::new(request.into()); + let pagination_information = request.pagination.get_values(); + let mut current_results = 0; - let response = self - .block_on(client.packet_commitments(request)) - .map_err(|e| Error::grpc_status(e, "query_packet_commitments".to_owned()))? - .into_inner(); + loop { + crate::time!( + "query_packet_commitments_loop_iteration", + { + "src_chain": self.config().id.to_string(), + } + ); + let mut raw_request = + ibc_proto::ibc::core::channel::v1::QueryPacketCommitmentsRequest::from( + request.clone(), + ); - let mut commitment_sequences: Vec = response - .commitments - .into_iter() - .map(|v| v.sequence.into()) - .collect(); - commitment_sequences.sort_unstable(); + if let Some(pagination) = raw_request.pagination.as_mut() { + pagination.key = page_key; + } - let height = response - .height - .and_then(|raw_height| raw_height.try_into().ok()) - .ok_or_else(|| Error::grpc_response_param("height".to_string()))?; + let mut tonic_request = tonic::Request::new(raw_request); + // TODO: This should either be configurable or inferred from the pagination + tonic_request.set_timeout(Duration::from_secs(10)); + + let response = self.rt.block_on(async { + client + .packet_commitments(tonic_request) + .await + .map_err(|e| Error::grpc_status(e, "query_packet_commitments".to_owned())) + }); + + match response { + Ok(response) => { + let inner_response = response.into_inner().clone(); + let next_key = inner_response + .pagination + .as_ref() + .map(|p| p.next_key.clone()); + + results.push(Ok(inner_response)); + current_results += pagination_information.0; + + match next_key { + Some(next_key) if !next_key.is_empty() => { + page_key = next_key; + } + _ => break, + } + } + Err(e) => { + results.push(Err(e)); + break; + } + } + if current_results >= pagination_information.1 { + break; + } + } + + let responses = results.into_iter().collect::, _>>()?; - Ok((commitment_sequences, height)) + let mut commitment_sequences = Vec::new(); + + for response in &responses { + commitment_sequences.extend( + response + .commitments + .iter() + .map(|commit| Sequence::from(commit.sequence)), + ); + } + + let height = responses + .first() + .and_then(|res| res.height) + .and_then(|raw_height| raw_height.try_into().ok()) + .ok_or_else(|| Error::grpc_response_param("height".to_string()))?; + + Ok((commitment_sequences, height)) + } else { + let request = tonic::Request::new(request.into()); + let response = self + .block_on(client.packet_commitments(request)) + .map_err(|e| Error::grpc_status(e, "query_packet_commitments".to_owned()))? + .into_inner(); + + let mut commitment_sequences: Vec = response + .commitments + .into_iter() + .map(|v| v.sequence.into()) + .collect(); + commitment_sequences.sort_unstable(); + + let height = response + .height + .and_then(|raw_height| raw_height.try_into().ok()) + .ok_or_else(|| Error::grpc_response_param("height".to_string()))?; + + Ok((commitment_sequences, height)) + } } fn query_packet_receipt( @@ -2074,30 +2159,105 @@ impl ChainEndpoint for CosmosSdkChain { self.grpc_addr.clone(), ), ) + .map(|client| { + client.max_decoding_message_size( + self.config().max_grpc_decoding_size.get_bytes() as usize + ) + }) .map_err(Error::grpc_transport)?; - client = client - .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); + if request.pagination.is_enabled() { + let mut results = Vec::new(); + let mut page_key = Vec::new(); - let request = tonic::Request::new(request.into()); + loop { + let mut raw_request = + ibc_proto::ibc::core::channel::v1::QueryPacketAcknowledgementsRequest::from( + request.clone(), + ); - let response = self - .block_on(client.packet_acknowledgements(request)) - .map_err(|e| Error::grpc_status(e, "query_packet_acknowledgements".to_owned()))? - .into_inner(); + if let Some(pagination) = raw_request.pagination.as_mut() { + pagination.key = page_key; + } - let acks_sequences = response - .acknowledgements - .into_iter() - .map(|v| v.sequence.into()) - .collect(); + let mut tonic_request = tonic::Request::new(raw_request); + // TODO: This should either be configurable or inferred from the pagination + tonic_request.set_timeout(Duration::from_secs(10)); + + let response = self.rt.block_on(async { + client + .packet_acknowledgements(tonic_request) + .await + .map_err(|e| { + Error::grpc_status(e, "query_packet_acknowledgements".to_owned()) + }) + }); + + match response { + Ok(response) => { + let inner_response = response.into_inner().clone(); + let next_key = inner_response + .pagination + .as_ref() + .map(|p| p.next_key.clone()); + + results.push(Ok(inner_response)); + + match next_key { + Some(next_key) if !next_key.is_empty() => { + page_key = next_key; + } + _ => break, + } + } + Err(e) => { + results.push(Err(e)); + break; + } + } + } + + let responses = results.into_iter().collect::, _>>()?; - let height = response - .height - .and_then(|raw_height| raw_height.try_into().ok()) - .ok_or_else(|| Error::grpc_response_param("height".to_string()))?; + let mut acks_sequences = Vec::new(); - Ok((acks_sequences, height)) + for response in &responses { + acks_sequences.extend( + response + .acknowledgements + .iter() + .map(|commit| Sequence::from(commit.sequence)), + ); + } + + let height = responses + .first() + .and_then(|res| res.height) + .and_then(|raw_height| raw_height.try_into().ok()) + .ok_or_else(|| Error::grpc_response_param("height".to_string()))?; + + Ok((acks_sequences, height)) + } else { + let request = tonic::Request::new(request.into()); + let response = self + .block_on(client.packet_acknowledgements(request)) + .map_err(|e| Error::grpc_status(e, "query_packet_commitments".to_owned()))? + .into_inner(); + + let mut acks_sequences: Vec = response + .acknowledgements + .into_iter() + .map(|v| v.sequence.into()) + .collect(); + acks_sequences.sort_unstable(); + + let height = response + .height + .and_then(|raw_height| raw_height.try_into().ok()) + .ok_or_else(|| Error::grpc_response_param("height".to_string()))?; + + Ok((acks_sequences, height)) + } } /// Performs a `QueryUnreceivedAcksRequest` gRPC query to fetch the unreceived acknowledgements diff --git a/crates/relayer/src/chain/counterparty.rs b/crates/relayer/src/chain/counterparty.rs index 0710f25a6e..ffd4a42c9c 100644 --- a/crates/relayer/src/chain/counterparty.rs +++ b/crates/relayer/src/chain/counterparty.rs @@ -19,7 +19,7 @@ use serde::{Deserialize, Serialize}; use tracing::{error, trace}; use super::requests::{ - IncludeProof, PageRequest, QueryChannelRequest, QueryClientConnectionsRequest, + IncludeProof, PageRequest, Paginate, QueryChannelRequest, QueryClientConnectionsRequest, QueryClientStateRequest, QueryConnectionRequest, QueryPacketAcknowledgementsRequest, QueryUnreceivedAcksRequest, QueryUnreceivedPacketsRequest, }; @@ -381,13 +381,14 @@ pub fn commitments_on_chain( chain: &impl ChainHandle, port_id: &PortId, channel_id: &ChannelId, + paginate: Paginate, ) -> Result<(Vec, Height), Error> { // get the packet commitments on the counterparty/ source chain let (mut commit_sequences, response_height) = chain .query_packet_commitments(QueryPacketCommitmentsRequest { port_id: port_id.clone(), channel_id: channel_id.clone(), - pagination: Some(PageRequest::all()), + pagination: paginate, }) .map_err(Error::relayer)?; @@ -424,6 +425,7 @@ pub fn packet_acknowledgements( port_id: &PortId, channel_id: &ChannelId, commit_sequences: Vec, + pagination: Paginate, ) -> Result, Height)>, Error> { // If there aren't any sequences to query for, return early. // Otherwise we end up with the full list of acknowledgements on chain, @@ -439,7 +441,7 @@ pub fn packet_acknowledgements( .query_packet_acknowledgements(QueryPacketAcknowledgementsRequest { port_id: port_id.clone(), channel_id: channel_id.clone(), - pagination: Some(PageRequest::all()), + pagination, packet_commitment_sequences: commit_sequences, }) .map_err(Error::relayer)?; @@ -500,11 +502,13 @@ pub fn unreceived_packets( chain: &impl ChainHandle, counterparty_chain: &impl ChainHandle, path: &PathIdentifiers, + paginate: Paginate, ) -> Result<(Vec, Height), Error> { let (commit_sequences, h) = commitments_on_chain( counterparty_chain, &path.counterparty_port_id, &path.counterparty_channel_id, + paginate, )?; telemetry!( @@ -541,6 +545,7 @@ pub fn acknowledgements_on_chain( counterparty_chain, &counterparty.port_id, counterparty_channel_id, + Paginate::All, )?; let sequences_and_height = packet_acknowledgements( @@ -548,6 +553,7 @@ pub fn acknowledgements_on_chain( &channel.port_id, &channel.channel_id, commitments_on_counterparty, + Paginate::All, )?; Ok(sequences_and_height) @@ -586,14 +592,17 @@ pub fn unreceived_acknowledgements( chain: &impl ChainHandle, counterparty_chain: &impl ChainHandle, path: &PathIdentifiers, + pagination: Paginate, ) -> Result, Height)>, Error> { - let (commitments_on_src, _) = commitments_on_chain(chain, &path.port_id, &path.channel_id)?; + let (commitments_on_src, _) = + commitments_on_chain(chain, &path.port_id, &path.channel_id, pagination)?; let acks_and_height_on_counterparty = packet_acknowledgements( counterparty_chain, &path.counterparty_port_id, &path.counterparty_channel_id, commitments_on_src, + pagination, )?; if let Some((acks_on_counterparty, height)) = acks_and_height_on_counterparty { @@ -625,6 +634,7 @@ pub fn pending_packet_summary( chain: &impl ChainHandle, counterparty_chain: &impl ChainHandle, channel: &IdentifiedChannelEnd, + pagination: Paginate, ) -> Result { let counterparty = channel.channel_end.counterparty(); let counterparty_channel_id = counterparty @@ -633,7 +643,7 @@ pub fn pending_packet_summary( .ok_or_else(Error::missing_counterparty_channel_id)?; let (commitments_on_src, _) = - commitments_on_chain(chain, &channel.port_id, &channel.channel_id)?; + commitments_on_chain(chain, &channel.port_id, &channel.channel_id, pagination)?; let unreceived = unreceived_packets_sequences( counterparty_chain, @@ -647,6 +657,7 @@ pub fn pending_packet_summary( &counterparty.port_id, counterparty_channel_id, commitments_on_src, + Paginate::All, )?; let pending_acks = if let Some((acks_on_counterparty, _)) = acks_on_counterparty { diff --git a/crates/relayer/src/chain/requests.rs b/crates/relayer/src/chain/requests.rs index 4874d3145d..d86770e7f7 100644 --- a/crates/relayer/src/chain/requests.rs +++ b/crates/relayer/src/chain/requests.rs @@ -115,8 +115,12 @@ impl PageRequest { // Note: do not use u64::MAX as the limit, as it may have unintended consequences // See https://github.com/informalsystems/hermes/pull/2950#issuecomment-1373733744 + Self::per_page(u32::MAX as u64) + } + + pub fn per_page(limit: u64) -> Self { PageRequest { - limit: u32::MAX as u64, + limit, ..Default::default() } } @@ -134,6 +138,39 @@ impl From for RawPageRequest { } } +#[derive(Clone, Copy, Debug, Default, Deserialize, Eq, PartialEq, Serialize)] +pub enum Paginate { + #[default] + All, + + PerPage { + per_page: u64, + total: u64, + }, +} + +impl Paginate { + pub fn is_enabled(&self) -> bool { + !matches!(self, Self::All) + } + + pub fn get_values(&self) -> (u64, u64) { + match self { + Paginate::PerPage { total, per_page } => (*per_page, *total), + _ => (0, 0), + } + } +} + +impl From for PageRequest { + fn from(value: Paginate) -> Self { + match value { + Paginate::All => PageRequest::all(), + Paginate::PerPage { per_page, .. } => PageRequest::per_page(per_page), + } + } +} + #[derive(Clone, Debug, Serialize, Deserialize)] pub struct QueryClientStateRequest { pub client_id: ClientId, @@ -303,7 +340,7 @@ pub struct QueryPacketCommitmentRequest { pub struct QueryPacketCommitmentsRequest { pub port_id: PortId, pub channel_id: ChannelId, - pub pagination: Option, + pub pagination: Paginate, } impl From for RawQueryPacketCommitmentsRequest { @@ -311,7 +348,7 @@ impl From for RawQueryPacketCommitmentsRequest { RawQueryPacketCommitmentsRequest { port_id: request.port_id.to_string(), channel_id: request.channel_id.to_string(), - pagination: request.pagination.map(|pagination| pagination.into()), + pagination: Some(PageRequest::from(request.pagination).into()), } } } @@ -359,7 +396,7 @@ pub struct QueryPacketAcknowledgementRequest { pub struct QueryPacketAcknowledgementsRequest { pub port_id: PortId, pub channel_id: ChannelId, - pub pagination: Option, + pub pagination: Paginate, pub packet_commitment_sequences: Vec, } @@ -368,7 +405,7 @@ impl From for RawQueryPacketAcknowledgements RawQueryPacketAcknowledgementsRequest { port_id: request.port_id.to_string(), channel_id: request.channel_id.to_string(), - pagination: request.pagination.map(|pagination| pagination.into()), + pagination: Some(PageRequest::from(request.pagination).into()), packet_commitment_sequences: request .packet_commitment_sequences .into_iter() diff --git a/crates/relayer/src/link/cli.rs b/crates/relayer/src/link/cli.rs index f4e37bccc9..f7b7372f4f 100644 --- a/crates/relayer/src/link/cli.rs +++ b/crates/relayer/src/link/cli.rs @@ -11,7 +11,7 @@ use ibc_relayer_types::Height; use crate::chain::counterparty::{unreceived_acknowledgements, unreceived_packets}; use crate::chain::handle::ChainHandle; -use crate::chain::requests::Qualified; +use crate::chain::requests::{Paginate, Qualified}; use crate::chain::tracking::TrackingId; use crate::error::Error; use crate::event::IbcEventWithHeight; @@ -97,6 +97,7 @@ impl Link { self.a_to_b.dst_chain(), self.a_to_b.src_chain(), &self.a_to_b.path_id, + Paginate::All, ) .map_err(LinkError::supervisor)?; @@ -162,6 +163,7 @@ impl Link { self.a_to_b.dst_chain(), self.a_to_b.src_chain(), &self.a_to_b.path_id, + Paginate::All, ) .map_err(LinkError::supervisor)? else { diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index 47bf6f8770..8038f03995 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -30,6 +30,7 @@ use crate::chain::counterparty::unreceived_acknowledgements; use crate::chain::counterparty::unreceived_packets; use crate::chain::endpoint::ChainStatus; use crate::chain::handle::ChainHandle; +use crate::chain::requests::Paginate; use crate::chain::requests::QueryChannelRequest; use crate::chain::requests::QueryClientEventRequest; use crate::chain::requests::QueryHeight; @@ -1163,9 +1164,13 @@ impl RelayPath { .entered(); // Pull the s.n. of all packets that the destination chain has not yet received. - let (sequences, src_response_height) = - unreceived_packets(self.dst_chain(), self.src_chain(), &self.path_id) - .map_err(LinkError::supervisor)?; + let (sequences, src_response_height) = unreceived_packets( + self.dst_chain(), + self.src_chain(), + &self.path_id, + Paginate::All, + ) + .map_err(LinkError::supervisor)?; let query_height = opt_query_height.unwrap_or(src_response_height); @@ -1232,9 +1237,13 @@ impl RelayPath { ) .entered(); - let sequences_and_height = - unreceived_acknowledgements(self.dst_chain(), self.src_chain(), &self.path_id) - .map_err(LinkError::supervisor)?; + let sequences_and_height = unreceived_acknowledgements( + self.dst_chain(), + self.src_chain(), + &self.path_id, + Paginate::All, + ) + .map_err(LinkError::supervisor)?; let Some((sequences, src_response_height)) = sequences_and_height else { return Ok(()); diff --git a/crates/relayer/src/supervisor/scan.rs b/crates/relayer/src/supervisor/scan.rs index d5dd77d364..3431f30881 100644 --- a/crates/relayer/src/supervisor/scan.rs +++ b/crates/relayer/src/supervisor/scan.rs @@ -18,9 +18,9 @@ use crate::{ counterparty::{channel_on_destination, connection_state_on_destination}, handle::ChainHandle, requests::{ - IncludeProof, PageRequest, QueryChannelRequest, QueryClientConnectionsRequest, - QueryClientStateRequest, QueryClientStatesRequest, QueryConnectionChannelsRequest, - QueryConnectionRequest, QueryHeight, + IncludeProof, PageRequest, Paginate, QueryChannelRequest, + QueryClientConnectionsRequest, QueryClientStateRequest, QueryClientStatesRequest, + QueryConnectionChannelsRequest, QueryConnectionRequest, QueryHeight, }, }, client_state::IdentifiedAnyClientState, @@ -236,9 +236,17 @@ impl ChannelScan { .as_ref() .and_then(|c| PathIdentifiers::from_channel_end(c.clone())) .map(|ids| { - unreceived_packets(counterparty_chain, chain, &ids) - .map(|(seq, _)| seq) - .unwrap_or_default() + unreceived_packets( + counterparty_chain, + chain, + &ids, + Paginate::PerPage { + per_page: 1, + total: 1, + }, + ) + .map(|(seq, _)| seq) + .unwrap_or_default() }) } @@ -252,9 +260,17 @@ impl ChannelScan { .as_ref() .and_then(|c| PathIdentifiers::from_channel_end(c.clone()))?; - let acks = unreceived_acknowledgements(counterparty_chain, chain, &ids) - .map(|sns| sns.map_or(vec![], |(sns, _)| sns)) - .unwrap_or_default(); + let acks = unreceived_acknowledgements( + counterparty_chain, + chain, + &ids, + Paginate::PerPage { + per_page: 1, + total: 1, + }, + ) + .map(|sns| sns.map_or(vec![], |(sns, _)| sns)) + .unwrap_or_default(); Some(acks) } diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index c28ce0ba62..f23398217a 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -49,6 +49,7 @@ juno = [] dynamic-gas-fee = [] new-register-interchain-account = [] authz = [] +benchmark = [] [[bin]] name = "test_setup_with_binary_channel" diff --git a/tools/integration-test/src/mbt/utils.rs b/tools/integration-test/src/mbt/utils.rs index 809eddb7e7..308dc45ab3 100644 --- a/tools/integration-test/src/mbt/utils.rs +++ b/tools/integration-test/src/mbt/utils.rs @@ -1,6 +1,6 @@ use ibc_relayer::chain::requests::{ - QueryPacketAcknowledgementsRequest, QueryPacketCommitmentsRequest, QueryUnreceivedAcksRequest, - QueryUnreceivedPacketsRequest, + Paginate, QueryPacketAcknowledgementsRequest, QueryPacketCommitmentsRequest, + QueryUnreceivedAcksRequest, QueryUnreceivedPacketsRequest, }; use ibc_relayer_types::core::ics04_channel::packet::Sequence; use ibc_test_framework::prelude::*; @@ -94,7 +94,7 @@ pub fn get_committed_packets_at_src( let request = QueryPacketCommitmentsRequest { port_id: port_id_a.clone(), channel_id: channel_id_a.clone(), - pagination: None, + pagination: Paginate::All, }; let (sequences, _) = chain.query_packet_commitments(request)?; Ok(sequences) @@ -123,7 +123,7 @@ pub fn get_acknowledged_packets_at_dst let request = QueryPacketAcknowledgementsRequest { port_id: port_id_a.clone(), channel_id: channel_id_a.clone(), - pagination: None, + pagination: Paginate::All, packet_commitment_sequences: Vec::new(), }; Ok(chain.query_packet_acknowledgements(request)?.0) diff --git a/tools/integration-test/src/tests/benchmark/mod.rs b/tools/integration-test/src/tests/benchmark/mod.rs new file mode 100644 index 0000000000..169d3ccaca --- /dev/null +++ b/tools/integration-test/src/tests/benchmark/mod.rs @@ -0,0 +1 @@ +pub mod query_commitments; diff --git a/tools/integration-test/src/tests/benchmark/query_commitments.rs b/tools/integration-test/src/tests/benchmark/query_commitments.rs new file mode 100644 index 0000000000..b05b02f5c4 --- /dev/null +++ b/tools/integration-test/src/tests/benchmark/query_commitments.rs @@ -0,0 +1,82 @@ +use ibc_test_framework::prelude::*; + +#[test] +fn benchmark_query_commitments() -> Result<(), Error> { + run_binary_channel_test(&QueryCommitmentsBenchmark) +} + +pub struct QueryCommitmentsBenchmark; + +impl TestOverrides for QueryCommitmentsBenchmark { + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.packets.clear_on_start = false; + config.mode.packets.clear_interval = 0; + } + + fn should_spawn_supervisor(&self) -> bool { + false + } +} + +impl BinaryChannelTest for QueryCommitmentsBenchmark { + fn run( + &self, + config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + channel: ConnectedChannel, + ) -> Result<(), Error> { + use std::path::Path; + + use ibc_relayer::util::profiling::open_or_create_profile_file; + + let now = time::OffsetDateTime::now_utc(); + let path_str = format!( + "{}/hermes-{:04}-{:02}-{:02}-{:02}{:02}{:02}-prof.json", + config.chain_store_dir.as_path().display(), + now.year(), + now.month(), + now.day(), + now.hour(), + now.minute(), + now.second() + ); + + open_or_create_profile_file(Path::new(&path_str)); + ibc_relayer::util::profiling::enable(false, true); + + let denom_a = chains.node_a.denom(); + + let wallet_a = chains.node_a.wallets().user1().cloned(); + let wallet_b = chains.node_b.wallets().user1().cloned(); + + let a_to_b_amount = 12u64; + let num_msgs = 1000000u64; + + info!( + "Sending {num_msgs} IBC transfers from chain {} to chain {} with amount of {} {}", + chains.chain_id_a(), + chains.chain_id_b(), + a_to_b_amount, + denom_a + ); + + chains.node_a.chain_driver().ibc_transfer_token_multiple( + &channel.port_a.as_ref(), + &channel.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(a_to_b_amount).as_ref(), + num_msgs as usize, + None, + )?; + + info!("Waiting for profiling to be populated"); + + relayer.with_supervisor(|| { + std::thread::sleep(core::time::Duration::from_secs(180)); + + Ok(()) + }) + } +} diff --git a/tools/integration-test/src/tests/clear_packet.rs b/tools/integration-test/src/tests/clear_packet.rs index 88878d50a1..cf09b6dbad 100644 --- a/tools/integration-test/src/tests/clear_packet.rs +++ b/tools/integration-test/src/tests/clear_packet.rs @@ -1,6 +1,6 @@ use std::thread; -use ibc_relayer::chain::counterparty::pending_packet_summary; +use ibc_relayer::chain::{counterparty::pending_packet_summary, requests::Paginate}; use ibc_relayer::config::ChainConfig; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::query_identified_channel_end; @@ -484,8 +484,12 @@ impl BinaryChannelTest for ClearPacketSequencesTest { channel.port_a.as_ref(), )?; - let pending_packets_a = - pending_packet_summary(chains.handle_a(), chains.handle_b(), channel_end_a.value())?; + let pending_packets_a = pending_packet_summary( + chains.handle_a(), + chains.handle_b(), + channel_end_a.value(), + Paginate::All, + )?; info!("Pending packets: {:?}", pending_packets_a); @@ -532,8 +536,12 @@ impl BinaryChannelTest for ClearPacketSequencesTest { sleep(Duration::from_secs(10)); - let pending_packets = - pending_packet_summary(chains.handle_a(), chains.handle_b(), channel_end_a.value())?; + let pending_packets = pending_packet_summary( + chains.handle_a(), + chains.handle_b(), + channel_end_a.value(), + Paginate::All, + )?; info!("Pending packets: {pending_packets:?}"); @@ -560,8 +568,12 @@ impl BinaryChannelTest for ClearPacketSequencesTest { rev_link.relay_ack_packet_messages(to_clear)?; - let pending_packets_a = - pending_packet_summary(chains.handle_a(), chains.handle_b(), channel_end_a.value())?; + let pending_packets_a = pending_packet_summary( + chains.handle_a(), + chains.handle_b(), + channel_end_a.value(), + Paginate::All, + )?; info!("Pending packets: {pending_packets_a:?}"); diff --git a/tools/integration-test/src/tests/mod.rs b/tools/integration-test/src/tests/mod.rs index 34534b57f7..6fdcc4e915 100644 --- a/tools/integration-test/src/tests/mod.rs +++ b/tools/integration-test/src/tests/mod.rs @@ -74,3 +74,6 @@ pub mod interchain_security; #[cfg(any(doc, feature = "dynamic-gas-fee"))] pub mod dynamic_gas_fee; + +#[cfg(any(doc, feature = "benchmark"))] +pub mod benchmark; diff --git a/tools/integration-test/src/tests/query_packet.rs b/tools/integration-test/src/tests/query_packet.rs index 08a2f90870..7bd3f7ad1b 100644 --- a/tools/integration-test/src/tests/query_packet.rs +++ b/tools/integration-test/src/tests/query_packet.rs @@ -1,4 +1,5 @@ use ibc_relayer::chain::counterparty::{channel_on_destination, pending_packet_summary}; +use ibc_relayer::chain::requests::Paginate; use ibc_relayer::link::{Link, LinkParameters}; use ibc_test_framework::prelude::*; @@ -87,8 +88,12 @@ impl BinaryChannelTest for QueryPacketPendingTest { channel.port_a.as_ref(), )?; - let summary = - pending_packet_summary(chains.handle_a(), chains.handle_b(), channel_end.value())?; + let summary = pending_packet_summary( + chains.handle_a(), + chains.handle_b(), + channel_end.value(), + Paginate::All, + )?; assert_eq!(summary.unreceived_packets, [1.into()]); assert!(summary.unreceived_acks.is_empty()); @@ -96,8 +101,12 @@ impl BinaryChannelTest for QueryPacketPendingTest { // Receive the packet on the destination chain link.relay_recv_packet_and_timeout_messages(vec![])?; - let summary = - pending_packet_summary(chains.handle_a(), chains.handle_b(), channel_end.value())?; + let summary = pending_packet_summary( + chains.handle_a(), + chains.handle_b(), + channel_end.value(), + Paginate::All, + )?; assert!(summary.unreceived_packets.is_empty()); assert_eq!(summary.unreceived_acks, [1.into()]); @@ -114,8 +123,12 @@ impl BinaryChannelTest for QueryPacketPendingTest { rev_link.relay_ack_packet_messages(vec![])?; - let summary = - pending_packet_summary(chains.handle_a(), chains.handle_b(), channel_end.value())?; + let summary = pending_packet_summary( + chains.handle_a(), + chains.handle_b(), + channel_end.value(), + Paginate::All, + )?; assert!(summary.unreceived_packets.is_empty()); assert!(summary.unreceived_acks.is_empty()); @@ -154,6 +167,7 @@ impl BinaryChannelTest for QueryPacketPendingTest { chains.handle_b(), chains.handle_a(), &counterparty_channel_end, + Paginate::All, )?; assert_eq!(summary.unreceived_packets, [1.into()]); From 012bb8b41d653b764596eb40d9a5eb2602be0308 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 12 Aug 2024 08:48:38 +0200 Subject: [PATCH 173/200] Add and remove profiling (#4136) * Add and remove profiling * Apply suggestions from code review Co-authored-by: Romain Ruetschi Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi --- crates/relayer/src/chain/cosmos.rs | 51 +++++++++++++++---- crates/relayer/src/chain/cosmos/query/tx.rs | 6 +++ crates/relayer/src/foreign_client.rs | 7 +++ crates/relayer/src/light_client/tendermint.rs | 12 +++++ 4 files changed, 67 insertions(+), 9 deletions(-) diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 570c053213..81ffa8a375 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -577,11 +577,6 @@ impl CosmosSdkChain { height_query: QueryHeight, prove: bool, ) -> Result { - crate::time!("query", - { - "src_chain": self.config().id.to_string(), - }); - let data = data.into(); if !data.is_provable() & prove { return Err(Error::private_store()); @@ -1197,6 +1192,12 @@ impl ChainEndpoint for CosmosSdkChain { } fn query_balance(&self, key_name: Option<&str>, denom: Option<&str>) -> Result { + crate::time!( + "query_balance", + { + "src_chain": self.config().id.to_string(), + } + ); // If a key_name is given, extract the account hash. // Else retrieve the account from the configuration file. let key = match key_name { @@ -1212,6 +1213,12 @@ impl ChainEndpoint for CosmosSdkChain { } fn query_all_balances(&self, key_name: Option<&str>) -> Result, Error> { + crate::time!( + "query_all_balances", + { + "src_chain": self.config().id.to_string(), + } + ); // If a key_name is given, extract the account hash. // Else retrieve the account from the configuration file. let key = match key_name { @@ -1893,6 +1900,12 @@ impl ChainEndpoint for CosmosSdkChain { request: QueryPacketCommitmentRequest, include_proof: IncludeProof, ) -> Result<(Vec, Option), Error> { + crate::time!( + "query_packet_commitment", + { + "src_chain": self.config().id.to_string(), + } + ); let res = self.query( CommitmentsPath { port_id: request.port_id, @@ -2050,6 +2063,12 @@ impl ChainEndpoint for CosmosSdkChain { request: QueryPacketReceiptRequest, include_proof: IncludeProof, ) -> Result<(Vec, Option), Error> { + crate::time!( + "query_packet_receipt", + { + "src_chain": self.config().id.to_string(), + } + ); let res = self.query( ReceiptsPath { port_id: request.port_id, @@ -2115,6 +2134,12 @@ impl ChainEndpoint for CosmosSdkChain { request: QueryPacketAcknowledgementRequest, include_proof: IncludeProof, ) -> Result<(Vec, Option), Error> { + crate::time!( + "query_packet_acknowledgement", + { + "src_chain": self.config().id.to_string(), + } + ); let res = self.query( AcksPath { port_id: request.port_id, @@ -2347,10 +2372,6 @@ impl ChainEndpoint for CosmosSdkChain { /// 1. Client Update request - returns a vector with at most one update client event /// 2. Transaction event request - returns all IBC events resulted from a Tx execution fn query_txs(&self, request: QueryTxRequest) -> Result, Error> { - crate::time!("query_txs", - { - "src_chain": self.config().id.to_string(), - }); crate::telemetry!(query, self.id(), "query_txs"); self.block_on(query_txs( @@ -2446,6 +2467,12 @@ impl ChainEndpoint for CosmosSdkChain { &self, request: QueryHostConsensusStateRequest, ) -> Result { + crate::time!( + "query_host_consensus_state", + { + "src_chain": self.config().id.to_string(), + } + ); let height = match request.height { QueryHeight::Latest => TmHeight::from(0u32), QueryHeight::Specific(ibc_height) => TmHeight::from(ibc_height), @@ -2476,6 +2503,12 @@ impl ChainEndpoint for CosmosSdkChain { height: ICSHeight, settings: ClientSettings, ) -> Result { + crate::time!( + "build_client_state", + { + "src_chain": self.config().id.to_string(), + } + ); let ClientSettings::Tendermint(settings) = settings; let unbonding_period = self.unbonding_period()?; let trusting_period = settings diff --git a/crates/relayer/src/chain/cosmos/query/tx.rs b/crates/relayer/src/chain/cosmos/query/tx.rs index e6897c02a4..317ea9e6d0 100644 --- a/crates/relayer/src/chain/cosmos/query/tx.rs +++ b/crates/relayer/src/chain/cosmos/query/tx.rs @@ -75,6 +75,12 @@ pub async fn query_txs( } QueryTxRequest::Transaction(tx) => { + crate::time!( + "query_txs: transaction hash", + { + "src_chain": chain_id, + } + ); let mut response = rpc_client .tx_search( tx_hash_query(&tx), diff --git a/crates/relayer/src/foreign_client.rs b/crates/relayer/src/foreign_client.rs index 8fded33524..c05a5739f4 100644 --- a/crates/relayer/src/foreign_client.rs +++ b/crates/relayer/src/foreign_client.rs @@ -1213,6 +1213,13 @@ impl ForeignClient, ) -> Result, ForeignClientError> { + crate::time!( + "build_update_client_with_trusted", + { + "src_chain": self.src_chain().id(), + "dst_chain": self.dst_chain().id(), + } + ); // Get the latest client state on destination. let (client_state, _) = self.validated_client_state()?; diff --git a/crates/relayer/src/light_client/tendermint.rs b/crates/relayer/src/light_client/tendermint.rs index 32d31dfcdb..808c616235 100644 --- a/crates/relayer/src/light_client/tendermint.rs +++ b/crates/relayer/src/light_client/tendermint.rs @@ -55,6 +55,12 @@ impl super::LightClient for LightClient { client_state: &AnyClientState, now: Time, ) -> Result, Error> { + crate::time!( + "light_client.tendermint.header_and_minimal_set", + { + "src_chain": self.chain_id.to_string(), + } + ); let Verified { target, supporting } = self.verify(trusted_height, target_height, client_state, now)?; @@ -81,6 +87,12 @@ impl super::LightClient for LightClient { client_state: &AnyClientState, now: Time, ) -> Result, Error> { + crate::time!( + "light_client.tendermint.verify", + { + "src_chain": self.chain_id.to_string(), + } + ); trace!(%trusted_height, %target_height, "light client verification"); if !self.enable_verification { From b053d440e7464550e987ff5c03ec596cf6247bb4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 10:32:00 +0200 Subject: [PATCH 174/200] Bump serde from 1.0.204 to 1.0.206 (#4139) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.204 to 1.0.206. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.204...v1.0.206) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9811203489..e605d5003c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2904,9 +2904,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.204" +version = "1.0.206" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "5b3e4cd94123dd520a128bcd11e34d9e9e423e7e3e50425cb1b4b1e3549d0284" dependencies = [ "serde_derive", ] @@ -2932,9 +2932,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.206" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "fabfb6138d2383ea8208cf98ccf69cdfb1aff4088460681d84189aa259762f97" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 4f23180fab..8064fd8103 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,7 +92,7 @@ retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" secp256k1 = "0.28.2" semver = "1.0.21" -serde = "1.0.204" +serde = "1.0.206" serde_derive = "1.0.104" serde_json = "1.0.122" serde_yaml = "0.9.34" From 218dd800f5db5a16a4a9e961eaabe9727edbe3df Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 10:32:44 +0200 Subject: [PATCH 175/200] Bump regex from 1.10.5 to 1.10.6 (#4138) Bumps [regex](https://github.com/rust-lang/regex) from 1.10.5 to 1.10.6. - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/regex/compare/1.10.5...1.10.6) --- updated-dependencies: - dependency-name: regex dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e605d5003c..d51a56a4a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2495,9 +2495,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 8064fd8103..d4a6488111 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,7 +86,7 @@ primitive-types = { version = "0.12.1", default-features = false } prometheus = "0.13.4" prost = "0.13" rand = "0.8.5" -regex = "1.10.5" +regex = "1.10.6" reqwest = { version = "0.11.27", default-features = false } retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" From 87194ace393491a469f4ae95b99429ac9e3c4e8a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 10:46:20 +0200 Subject: [PATCH 176/200] Bump bytes from 1.6.1 to 1.7.1 (#4126) Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.6.1 to 1.7.1. - [Release notes](https://github.com/tokio-rs/bytes/releases) - [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/bytes/compare/v1.6.1...v1.7.1) --- updated-dependencies: - dependency-name: bytes dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d51a56a4a6..0c86d2e454 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -478,9 +478,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" dependencies = [ "serde", ] diff --git a/Cargo.toml b/Cargo.toml index d4a6488111..c2185ccb87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ bech32 = "0.9.1" bitcoin = "0.31.2" bs58 = "0.5.1" byte-unit = { version = "4.0.19", default-features = false } -bytes = "1.6.1" +bytes = "1.7.1" clap = "3.2" clap_complete = "3.2" color-eyre = "0.6" From 918557aa7eecf8de28870fcd14a9c206e4d61a4d Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:14:06 +0200 Subject: [PATCH 177/200] Update Provenance version running in CI to v1.19.1 (#4124) * Update nix flake * Use Cosmos Nix main branch * Fix async ICQ tests * Enable async ICQ tests for Provenance * Remove '--chain-id' flag from ' query tx' CLI * Reorganise Wasm related CLIs in test framework * Use variable for code_id when querying wasm contract by code * Add changelog entry --- .../4115-update-provenance-to-v1-19-1.md | 2 + .github/workflows/integration.yaml | 2 +- .../tests/async_icq/contracts/counter.wasm | Bin 0 -> 177529 bytes .../src/tests/async_icq/contracts/echo.wasm | Bin 0 -> 138325 bytes .../src/tests/async_icq/simple_query.rs | 366 ++++++++++++++++-- .../test-framework/src/chain/cli/async_icq.rs | 43 +- tools/test-framework/src/chain/cli/mod.rs | 2 + .../test-framework/src/chain/cli/proposal.rs | 181 +++++++++ tools/test-framework/src/chain/cli/query.rs | 56 +++ tools/test-framework/src/chain/cli/upgrade.rs | 31 +- .../src/chain/cli/wasm/contract.rs | 162 ++++++++ .../test-framework/src/chain/cli/wasm/mod.rs | 2 + .../src/chain/cli/wasm/query.rs | 81 ++++ tools/test-framework/src/chain/config.rs | 35 ++ .../test-framework/src/chain/ext/async_icq.rs | 35 +- tools/test-framework/src/chain/ext/mod.rs | 1 + .../test-framework/src/chain/ext/proposal.rs | 20 + .../src/chain/ext/wasm_client.rs | 85 ++++ 18 files changed, 1039 insertions(+), 65 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4115-update-provenance-to-v1-19-1.md create mode 100644 tools/integration-test/src/tests/async_icq/contracts/counter.wasm create mode 100644 tools/integration-test/src/tests/async_icq/contracts/echo.wasm create mode 100644 tools/test-framework/src/chain/cli/proposal.rs create mode 100644 tools/test-framework/src/chain/cli/wasm/contract.rs create mode 100644 tools/test-framework/src/chain/cli/wasm/mod.rs create mode 100644 tools/test-framework/src/chain/cli/wasm/query.rs create mode 100644 tools/test-framework/src/chain/ext/wasm_client.rs diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4115-update-provenance-to-v1-19-1.md b/.changelog/unreleased/improvements/ibc-integration-test/4115-update-provenance-to-v1-19-1.md new file mode 100644 index 0000000000..f09668d2fc --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4115-update-provenance-to-v1-19-1.md @@ -0,0 +1,2 @@ +- Update the version of Provenance running the integration tests in the CI from `v1.17.0` + to `v1.19.1` ([\#4115](https://github.com/informalsystems/hermes/issues/4115)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 5b1eb0944e..899ac76fd4 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -84,7 +84,7 @@ jobs: command: provenanced account_prefix: pb native_token: nhash - features: fee-grant,authz + features: fee-grant,authz,async-icq - package: migaloo command: migalood account_prefix: migaloo diff --git a/tools/integration-test/src/tests/async_icq/contracts/counter.wasm b/tools/integration-test/src/tests/async_icq/contracts/counter.wasm new file mode 100644 index 0000000000000000000000000000000000000000..407509573e89f0485978d34fd508165496cee4d9 GIT binary patch literal 177529 zcmeFa3$$fdS?9YR`*qGfk6n)>CrJ_3-YMl2q)6ewR7gs!RZS&9q6Ry+&GphF6-a4P z6+&Lb*dv1!5->{CpiyZ}Yc-7zkz2dO+Mor(Q`{s_Oz4UFA z`}_aDxz^sN>eMSdq}!z6?78Ne&+k3I`OUeq8}58#o@H77%lWzciu>-%@6+FGUwNO? z`pNd?%I=bkhiqRbl6_|>GjpN0>>H$qSng6V2yuq5ZeK#l7%1Be!X)?TAGA z7B!t3NY8%%7XHhMpDdQk{kPuTz2Wt5y5p{_r*!|u*I$3f{u^%0I(i!L^xb#deAoUg z*W;XDzVS_W@1GXF^9?uLniWmeTle2{S5#fR;l>;9xc=@NZn^o!8>sK*HaL$8Z@Ts7 zH}K}4?9VdQjIuYq`HeT++UAY!-2aB#zV7QUIry^c@7{mM&ENSw(aFj*`;Pr@U?g{3 zf7_d1e{lczWD9C(Y5$F1_w`@@vRACBv$@H9{S9}$;ifgOx;O5B{hPllW;49~&HL~8 zp6lOm(+xM@%6NaR_|+nB{wvF}-|ct1-L^%jbPuCjAftteKCPCvg5R`}(-%Lq60&MoiD>qCc*WW)Qi`ZMqP zZT~*2-~Nx}!`>VBzwu3Xd{2=LZ@%@;yKcDkuA4Onbg;I?tJr&Z^|z1 z8a3HB4sN*RmN&gYWqvxJzj1&2^fUQ}JNDoH=9}->f9Lg3>m4`T^`<+r@6R{gd@B#% zdBYp_3+Z>>{H9y4zm)9x>#v6*vCQw_JGh zi!XfR8@Imcwja+A=l?u^TYljK`H$ug=RcN{_Y?WM^M9IeeOvL}7ry!C3qO$mZ2pt^ zJ&)zTlK*P{OZkN#%zrKam-)-?eoy}X{4Pp=Jb&@KiVqbpekyxr;4909xi^ZxbVk| z-zffh@$L}Rdp&r~V(w;WWe}~@_tkl&4$hzSD7eD~ZyA@=@2ZD^dvIrS zYX8*~dc|w*SoC>xo@SVtX@)S&?6*yNHL$1(R^Uf7xK4_J23!tS_RgW9MeBAEe+GGfoCBcclKm^ z=J#ZyBSlqgD_8bp-?msPHJWrOpPIdQ(y6-FE>fgHs9IfvG<5(7%LGEk3hFz}R6J=< zmBGiPhmfMO1zsqy-XZWlQRJQbf^193wq$yy*`kGOxjhr=fCj0&o?J<%hDI4f`+bdJ z<-lr@jSEtnol@S&sZLd{77OEULH*TYu$OkaB7>|FN*LP0fvPat-5e=UQ7rT{P{=_g z09q9+vAqeI9_vh&e*O^UsXo;QuCIdO;@DXNYpQk)lq zP@cOsm6%=(#FheR>kD}%C_*PxR~uyz>HpKu=LJPbv?{W$6KPY7 zUY`0ZR*Mxn>p@nNxdAz)rgFO-6gp|8HiC5R~l!kRGi9(~$S0cn!|D4UMtr_nVj z_qzUGq_`(VS;0`=a<-D;LCAjZlm2ywO85@fjoafnFa zng0!PWpb0eK1(!0i@{lL{TPmxunEBnK)a^LEO@#LA;t)J4z?C!GJD!A1PEy`ppXFt zB)AHzw+0I6THe9qKp{62rT{3bo@Orw-t*Q&GOI-I;#)r+%@g@sxOD5)=|I+qBTLG5 zdK%*p7+7%r#xU=RU-}Y=SQ4a7OhZ@wVs&0sGrFYYEajtm+UrmLO1BW1XfaWlWu(xRuK7J z07|OrZ_hfg9P;i!EkU!;wLwEhc3GD5RP~jz)zK5sMV(<8s%=4>R-|3WUD2o;GRUD{ zKZx@5Mm=h_&fKI-O9MnxZ?sAB0V5)K5@|%=HFj0B$OOx6#b(H!%9JnbEe*}9F8-&Wi!Q58}o(U01N(bcPD9SjJ41rhErIrKHYm(~9b#X4xH za8-qZ6jmEjxX7e%ZIHq>X*@;!RCZwW%^*~B6*-y|>dqaa()ywNfRbGi4nVMuRHmkI z4W#mWxrv0QhjJM0EKvj?3>6EofxNVQNIK!mts7y~xk**7SakN2@Quo^<`$%=lx;c6 zXm@a)K$nIZ0}a7ntJaASz>r}!k7{v#3jZh8g+HLpP6>Zn$?BmnF{hN-7R)9Q(O1gU zf&JDDiUkMMWDODO*tiW-U(hjLW&Velk@+Q!^$;>T(Sa0S&_Kf#sjLKg^alW4Yj<0z z5MgsdktPy`AJq7Z(JN{jAs#yNXlT(QCdwthZ7Yv>pRe8*JF*)kwCZ4T_Nrn~q!s{HU;;1+sDRXk1dLU~^v2>|_M2k-ul}+zYCZjWYFOM|65BIV%>9E4BKdAu^M!RHB z<#lldcz6ECl|LjO3$!O^f^*aKcFE+V4Y>#^8M_@Bv1!$>ftI)JELX?{Dqu(>_T)xk zhl6aX&3P$H%B~1H^EFGw#ScXCVX==*P}f@a##wTA2qie zsI&y2JgXj7;7ZA|kFjYosaIj5dE2R{V8&6DRj1ogg+ih$OAy*?w)LXKJ-7w{})Ja;r}lnjT>})0X%Uu zYgS~;WN9r=ut1VuT=Y2Qi6yV6)bEmb0!wj#y8=&i!xLMy+Pb7z@p^_oD+fk+s#!;h zAxg+%ykR{C5G$zI7%#nfpx5xg`PZoCmTOqM&Ouov$b_Zp{}jY^IT>Mh;(=20U}Jo~ z#St~*2Bt@qrmzd=E0f=HjR6FydJxMDLMabH zf>~9@eQ?Gix`!C+Rm&~Ds^0c23tW*(hV!ye)f1|gXN|VWuvPNh(YER=$?j!QDzdxZczQ~&mE#dl504OazdBD;-Vd7Z zi&M@O_4g&ur3pxBXrzz=vG&z;Wvb4iXj{2E;MM>?fVr#51iSy2P}@PCun2-1caLAN zCm(NF=!e;U{+|5X3_hXApcQ_VN{Gs<4MvZ6c7w*$ppBu)U^cE2`9vR*C;idL=-G>i zrY)#VC8wkq<3=c`I?RHg()5BhRxJFw_#moB?ivih(boaVYEId5n6NZZ?$;U80oTF>>lH?66Bd| zsaehnoA6KKxk&7X%dwRVTNyd@+nu3bXgnT+etGMb!Rg%IY5@-~PHoHTgpvk9B5V7) z4ZZUrA&uo|CQpv_66$TLGS^es%&WJ6tgxD^B+*-4x6!HF)X-x&QkLHj=3}(+w({|W znHg1Ysm0EnC8_&v{5^1?yf>H_k`b^r`=fbP$d)57um6*MT>Y?iq*nX&gJP+2^t+9A zMfqR3STfdJIB>7yC1laFt^R*xL8U!aA zR@Fs3peR=X!0Zx80}_ISOh3_wTLxswI&zU@}n16zur$1BJzUPZAX?~pT($oHHwMEL4Pz3C zE7G;OfqW$$ghu_OaW4~Rb9m^f(-#{;<1I{_ z8LO+LeY({aIne`RVzAaQi9xr9Nf;L`3%{F9JKB!*_&G8h8fU;cPVE-6mz1BQrPXGXF-4>QU%^Lr~wH}81y~anC&960`;;}WIY#xY|k^|u69*b%d z5-+WUdv$i@_-w8JSrp$Pji_bukRmt=skp|j_01ZO= z$jO0r_t+%*2+DglsHe(N_eZo;A|{~&G0TZ}2q#`_Av2k7lKMiX5sI{4>$1?oxohb! zrP*y=7RlfYH{LF!C$qT}rUVFDl8nAd9KJhDGB67}p=a?@0$AhKf+31Lm|uM3rOU5HJor94#1b*)PAI1+z=d(|wjW8Ac- ziAeMW5TI6xgER%e9q(C52v816;&lSd?CVl&H61)fSCbaF$qQ-MR*^ikz+K~cmA-B4 zh2$;rOyLD}sn3NHfYh;kwEQzR#hk8ki>e40*%an48v`zBugp2TLQu{i;W(z<$6iD4mNFwb#>lQ$Ab077TXJ} z#a-h;OnFW}w~W0cKZcBxMQMC}d`fN_*sG@a60*Fd(y??$oWtNU3mak2BPMX)Ha0FB zM0Fq-=>dobiXa-Wc7$8;abs*Z5kxsKHK)t|2F{3Ey!9T`++M=Qx_5bj-FKP7qJB6l z>VMrFAmh?YXdrjdQ$8IDYw zX6=IG(n+V)lh;jMFQ1npT4(8XR}3G^pz4HzyiJv^SoCs^S`A=A0SPb?+8qZO5m*-; zH^8)$VIVKN$J2mgm*cLHt$Fx?)EmvjP?d6@@eZgQ3 z#ZFXKO1N(DQCKkwj0uM783#tcSpZG)5Ofl*je10{Kr7Nvn9(fuoR*==l3H|w#+2Jx zTSDr&5v$j+a<=!xdlZe5R0Jvor%JMkrB)MiVc3?KB_mt#=EHeyq=_YEIRROj#ngfI zG^C!)XX&DNKp07}$OQIF1QCu^J!p|?%cDVE3}y{Y%eb)xF~vi0)eJ5Gu<$_Z%c1$F zXh3KMFghcve8WH3WNqK8#f?ES`)mRa+^;gdz-^bi14+#WYF3nq`AlxF3m&}AKB&~O z$!F@|G^NKjlW7#Zx5 zA%L7r+W2F=yen-yitSP{{sa%m0B0;-V~0U25|`|%dqw9yEX3~UwepP&x|McDcyXY< zNa1ssjpXVG28&qu9&#tTm@#wsO3j|6{^a=j7C}|_U_Jk8jUE)vkFIeK4hD96;DKBn zmGS%N*d6-y!8-ruRJS<3ZvCFmW|w=|-MToyhyw^YRv%1{2f6~@N)FiI_;3z$Xc7XY zT0P1~BpG{Xp#baeBI#&lV>5QP;9TK}0M0HOZT7T1B~-H_ist#_ah zYEG{`HOGW1z;t2sZ>;91V~Y_w3^Ow~{RdYj+Hc;tdCZdu9uYKzs=zDq+c0sJh44?+ zo}yvB{UB)L8}<>Vb-MEA|gCV>SNa4a}G0nSbfPHk1w>~Y{kUatqv z6W2cmoT?wd>>RASl1&QZ>NX%r-BumRCe|eeC-1TNRIvdkbuF7zw*}|4?i8H7HaIPk zbnFgTG-pHV?D8C8wI`hn<2=!!dk|S2&cjY{Sm$?=bS9^5b^c-gR-7&Kw;Zf@+;Lep zU(b#6;=X!bFW5Ld52W+@l5LX5N$}vu#hXI`r^=_;jgaImL>$m~wA5 zh-Azm_q?gcDPyUHsyt9{mnK744Qm7$fs`%AwGR}>c=E)As28Y4OfhB@Wiqq zJC#bjHY_FJSw<;lF2sFfE7?v#ecIR9lOo+RK?{%2JPKmNQkigUc=Pm3Wr3yC)572) zx5lEP$I=;j2b76ME_e&^PXu7Gn))^K8u~WU6!U0ZC78?Td995%Td9(sNfY2Q2*o-B zakC)8vclNM$g1Y!tc_Hc<1ua7Zq?FU(seZqtu0YO?#=qB_N_4(86w7%s$pxXz434l zo8ck0=O7l9p0I(HO*9H@%t4}T578(X#A>`CgIV%piezP8dZ%MaF) z!GakZF4q`7vatoUs(YaR3r&s#f=DD6NoICC;zTrhCsh^`n^sR|wqJ{A0LE^b02mIv zLnrQ0FeFdlR~qu+A3l1?27*(m1u80jJr~c_FS?|7FgL)9w^R#z4jrn# zLv*3t&LwU#_|O01Q@{PwKmD5@|FQe__(}u0)cxX*{_Ge2kN^1Szy7|z&YBmjrD6e-*)PKHrFxz$Xvo#Qlf`P`+7H}Ia1M{V?X3h7$is#rM4O0o)bKdy03^?JFO+UrJ|T&-QmP?oAKezvnmK^SwX&L%-NLG^D{r zCVcd<5B-9rF-e&FPKkWvn4%xZvop-`2K5H^yT$`g#~tqbso&? z%?C#x0iPrSjxq_{dJT^X=i?3!bl|;TA@B; z=r`iVhI)yG)QESvYJtMB;@$Rk>x8g?RI^<8VD+$0{bK~=8be>EAavIu*fUAE)Gd}- z{m73&TCsF;k!0()BW?v`*!mWbGu2xG+1UE_Ru!X1A?={`5$N>j#s~Nigg_-?m`Z%sXjJebl>8;RnV-GrE*aVFzJpI0dp0x%g<=M4AVK{Qku;t zs<~+bO11FAo|SbTJFm)-ry#u}YC^uM_8I9b)@YtZ$CO-2B0XFjNL6`)-9n)d10PnV zVM#Y-UrKNCx++R@qMI-nw#Xin+3z_y%`6tIpI%4Vqm(Ta>rp5ow0`ghL6iRQ{Ar%w zOLFu|W{9_ApPV09{rQ1CsekqkQgRQs*W6PT2tr@jP~JqE>rM7mMANHnx~V^`wtq)| z=0+d-^rS< zK=bg2;Y#leA`2M%B)hWaA`7#uNWnOhd1vv=UWbYdcjhC8Ktpa4UlXnxm2uRJ8}J^X z>v`Le8hUF7=gi!c_gv-%-vS8$0D#;?xS|_5uBm?o$SyX#3pvlvfciwtj6A3>h*{KE zfYD2e<7tl#bXY|;r`5#7_ZxMEDqR`?!{g$K zS5Tm=YbF#56vQaf>&mZY0z}EqPHuWljbgCN)1ROeZct&lmw7A5LbAY+5brtYiVPj+ z8S=Yi5XsO)n0{ze(Tn@l6lNQisR&7K)+EVtNwQff3FXj_ZQ78dxOT+|@MJv0wA#LF zpW#d4qkV>Bn;kjJVWfkCqnr0h3SWvmW@j(8iHuq+kR?agNMwBWH^~@Ck~H_3Pz4Y_ zhRq$f5l}?lW!kb;b}1wR$wXjKXDoO1QJ~<}TCuz4eiJUaDgjwpKm1Rj&Mhn<#)Je! zzG6-V`I=T`M6t`F(6PrdEEkU&Y`~!4OKdj+Yhc#Rqbza~9{k+pXQTCVX zwP(hrZdvbYWC1;FD+oW|5*x(AB-&J4cNfVP8lDs+6$v7_7EujS@j^Nju%G-?^nP;;^xOJF6dk?wpSAe^;Z-~uP~ zH^JVFr7pO}?mQ|OvBG(DqAf=ct{Sopv7swP7N>s(y3NiW_l_0zjINGGcb07BSjN8EzY%6*jDMA$X&>CB$ONZKh4b4JK`#?TB(? zVIbPnrD<|g#6RtO?8B&7)aGu%&^W#Dy%OkKIO=LKkIv^BFg7IOHZ9^_bztaw6>W*K z4np+UW)K$K#0j|iLFk$v`~$BK7J?e*S$s%RjJ{qd(He%I7`qrAoV0_2YP=VTg>|E* zohh!Mm8buGFSbjP2*1C_!)lgY!h;Ph(a4m8*#We8-N(yEv`@+}9i;6txj-QP z>2_IF?0Gvj=Tk7k!$40WQdbwH)3r9ok#e$^f@pUkHb&njFuzJSD)Or!(Un^elg-UF zL4&k$*ruaMNz6$G2ig+L$(?S8hSX8qjb!sEDH8*deE7A^AyS*1@NKx32jQFNUd0P+ zX^i>MMex+Na)-?4Le%(fCM5rlCuW|q%B`OQka7YQv67jTA7G&O-TD4K`Mo5vZ<&;w zUPe;?dcnb*V^Q*lvncu4EJ`AB)qrPEc9{k2;1gVi1|Ig2fp-h|5b!!J7NmR3H-IQ^ z0$M;8v8Ffpz=H&Ztoi`>z8Ua_(H$8`iN;Wm45W>rnh+peL`H{X*Ng&$5GqU?1HI&@VlJP5AS&2xQ>pk(3oxMDla60OI>nsYMj%Xr*X% zOR-y7pYvT8Wqkz37uP*jH2hQ6kCO*!)$g0hV`k84Ss$LsV{Y7=Th{L`@Z2YcqJ+Ax zA0iJgU^dw-4y258A0QW6%_e6>E=$HLk`y__OHq^^U* zGJeNr@%qDYTEog07cDtZt)|D>K`t2K=bF*EVu?Fgh-`i|!m%FUK2%CRNbehXXH%I` zL(bfwQUGTpk}Qw2okeG)&)Hdg9#H|ZaB0brg9%FOhYGnW)ae*lDV%&G9g*1QDAL$G zfJgCF?4#*KM!&y!$PEX~w_Y;03jfb~- z-<*;|Q_I9GWL0XNKDr_(L1lL6~f?i`2f!CdEaPmWY)#?{lo- z`Y6(=8CxW}XX9$c9$7pC<0cyMa&mMAX6Ed!#BQA3#q$)a-Hgyi`s0kJoeU?epbl0! zh{-&sb4s)EJY>qtj+q(3E-Cpmi1u)%$AERr;Y^2o>0U$;6o_{?V}a2FW<58|hp{cl z7;CN=a}BnMG>ry4rM5Q5{!;baby)~4Q8y!|Ej7iKit>V01Gpmo+p2sFDzH$+q&Q zBq4Z~Gyx*1C|5ebe-73s?viBk^?ZUPdvoghDUxTu(#emL)QxQ9BDf~~Bv|VAk{{8n z^%0W9i1IeI^f(!j)IjdpS$AmG_`$Ru3jRZ~a1yCFTO=}wZ z0~jqHdp7z`A?kH-^F}Kr99DtSyT^Qa0AJ{L039M$ey15POEM?*EA+ zHnM;pZDgZg&V6%?7md%hx8=CKXMF8p**O0wKiVIQT;`Jmw&!4RtrTbdew3M1Gc%d0 zEX_j7DyFR&NJ&KljQ&t@g3&*4^3e-Vr#*UDHDTjnpvlTwYE#&FFku5$svmfmIp7YM z!3N5=8Ee7@jMe4@HXxuTN7y*&d_>sCW1|o@7|v}YK=mc03{zt=8)he`e9H>Mufu0iZT6yghpVHC5{sbkA9BC=tdr%Eo1T1UH)MRQmFe@d$61-2f)#XSWkymDQZqE8BeJ$K`JJ&cD|1d(W**L=aGz%FF}dDcY$5GCZQj^2HNz@xqDIGskw8@y!~j?N2f zFut-HOItg)zKNZ|73>>wZ;ITA{GRJWa4dUm<920O5rVIUH@@765x4as(@VPF{Okv| z0H;R)XKrT4*cOZ9UBRdeql;Cs3NWk53$#&1;1882)y`a=W3+;EI~5tM;~NVsOfM`; zgR%h-jv0W$=mUR!W+pd|R}IWGz&L*1Pw`&mqLHYqRP$MTN^&3TEqper7MHAH@nXk$G%chflA^~->V9nzg#0F%A!{R1q8DGm}wzOvN9#`BdtH=l4bJhJXJPq-Hf9x zbdMabnPe|+cFThJk|PAP$@?+xC3y2-nk0}qs0!Bc{8JLgdvXPO)@Y<5JqT{~eALvFygP4IBQ`IySKw{mx4i{+c9Bcrb(*Qd$^5$nJ_|Pd(ehbucPz#+TaqtRd-YK?2Gv)63Q?(j zI#(+x$_=J^mzK?$Hz05ZwQEDDBrTgWxpHO}t(Q}mRd6=5Y-VU_*-V_g%j0ugR)29d z(n%@^&n;)MxgtQT5iO;e^Re?Y5MHLGwB*FhsJxU;{j^JIk1Lka3~)1YJdtvHT}lsm z7pRS4HxztT11HmZ%&w*2=?c0hD48Bi9zHptBZ6R?nPkwI=~!t79Bb;Yc0x9pTW{o6 zTmX3j0N@FfpCm`Kj*-+TLTb$MBPvC`%VUry=H$W3O6aa9&2M;tw*++|@D{ask3R)ZxG0dU}u8tzc0p_aBf_Z67EKfp_4ijp2l|fNxASVBwxX&T8qAxUm=}|eTw7- zQ@?^QpKbgK$*PoJVS@+`Co0L)@GIaTvtNN@hHLx^8_&eApkojpOrC|onR*rgkt}Ch zv>N#Fo`q&(#LMjUyb9+vYbvd=R+|?|84mbcyocjaT76Xw!SGk7srX zs(Gwkf@*1N;%Nx!E9O;Duwl3h3Q1~Jj?sHkyP^5#sv3gJu8zWgRr@&@?{TECf` zXj)%2M82+9!I3zEMyvtP$g9ArwQ&bDUIntg`n?LDI4!TjU+0|Y!dN3PCPm>$T_L{w z6*}#da>pVjfBMiEdtu+@s4#h=QHhGrkr9ugV#y?rA;uV(#zD}jKaT{|hAhF?qmOC> z$APBPbI_3rt>=|ax+OqLHH-u_rIrez#26NcCJaD#R>}>>gGhnQIH{}%9&On%`t*Uj zhrbu5*-0BjbARS-q~FaSyHnoDXIsC>d1JDlblyNU;$`D@y-cf@ybTV?>kt2)9PleF z)>*bM@ahxJ;5-9qHWYr@XUK3G$SQEfFhrW-QD4FCe?vQ4K}U||;TB0+`up4W9bQ*jF>z@fSex>9nw7-n0Xt0u{vi_`Kl7mZSUg(-yD1l@9vEiklG_Ql$ z6(^Xz*o`oX4AlWuy?XvzF{U{vJpHgGs&?R;?1;3E&ak5BQ@1VA_(3F_v@wSedK}2; zSA*}sE6T`HVTRzfZXd=VR0}hWMT^_<=VP?hBgcR!gj;GfDX;Odk#xU))IiH~zw2e0 zocmneP&eigNfSi5r`YMRjgP}`aoHM0t_66$K|1c5DeD(O2G==rK#GubR!S473*H#L zRZ9r$^jrZ|r$oXl%OCGl?UF7nM06YV8ha^g6=Z zA>se^GeWdDS-Eh0{(Oj1qkxl zID4KD1h5vWQ@(l*gzz255&{tZ64AohmI_4a7{725^!TgAa3QjJ_~m@~&JD$=JrcVp z9+&TYVX_Q=!H~C>uw5II`WZM4maUcKhGmT{Na09 zL>S7~h|f!EZrsP4QI;Bp)R3=!r!wlpx<-P`i&>EVV1Jm&hTm%o{D(c`_o1)M~A`()uDTMi2n)s&M; z8lc!1l#Y^fR@8oZe8l7<61t3uE1YPnS~$oxQTN_H=^fMsNL=)Q%YCj|Ixv}|Rhq-~ z_$^3Pp6_M( zKgOHCz3A2vP}KsSE8b13tL8d&1VclBp>=UXqf3dg&{0%iFsJzPxp-5RKCM7sY4XHQ zDAos%hy*~rAb`TI=A`qP(E{M5ac-G!C%;fBim zQ_Rsf>Xt(voEg}^=!Qop185C8hRhE@{Cf_)^?UDs;Gx4u z4&C>*$);<#H$k6^rT}AN9-??@5c2dX=Hcy=&N{V>%6_%!pF9fZQz^<_#IU@6QS`uU zKQ1OWB%?SeCOCK}H7pI(OEYc}D*VggN7w@7oqP9$J*SKUgM*ak9Rt%gRK__-?X%1? zALJCCo8W3Vo%3cLk&ns-$o?hYI=T&-&SFry;ug->?tUvXnSA*(o{jd$7 zpH8(|KP3XuB7_sEj6_2ul4v@_l&9`JqSTi9^f20IW+V4u^X&OV%SZ&zzdWw-N?GDT z(_Ob3>g*2|lZ>;h%Bzjl@*ivxJT(RuaxLu7Y+g}cUw~6M=uF5U9EE(~Cv*yq>{p-9oDek9 z0&$RKu9}A(b9uhWZtma=W_I`!mSP&tN(^U<>^i!SMV1YCsdT#*v`)c$d~m!Br-{8` z(*sjt2Kxn{3o@gLpBC2ViQuGlxu~~(jpMk8a^+0N>v9pY2-eg^y08Z~GeC}_yap2 z$@&(xL;wpaVpBa6=zz6}nID^95_sLNvxU ze%vG;k0U)XDSrf;jwAOm!k?V2K>Trujj#K>bBug%-8IwDRNw#xn4W9*)AR+TF!{+beirj82tmi^|>EkQlK~;-Mzp9aXim2@$1KbkxW(U z33iKM)@iTx?(($p8b!S|P1V1B=t$h=E!PLx+<(|^M#47w6d`APU#Al`eE5q<1W+ot zv<-Y%4d|;hr))q{EW2{dhvrgs&A+{^l=OAF6WdtU`I#6@vQnB++{JkCoZJ>eP;`ne zEv4>l+GAuFFOA}J5jklQNjTeW8bAI7CdB2KM$SfbAz5m|!x$*aR}BF+Z&w1`bo-_E zeDawyJ;u@NL_0bMt1ZCzlgmvn3ikyP5WABZ%>kX+FC`%1;8 z{W7W8w3lBaHtn%;v?V=iHtp@yK#39;@Q+3PN-mH7u|8aZT_l{zs4>^HgdUHCrvyp& z;iUjbFc3eU|1}(qD4MX6XrC z4@w1HT*}WrY&?EmM?Up8Ai6P3Ahdns&3p1OpY1!2e=YqJb>d%YdeVqrHA9`yR5^nt zKpT&NCXhI{7dTc6alg2@(Zd?SnmIU01Ch{YNTPYiK4`Q65@ym78hIx5dLt>Y?5_ba znNbt_Q-*P217;J{A(g{dCnHrIs5V9ld0~g8RgMmeiXmK-Ii*trG_N@)E=JdT$>HFj zW93NzOWU>3m7&dBK7JX>XnH$q=2x>zD6DoA6TziFRr#bU9agBm4 zTCxZ~VA>Owx0IH+Yfewa83(yp{QX5vT_7&--=q%hk##NmYdtkv6O_v+CqqPJU=NQ^ zfq`9m26D8?H}dF`OJMAm_jqE7O@_dsdI)p8egAu>=*FRCX-GwF0gC~!;3vZ%>M}e& zQuiUGu;$XpmQX)HYcAbG8C+qJkQlV_#=BHj{YfrfL531;1_79e40hgp zTKBSu(>n)7FO1jnt~Ia!O0Tut^UX@CE#PwriCq!tno3Kepa#V#82gTgm=c8rQ+ng( zwfXPknT4t#dn6HqfJ9)v<^&X+usslQsxl%P$u9s!%$pQ}Zlak8uG|KYh}B_g*X}HL zsLZQWX0_ODe(T0%7c=E_ZjP%LfdvN>j=T%VoD(=Al+~1?@H=QP=mijVgID7ji>(WH zHt!`zY>Y4y4Wiu56%lx1)jWMdQ@X@){?Uo<;3QB+d8~)iLEpI1os+;Ot!^SM?!UB4 zGB%)C*?>ybGq$L_u%Qn$fQNm_^8454)Y^sO8$I$i8*_QRe4zeAW|s^`6VQ{h&zgFA zDOTC@6P%KKRyGq&fJwI^c+@(xAeQkiR?cV=l1IAw2n#2#g1D>9}ehFwcyDWx@7BN57 zFUtG6`f&5q{(~do!;u znU#*gH{~U2m=!8fd(fn`gu)O4wpI*6LugPh3QS{UU_crTO*5hxqoc`4VZYZ=mapH+ z=+$jsGT;SMY_?T-5x|$^j#y(Nm(Zji!dOu7EHyUCUF=#zAw4rzrJ5^brpzv)@GI`` z@R*LhG3NdsI+8B!c!bpGl``)4MW<+lJ*hhkyp%lc>ta5rhD%-9fp7}J{^gs+1GSe`CnuDSbm8Mheb13&-M%be}8^OtvxWAmsPq=&Z;k~iTj_tfZWN&(Xs+4wvvCC{I5~|_Q;2pCoitzf!8_)a6x)~NJ5l1+<{bcY6hr| zzm_DtJb6iVUejZBzEjr`Jc<3cg97i5vM;JCRnh54Ai@HZ*^=>&kicd-g4kLVa+h7k)zZJA0wEqX-glOWq3}*h3OZ znhxKo=5b+sR)Uv5gROjxtvWbii-rpb&ziz-v4tP091s|O*|EnF0)Fjr1RgPz{I#aD zMrT)4U3(m%dCzeK-lgLRi`AlzBa}LhpeQ1dgHmxEVLO1KY&womu5%n=y8t4E;4oBD z!hk@3mR7YIj8z8#02#BiNzLFuE|J5I*yQ(I=@E&WvxEb7wpR2xIlCY$99?qphSN{o z=o{Saii2oTM`U`{kWC{p+Z6}vlOP14Oa)LauvN}bUm_r+#=u{-_=2W(+hkdqUmP(t5Rb; z9sYWb_9m9fvdB9KUof%}a@~Fn1K`Vs1x`KPLRehMr*rguK6yKS?$8mbmdnXNF^W>= zNIntC0mXF);Vy!x7KqJYcAfOS>ybW8!?fy*9gca2@5m=)Hx?$9*RR?i!OClw=4#o;GQ_g8 zE#Dt-`(6A|C|tJ;Wt?7HI<;`N8YCcE;W&(kbal4e*d0h#f?#`gsr-sT8-nF2C@PT> zgk_9x&t5T}mv07I?FJ?irgt@-zU^Azoeaa!snCo3+8{)&huuU`yX3nRx&aZ&MIMJm zIMQ@|!m+0jNsIUsH!2BgscT46@f62xzQKfu|9={aV+;&?7aS}xXZ9nRKh69~@P6H*#LWIi) zggj8BrUrUW40MxVuvU&^{SI|DrTwBVsv9zCzo^S2q~B13rSR^9lE;S8H%R7g&vuFI zAXVv(i}P1X6r7UF){)y1vcqac26+(JM!fkU{&uuFAiRxI0lth|J#WvpX&gG&s$p7hC|{z?o=AV0 zI8iN(Of;WW_fdJ*Lg>m-Qpp^%q2McHl5Jep=V_t(l5mmXQQ^VfK&_*BxH#K(c}`?_ znivI=YgI-<06>=&yxgFeCv|B8O1gy(l$6%~jwOJ7Bmf8pP+Tcz{zBQ?esU;@J;k1i z{REz#uHK0&BkW7?{d_(i12i%$F55;ldU3vTIZ(>$p=NYmGb8!D0F-cuc_&+9pJG z&6uiH7i>giaaIlVx#_r)0f`W$9&@@|E z2ea$y%4XM9P`L%3RMzNQkVDY-_Usywmrq`a3$;#`Lu=El6{cdZoopazq%PSiWgr`5 zf)zQzv^?m-x$SJz(OjxtHx>;!xU#d^>*S=o^tIjarwfuH;-ce5yV%)1H8YROr@b zyp0_3$vT0N-8F$xk~Wx1-#V*ax~F5hI!p8!;B5j2a+V4D1_emiWK<_K8B#S1u+Rq65IzF^C#|F(~u^MXsE@!BIxwud{tOo3K~iNvP9lAKnPw{raUEk0&1V z7?Tw}Uc?I@y+>g%)Rz;%>p>+TxH;dXz~D`f?kRQC(Bo3jBWR1dz9>44THuR;$Ed}3 z@bV0;cKq%4_;P2zK58nw_));`{R6;uUZrh-#)W?b*M7f}Q(qHjOMz!@1ZbZ*PfBF| zbc=u!r;|?O@|UxJXZd(eJ+6am@15g1L7wjafg>JjQFHxUd+*!@)r;G9=1lr9d^}=REii1l581qAH8Q!1O*w9R14fz_Yhk_a*rR@@9HJR znQ8)G__4F)HacQNVp5dvvgN&NnnB&g!sM=sBs($3{N3v=g z4{S|LRQ#wWPbSFWcI#?fRcR8FcB^Ac+Un3`FHCR0rrMfP7tjdySbB1g+;|t0;np}% zrvt7RS+wxLk?yj3p-e&y&_Yztm3G|Kq>W3)qm9>xz02)Zn~UO#(TgYtLix-7Pt%!D zP7d}-n*&jh!>&)0BM=+{1V%OBeFl{4*ymB9zJ>?SBJT>5Tk1dGZr{>@>GlvJr(Hsu(>p5sH zheWtPaU|U+e3aI7aE0Y?nggfu69-0noWYx!1La5itFHxBaT@YPa!#ZRXaj{HFK#{y zEM~@{<_ukllu!%!O?C4b1@4jXWj{}l1j%%q=w7C;IoSAM+pS>&HrzxsnvO0$E4cWK zhZ0RB$+e~_bCerOXr&o8befCL0wLaiqx)j!5?T`mIcyR(Kkq)ck%CWAX8a(`n_w6qExOj7Q$g(Q2;Vn5!dJQf z-9*pFm^2dg%}5xUC{^QXMzYFhYK|L89wS*jek67XF%S&{WciBY_fp>7(j2=GC zAEV|=0R0EK{{O2R`k()5h5qm6LHoKo$?l_|{nE6LMQ?(+VtE6ST;4J2%d2w{NINj|)?k$Zj6rz`6=pHLg$8nC_Y5hfrVI!NNyV@RvBP zCX5nCG@pQDKD#|h-lUIU>^{gxFw{3|RK)k_68U;xj#A`jM;Jp=oIc(|mbbzMMmnRK z_Y%kRq#|xzj`4_Fj{{g5l0H67P5gr#RH9)%zg4E*Jyzx~zqtxU7XlvTNAJF6#RkSwm>(%;uXFVVywb z91J5APxQ`iqf9NP5(p`hhd0py9Kt#EJ0>C*3h1kT7*T>pq)fJii=jme0dj?xBEyd2 zmlY{J?#2drIP779j>DHl9uE3MmJ-ye&}B*0HgwryQ=QiT<(;TdP(yTbQwL^I_%Yim z3w+kcHkiiYaN(k{e3^D4R)!oFa9Y!-ZOy3(KeiD%jYt$V$%ka_(vqN%Sl7=CO9DAq z5*Qw9fQqdc9cqCFWZ+-w#e>WPfcQ(Yu`k4eTz$?&l@?bJY^g(0zGR-iEGvW`ugMGS zw^*IaYNclc95}*SGj^d27^Mv$6Z(U+VHy*%8!-h_DT|SsaU7Rx#5*FFPZN3P&2T;O z7bAQUDQ>>-hy}EJ<_Jl6!A#Wj?UaMh;c+b0{-vS72cxK0WGwewVx~nIq`@toae_5U`-Xb zl|Qf}&zvj(WGf#BsQQTTzOKOx7g^uZT;G3=IyirCqAI*~BR{}wUo^CPXL%d-81tBK zO^;c(I7;&&ecPTfccdJuT+(Txfs3`cCtw=sUs%Q7G|_SXj;^zxa0vmaXH5dc;Y+%Y zi-^KMnoou@RyvX73-jRwU6hNUoD7pKsMvWvB<+?by7t;&ke>?=(f~6B z;^l-!s00E&!Q_B*di->Vh7ex0t0iC#>WA+K{~L64BLjQ1`8abLMK+$t%^NUDJRQTP z?Mo2eSv+C=#we33f38|+hltXi@O|mF21Il(&<7BjI=v8A*|~!xmIH~=btIo8caiBs z*d4J1f5A}Oq`=KZAy|zX(_?=Blz|@rpl!S(K7KCe9oS|URqA8S1V6{~LNhF`=^=2V zZSxtPS|}%g9wn*(kGl!9It`EnRX?5U4l2gET6~5}yn%ImT@x@0JBSvDJBb#dKbbU$ z79FWUv~(?6sQ!#vqI6?zlJ#`#QgrIidiL%|GilnP$Rq9_Xsj0R{o?vRe0=|pH2p{D zw#;5LL-Zf)gmGp9B`;i9`Y;Mv5HjEvHv$}kn4@oHg&ZNOz{0V+E{lVmY zRrYZ<+3B$zCGloi&RbU;gsrdPK;(+dkD**7!P1hFMFuvA$xWD7hUl_tNvGJ#TQLIb zW!&~M|M?CdpnN zh#n?6o#=ZDAr`it8PxzSx3Skv#8*oh{#H|2C$;(qkYfvT>-1@ zGdS~28Wu;y+iRnzFX~2rKlnApxy|v9qi918D*5;ab<*(<)+qi=m^HuT{|Ldy&&o01 z1|#dRKZa3A?M=|3(i)S^X&8m|f{Z)l;N+|}7n$ls0RpwnL#wi*XNT})sm+y&w&QoQ zOdhx6!Mcrr?_uVXzyDM>ZVh{=jDx`79dG@dKx zk!5z=pyxwxmu>&CL}%U=A5vf}x|S(tnMTz9Jj5lKPjI>dz9WhO zo_-q>Er@#bn4VndD8O2SIqu{FgG190#Wg*-Fb7RTrV8$< zFjpOUbOp4}bw|gZT+lj6^R%aht%Z}HTu{hMu#6}e(I$K9{F##r7qllAoLg38$oC>~ zCQkFo1rD#;UDE)F@EL%D84`=|0oYX>mp>VCG;5;eShCKwI4yR^oKwI$vv2OSnDape zigKrgOm*Z*Cg{YS78mh=-KvG{4$Xk8<6o_}JAlp!uTS^29^5I<2(fHSf>!kdjVl5` zYf;RW`iBo4VT~}_rR$n{ZCtB{usZ2E0-2)K0Yo5KS549ppNQe_MGV!oV?g91PWri8 zBd2H_dd1hmWCHfFGK#`iBRPE+J#T%E&9g`;XuxFTId690)iKkS?Z@=FQoc*u!Vt1P zi+ybAL;iUS8c#EhF4i=@#iX<6tsJK1bQB}PAr+6>)AIsO`_CF^>BhA#nSsycO&8oE zZ__dLaW(rkF+0kGy(f&ls}$lVEi1=|hC(rvG$3y$ZHq6|KA*Ypj<_J^K|t4?J)zfC z#Zd8AJ`5GNsfC~W)dl(I(=@tFKuBZjRB$BLNlU;8M3ZN@6}j3XObrB-tnHvTY>ow8 zFJ>a;!NksGWs0=X^=v89hGY|IW1_XEII+D(p_xTst5aHbb;$6dmAzlIVPx1;IB8`u z_>5euxW5&HCZUPYT(y${<%k>zp`-6-$iYP2=h^akwiFwGN!bzsa%j|Y^Yg43;`Gc| z6CvBi9LhF8&Yn2tP&*B_o4h1Ixy+-#C9q^mdEaD=9i>Rut_2rKTNE;_Y;Ec570UF@ zNC*)2Pb4_nRRR*$ZZxk4!eb<&V;!@}U}-io7m!J|wG!|@vX$65bl_sZIraF=&w>X zSj3VsK^9{X#JlH-Mu3-~XIELBpD8bu>F z?*$S<$=oIc$k#v%?RmdXeE<}XfzXvU$_E=m5k6WBF%8x^Ya@K#w>H8@&OU$6lBJVJ zHWPNGBla}#@H7z1-yUTrW16EW-%n_khr{rmO2d0{c6d+D49{^kF+_PUJ;bNh4)Mvg zLu7KJ{Xm=*KI%Na3Bto>Sw#A%!W13Ymd7&!fE(5C*6z>Q^e04QEh45XMIk|JM6pm= zXTFl6Zu+8>uI{Gcasf^`i1?zT;Y$HSuXU{sb!BDGKf`B+FEtE7@hdQyQmUKQI|^&s0N*;J=65MJtfTav}-Rk2+!%JgDkXM z843X8`Uq4Aztr}cKsx*!78m$1!u3}0Ni0iYNelB48XIg|ue+Hs#wF)u2QQi49GuWaXtkyRkY!LJ8Kp|#pA*4+r=GZ`l zqNxGKy!t!QOXxOY2(%rKL+?Yc$j?pJ>FdG_4F{i9FGPukAOPqL!+0~RCICH8DNZL0 zCOVVRj=hHvd#&?fBQEmr*c(x@QgO(EDhbf@R9q`cFv6mr(`(nFWVXrK^_*qOZ{`wF z7E|(*9T%`(Ji;@)*t;b zsFwRJxmMjpxYgPsyBYDpI{)TWT^}zvw)%TMn_cda&(->N!61O4z1fYxfn7GFvXY>D z^kD!yej1U(5P1mP)ZAmd&fDd7~(p&WFm})8`nic=hB5B z%3Y{HRGB6q-N$~QHbh6x4cbX7_t=94)1&rMK8C6Avli$vc{1*Sa*0yLAV6;pwV zhzgEtC8)r!MFlMb=?s#0x#JYA+@6*a3L8m+S8ajI)YS_4Bog?mO(|GvW)GWlaEIr@j5=~#nZ%j=*3y2qZiMT zkw-9M(u)f+@-%%=pY-AhU#gxiJ)*qyA`P`fWLmYc->N&gV;cdWQ!5q#4S7S)v*evH z{wt=BMB&ySC#e-`Ix3LQ5eA z&&0_PYH{n{xc0?IBG;svKLP#dOo8X+#xm< zJ?rp3_nw@RA7!h=ApWbGTxbRnlH}xaLv>Fjq>dlx>9(vtE zIWu%^n%NJif&Q7yOm)9JGiyfWnY~K`)75drTwGw5Jssf8HW5&%Tvy?pr-TaY)&!NG zapz|O71doAD#4JOu$DBf2_aT|Ek@Q7cXcOgNlKDzK6HS!)aBmv*Gm6lEwLjfMVzc9 zHkXsNgu9%HZU}2hwcYGV>f2gcTVJtIba}Au%37i?R&v}M?2$#c)$l+a^kr+wMF>8V z5h5_Luip+lSxYJ+Yw6fllFjVbVJ(?ECmfN^Cg+JeHxUy1ue@zYigT(utjtRk0Q0Oi zkpwg(lCIhyUA3vzRdr6xq4y9rF))D|WpO&>(qP;a_X}nPM#h&8PM_jto0z4zGw%LZ z)V)}FOJfq9aTEWtX@Y(2FuD{PeoDIcw+bw5f5RX+6S`O3b?H7>$$))sa;_PbnmALy z&epAu2dwu$TfJV!_VKZnALi#NAs5ymJkuJjVGGXYgylDz15MNNOpfHvSD#fktj=+O zB%DVgao#!NJXtibB=*OY^A>{hw5(h#rdEiTh!SGW5|LPsFJ_4dqsv3!C8C-=!zE%= zIatp%OT@W#7I#0VB_ezBcnGv+;TvIEp2iYUn+4BxiO3Zca)j$nb=?Dq5u0S5Y+!N+ zqsJkQIDBJG(3s}-zfMi_DbU0Gj&*tYRS$H#Wdu>VWn@Nn_&8a&XOOHv7F)71*D~T^_1hc$h7Z&$QVIF*R!4!YV^c6<$zQvN9M`M=4I(9uque z8RmSdG79;$_`<1`vDLIJ2REOz%JB%zk>*Pg1Z373yfgF-uGy8Nj~Tr9!IE6@bsQ-M zRO_0Vn=od|c!_>YQNhGY|7@KpkexsxwR*OIqVfThDdXrK5bOlGJ6Q{wO>C zHM?EdPO1Z8OyB*1k8K5EGz~IgdY8}JNBpe%@f`Sw->gxg54;2cTBIa%!;OoBxjNh& zYy%`2zOX=&HYaTl@i}8S=)`~yGs1Whp(_yxy&m6zhQuL`c$=ygI9WWVz9S`!&59Y9 zpNbh|XmAqeb%Oawq^9S@d@6q|^U2rRFrTy*-bZannZMLZ!(WKTFUC~p%$N#l_6$vh zsB(~x5JHiHXJ;M$`g8FY!MVv)U?n!?udq_w@fmxQkwII7vBG!JS_&f8T)V*HHh5`- zCz&7b0`u#Q?{q4|{&3jmgvg$X!!oF-+5MT9>|^6+s+!12gvf=dlF#!(?qEvTsHWx( z+2K-aRFlh2X-2B)lyR+% zbt78TfHuVWncWcY8MDJ*%Cp80ieCgrd2p$hmt~n1ASACJe-Ki}6U1>P?ZEwU^XRkX zeEKsvmgL*AY|nrG=;#KLB8*g}GrEi% z-9gD6&`#K%%EY8GI7S4937;tSh#eJ!okDfM6_}rF) zg$rF{%WsbO@ZkNORE?(A-L(-1eW-VN?hiJ)6kAz}8+R1EdQf|cE%)-7;PP=Hl;svE zL%J*KNz>C6hQqWAT{9+#=$!aC59wx|L>KX8$v}XIjp_gtw`4f3qVp9l_2GRU15i6$Duu zZs3{&iiQJFk24&=(}qbI98jJX2XL42EC&>Ehd)qM4_cQr96*u}SFh!OGB`jzornXp zo7`}Knb-{n6$!9RU6fBMQNBlD9xO!p;viTa@;?6Z4lj}yFmup(qWl8Nx7pLH`#S2< zt^fROM?#$GKH&!a*Z>uDor6f1?w?j^o$1hx76i~)QcmfzIX*)eE|d(3LBFO|(^<-c zR#Pw(3L{Z1P)<|}t%??ecdwxUcAVr92G*lJ%&RHwb>a}tmx}gutnYc+d+xN?4ca>* z+LNq3IqjWJ>A!ch_ZLa-u_y?+2dh}_l{0crk||W3xMc2(G=H{M>=6oruw#chWS)eQ zxSeKMMXi;2#i_Nv!${U>{bty*8d{k*)%Nb*+P*xMw)b-LIBk!pGaZ$+ZWc)zUgC!p zLbv{`^77GTp=AA?qV#1QRJhLsu2Zcyt!6o zY7`$+VsPuIS56@NY>3rs^M$}Kk$MeR)$sG(FSmLftfjO6{?%(K4^C3wHURq>Uur7L zyd2goEQAQmi%O%&Fbgb?)tJf zzkJ>Oy%Vy}Q~wzom$T$ZDDT0gZeC`Pe?$AfD=OFWDbYUBhwOtx3 z8P9vM)}N?AxVflsI$o?3x4hPiwYKHwy;$;foYIT+ z*Uy{TXX?dTYiK097dJg-HuU^S9VQcfFXFSDwX#307c*8i7eZ6~ubSd#U}Jw7`uclk zVtjDwz5O!nUmUZ%{EF^htn116BKIvYCbadw$4+~az0sa>JLbJ%bk-F< z%)jaigjqlw%IgWNO-Lz@EfbuI&QKzRf+_pSs(=F_J){XaStAX`!n!~p$Ob1DFWoNy-_FA*o zx@)c~b|=;8s}mKW5*ns6qPCN$IE&hjxR4Q)D5E&CS{X5e5l3_~h9txxii(kFn-Fak z!~XvF{k-paPgQl(jpSo5p_4lA$MZfP_xE!@_j5ma>^*$yy|b=s}iAlZp z(42Ztv!mW;vGgz*xm@ERFyZtDLYD|*VQbL3no?%$TJ-npD8YGMxjCYG< zrOTphZ;A)Ni~se`gR1!rQ>*NY6<>3+w|+_lH1DgY-+e(gb93h=`(Oy<0Vxs^I!FiK zIIF#uIz^a7m)T8W<9j}!#1OBSay{A_odqz?s@e0RT9U(Bzh9MQltjd+PlsA`eq;89()-y+kA{iq(4h5 z4#6lzWE+iJYIG+Fsc#Mb*Wr0=8X9n-9bcF1PQ7~_BJ8>5DQ6+G;Z$+n%I;$;&nLI6 zyz^a0j~zd;xsl#9+?6e7%XE+9BUjNcin#RJcdbE*#XR%;4 zTF%7$^iFT-YNIO)h5FBn|AQZ*j`(+od=ZVqvdBqA*E2 zVkL`nQ}|?kPj$j?bx#RK%4Q)RJG89kd1G##c{0N+9rKBmepLNJom z8^5~o#&VvwY~h@L!`?tzkmYda&u@}xH9W}A;NPGhfrAlWCQ3zwyt>eNrYI1Z!qQ_L zYarF6<0zqGevhT-4K)qPE0IdgCT&sk25Zm7+}Co$9%fJl$lQmw#PoomFkcr)$zc4(*YECPN2+Cz9{8|!z(lR@W6bd2yBv_~(0a6PV znp~rj9Rv&J@%m1(MLcM-MeaZ8Ml~o_R_~1t>U-!zL{i^t@?Fa!t;la>deHv$wtY?d zdSA8-Flo`(V&_)7aO|rw+U@wH|um_&&um_L<(>3KjNP*X@qwc)7NRlNo;P5j* zVe_LPKYma~Qq=szDx$}5RSUibUQ^dATqkT~YeEsPY@{W0-E6CzYuvp7JkgtxN|!(| zW)-2?@m(3>EI#WoTAqoC_QN`c-Ry99GGB-O#RNJo78W$}8{8$6rvQ>boUDXha_Wa~?IOfV}! z7&B0&g+nk?>%ee zhBvxFXqVNY8@Z+oucfoZQ-3`_$c^QY%F2rvlKlX3(sASnZ^ov>v;q5DUI;aFLe1PQ zHEQC$>{OR=W^7a#L3^&13ZaLKMi|kU2NX9=>*%nTpq4kvI6os@7g2$r97BbW55U(5 zMV%CGzFu+KIR`13vZ`h<=$J{+W0+y9xiDaIT;9;7-x2Cd080l4O-WTGos?0W^r9*GV@eeC|Co0Y%y` zGgj<5k`;ZWlU=q5pWz$?3Z33$bec&QFeac{{uhq9V2YudN$|4cB#{m%25 zc;4#Do#zpo=#(O7si5-gTQqdG)e$#JNwwsE6cVPndg%_~qc^ieV`H}z><;#?x5 zLUx2;x)>!?^Jf5+(n6d+&(j*igaU$Hwf6QJk0{90dGyHV-uCF-t*p)294MeCleo#m zVUZgwcn)97i7V5oY|DRTc988S2(m~gZqihsJD{O3#(d*6gT2IXift?p-n{ev@y_|2{G)yar4lLUyl8UI}C$ z#kCM!TO=lqZZsX@d^InRey@BE99*j+Z$i!3k(aJ`^6*M*3khkwR_IGkawsK|N!{_z zjCP^KRBF`@Wrn==WtRdZe(Xr@m@L#ZFzoe5t*mnsGgCUekM@+-??C0h)T68I#4%y~ zCft8LvN|H{Fgy_3{g9I^a7CbDX#>&mkJ!9~!0Ah-9Xd#xDLUX)iIj1E_`chU{HVlH z$PNv0anqozgvp|RZ40x8l3(2{iO;i#yw4AZ1MBzQcC^fOWD4zG3*kVXh)jMMxK64n z@>_9J>f8_0ZY*0?jM@ub;mD+USv?c$N>do#fq4rYOa>c+!^-LzEi+7YPFEdke%OZS z2gX&A}7X-oZNIziWpoSxoV=IURr{!xKCWW}0YYTrtQ>NahWX7*NG`gRx$NV!&I zOlPmm3x3-2f?x*d+)uu={(?SjhN6@HeppRFr9z#qI6_zC; z)tFZeheWQ{ILw5@SOevRJ}V~-*5!mjJLg80($&3>WvTgWHE}X2ZccK9!$x{NFwCUI z$r~0n20}5v8!br%dCR_TokEAMN@nb?etUFS&sdOGB`cBP5A5MWYLd#Hg5 zd#E91_E5_)j?9EbfgxJusp(gd>X51=>QgD7-tXmz0$YRCDaL*j%`!d@_l0)F zbW@^c76w*6`PBD+_IIB7=tIvW#w1;LNNPZOpR*nEw|@QZ+duj<&sOhYRnV~V>EHdn z&;G!pPyGB-@ww_gfFw2#Ek7%t`_OOP@{xN#{_~$zfhFER(D?HNDX7B+&$R~ezwq>V zuz0;VIsB$XD9^|?yX49$tf zP0ZX_W_&|+uyk(Ru9x02LIT0nv4(l64(erQUuHK-?%5~Qpqf=5Ez)^!gxcu1dTK9k z?QKqH^R+eAWBjra0EZw8^DnYh^;=6RGrP1E875I;6>~8ANh<75kSsH!9Gt;dnyA?o zObpa@Qo@XE`Bc{f+432QUsY{u*p)er4Py=2L=P!8C}zUq4Wwy>UjxLiyJ4T7bWIlC z^Z9y#8CML9nw2MDI9X{a)lKaj<%1=p(Bv#{wIvIkPMAqY>Sr-Bq;{LGYC$xsu8CuA zRo6uBcdKjknkM2@yUJ=Ds%lE3n~XaxMO<3vU@T^H>%?6csvj0{IKxo(Rf;Wz#G3=s z`0pg)m~;tR*cxlYS?f7G8^8q&uV5c*hU1q=i`+4eEUThOes1_F<)pkaCV#s;;n(Rb$=8rMmY+OaW}pER%bb zE53ZYhi9!5h$3unS#Iip(6d;N-ALJFMXOwZrqi;6+?zCqzMLhd7BIb3Q}pb!85c9u zYFmWx%4t5BhTJCfk>e&}s0Ec_u!_!%(4e#EmK^HjD`={N9syY$kOd_vj1nSZ5w|4( z!mTVRc-x$dTb6t2;9M62hR08*Mv7i^`MADhWSrbMQI zkVzkEnY%8<^b(V&nq`shc+HdiqGzhKbuw0XhqsB|(oK5NJ~Q+qL^l@=rw43VPIIf zQ!37w5Zu9~;ND7LalzP*BkS_R-GCpsL7phJYGcNb7_7pGwjBNvj(UsaQQxd*mE?(T zRuPbQM_~|hjSNAjCMoeclgSaUE#GRqHVGN82R+378DK15Kdk>kpoY}6b|DY}MfWZM z8s#1w$KQhEZyPQ2IdDRmK7`{1nM=j&tBZL*RnrZMIkQI8!fZ&w?YH9EzFk&|gq10h z8AzmSwg*aK5l04+b@2wTLI;(~pfTp897@G&?O}Fk-5)vN)!dy~d_{l>;f1!5U1n*1 z;^93l=be`Ej<#Ys@8C10JQGhkXnt&lW3t57O3f*hV?D8|+H_S8iBO{Z<$ABbDkzX)HqDJLl zA9fHJZ9+Vhy{a9B9o_EE0Pduo?o*GzL{&2_Q9I~Wk5%=wsxnxDN{{=o7Y5Agxr$$` z;`Y>n+YIrkAIIuGTA8od7aS)`L0TJT^lb;y$bbz7oqS4V%Y=7|8Ok?cnesaQRM|Y3 z{;Ee7yBB*XG5`@(&lBQkM1Eh~z6lwzb87l(hoV&M0bQ!kh=4qGQU(@6xYt#tCksv%#4S*O3)n{3a)TxOI`eHq?CG)z!XhPR2(FXKV(76j6&7ln8VmYpj z9Ykqdn@CV}ttcMBTndnX; zUj#|w8%>ZY5K_jx;&<&=@p8J4L9EiP5#)4gI8YM@u@FXPr& zsws5uBQ1AnXcf$Cgm5#rMU!Z=_G*_)#%h{T@vsc~#%D z1TIYay%;I0HA1z@S!s;w-t6nz`)n%7?CbcR`fS3kHRntn#sR3X>t36j_mloLVd}h8L9_{0* z;F$)dvuP#%@Us83^fs4NW?)S1gf}Z%Rr`3XcJzfri^&CdByH=+!*xgYdPmOCyc$ug#so2MH#jyT&;mlTZP}q0=;ARr8 zKt5Q^@ zi?(hJ9(Ut`a%h~)9y5iYRCwn`_gbDXooHRRE^|Y22z!*iD@rR17p-ch0~i!KEA_%d zHATOQHV2?-CXVSQ-$l+~0`qZQ6Cb~(TPTea@9DDrp>jU!tl_r;$>GC#u0LuN1n>_y z>CHoWqd$5B$V4#L>J3sW0v)TF6VO`+WsZP5;7ISe_;VyULykWmx70lMdQIv#UtKr) z#J{DiT)#R{9WSkVtPd=D#b9qHrzS-AjMa1Pbe=75>5Vi48wmcKkz1^>r^K@U39RZS zhc%75`79~qEYn)JX`P09hF&v!tub#IwvA~IncKywaoJ)*O1JR?vo@e|n&E^yz6ZeR z4}c3dK?3=aw^K0_HYZg`%DQL(YmQz30|)~EW<1~J0Sv3SqkQm@RG6pR-~rhH9ffy< z8@V`{?iDG3`-6M2{h@8QuqM1<{bG;3VPa;L^BHF)4NehuIGwEg)=%B>@DJVcGk@8fGuA)%0e}9jibmUZl-0iOL_1V zbxKXB;DCY$#6Mh<^Zh--x@isPP(epcPBpRiM$~uR=8wJvZOY7{CD~$`wAJ&5awR>j zF2R|GRM4)p?G@P)B~Qer`5AD_I6)j;TgiQ#_nv8-3hvL)&uC(FflPKIDx)pz*U)bg z1eBn4YJNl))=EmGw$fx8N&457Ijl-iO%H-tR8xYE3y=Ib*C&PP6JkwOF8VpD<(zC8 z++*28BiV8|_1(_O@-=PVbeZ1kmTlO*3x^F zJXB*$0MeXe!<~PmCYA_3!ia%8!*li^GU$n?fyTcE8oh(!O#tu4A-~ZeDsvWez>BHs z_aUw5gYC)Smv}ZI#JnlcF1PA<@}*uN`$?mRFUJ)!0j~kjbg%9*=#zqsh;o(Y#a)UP~9sFp9;Y9lu zYa|&<&gO(4EKb{(04R7M&178^%~Ngc;?c1#e!X>InK;R!?ur_x0{W(|sAE-E@XkkZ z&cmuJkc7Ij&yC+^SN3Z%MC0nmhT?QaQo}YgY!MqDOdbAJyd%P0@JByOJmrG64JG%X z>dnt2caK8oqq=Wa{ubzBg z2C9=`61gddn>775C!J&)dT%xCw~5Uxfx=;mc}8p17Ta->4=EjH5AvsVWSHR)qIKv8 zWA>df3}Az$|IZ*_ze~i0zdRi0E{G|po1%dZuMK_zxmgq53-{(D*6bIfJG~F(S!w|_ z0*VyvI0*IRK|mP6*OGOm_34b!P@Gs^mI>MtN%?YN+K*b~ydd~!&Ea}?nFl~i*c71c z7-+MV!8e%zV_v|<0id7TF6A6cL-RbK9Z|q+3s|gd5LA?{bdL?A)g(L!JNkWRN-T-t z<#d=}%C&)PFf>??#s4pMM8eHk42fc2>@oHFfI%E0s&CvpnDq`Pps4m@St(n2Zu`nJ zE~zhozv=fZrOPr5R1r%kKPlV~=!IV*;|l@*I# z#5zI+X;U&RhddqJV@p=LZgGvlNwlcUM;qbFJ2y5qHnjvH(>t--C$X7KMWH-=DrB-< z(*~O(LRzRZGeu=E+1y0BTBca<7ki$Y@PwiVHAsYTW1K*JhkqLV0rmv=Lb~q$F+B3| zWNqdv$VGwfIsJd+Xo2YSP_E7NvZVS?Sd4)CH9+GD0e}csWCMmXD^k4l8ZJMPTyuz@ zzvTyyhC`hn|I%hM*uZqp)+k6IE)6~-PSZxs{IsF8rqWEpn&gEp(Wv{f8--gotKj(XJ(Iz*UeZEhR|O_9T35*HJH+c&3v0C_=&I!* z(6eIJIzvyG7J#6&c9kO}i0Y>Wx~|Xzih8tj54H-y}3c{eW0g?V1$!RitpKkpdb;q`>h;ww*PTZ8^9O zglepkC+_NO9Wn_-bT?;f*y4qNV4J}d@+}&Bec2g&FwKk>_hrYm8gibyklN83F3%EZ ztM+}$Ahz0}fbUQZY?TKHnw@8XNPUn&(bVvQWAc&|C@wqaiK}8)y`#pZ{?+Laz))Z| z>(w-eX;$!mct`jH+82gDwUEI`n6RY|V_RSB&@)@^uvD`wcvPK&6JRkDunn}o`f0MNc-=R^F+AX9%RS*9+Xuvq=g{Im*6 z$n<}Last7KAmB}jxU?cJkQybNt19%7FQggCjHxOUcv4mJfT(70oNlsqk&C2swR)sAeVB7 zwTG2TWEmt4bE9V!4y|#RPa-2?41DMdo(Twkg{xZtu9mk7%^C017_z}SLdDY3CngPr zCeEnt>szNY9>U9lkok*F(7xEH3p`_F~)PFwiz9p$}i zl&Q_vSqk#q3;s!E6-4Vn(>ldo+zqh?Cf0^vO6sfUWNqUw7_>v?EpMYlhwFCOjLIR($@-Y#-wepu`@L9>= zIcB@qdio>x(gPVsHTpUs4#d=A3OtrUi?eJk(ORMX5GQ6KE}HZY6z{`(CbCiHk5IqdUlxSvtNw}#MMrDG%UV_y(ZG``03ZzyG0Ro}K|htwg>XD;toS-KR$CUZA>(<#W6pGv-Dv|w zGvR`b+ceypNIyWXpXxfn)r2|&9Nx?L-1j9_-#}wMOsh(vDnFQKUElNQVM-uL*6x7q z4yrm*3lss7u-(tV&UWT2v&+2;iiTxtIV6YaKp5ozopOcAoPia6Y`d=T&$6+!obpgw zqM+sR9;)P}#5(GlJ>&bbi*3z?C5`wI<@ZC(R;iT&cq$CNs4xMHB>ttB{48nYBCrv) z8*Jpx$D$M#I$WC7;}B;5x2Q=G)QY{+l`MU~8e4*q=Se;wkN>ew8#{63oIuExIDx~V z!-K{Niee&t=4QnSXa2^yCw^0N4<>H!ncNeR#?azrC$H)+M#@G;6ky~S21$5@lbZdA zqlA9|*kKO{u>rR0M@s^sAb!p^{NN|`=mO{-tf_bw?uUL5+gB#KfnOeM-gAWSX7iqb zJ~Fx&6jx5L?zMqT5m5PDwaS5-TcbGP6p`*cZ4NzSYbc1t7ww`-9JbM+J%DIeH@j%q)DfeN?syBMI|-Hf2ftE&WbzXdkeOKB5}hz zi2bk$LcuLEo>tcK&<<2Abi0yKiUOAD!62nxQIk6r<- zsDz3jSa33BCdLQ8+X&)*YJLd`!uL>YCkR7=2w@~~1+f=P8n@?J)+7xfjYwI;T@`j- zAzK2`>B4@5aY?Z7F{cX%hoDQN3o`@qm5&)+Kuwg&?BhYVG(l?c6~Ag7Po!Z`HJ**6 zVTxG<6XfIvB_5CFJZj84&Z9vqzB{1hv2#Sr=@>LdE^7PiiRAbl+?ZwORomD+(m^c=Uk^iNEJh3 zt)c|1E@e1j$R!V)F~fO}5^xPaUi?tv#)6;OdU`wCJmgu0BDxmSbF z#=n)cD}%Tq?S{?nmP*9z$Wm!i!&%z-x8z?g?9lr{v%_QeHQ3>CZk!#OK-pB5}H^XbyC z9Y2KuB&d)v5>%!Ea)~uHx)0->X^4NhUt46ztTmj7U&1i5JdjD6tMa3{s-jo6Gbijx z=P)<=WoJhb7p?cR6miNY7KOYc=(TQ*T}_`IsU#>@ME|JN#Cbp4UZ+_RR1 zZnb&}GM~G-+2Ye0&2E`@7?ZQygI@Op0rWUAy*84V=QeAd_F3zP*Rnk~x0UEl@njH9 zB^Ya2yPGz5yR5aJ7I$WN?;gy=jYP7*_E>xhrt**}kcjLRvDda?et`x=m3^qPU+gJf zG1yGWOTyOYS>7ns^*0`V<7g6)ucW>L~e)SQ~Afo3%i?6WVU0S%u$X z+;WTZVQxb*^udk#w9stO-xGINz5mYywea$lC0Xs%aPO;Pec~;zJN_W;Yozz}mAwldZV)HZO#H9C# zJ$Q@WiM-=^9Q^LK2o8JmLB^>qLLCoNf&`V}1BV1N8v1c;P?)K+m71u!Yfl$i0u6f%8RZ{VPhW&PxFEYYEa+nGnr6IRAfo~*nMUIni5d@ zg08?lobdsARxD=GQ-;c-J6b5ywU){3Tp&keO0G5qND7flLZq^S8m!Rz4l95WOA%3wrK&?MC)4DgwjdTQaq$-LgUeBe8p2&b9Sl|)WbZYCmV+e z81f%6B_!&X$C~W}ECxpUl_4e!lZOs71fEYuCIh^@%pm;^Ia--gk^l~D`F)Q8nIlYz z4&A1}=dgmZf?>x964e3S3AvVF zSNtiC^dq6{QlowiG-)J0BcNNSW@@0%)TB1!nww)cgaR;HKQNhd#*f8CGseX7M!>T2 z%t`5KY%>b-gLUbq9_fKgA!X2m%Vrc4$wXMOf`UAPsvLFDIv2( zJ5<_?jg(I!W(tTJ!$cS!(2AL>14RZjJBaekSYc4BCa$)rrcN!<3^0CMt0tq{slj&^ zd}`v%-`A>XAaTaKS=UU1VjyvbW@2-w zSv-_L09LsEzTwL3;=V=M#?SsrpG}<2XGK@jSK~cG zLOnnj)8n<}l7$z`40%hr*JF#baJzz!)d{dBjxy_k){mxKvY~&&I5-Q0VHZmtW(?p^ za|DIP5fHDf2<`YW$1u=$-f1uj?2Yij`^V_xFy24GpS|LP3 z*htGcAH(^Q0Y|m{qBvh9Z)2)QGj~OHgJh7yAs@`y_>oSr`@3q95xc~&cbN>iSYk-Y zS7_}p`Mvph>k#+MzU&5fi8XpQG2XMqv*{Vs(&*U)nvSa9a<)C2kn6{Kw&*=0bE|r$ zr`>l&Q-l7p-Gn^Mvi)qi6iGKf4A#up}Z>&5A4m8ykPQwHcE#hhVUAYgj6g-dfhxo?$9fN<$W- zz^Vh6%`6eq?P#p1uo)$7SFf@PxJ;WyNvDQ-M^HEOq$8-isu0xeI2@f&<67TTirG)5 z1q~CO+G=69#0Ao#A{dP-(t5`UCTdGy*ihn>1Bf_pX{>U)1D&p6q1_hUtK--nR*0#e zx$$xUJN^(XnDcJzsqraTz+>)M5Q%i$CbEVFLmJK;DTWwt+6bU-TE%GEvINyl*AK^< zuAYtv0CIN%Z~!P8PwSr8`Ck&{`>rpV^2KbNe<>9329XD32s#VB{bj9y<1m^U_GJZ( zjRoI+K@{-2(w7zR%L@2q1x#4Z%L>>muq_I>wUYvVte*X1^SIYl)1KO0$JLzeP)&J@ z?^2Eru6*)q0R$>cl5i%!xAR(d(=ipZy{6h>JGdz`6VR(Yp1Rk?XG-_@E>#)q_Y>1k zK6Y*YuFCrt->3OkPM*DMrW2mb$vKdvIt@q1I%mP_2*;!~Tc$Oiu}R4TOcp(ruT4Jg zW#0BJnkCv7GRlupaXnGJCzXk=Id>KwwV5j4W69JrRedjGUdHrhoT_e8aL%Wyo1>|! zH~+}^Ty@i$XMZVcUjomQK1Yweew*g56Ixfd8M2%F<{T)A`m;U+sx583I-wAH1fPi6 zt(wD>f*@OMH9KZfp{Wk%McK5mepIY-W@2^5CwQ_KiW#FTVALlnZ>Cn?3oJY{vG|sH zVj;tRY*qoLeO58}HaQSl?n8?+l6=W$H_UV9V;5|KQ=Ri>Gn+Yo<5&?e9V^Y*_a=!L zy+@4a5-_0t%vE4JH2!a`kO{4Eo-ZlYMIGN_Fnj)s{>RSxt`?3d8pKsr9 z4%dBDO%hRh3a~v?&`1?A&%6lt#QThKxKF#v& zwsAe|?c*=7AEoyV!8om~If}-Ln(s%;=lKeBvC1`Gp)t2`7$3*QgH&uGj~lR|zgV z@yrxVEx71GQ*ccT@Fi&kcFwO0t}N_0eA52n^K;2z*zj}d*8N;?&H$fctLf*`t^2u5r?zT8SF84O$zuqFQBy55 z(~8z*NrKg7&Ym;-xu_GH_;h|QTc|#>pNkOb+Rvp?nd*E2Gh6x{7nU8%l2<~Y>E~+8 zOXYqpnG86(fpZ%_*Z4!AZGNt?rvM#TXy}SBMaee&T-Go_4`=Xm)lI8d<>#uKt{;vy zT|EW))->GYP0PV1H>(UF^K)g<%=W#%2;epXS>Y=#k;(S1j1dd&_je4tZ%X%)adM9&Udk&7x6d zwVMg;RcUosl;%#~mPbN4feN+8yh?)DU|!FT2!u*wUfnjF)VggrspGlKKq9Z1S8`6+ zQ?#2osoC;fF)x=d-bsBH%uC#L&Ab}b*)Xr9FF3SAsamIFUN#eXp~^`u4jO-0anRV) z5%WR>TbS1xR_xH}oz!Apt53z6%sc*Ytm&#K6iAb=rk~rGH+SYuzeICnlL96QY?|=} znj^pG|Ce***y|TLM>ZCDd5#Rp%aPDDHDB^MGP#;xo+A?%_3{#=OtbCM{Y$+BNh}eH znCujUK+80m^(SkSeKKnOHU(VkPf(RsQf$gd#tVpRfm>H3P=_ zB$>WFu($(%pcT9xpT!auJZNDS3LNM3IDPnf5A5z;lD$qJ%?f?J@ZmZdW>z@vg;99S zEGXi^Q;iar>cMDQJ?l{ipp0;Gi}xTjQATczGxv7X5zU1>hFnE4kqCDx@j%e8_{k`E zQGF%?%~_%7$2gik!Syw5UqHxx-@|Fd7fW`#yapsaWJ7Nsw)sOjr3je5qJe+{25>*d z<4kbnu{Uk5*sx9Xr8aE$eM$_?DVU$2_Wzh#AIe!~CrFS5cNr{D%z0x$V4{_TSA1Z6 zupn3(^)HBDj3X8Va0~BPfTlebdqKdmZQ2XK#H@cYK;MIY?5+A1&Eo}Ul!ZFz$39YF z0orQSAiOJv{)J-J{Na)$+97Fi%)&*VZV_tKr=O$1i=sV>yXjE4Pw%XdSWx}yK-=RF zsmgYHj6L09I@9kxr)WCiMy(qHU?m)qEpGv^YdM2nnu%O|#k2F>^Myp=b(U1HK;8 z@CyI-1b`5gohy^>wr4E1YMKxa@f!~r$`6K%m>%yTtlyKNtG_*f#F9R&U_0R{wnyGTaV#{7m@FXIh-+w z$dL4gX#xL8fPxv3S`L}gm$%j#Z`A>{OKd;BE%9xmbp$T%3hX#(YFelsI-WOec2nI$0E*L0}mDfVh$;drH zpL?IwNfLM#2OhmHlnw0)Zk&zqM7^k1>SftRxr3^{%Bq=9W_azCL z$(Ii6gLtg?AzdE{8=ueDxmr4M=up|^01Fuf6U6g&hGb&cNv+7C*UO6oH-g2GS0)XpYiR}rnirCW80^J7~AL)c6GoX-k!OA zET5AFNhFwd@yM`5r-0GHaMv?lS7I+N=34*{cX2M2k&<$}aHX9Rrtu!4e6?HK6LGL* zn&Tsv!9{+!B!Yw15ivn0bfxRCIcerwVPc*AaW~WViEGWR2gU?+9Z8IZL+VOO=j%hl zitTJ#<9UWBjl@TT_`4K;i}<@Q{_c;z2kf`C8vg^m@@Uckfyc>lpaZ^2Y_j}!3^QT zyWxQZR$7Ei@%GbdJWLmgu85P+^dpDxj*FD(GCO*TRy^U0<|PruCs=rrDnlnf%>O7A zfjWcGYy^6PJ&JrS@N31d2~|Qu=>a&2C3U;!J4*KpJLV=B?7yjg6d9*<{!|Dm2M{U*m!EGz0>fMdOpi@6roesr}bn( zB}L7gjZi1nC{nt)p#+ni!8-3GvEe%~MQ=AB>!*fAF z1fGgSaW@PU<^ikXA*kM0TvBVwL0DTxKbpESL++*0^M#Bt;oSF#8&)-Q=c(sskx{I~ zEVNNci^`%}a*Ikz@1@I7@pm{S@?OhzCti@`n}vi&+RVVGM{8NpxZ^=%Ie|419~tu_?b*|4T-K6 z!cT(nm+S=>Op_krdhkOC`DF0pR3izFS@r|jSl3+mp1y0%ym}`dkkoCQ{dX@dL^6@d z#M#8+)Eccx*!IQoZC_Z=Dni)di<8!jkZ*TLVac#8GDw0JuE}4eO(y9_l;S$8 z_hTuayE%Y0nk^S%0MqxDcB_U_l}3(`4Ic@igAY1XGkQ2m5XNvSDDCh~#V+>ED4`2d z(fCtgDD3C|D%p!^%C5*?13Yr{ z%8+oTS(tV7bJ$X4H@B3UA8zm#za!vM3S~FnMk4_ zy3CGomRg?RpkW7`GUYKp?)|Io}IY&wGYv=jC+wWnk!?7^;}Tb+Y@ zhm&eF=Pe!Hv#OJ#Tj9-q5;HM2RC~}8s-fyqG*Vvl&@`7|mCddkxUC$lTy^a3)yonc z2chxE`WcW}V&82mWH8{r&F7O_j#BLMV|QbEk4k1$$)#BG$*;SG@49|>@}gUg>Z`BZ z@|DzDF<9BR;>4M6zRcA}tHRBgO?3c65L zKtZjo%y*Gq5dPC-KH1{z&Bk3==GWtEY2ite*g~Y8{5@3q?YMWsn?n*dexJMVl^aqa zJ4j7?px21I+VYd=YyLwBa-jHI%PF##aLzrlFd1rEgLurtjR&z#5$a0n+L2I9!guI! zc9ZQm#t+Ku)sz55=W;SfFqYFHJ5os$j&akVP!W1k&NPG#HjiF0>p#r<)ZR1B!{LG> zhsKJTic!K0#B&HWl)>iTo1WP=YMP4&<2U;)Ot=LxoI)G`ap7Rgr;MUbqudG=n=+ z6XFEh0UHH32JR18o$BUY;*ReUI7H%4)ZKi5=i$E#PwMr*(QC_tLZsQ?=kQ@*;X(5p zc`P%|ep>w4vQ*a$C91D&c!s<2emBpOaG6m`}z=pM>W25zAm_(x6yZ2#Z`kC4 zxrclA@5?4{nwR0Z0jOp%=WxlXo3l2BDbnFC@6!2th2>lB-bqrxE;vS3%f2wyhu|^u zqHigr!=+3QTQZ{{d8Us`@*x!Gy9s=Lu_S1mA8cx%iVzol9AM$j-=eRt3U~c>g@=B~ zkCcn|t#ocGb5bxWB0Imkl<%2kHC!&Lgtf)@rN#Mz?UH`F!+|p6kT;fBq6dy&WRAns zu^6oKP*f93_jxirPaWgbxNZPB;ek)OsW>x|i0a^aIX%-!CYg;*;`Hwhr@?uc;s-0U z$B!n*!)Yu|NiVXQ@zcL{Z#ge--$F63!6m~1TWR#e|EKfiNcAnV5kHUZoV<|%O+!&- zT4V>O>8@n@c?evJ-b5aq>0%dvl8BmK{c8T^E6=BI;G0%4ecw^d{AM&@lOA56-7KJX zx^*#^yuxPp)WzD3Vv}2o?W>D*8pWoz7TaGJn`jj4 zQS6O?%s`=$9yr>=j%E!g5(B%a+AEjeR^%&J-FB2+`(Mf52`u!Zj4`cvO+c8%6q!S|Scrn=|+)=KNWep zQDml3B;rm*PBx0nHi`&ukg$rJibbZC=jh82SA#~kBj>5x8*C@j8KA<|T%$+>SH~Jf z<{L#CxH{e_vd}2fz||d%B8!b84P2dQ6gjU^q=Bn@8bx+BiZpP=W{i47=QoNpaP?p; zGOZ=$FE3nWHwi17sUc*k(S5_&bh1aUAMw|_8?Oyt@%3Z=dQaoE;VQm<++Xi)yf!?= z*H8NE3mUHtNAdO3{`wV-*M^_?`lP?Uu<_b(!)qJTMU59O^-P1DLj1Rix%-YDb+JcY z>o+q4cwpv4PV1HWy}bZaiku5jqdIP-bHrbN^#p!*e2_(z#1VXPZ2goi+NLyd8!LOt=E$W{x%usz(>$jrH z1PHj=+%A}pldW;PfC)vTL{rySCP5nVMv11HudD%9d>SR18on|F($H>{Xe#&024GFP zQKG5WMfz{lY%NSsqKBa)a07G)cefV^vXGg3Qphzz*DYwX2Tte)$FT9ERS5^HKZqsp zIJ8FQLEFrOj+qA&W*&6SJeV}|VCsuv9xQ5NBXaLJx%bQT;I#6LYFabw$4QeLkuUVO zSPYr0<-u@K;G@)0E<)Z9P*5``;H9#NTCfZvN?WH4QWqJ{F zHM^F$uNlJToCN)~k>K>aUSG$|S+64x+1D;>yS&b?V`8k=PJI5g%i1Ykx2_|YNUxpp z{I$#4KCj!?O;6ivCp&-bvKDJObgrA8wbxE_{@P{jfY%e(P0!hDCpdrYvUb5H5KL&8 zBcC%}oYp{O2J#IL0^JKMpM*^0w{v54q{+taKgHrJdy&Du4 zkV~|Wmwr#k*yM;9Ch>E+mppDl3ng&LQp5&0+|@syILl&gRXo44@z;sOEZI$WnI!1b z*J9e<={ZGJm%1L3f3~;ik9`F!kgwr>2?Fy1=Kt0IkMU&np1P-Zie z-9)R6IxRx}3}&ttbwRvsVLivNALX@akHFvO4k&%#V!L>UeYQwS6CzXr-% zWNuG!;z!r-J9f1gN-UB}tgRw3l?p;RGtBvC^>|I^jWjYfEikAx0Y!xLe0mFN<>*Q# z8WQZl`n@%7T#?K1Fs*!}Wbc$SW4F8*q&$}etTX4iQrH?-!NRn67t_imy*scPp;@0g zx|`V?H~UNs>;|>mbdSO1AuW`C0xty%;lU4aINz3Iv*luz9h!>ku~73_kGn3_P=SZ$ zlI-%5m=~dij`&kKR(MrdEX=IASv0CyD}5z^v}Xjev!Iy2mOFw;aaqhNYO;!`g#cLj z)q;KW6Z3i*O9(*#;7HOUH(3h*Sjd>#{9WF%3&6Qc$jJU@o}Bm(8rwH= zCGL8i&?dxOk-bHi%0FvvIhG5AH$Rw47SG^a_(y}KgM?x(S63h$3yuV3h9P`pirwJ( zBG1KvF>={aK3ukh!J>uV3nT~; z@NWtMD=FlX11R53`+NaTV2Z~ zEFJB1?@Q~s`DAC^_P;}&&z8sj-5gRD2T+f%6~`&kg7b_33s)^dNO`3|8{!V>751~j zgQt;LsR!>XW{P1B-a=6eyU|?34ohPkiTP6b%)|&hfr#Kkd*ci3m5>lvEyfcu8`uBo z61r~;tofP1>KXScu(F^cumTVU6v3KBu%dkFwS!gT1s_=xtQvU*R$ZIdegszQdDaB$ zZ>D20BE+eVg|9fc4YU##9n^|x6-IdM|Aol9id3<%>(4*L?UZgUl4FLd4<%D2wrN5Wv076xM>?2LJpPmKH3GTuE@k< zTjjvAV^x2x4v}i#Np+$-In^U15H_jKh|APx9pd=Vrt6+8{4vK`;5k%f$=8S}dxqAL zg6g1I0D?{zV37G{C3667*7d8f15l?fN_dR{P!YruTjQWqF755(e{WssIds~R3~d|# zsb6{#G8VKPuG<2f~*`cb3>#F|r?5jd3Syd6x$E^++xMKBtW2Gs@jE_~`f&qU- z3J}qNyVR<6n_M+k5s{f|F`gIX)JK(l&}`|E5AXuJR4qNowY4PS zNJ~GZkEVBMX~&Nw2KnfDRoEPpM4;gPJ*rLM?qlhNJ7Na~c9U}|a*v8=H(>SFP7mPz zbE@>LyD!zj*U6O zlBjOV8uTTasPu%s?eEZ&dtXeYl0sB^OyBM_ye7pRuX-YR!$;4E8h7eR^P^J~vhGW= z@X^EiXnu$8H$QqJe#9rlVFRaurd{7W#=#JXne`$N#EDr^nZy)IGq~JBEwF#L;@*9= zc#s&`C-I;OfJq4B-tUeQ%(=G~5p?=FWKlSO)M=;Oae%)UxuJnFO4sk|SVVLh#@Fr&766DFRa6C5L>zlHq*_+4o+1%FNd{R$!0z`vj$Lc%%@E+FinhY)Jst*2^UU1a7 z^X3!WRU`EG&*;78wW9$PE~WMLv)kV`uz3l?3mfd3W2%_qCh%+9IGU_%bj^Wdv)JC_ zY1a0`e3=46ZAslBics#iaC2A;5B(*5a0-7d6=P)~ktYlV|%qU4nRp+pF zGv(o}T2Sdyw9f-onOnihFs}_qCzEy6p4Z=a867)C4#w?M5i0Di&Fp2KJkjnW9r@-3p;@ql5#bz*L!M1^P1_v^ zYHkQ`7MQgHqYdF(@L8j~!oO_@CoN-yK~!Jt3q^gY586R$>I?TJ2MeQ^;~bT z6T#OOqta;#Pw5RR*{XRG*T1H*k~o<$^*78MgR10Xs$Cf zSHc*ydZH`qaJCx$^i%Ku{mvCh(vxRhCL6u~g|zo3E72`wQPw;3d5fOp%Wk`%PS=wk zHzK9D{3@~6vd?TEC>5%>Y3^?CpJS2O{aIA|H)mh%@yu5XQ1UWf)L<#2uhH*z-S22> zta1neG!)o-Jl01RlPegY=9NrA3oKTpgQ65fUG?n%jH^VK^_czCDSc36r~PEhKz9OM zV6U=l2b6ByGAA1lL#Qvx0h@YdJELW;#eIWo{R!CP=c*M{* zvp`Vbw)7G6v8_+Y?BI$e1{Un+`NAS6!X)qx=N}B1Plv;M5S;6zsmDG~X$y;~YR)J> zoTpRbd(Wrra1VqlWmconmzp4ngf+%tu-S6HoY9PxVe7WVp0#Og=Heu2wfNuG|C*0- z7MQ4>K4j_xV`b*+=|OU)oXw6h@kAYzz`NNM3F?`5tcpy=X9=Tvp-V;Jmd6( zRVWfB3C4OD?Q~%UbCg|}WZoLKC`o*qM;Pr~qv*n_a%54Tki~W%LGy=G^0~YKEZdQg z43>iA|Bxhk&i}Ulx5J}Yg zV#;F_5=%M0pR7C*EKJ6Dn=!c%R^u)!$|@eqk84Jk@o{TSyHk|l5Gs<8FO(S2ayv0Q zq%MfezUGgbs`1VX{4n& z&oscZ9;W!hC`0mUGI0Q80g#Os=|d>UeX6 z6e-tc-jvKX{u{e#Jm2xs3#Yux;`^N6)@-{E)!RaDF7+nU;SIXSJdoQ9jp4(zXJY)^ zj%I=4i_?A(x>BL4#6R$3OwaTI2M#wskQ4IEEliDnAP3}`KOm~6*@B#pXZ~Pv`~&Pm z_78be#EC1+V(SIlqKbsN+z9w0bv2 z&|*LJ&N6b^I3>>HgP$O;3apCn14b2dv<@FafLhH2>YBi4g^iP(?X+>f9d}GTO}x9t z!Y#xc&ds)+i|hd^`=B<2x1FAn$=5mIDOTC}A{eEl;aBFFeg|0fA|I8IpUCIF^z7k;Ds2EQh0Stbjt1 z?gRzQVP43S$Q&O>m{gCgQlPR4 zf+OX%MCPLV3kct|5GAC5RYbu~n#VSG1#DGX(WfqLRVgh3@k+WXH4DO2ljRadMXLdJ z{4u+<7NvY;@_Xc88z3l+hI*vDp;W^=$ibG)Kt5Nj4$=^UEIf@Mu{FJF(eX)ppp{la zd-T@xQV}rh#ZET;6QdGTizq{QS@GA z6RNS+@@wUC7N1&tI)+5gKY)s_MRD{#rNE$(O%$gKO^trKYfa@aD%NHen=vKRGqZ!a z`GrNJhd=yH!+j|Giz15Oh_}1@3%Y%OyuF~$QQ2Aefq1*OKd0Nj{LlXFMcU!W;zhju zhh_$Z_r=?NeRjNO;WNMCg|GB8Y=1r8zS84T-V<*RXdhb^KK`f|KHx{k-xqJc()4Bc z{&>4&%aY-?csnaUaTfmi*ZteR!n?BY-{S3Fg?DA);rbSC%);kBN4*1xk$VW||4!`Cq9&x?#yk`Tx$o_P;%C?ccG* zX>(==h}Tnh@2or^r*HdTwqTzfIKdE8<}-PcG2y2GuAc1+!hg!V7bX4+FXs0saSC326$@2mipRsK_b-x@ixV0t2U@ z#cjwFl9R{}XN0gaOl&qn(~3H(XE2vid|PdgdTq_R)INQqcoow0;aDgO@8ShYXFQOJ zq0~J|ZA1_+dSQ+EycT{eWdX{A;CNTqjrgV*Ni=HVme_&@Vk*Sjs#|ac!@8&nibv2j z0F)~Qn<#?qnYy>ly5u9GkaaJzOto-49{aL2za{f#(f8jWjoR&hBotPTu-P-DQ5!GW zy9h+mVRJ4j7nER95-H4;6mV|{zo-PFgJoAec8#e^Q_)|V=;q(Ss-UN+@xNPi^ADzG zX=ls!&vnxaL^p#h&88u>VUCWB;mznNkqvY2!MFBG92Z803iL>UlZ86>oFSoFK9U_^ zzDuewHEVW|fa@;K-ydePzKD%5AZM8R2kbwmytNp;HcP+eq zJ+M-pvCqaI5!6Z2N|^xH?k$q*Q1-&Ml^(Xjo!|2TVVv$F9M~P2IvjKpHnag`Pq>In zaw|*_tWJ(y;%dn0edJq7%6kNZlFHJLI4#!a4U!snR-)DDN$Z=B(&BUr#((yvsW+n zB8@OfX@R7R2sOoX=R>p3*q|y4M&O?~Jor>vjdWeajSL(7N&1%Y4(mw492kp%)lJ-b z*KQ5SOqV zky4~uB-gvos%$!V7AgVYnm_9HqcJW%KT=BQh7+KPtz_BF;SNU_vsyUdaG9_3g;XvC zW$y%*LlQ$N zkOyvD2ul$K^xmNinFHk-#`4%j7(-{kc!VR(Yv}6{+;KH{NpR>W9Om`Nm@pTe!)1p} zb~GqB+iv6}-266CKQ=S9fQE37FeHktW)yVN(N@~zom-)R6)T6mBdZ;5Dw4OagD-h4 zRTapftEVI)CU9ZUd`e(NnTm!*8i&^fyKSvzE|oReYPQO)w~8XGNu(NFqwNSK2O~_U zo(S@-F`$V!1+xZ8j$qa#PI$5=P6OJAI6Fq1iHMWYIC1iWQ^IM~ddyr_sPGw~_{xu~ z5RC$tPNeisF;P_p{~J-`VvPeff=4>g!nVq!)psO+cBMu7Uao!{jGZb6&AkHFE=)C!wGTke+t)~cV975bu)(A;5nc=e2 zv7*aLrUNXHWBt)9GomZn#s?sXxnWIPBB;axhqn$$N*rZY#x#vX+RYnd5-TIIvk_`UmmF_Ymb) z*{DW9MwOmS8yaKPCiX^Mq({cx78@jjrAHEkz^mCdixs`9)yDVr*CxF+vJBGTTdydQ z9+JgvqvrG$SJ~yvS~wp&A1EV)q`ZsHS|Nyv68u57%1*G3@Gt>o&zK^KBsb(BA{WVs zYrp7Q-x#Rm2T3TcPEycK^PN_%*meqh5fIoIeaqFRjlZO*6Uj~CiAZ55lzUZetiNB? zKdnO4#pd8Xj+yS-D)Tjth@?^odP7`gz5Hxypv5i1R%_gxq{*cSw{oFO6!NKrN7WN^ z_&jWVQtw0^PLe8bOJX^sf>lkTb9}82?2&_?$|+ zHWk#-rckkoF0wIH+LU$SN)kfQK<#juN}CF8wKj!RDj7qaCcFW#&910fatr5)WGi!b zK4e8kWF|=P4}yf!)M>*A#vNFer6c@+2Hg>9r(Un=Op-XzT4f>3c&<^kRyEN{D&ixA zt&#}^OK7~IDV-cmLXCFD5M;j){NwfnDpArd&iYNdN2ixU;W|PCIoV89R^zS!gNi`d zABh^umc3{Uhn`FtxedjGjx*6#B^~Ln&xM2sqbjp6Os6>!%099kxK=|oF2*VtXqv52 zV@!)8Y0&K?F@lMI$q8%KOvMJE>kh!+WFn)OLG^`-{`k4_ONaqjBoT? z7kgAUoAHf)>tY|)%_H%Re(PdS=;pEbM!$8jr*!jpe52pG*fY9$GQQDoUF=!iJRRTY zw=VXaZcfHG`mKu{WsVw7#W(t`i`}j_8~hQd^jjBuuWpXTH~OuM-Km@7@r{1#Vt480 zj`&8ub+Hr8H&Nf#B8GDyqiTrKwW&QMy;6xt>*7eCqyO;n<2yi~NA>ekh_D`}OIit4 zq7}h)Lu@ug?F$NUy0JhUa^2 zcEyfybxH1R2{;*>e4rs~1`+30Twy}7w1j^E3nE7;XBgsCC7)55Y4xW%LXCw*1r%no zCa@eqJW~K2QJ3&z-MOH46O>vBlg?yaIpFo=ThuSn{RZ*WT|Q5*EUE&8!b->Q;sM>3?a`1K^hwkpQtQ&dB9k(=+LH+pVH&&3>_Aop7x8 zjIfy=;A1VrFs!fHT4t!Bf7wwX#$*_haiuZm zqbRR1GmH{*dDYx&b~>Ap&d1@jMgO?&gd7kq(>G4;ceWX`!JjG}P1PWbo7FSIB2#5q zqrYx138~}u5`LCSs$nmYna}J_D>r6$Hp*4DW3%>pVr&nM+ZFO-)-s|~-cRh^IB|$( zvo)f zP^l9Zd92{zny}JHSj53Z!m3<`-o=WrB zoa4k9PUZEjR}zv?xg*dOsC=-B8$}BSaeAf8Xv0Wp+pM;K9+{Kk zX22qThuySGM&SD>C;w=oqd&B%fEh^@EhkXho>{Rcj5y}=Y;q&|wDxq4x#1h!ct$sT z?_Z?-o6SKY0Le6I&b;WZ1Ezx=gAIdb6mz=<;fKu{(6rGJF+n&Jm;qY+tl*?EDW2>i z`*YAei@krDvk2|H0a2!55;#YT6PKG4ZZh}?fg_M`Wr`x=UwF-_HBKq4;Nm0QOX7Jg zJ3%$4UsfpV#Rd*LU88YX2SU$ZrNhK}30|;1Y-vH}pB5}6QK)roU8SL}f1I5`9IjJ*s)f^LfsEbnO zy3tpySgCu@t>)IiYtAL=aYR^6dq|G5@)y5%>iwVjjdoNSlw=yX@rwdv5{3v-R2cW)2AUGPf^I0!$uGeK!(Ie*6$F z$t>BI-7;qEEa@1#4bR3RdF$qI(y#d%bTYY_OI2^%j%;Sef);OUT zk0(t;WK1y$D@AQ;aCOM*wB0o~=xIKwIgEHU?%G-w=M6qa^Ah1W`ndIYCq040=o-Ot zW;JN($dq5Bky&e`iX!b-O;%yIGxnenSIZ_p3CU(Z>oOMgx~&Q_$r9`#0C}JJWp}yY zS2m+kE0}5svE#OTE48px2~2ssrJ&(F=r!qmlZXF7zm7~%t(ZV!hY>dTGsa_X;ZMXH zJ*q?%;bx;_gY7^$f*;Z~iTkzno;H9nrDP7o#oD3XlwTCddT*Y~uv@Q>ppe2v*X-r3 zu-*#qSnol0@DAtB;6p!Bzev}6z4(Geg6*o0$cWHM3lG86XcYR`Yy>=&HH-?iRug}O1o zL8-Z93QM|Ip%=%;Nf+y*%OeH@p;Rzg?Jd`6ODq(vN*$Sm52G|}y6qu?_=oL53^cpz zQ=1-dyT?cNbd(NBcsG2r7tT-4Q1@eeJy!Qq_8`{%OjY;EygmuIWs1_=B|2!A0r=i7 zr((ooei-E`W(gf?7nav(0JE9k9$Uy7JAF3Gkr!%%8J7x^iUIeYjMFxS z9t$j)yFvB>oc4ao>;-NA-5YP-wc8e;g8(5&I zbVzNXoppIUwp5R$v;xKSu~-`1$iHHy5rSPp8`>0swzhDywr;`$wc&weFuqpG4Y>K9 zPjB)mui<7C)^i{>yviPgW4sEF{0UTaLUM$?PTB+df1qHqW&N{S0S*&n8;YSEC}HKN z<{9);SAA59Xu;}|3P(T_4qs*D4w0^r94!(B5cl z+U}alZi|+A5sK=|TJ0F2iUS*J=NCt~12%*E-Jv{qzy0dT&u6m=z$^mYFFuq|(DuI8k)haQ))%>{2n`e7X=m1}+OY8%2=2SY z9uR#v&Rx)Si`pp~sA_HS6Ov!tX>-8~^yMRT@r%`&-e*&p$}$2P)|RO1KHqV%!X*m= z;n!}%W<{Wr@{+PR`RB4^?@`TRjD@jZ!f&ex^yy5vdD56ruaPkDVE9B;#nW8CpUS=5 zGAADwI_aC*weu<+R&LcY1y#fu#_85l`1L>E6llkK;qy=H= zuk(y;8rnJ=C5y%nN^KpUWciJG)k0Bx@umHbr)&{#=i zu6zfojXJMN&gbXy)$kMulE#qD$Di|MCnB1O>QL@I=A}!T%ktY*dZ0^Km;wDoepymn zl^oC&%1w(FX)$?azK@^om3hIBw9FORej*uClu)<}{XwVa5@L8nO8djFcptgG-05g& z#xda)jlxQM0S8`{Ak{SyQs0#b5M1I?kt3y2zXn(4I#^T&Oe0}B?2`ruysTukb^rIMTc-ylj_YNQW3& z#!7J;Fec*)^Jl_<5E4v}eLJ6arPB{IggTJZ0m{Dl+C%((>$N%>hl{Z$Td_%gt0uYJ z)};H)i#9c2@EMO_b`q&9^N())f8Cu6d|g$Y@Auy4nVh6ep)I8kx)Td6edOIF4X>U; zOAECvl!pS+oFper+T@({oRdBj;S}l<5m07eRJ`CIps3({yowH^b;Q?<0^W;?j-%k< z=zPYD%vDG3h~$2MYwew!q%9~gpV2w(%HC_Q*MI%jfBj!;?X|szsP$~yIH0+^fFQkg zqm(SYO^DY}t8$2*aI-Wwq$QYx;7`>bcBsjis&3STmS)hW5XCMqBk%@>H9q6T7aXgLW~KzCyp?L-)HP*Fq&7~NhK7a7kr=SA!|-0M zV@G5ff=6+;gOAz3uw&F9c8xcNPapE9)J2yazLu>%IoBHUsd1 zpB{G7E7A|(`m1}lQQ^d~@c&Va$>LZ-ysaem_!<2w*08e@=a6`oB&HPiyNR|z&$3i z-f-Z2nuZ$aC4IZuwZW|+B6iZdT1+$h3Uvd7xYbMYrlRxN}anAcrs(=TK32A+hq%k>s%GLduhZGHzduglU zcjlE?$PPLV<}%N$tBbc`pRs&L?n`46Qr_<5pe_kN&$ui6Nb2E$ZO913M`cHcW(9Er z;?F20pQi^im_h)f~?_WT)2by@Cn5=~M|Xna>+_zKAPA7BV5Ik??4o z4S1GI>F3^RRb8)VH7A3Rt5pkja?tnO;W2dZu-_To`B`)f7Ru%o4)T_uAh$7-4=YN z5+B@u9Cp&n(qH>6mpeEz;&)u{_sGC5G)X~xc)~;a$!}I~AaeMb>fP!6=NGu;yV5-W z;IroW1GlGkr}vy+P(t}x?w{OwzHZAkyVJLqO#bqKi zGKpSbt5ZAAdd~V&xxxvc%F05-hyb9AH*l?24M+=k4DmGH;Xh-7@ zNcc(78Sf^UlSK6ydDm12%3O`8d{wH2{zJE}U#szj9IA9u!L-_Rq-8Sw1cP9Yw~!au z#LV#)arJ|_V0B;}hTT-y@*bY&);M}EQbT>M>gQp^R^49lj9{;>3ES~=ZST^#Qda0 zGiVPSFI0XX$q&+I25oWK;B1sz)rkkO6G47dV6<%G@vk(+^( zq$;6Cd?EUGRuCpIjazbZO#TTqtWORU@Ud%O9S$< zU?{uRj@8AlWcj4@fqtT@q=~t;ATm zTHkMtNP&#c{6S z`L_>Q7qAZ{R?`yl6pw`u(HeLW-#(0|;n-25!xZK;U41@EOMYMq9X*@rzfQ-ImLk0=j#2=uY;G|H zHu5alkSBIt)o_tvACjo9_Dp;D%t5uwp8hg5t#rzs+*-I1@#rZ&?uPLfO#Fq3`0rd! z#bj?LBf$i~*C{5>MAcRvS<%LrLCG*yKTN$M<*w%rBVW=nPT3Nd4?ObTCe?=)Dn$lu z6m`G=YWC*wMCt(-p+_1$YVM>nFd{Y2bke6NFC*eH11%b0u#a$rm#a?RZ$-;RlNSld zrOD91L$z+r?1UJkJXZzIJ*too)Jj4MD?d^j{8wf`c{ZYw<#n3@EnrH9$n*?4FQc*s z$hfkGcsj-d>E-A^mRzmkC5#9`!hoa~P}^!Y*Fth8AsYB#Opjbrp>k)Vidp}wx~LB) zFxKfEQkFgWgZY*>-(?U2c?Hj91IUuJ!7+u*Hx&4iEt-ysnr|pbGuJm1j3(<%dYZ{@ zJk2J10S(GJ2!YLv43$!_48=fQvJ-S<9=A9~6)E!>N-fPANg!5EhhXI^VWbbUglQK4 zW9I9dlCDs8`e`1A_dnqNL&5XMx&O;RWW+l8b`vMR{y*8#5(Zk!*i7v)`-x8G0k@LP zgXT`sqsQFo@Tu3CyCvLhGk044*rSG#s{d!C_n1 z`o3*ly2M6t9$15T3Y$L-Ljk)YXExk|HiInVL(_S;lL!)A0gO6TNJ#kx)9@vbVnGlv z76c(>qnJPKrSAy!>p-~$9;4X;9_c8_0eE;txYvh;uR;Sb$}Qt8Nhte*FEi&8>;ww z?L8Pv>G!Z;zN^V`PIH)->G*Cxx$dS%oboZ!lS)5)=!|2fS1Y~zx8H3l-@_CbJ+grs zli_Rk-*NJ>a?CI}?zrW{H!LEHIkWR9H8Fy_)KvLjuKVN<=PD!XN=M1Z2MFj2pRj?4 zq`&{m!+7u0&v6Od&B7RpMu0KFEo^b61gL!4$-$(LQY|XSZqNm$axVfR`aeUXbr?`a z#-oEMa(&tv-YrkFhA{1^>ZwCxq_7~m@e#+EqHI?(0$jj1n2+mNXvhLk!z|;3aOE1% z7N(A~kf&BSHN>=Rvrf%qR1uQ^g8s=gib-x8#i|S%jT#i`@336WdhLEnQ}WlC$JJ6h zjXjEh5sQT1YFY3oWl$ZIQL?NeW3wE5sk;(d;baFNy2*;Pcz7@)F<2WC3(%Gk+2+$Z zny9$;SLqS5Hf5IDaDGdXOXEzWC(JZGx*5^B8)}Kh!mhjdp55*c z(V82dc9LZd4kgO$dYi2Oib%zJn~TC7rXZ~3gs*4qUV~R9g-NS|&eYmWHltUuf@`M$JOl3k$AxYUG6AVypFar+rzrJFnn{U&4Tz5$RzylJl-z5bmtAe`BldpzOk_Bgk zTqjk)fLcCn{Z92+@jSI-rVd|=z*IKrF;GNGgBn1iz%_FXjo{+Z!m!J`AOHu95=vSn z2-XS>6ez}H-+uw^WwLlh>MQ57h3T)2)*BhR+t zS#)tR=t5S7zy&5X<0U|X-o&S&iw@|kT45K0u5cuuuloDICv5|ty|3|MPo)Ar|8 zW|(O*Ol~BfR{ccl6BTkkF@7AnVK%c|IqW= zr&Ey$%2mQ(^uHHAU!~3QM?+~lb3p5>5b(OPeyF@W@=?TbfSH9=dx2d+$uda!qDg{{ z)rN~wR_+qE4`aC^q|f)!vdnuTD3cPk<`6#?7x&1fly8`iXfPWmLrgx}xD`^w!+~3oQXxe&?U5oZnMjJ@lAV+y6}8nX8xvd`tS6)hkl{-P zO0!WK#t0}ZN(AlTE=DAXo1na}bc|80JvWIo_HFRcSmHd?lB%a298z4&`ZC>D=MhHf z!`$%)yB2>F>naFh7HSf-8%sZryiS^}2b1zx1G393;4%~I9axm%gYtKC#9V^KBW8cW zIBoXq0;ASxbBsiLtj{qLtw=mtqF67}y8%Wg{}yac5*LKwD-$1QNg+Lc@cG0ZZq0R9 z`d~Ra%*kfxR1By5_bQ~mshrd>bR6mB=7!_z7!G3+(opz+8QvJP9lgh{*e| z>^^{_q9CM&0`!Ie_}xb1d67Xe*aHtLE*Wny_~JN|BrznQ8z)W=Ovc%ZKGv zc*2Z7#F8T$1EaDy%mN=8uFZvSGWh;iJRn*exO`K@hvVq8Jdxc#$Q1?Ex~5h5upp?H zVZu!mCipY} z$=Vozaz*x7`q#Qgk@dL$t?pUC1torxrEk-^;dVL#mv02ZBqeFm9FNGy1=W>^FVbMr z;jeH~(18b!uLRS8D(B^lh#PUhnT56LD6kqI=M3##a6KTMfQT&%6OaP+L=S)(R_Z6F z0o}}pNX#;-r{hI{Pk{mB27+utHzBu^ZbFfh+=OQBR+ieV-4Y3S!u&eBj-0Y9 z6OagE;UO&<7#EogPM|dVA*YfL_JQcYaFpR+ZdVk&_&je(!0ML){PN4#XhfNP~a7;u)dbOf|j zpA5Bf zMi^?aI}K24<&0$40IrZd%))E<+zn$1eX;Gt(HK+0oMuG(MllN)&R|?xYDRBn_k=Vm zgd<092Sr5N>`E{TAX1DtoX1JAg0Rl5uZCP=A-POmnLBr}<5l2kAR=%AzDf~MVa%^h zwJfUC$JRM~*QZvK-`q|lZ>_BX(x|2sG#kgTM17YhBA%{g`;kcL$Rg6`f+8Up?dFL}y&Xxjy*KRG;*2*Z2vf^b^n`z(3x%7=JWPytanv1~R%FGQK zF>6|S(*S%Pk+Qiqwk~2Zqt9!w$9_-xj%&`Xt+MUham|)m9h3q*i*1WFa&IMgb2gnj zcM4=CThugWCSVAM{3fQeCMj_EO+J7-Ly4^Ys1+eyTXYyvot6%S?PD@Cq_~;*hQI`pVngV4U9a`M#Lj6z;KGexLNQ zyqzF~^)ghqb>s5V!-X6}@yUCP4^`hYV!$;C1qJ?Vo`X)~1C^`!Mf|Arg>`TZ=9C&3 ziz)urU{ofX;EQv{ampC6mFxc;2ALrWU>FheZX6#O)5|#v9bfx7(htA&i|pT>6aq$n z)r;ElJZPV2>Z{(wDFF`Z;Ze7B;#oCo=8<4q=j6~C?rn6_dWQk|J-2i=fLr!+()}ae z1Z4VRZcM)VH*Hg=X7y2VdjEG#!jaYrk#<8fHy z5uG|78fQjS!}ZWnlDi!pgkqK%Jxw|3$4nxqrQRihS;Jac4G$+@m2;LLA!wid?0g2) zY&OPMXpfhXOA=Nj$kFA{_*gw@ja*LUMlMLo(VT-;58@BL`3gLiD zS=pTCZ8@Q`-tjCl8|+6=>+Qihm}5exNrj7QPY1cH5Y&cJ!LROw+{c6)mnti8V;r(d z{MJzt>p|_rx*|htl!3FEumXezm~tX7IFGAK%$_i5tlz*H%@E267U~%# z^+qOB?MxXkPSBk+z)CS_z^}y47Mnstc!k8Dg7IKf;ZY;M)C1={iWsfm zcz1@wH<`r#Wt<7vKzT4O0*IdikTMF~5zXlAM*w$HIX8Z_&q%X^IzB%0x(0Y!cpJaE zA%RZouJhmCki5D<>ktv$$FIJsA-2wc>s1Zx>!VW`3DuW;oYdsiWUspDAHN zuA=?u)#}UDS6#)+2&o6PA=LxP@bLgU#;xO2Vuu|B20P47^EFs@=r9UGlGaeL7C=7k zA-+&zIuQf^;3_Fx;fF#grd8ujGGDtuE!$ix1oGVlP94yyl-!E)NP<|}jqcV{G#wFJ z98|H{#jn~c&Vh2r*PZP#c_upp0H*QzscB76Q#<&pcTGW+(SQVtSCzS0ztXs9(=$+N zZqrFI_FzM_C@mxe20Z8^D+_j@Qt!XPjlwg_hn>{T(adl$TNums<;QZRvEkuNe}AEG zFq6w=dA?^Xo9oMF`gRw``ueiPVkuwB4DT2i%k>xY`*PVre>RsN$&9FI?{L0vcd3xc z6*GOMp?t0{pCiU?u0OkfFgvt!uv8iv$x`)DZpTo6G0XFUsYxwTcf_$jmrIloBg6@n z&lALxget;NZf|CIsNcVMC|Bxe_m?j9SNRV*b^LRjuklxPoSj$m6EHeY@?7=)gsbYV zCe#p=Hx=C1a?SYX3>8O*GY9;kks8fC+TN*3mvi*K0=VuFre8C^fW%rL} z`%2mV;R8*Dv0|yOsk5`KGuzy|y05*ZxvjOOqrYRIzpHOxO?yjkXQp>eZ+~wl)0ge+ zYZ@NvEo2G@nli&6uc=rdlnO(+osET}LRLJfe0>T3Z)SW}6!Li=PzWm6lmTX^NN9&q3 z{k?0leO;|>O?~@TK`VvK&g`nu;j!YX=Ejze#%5D&G*cR+f6ZQe0 zS?QMsvxTgmA>{I50t4?{6{(ZZc5dJ**vJ~vm>;G+NSfde>m3-%4)-5ft9h(CA1A*? z_@B56uVFl_XJn{Yg!25bo`q4He+5^KN&ndB@K9f-lnrz6>~zuuXP76P@;iod1NpOq z`F}~aP^@4Fdu_DHe9B%=dCkU!1pU;`BEm_8#e}n&P5BXjy_siB_HN&C9-z!|q+OiL zjFkrSg`qcQ`@g|6;o>%~`c>BF6R#&U5MD#5Oj|ar!qnCIeR zZwbJ6fzuVFpT$+&cv3z% zN2I-uJmNB!2W1?tqCX^*`Dx4>32ccnLC-^u)XY70j0sk#OkmNJ5A(H>r!5GT^|teD zbr1ryPieP zxtqj<>Be+EFtzyrtk&xHpsAy^g@c zUX&lJ?n!?u<#zr`FMIRg~ z?i`u~BzS1l!{JPCb~tNCFhszJ?M!i!2WQ2Wi!_sY1zJl$v*<4Ut6Cac8&?~R1=*V~ zl!`_vbN;!y&bb`gmrR{c2;(iwdOqv;V>$252L}H?d~4S?JHzPmz~<j{4>xLjO2 z6_*!gM~4q=#j275WQ{3<-pug6%z@(ev0kQ+nFTvDMTGRoP^q92JMuZl*+9Sa3-Nz0 z_rj;-$40^?!g+-7nRs?SH+;Y^j*S}9^_jG=4vdbXKQ`)@^8Ro(x3e_pH}BuT?-k6L zW9#{Y*YN?GbO}K^Pd~FCLy*=Ui0L z)?L$Jd62lqEQIBI#HE{u@gGf#|7=?P-=@X?V_H1oO|7qHT6|6re=Tk5M{#EhVQUax zO`C8Vb%y-p0`4y)Y$v=-UCepBZYmGJQISP{4qMMbw~xfa0PM$wP{7ABm|gokH&;! zYG=@ZkyJ&0pn$O%xGnslB9o=$@5>Gkhip_{pOTDrnwCeX(cjM1&kw*Z3bYdpuDKa7 zycU>LN&k@82qmOr(XZ0JEc_-z1G!b%{diPJ^06I}oz}5rx^19p^e>d>jI8@shTT+^ zg)B24X)9=Yv#@|6!2l>0Wwu9+{zZ9zw2&|1o-&0^4@-som?#a73vbKkU=3Myd(@XZ zLY*oU4)_DOwp6*%V@|heb1P~;zZISr4z37M=}iY zPO1W-BY9jM#k`z$hjLu8XQi%P=mX7w$3Ei#mhy;8(T-3e(%k`ehosO>iP%YNz?fh04ATzh$#{t!souC~b5x)A^z*FbDs5@Oz_nFh+m)xxE&y_*^)sz`m z(0(X0-oX8pgjXUnk|#`+8KO`90Nv;amGml|s)vvvy!<(Hq{75hXIxO2f`RuhzG#E! zvd`55!O2&2Q-D5djk%X$&4(3O2W zp~wAvUY*guZsMx(>m*3W*?s_4JYpy_(2{lpl4~+*4e(rk2TJ@PhKgO}n2h&l18F># z3$$gXkHHo?@-_2R%sZR&%M`SUHjAsH0V+ZpNu{%EFv zL4o){T38c<*=uD^H>#+_SW6?mK+4O<7M3p#?aXCZKf#A=*vNj;rGtd&gD{vN$+?X* z;UIvCK`~GncY$arSTE-PTo#bTs-KJXf>jib}EMnb(t8k|_ zLcMDz_pdsw!bS(1#+X952BB9x84}$Ro(!$k*28&qIxzJBL&(oweOOSH3I~AVLKb+? zDn?m0lX4&>h$X>>h1O^LHQbvW3UXu8;~tT2q|9Mq(zj7g{`|0twm&faOh z!J?UdOcv`^u(Q$n7^e9JZI)N+PCRocSV6QLu-mU&Was7dd9aM<(tATX{X^%$TFO_> zgHiOap+2MW*@-~iW%6hZDr{r=T)B(%W6hO^Nz+_87l&GbiUX2%p5(c7oOPK}-(c|c zIiAUyeTZR&bT}# zs&pPBU45NG4*>Ek&qc=pqx7LeSshuSO>icCJI^lxg9BRZs~C}GqzTT+u?k0^h~?3j z-9uVPI|c6TxUD;I8KYL2RwOMfS^2!g^Xe>>kf^HQ<-m!eE5pt@kM2W_3YGw z8QHevOB*y!l9~Z#E-npp1-Bcs`-8i4!0>hu9HQ5mQvY7+x9ASCTjWj>Z-6{I0f2z~ zmGJE&UWq^Ds7&8a`u4%$?SqAF`F*b)8^-gO?(YvM$+CSTKi^kxb%8s%#wl|TSMkme zchs9NO?wjMcdriLl79iW_%;vr$%xff18=hTKeql0#G75!C? z@gzLC{#R4Kek1LK`t_T*zlyM(ka>AKG@LjNNW7_V-b%4`la0sE?M^nZHq-ISs@^0}|_Pab_#uV$9T8I(0s;hBp?=E?B#J8oL zkqdEQHw^_03u}7F*wyBbQRN!LB=O1cJ~uYfiv}M??YJX7?Vhj3^}((t>$;ifpdc{{ zAMF}=Z7(Nt<8cyi_Otk#L2kzHDY3h(XQkgWpq*yi$c^InNLTE6u~yXki8_|9T*~T_ zDY*2_ODoC=vHK?R>MuLz?B?blm*0C1>l&y2q16M{(l<=4UEZ!K)pyzI*S&Q0s;yhK zZQY>J#^n~O8&gqtl;mJUk5V${=M4oMwbo&LiH&f2TztcmG->Cj2y7am7@{v880jT9 z!!j@+?<#g%a+#I&3%QEdoXl1HaeYXP+5HnVYE~aIe#ffbA$cW7GTLxgXmr+6W(8$J z@{(fY6EE>xI_dPfL%DY3T8yPr`8Lf;hFRD!p0$_H0*`cgOso+-3ViZ$e2E|(ufE|m zOHMvz>9SLouUNUNxuvzOeRW4?*P6BIb!VTme#5yNH=TF>=GSi7cEN?)FS_`W*S-F- z%X>1tef`2)vX0pXqJ6>7&6-{>M-;4ZpTrU!h#S_V@>Qv46c1!9!Lj_CL}W7>V%>Eq*PoOzZl_^0>RKyJyCuAC8cU)RghDz*&bZ&{}PY(m*j;qP3-cJl;1$9j6{rm;Cf0MK^wfF6-|0MfA+1&vAnrXeB z?61u*z1K$|@J|R0XO55mf%JdY_GTjAi<1G|-CvaIYL=?-CCpXT1Lh<}EA*;HZr z^W4j?6UKkXeSJmzc$6>HvWaxXrI&^IXHSc3|4C(j#VhmI5|oV;@@>N+hbYaGbG=U#_l>Re78CC0U#@T*f9V?v40PUw;8g#Pzg@@ai! zrH@aUd-?GmIo|;j_1MAMUB!Ix4T*^gVTc54LwU*i#o+hnT-Z z0|$)tYMS*2^ZDI&6GO%V60E#y4b1r}FtyW8_{s@e9D~;}fLIx^_@nLCzbHFe^b*E5 zfN1Uc3FGGy*B zf|hCglHC@Q!QdWZGe|!0`#uoB`iH)mqBW-80(%IxL##D;C#8_t7kU#Or{1l!-9uPL z2=O)fiVm4~?9KLpFB~OPfg=C5)pq|&J6Fx=IJlDEE)y(lnQbTX8?cAvC0;E$vgv`5 zk{mPlQ@7RvE~aj^aq5vd0Wj#%seW-VKgPQu*wd$cGFTq~d7 z7R0%jdS^^a7w@dh|32dHCwzbqSc3b)?r23oXf+#YOho>TAeXjn6h{~~c`OD@H=!kY zi;bhdBG<5<9zEAkutL;7#M@5O?dV`0T6c%|oz}w578|<>C$P2~ov}{KtNwsF-hG&H z(Ct{yJENXd_fS< zgV|MOH~feic;YzEQwJAkVV7NtQQP78-pzdviw0r+7mx>Xbd)FL3HNY+FX1BupI=C( zee44=%m;dI>Kz*z#$%v0`!aR-4a)6(41($d<} z*3#axx}~F~v!$zLO>1*&OKWRuTWfpk>ei0d&epEhHEqppEp4rBZEfvstJ^x-I@`M1 z*0eXbx3ssmx3#youWs*X?`-dCU$eS-b<673)orWWSFc{(vAT10*XlJL%^fWrtsQM0 z?H#K-IyyQ#x;oZ$Hg~pkw({y=d*|xTj?T``uFf@G&0Q^BtzB(h?Om(8I=VW$y1Le^ z0mL;lzlN&UP;3p4GDW15S*{ttBdJYD%lmLO`e*trYk1o+==V<`B=Mq3oZUzKV}y?r zj*7a#%j$Pq+`SbBFWw)asxr;u5(cAlk- z;E$hX{Zj6K@y|*B^KW?hvdw$ZUu4=Zs-KhAVfv{r%(=X=vGEPY;TB+)**skG-i8#IN0?0{N2(`;}bEBRJoi%9Db)1{SIEox4p-@LVckd4T4`dTBzlIW z(_fQ+5#flufp@%VloxG{ZXt;ZFQDAXT&1^5riStP+;JJuxyrvA|vEEuQN~Rzy~%8r|kdi`VMj<9)>YX!O41 ze|W!*{my$KGG6uZ{RghU;X}=rzV7;W-L&u@XUsf*^KYMTY&z?TH|+TFp&Q z$M`YU(5c{QGZS7%z|P`QeXdEY9T@F52`F7QJyzhG7cb|+s<^44J zGw&Jy+30f~gzDBTJ?+dbTW|c}2mi;Lu7B^Jf9S71_tsCw6IC5&oO#JFANy8x_PmbH zOD?_Uqo26{Z&p8f+}qyq?hj5-q6l%z*8c1jpZ?5(g^6T!YW4{oYr60K$P?eI>b&XZ zdlS{CojEXc<9qTuzVOU1F6;f(^W*P(e`C|qWf$Lm$DMz9*FE=s{BsXI98cBES=4>j z`U~#9=NsR=BXQ#VhLg`c>!&~e#rT)M67^qm@+r&Oy1F->w|U!kobC`^PhWOmcX9ul zuX*QPAHDy9!;gL9{#^dOS2nyU7KyHk3`E?f#`3j`A}uo)Mwe8b6k8EHCpu$!`J?eA z(IwGk$@bKivk!Jw&8<$(J8k`%NMEw5c`l#5SrBvAc16#RHASlvRf)C!(r8UpN2EJ8 zKM}1-Y}?e?R@;_nOjaK}<-#q?lFR4LKV{+U6RNh*z&W)iCaU8blS`|{QfH-?$4`q@ z$1jMxvARgCe0}dp8{26yr>MfuySBJ-o(!L^HL zb;sO8PnLgk>gH&5)VprhIh)TY|Ly5!}a%_Y_4PjoG+T^X%{?&Ib6 zUH1f?u8ovxUY}qV&8&%b(V1n*hAjs#s+kjsMG{quBB@xsx;mbOtCs)%0Z3 zaqrL$8OyVuT32UmG_B_^BZTowxtBZ(;}>#&CPCZvWk(yEWx{x20duH-$Ji)uT^oaC z2inF|9qAL4l`?%@)OT)<^*C=h{toB36a2+Be$V1xth{5z@@9W!{_ZDNdiVCMI_bAP zjm`^x#|OuII)3Lq)!|mxcP^=Ys`I`XnKe!G?p)Kn@Tqfuc~br6XLmidb!)zU+wBkC zxy^Yrb3yi7cV6Ipzy3n!$)~nAKb5)o6F@dH@Z<4Xk0hxUceEOHOXGrt4hVs^A=E_>vqm?X)%^^msGg} zQ8x}y-icl`QWxd4J1_3yiHbOpMczsLTg!PbN!LqNxv+6}%xiG>MxtJo8;|@0NC4V| zYV?xvYR_$6+!Adj9&?v*RGUvH-AEUS6pVByJ@2-NTk9s&V8r{%TF3oTy%V{??eU%X zkmp2Q4)@>YA@PCzL@(yv>dil{);%S8VyZFHOy4|jse3k<_c(7R={C7-)XI5i^n1CN zbe|F0TokD~UjLz%AG?1Rb0YLIx-1fPKTQ3O_ZO*_=$qV*nWxgr>PQPUCfqY3OJZ*F zOpXC+uVRL|J2)QH1qXMyk>nhMRo9*C&PYUJUrMSYCkUgAlXAJjLlMq@L^& zE=bKr7|@tg<$Awn)S(9VCR&TSoMsv~qZIcdjUe0MOAoGl;amWrmN&*}0DMDfYRaV_ z$TG)0D|&(M8@&@8`W%fVlV0Ma=q(YaGuoPTXSj1??o4W$Won5*vF;gBCoz(6ddkn* Za~7nNNw*8bR&2~xLJi@cv3ap4|364NWDo!V literal 0 HcmV?d00001 diff --git a/tools/integration-test/src/tests/async_icq/contracts/echo.wasm b/tools/integration-test/src/tests/async_icq/contracts/echo.wasm new file mode 100644 index 0000000000000000000000000000000000000000..e8a1bdecede1d623fc5ec5df21b71e6d58c4503d GIT binary patch literal 138325 zcmeFa3%q63UFW$U=XLM7k5ezWKn3?XmhqNCTX7ID(ptMF1*8)V+Ng{Z8%QXd+=~P% z1d|?ysw5cEL`6-M*cgeX1vPPK8%G>tcR7s?W79TvXQol3gVWKDpGiB+n6^=)>F@9N zUwfZ(AN7EMk58aJ+_U%EYp=)u{r|83T06V`P2ZYlS(e|MpLJbv>{xzGf3xe#W4_i; zc3rOGoQp2ED(J)y<#%3}W!DW{>?eNj&g*(nl4|mHKUHbkpopq>X4hpi4^?=l+Ar=@ zkKJQ;@?Tc`aIst-x%u|)^{;#5(c7}FuKPEDc=x)H>w;g@MZAY?Pw{w2@ zt#7>j$h7jCUVr_~S<$?D^O3jQ7OyT|f5Qz&uf6^Ho8EB4^}O%qcDRfe-gxsHUeA+% zbR^64X4Jj$&EIBZDx;Gqo-JAbm%w~A&n~xlQ>$R`H z@%lI1%y{oE-dW`QSC(aOp<5JrR%BVX$jV+>cDtD#>A$j{_j|pv*U!rwd@ts6MMe!U zPwl9}->ly&m-4xOznov1pXVKF&>ZAZmK~~PStlQ;E0Ij|--xEmoVrarKuay>dAA#{ z<=q|Gz@7BeS||Qf0oBsYoLcvPyj=Kw>JG}C%Q47a(d+D5&NQ4dTP%2OSTM^h+pU+1 za!=9e=eOkF&%Z9i+tE9xJeJqTkDthf$FllUZ~tZg9)AbF{bO^zZ$0v@Z#??eA{)Np z<~QAT{mr+%LD)a1f8;GkUjJsU&K+ET(@k%Dy$Wxezu`!G^X45#kKFp^Hyl0krfVU$ zqu1Z|#-rIk*!6~+x&D^xUw=eMd(#`#sd>^9^M_y!P4~k6eGt zwXeJWO-IUN?$?=Yoe#e+{}1_Bt(tFZ!8;*R-Kdi?4SMS!N75)EJD~AqMuQPEB{Sy{(b&r{;~Z3&7aQyDF6TR|Crxh zto&jAJ;kT;Kh6Iv|K8%y^H1l0k>69y|MWlYzq9zAq9~3PcYc0WA6TCh`?9L2SJ$e1 zbYEWQU?x?QXF3NylF%o3ZQDFs5(sKJ;k{(h_-7}iRr~a zY$<@Y{w055Cn(;ZH#B;wuy$YGKykZYq482f)>Gi_%R%aIXX{I! z-^qItWGDTvoA;PqSx?rNhRCk;Uzf5i^b-6qH!dN}7hKNe?_`%B<>xQ>S?mW! z3w|JOMgpbiM~F|vC8Aka5-l0-i|Pu*Xp*WqGHG^nxkEJ4O)b{XWU2&_6!l$sqK%?H z9+z~oTHG<_wbkM+i@mBN^2q8v>Wd!Ys>%;9E>z{{p?qOMy_yH3*UG*28u*QY-sK_# zv33Dba`hgrR*MzQM}ynT8!yjp;)V&`2uuo%aNL<;0TD=1eb~iAA z*pObhnwxa%3$Ez!r0N1tuB!fpSqJj&)Sb1uuX%KbbvEu&ki9(1xvToRvIy#FoMqMY zpcV!3XgeQwC6L^ZK@K(gMue&->QS?G;Vu=z>S8+@+#zN|qSSk$Mo!-vMzqKT%l*af zOJIVI>X-FiVTLB$nE1|g&R`KkFVBz*rgH)CEfPu>W^aWo)R-ltkyX_9=4%tcT;FZv zsx`?kP`$rI#NJ~>AlT|XS1b;M$RLe-UH+Cy9%D_|2h+U1zqsR)R!AiJQM;Krcmb&= zF$R`{91fTq`WoNM>OarurXhvZDJiTrq;P>r;p!lTtI~Li`iX39^hF?4a}_z76za}V zQE7cozNX8r2nQe>wuGioG8NUMydbRh=RonG_#!};h8hDkmln0&IvD~OGR)>tEzUQM2Px?ZK7c^mm9|3@}V+IJzlR^d6iYqg)+lkbvN!|`)kP5RPFZh4{W8zrhWPceMtEexeM%WD`nk2H}5cr$>2Y6OCHn!-z)=Wwh5C38-X6JTZ^ZyG#RSJ#ST zF@s?U@TiiHMk>8+yriF7gx}TTrZJ;rvhD-v&kUtQWU)c4#wJDa%1wGjxS&KLh8wUW zal%yaQtHm|eJaoNN=zOgJv{N)_h_|qY6>bU$LmlIO zP=62V?}@&rCSBEQDVwVu7#^)%+_M}LW%mH&c%kZvz`J@wAAz$R!`WA6Z;@iHok zcMeEJ@jIH#>t`X%fx+5%#3(TOyZbVAP|a8KHR^luRroI>Y!?7B*;VJa@!BE}7hiSW zWWHv&b;nnq`OIg&>eg!h^18fj%=5Z?+juvv>|%snQO`g_>sGsXaB;DltC1l*((t;T zCco8g+U^3^(SK8QdG43394DE0l``a%jc#AllZIB!tMO5VcS9dGOlUR?e$8|Ylkq$7 zu-5RZmTiBiF6dt7PkRqam+8N~2ja^NKizA(`I=FZaG`craPfwx#Y4axPeSeZnQiOOFn81tG2$dxI=jAPx~JgpCrrs)&cLJf78Ye#?(;R1ym^2}Q(`BuaOPQo?X+6~PV{ z?3KNPNV#p?)6XsAzJ6{RTL^E`Se`@~n&t7SW|0hf#Z)v)E_Vgefu|O8L6*gB%v9F+ zVy+3}QCu4*HnXwsKgl~>TPjk{pm zOi)V39Z<4R&IJBxIK?oWTHdmun zmIk>^<#C2Iz~UDKc#<{J01dS^#wZre=BC-fVbGjtws2E(5y$!%q;jmIFyTEIqywNV zY)?iNJ;-Jq$gdmA6_?Ta1a+)`1&q-KqqXX^ik&N&tb*%ECac^ru2Aff#GneX)|jj} zaRb0^q!LKxFXqGO0zE&T3xyqd$Ff?_<`TbSyrV881Vg*e{?$8glk?cIJ-AeMN^IC_ zVUgZaBlY(+wr9s4U#I>cPBx;d%rvI`#eKOvMWQu+L&L?j3}ch)d-KNH?9`8Yu)Ge; zg|X)K;!#ZxS$V?xrc3trdMx}%6^#?TI!RV#( zUh}%R93REyKdAB{<@oyx()lh;(|f7xZQ776R4KI3QOKZG&S=0}E-6z0d%&AL=xPWkOzRq-9y>JTZp<}ohvHu2hH0&J4bM{RjI%wS5U7k0hwZoJ$SluU1m{A zKquhV06&0vSyKoc9~Npm$P@X2s{fKh`FQU_KUN9OJCuK&!6y{8_|;WHR9-C`J>n=i z3UnW6V`!R~ah1p?`Vf-(Bi;f%hY`{ILT#!!C9N1YLcu6qOqNYx6F#zA0#QIgauy^< zW{9gBP{V2$4Cf9nE`}M5obYI%|1|0C>0hR*JubBk8?IRRbum1uIe}j8T8J=r{SpZ{ zkLY|!G6g&|{PO|hc>#f-`xf+`Is8TJpp=f){mNvakyj0DrOQqMTd2gqS%|O!pftsA z4@!jAg8N%7UNJ_xtQH5ya{+k+nOVw)Y=lj+z{4~ZzpYA#gk;#q$f4hE<4`bVjPSU{ z2(k0k_JISob6CU?>vyHIX#t$nyr`YSu`qhJB96e$$52T-0p|< z35s}!HOnn(=%F0njo*j!@lNTrM-pacRK2AZi>8vNNhhZ0I$VgPkclA~0c+PC?3h9k zN6Pa0j~t-uhqYs^QJ3Sn`W>(pMk?zeGJE*xj2GRwS4fsS2eIGgBq)etiB*6h`r$Q` zCHa^1g$Q6N4i$beZn+BQ>UoPq+FEKGv*jR#Y@yV1jmuwNwJsOo-b#8+!C-rN&PLCTTS^ zTE~IO3%EgXuYy=i22s-JOQN|0f+f!NtU^<}FPju~d23xVFDe#Hd#T7XL`k<1Zqi^s zDX|r?MEJ6-Kf2LTeDx*8?qD#4ipX(wQnZTc%Bf=dq@L>KWCK_+@$wC!h_4I%1W95O zdxhvaX(xNF?)DQKLxnMBKllpz25!sq4_%}dkH7Olqi7mz_#Erxb!DTI-*HUa1KhJvJ< zSuI{YHm|73mdZuT#1fTgkcM_y8yu0!ya-wu(!Op&^Pn1P-Vl7rd-^%rku?KkU7&tlEjhOV%E4^A+Q> z6pz43cYrh?xAQP=Ty<8&Ov5njNNl=YD0 z0VnD?7W_@EP_<)|swrT*4>yw}R2H697Cf(rua?c>1tERp%YhO;ND=s_WzmTw#5PKz z*^-r{sSXhNBQK>{QcXInh!#R#$2mW>f-oVo!;Z=7FJ50N^Fn4|QRl!^ti=_{V-j~L zNEShO1*c_egXr$!Z?`#wUDkn2DV@4dl22~q+by_Ba7~qLGN^hVzGKp_ z2Hyl5F|t&djvdzQgT>l{2us)P43+mI;fYqxw8o3Mq)8d5IE6xMyy1|~j+bX&$n;s_ zs7(js-%`g?? z7B2cZ&M5HDrtNipRpDKcPB>>sadV*9zQe(ZB!ULo0VqmT`oxs#*D5td<`b zFCoz8L<-QH^Fm=?RbH(^9}C*8M4K*ZptE{V|uT#Cn;o;op;RR}{AX zmA9S9_Gj58NZ4NeOVgW@<*i_rSSJ&UDy7nE{bKhE)(+hx?nj^o_cu17$J{P?+eXwx zG&T!G&$0E(oVsmU7|#*p0;)1e10UF9!P{Icz}uZ95rivow5(J~gbazWog9%w(A=P~ zSZtR3pv{dEAtu?4wrQDUh>!?m)uw?^6cVA3xdXSQ;aP<~*XhiHlfsSISXerx?R;6b|!1T=OOHR_BrQb5B zOpuKE#iE|0mp+zT$;zKEl{~MW_=!=etISa>XG{}n!G9t*9-m!rbZO`c8rn6sXC-bO zcVp(6OfI*h0WiBPT2lAznvQ$3G3NAoseQqA2P2F%ojzBwrju()eSvT>KT1R0DRqpR zL9#!A@Ts%WK8L+2+0m9%{n<=XBBw|QyMU3?i=j*l_LgHU)V|{mi4l9t64tW79o7QS z6#$g`AVU{n)gew*?-8c-NYQDi3VFG|*e4s_sUgWOP?I@8;?iTqbWJi0h@JUgvJTQhyaPyn+ z2#gA~Kh-J~2RW{}qj&QT2m}Idb!@cH?J3oY$KDz=K4E*yZ#s@UU;_9 zkUe>65*n`R#m^}CP>~k5%lbhslX3n*E|Vg?pUbnqlF63!eO%fhvlvTarv4O7I@!*H zzA^@_pw5#FUNmqovP;W%Pir#oDc0(beuoTwwfJuC9&GRK;_lt;-97Y%1Sk+WQTc8P z;!;1yB@x3={Ww(04dRx+l2L{ljXlEyP_?56i6Gv;QgD+~usb|C(v!H^)!eY&Iv07k z4ro2%=02+CWE)84DiHEGru9RX#`rQnDYR$>`ymZeh^Zekgc0M7V67i?2|~Orx!)z& z_DzW}bloK-S$3s#?FoJl(a$4{nvzE#faBkJA{+gsC&tU!=-YD!tJ@Rpn!e%x2>AvJ`do&sqP^5oj<_zkQe&TVSu05|yZW)bZ=)!-} zSAl$Ks~Oz?=eL9Vif%UIKGbL$v23#-9RaNgTbPiZJ-!F@1v&Ef#B;^@(o$ZKE^#uP zKNpN`q>lza8%rB(Y%FbHe>xl)8)txXuX3D0J+Ej{Z{uhzNgp%M!@@1vPPhc(YfC~d z@P1Pw=DoL(3LCjMNhnaZk%u9f;9)H|e-=1>s90hVJ}-u|IDNE;sWF-07kUdLjbTt` zY-}nsE;f}J?wiUC<4t9TCk?lFd^mFNpwl!GM&y-pb${ww1e`p`Q`bV_n(bz0B@axI zxi&j+gd7PO5{@liiPrc|>y^x;6BdWDMx0K_n`j9sdbO{9+MMJC`dPLLS(F3koR{tD zCDp@Ecr08<`|z_eqkxF|#$8Airinfq{apl+t!!#P~^X-8D_v~Et^jcWU29JTshlw5rY&z|Jj!+LfffBbCtwn=f;v2HkS z$ICNv+@6%Ml;dX4Zus#}wx8o+xJw8(gKn$j5rh-9HD%&DY zyKHh!vcZx&_lYPyH%c+zs<@=#r`ku?fme!W95?wzIBxxBGQ*3^%&gXNb2es% zT@O65Vwjj5x3l#l#|@kPC@$AI4~*^0JvnvU#3k~~&Y3!HbIEb@!URzqJtmy~+VI#| zrG*S*XU=u3)3`(ITzXoatVqr_jvM}27xzUz0M09HB=1d0M&snx^?BO2>z16Ge(T(D zm1DC{x_052c4WU8Q9<_6<{D%_PTt3f3cux zI=tHt-v}1aQ*#w=2VRV-%TvSwBb1-n0i#`aFzFHgmRLy5Gpmjk{$`7C4`_vWIBWcl z@rYL)cJ;;~EmF{cSg+^)QnXqgn&1Hq%O~S^VLS{cu*qTe-eg6wJt(=YLmbSh#V40g zUMsJ26?rTsHdZ|)*(_0cFyWE1bh+m#bc0f3(8${J9M!7rhVr-DEtgiiGmx#rQjV1w|3b_Xfk09`W> zks4)QM@an5jftBb91w0b2zHk$bNYHDp9=*tI&NaK>vunh;M=W@nkG20J@zW_^ z5+F418L?4$Z<#i{goyCo6!|2v2PUL~RvqQdN0lTeBy1q)34n()G$sQm7LX)S`hEv# zx6g3U!g-Y-LWFIvQqKwkF9>PTf-^5ACl#1bq0<)t3qns*E&@q~dhsTXLP!!&G^0XT z@4~qW4BJ$jHe@hBPHutS=m>TqFVTX>DjFz)Y>LQ>2ph5+m2s4>3hDy~0N zWwTHCDCfHCp9@T^`9IhbW_!G=PAbyY;D0X#RGf~)L8k!&wG84A= zAa~P{hRh?F(bS32#2wL+X%ORnJr+FOt=xta>W89x)DJcqDlP>yFhf+70vZqc4qL0f z2hWopb}XQ_a3k8VMr%mQusqwy0T&Ky$U;roDQ@QDo5LC(V&IaS2@BqAx-pvsPb(H6Bzvf*C%+ufiHcwV1yw+nKNiE>^fi5!QHOql^0(^73P9 z2E;sRMwzO(BuJR*gZVaL4MvX4DeI3ofZ(m&4Ae#RDfN`X8e2*o*4R>NCwWV$!x~#k z9oC=}Y=II+_@O4Oq0wkmK(PsHoI$;C-A>yVakANG41aat?T9fO_*IZ_yF8+^;E-iq(8!dMDxK#u%<;<@5{OITwg&Yug$HqwW~ z8ccO#X@iZ8r48&)hx2f+PmjxRxldouZupilq7o4yr@{FzD~u_>;;)0>x& znZbVwfo#BC3W01aYw$LM%}65L2-8TY+f>%T{**Y65D0Icx)$2oY<22dsB71n87)Q^ z?+~2euZ90^WKPJNC9amVFq=Eccbt_6vCx|3-1Y_HnIiF%gg_RhLu7SEFZTJ|k3uaG zMc*O2ZRg4AA^&DmawHG84S_^BB~c^OL<4RJfjp5yAb^rt*tpmb0>RI=2tt)LArOjY zLm+BVA&}!`8v>bWEY!2@xV9ne7{{O;0{Mh>=&Uk)$|bYPP(0^F+D1Jl5&FbT2n2SE z5Xci-Lm=1;n?oS?FBPNM#X3#+z~+wgIgWXIHSj32VczYyOu` z6mGzC;QE?ow?|%oTEwrxKpi6JW)!z^g%fp4_%2W^p3M%udy7_CQA%kPiMrF9?4@P= zF(Fc+1uNhnyvWasVGI=YP(y&t3$_4ve{q|fiFx@Z9#cCSaP(UHUicY`10*oMwCSXo zqEqHc6p8izK^xrAj-)IC8(gKGj043r?5z&8lTnAH&>@)#DMMwfb=Yu2*)}XUlmk^_ z)!W&Nc&YfBm&s4pBCTZFZS!QZAk!kWQS!?UE!lS z{m`2%wb5SV@OrS2#?HVN>@(EUl1&0TMu^Wwl#45fCAw)LhB=ZeVqp&`*Is2W;pTXO zaVCc=wCL)ZYJzTzGD(Niql|e5>2(RN#OPfF?Jt4l6b)!ef5`>A3H)@mM~N41AftpI zCA{%uuKF=M0*pntdB+0*P}R znnGH3C2ues-gqJyklCUI7rkVo!(54lM>;f>zxF&_;JDHLrs! zk1@;@ftNo(+c5>&eNC>UZCgH*l;UbUO%NVrt*yTbsNuwuF!rUAC)pSV$GTzS^h~La z5oNShL1G}Y9sXZMUMd5PV6p}(i)x%9R3nv4_;`)+!1x!0o)P=Q^n1Lc3~wSp^;g|W zrK2y;mVCExJ4*)KE%>f?d;6FzK9XB>Fd$PfnS7Ub2v~Dm!$mH~H4B@Lp(?4{!@-1L zr~|z_+uLH({t5S17vkO73d_FRc{@36+YP53Z8QAEx-%RzwPtAiYGpuBEe%x>Yu-RL z4YVpnc#uMz&nop_3b3LB1aT6~^pVGjV>Vmc51UZRkAvh6fl;+UDnlsJgJ zB;t5-197}a6=I|3hbsOk53-QSsnlk2XQ$gVVCak1bpA8tNV~L8L7Nk_p!M{(pMZem zBlF4y{Gj8tX+ars-n78=DhRA-RC^LGE)Mugn-x|mp%QC&ihdo`TWMjCvrj&WxQWCb zN$b)7@1;nFz=oiZa1LEs@)1I5%{ga}?#q^k^<8(Jh(%K@w)$R%S>MecFPeV3n9kSB zZZThsS9lx3BC3s;>9+G$XgcQIjd^$LN8TCp?#8@H_1C=G>jmS+d3>w0YHz@WI&;zQQ9pxZaFOBhd^2 z|A83EDt7^Xg~zuUNgg9v-3)!jxh+MIGu_abQ|Nb8z@@SdT2db2O&mNRP9^tL?qMlr;Vmqy z0Xy_jHBk_SC>>zNaq>mkfjG1?i2HC7oop-b!B(Rm&{H0(Vqts6dXP)K9+XNiQX`Xs zawVaR(Q;vl(%ZOTY%*4;q38Vgr2=b(RTx~0=6pOEs&1xDWuYCyFdC6gk8MVxt!3GC zp(0S}9VSO>?mGZVhKJ<>3~L8VwPB#0mK;IO6nJmi!B{lpfB}ncgKQ_{W{|g#O@Q%G#dJm zVeL+|SBGo!2!#vL;b%Qk?E&$mJu#4?X`}(Go0wqLX#i?!+cK}cuBPOPiJ%LCNNpHJ zVzmb1!(YoYq=*fFNt4-s7E)Uh`~*k^wI#|F$o4O;wSS4<_*cmodXD#-BBVkn@-2;O zL4k-4aLOG09GKKrGSI8!?)Nm1Gz>`&>${*;aqD#WXb z0%LQ5#9AQ;2&L9Bu$lKHJ5r+>7zy6B0x@tE{WK9~oo7Yka}mJF9W0hc>H0Gg3dmU| zXg^FI9cgJ_A{kew9kZIq2;(7Vb^4C|$q46B!09_GNMpc@FXK}Y7P@1s_mK4Cu2dii z6#8-U1TwHh0QMr->YyeONvfp~j@bkNI-4YHYuWuG`Z#w)fbrTv1jm7rP9kF$@wj7u zT5wa+fu>_1Dg{GhWiIhC1);X;$e}LK!Prs9d+`+z5NO{6=^6;sJ|!W`d#D}JZ0>eU z2*n7D#b&gHr`}@E^Eux8irm3`BbUyFI!BY#gId?ZfWnzv&T*C_M4dl7m6K5Q3mElv1@)3?f`C8e|{mmBS#WR^#=BoTRggHnYkqx5TbC-YI{+sJ&VxQw-wCnd(qMvTKnJo=c*a(1R#)TUzv4aMHcU+Ya@GcD;g zw1HJ3hH-e8*5oF?mgwTl>-?k?r@(X2nVdFnDmA%m5we_HGm2FZqSq28EU?7=^Fd}B z!tl=$nPFzUKti^&kf?A24#-kH??oTI%HFSv2J$-Vm9FZYVZxD3-0uL^nBtv^mOT0?~#_tO}V zGAsX3kK}P}Z$3^NwDI`aHTXG4!7sW;&suuU`YRk!wZ7EN%S_+&P0rDKB~TN+VzAeI z`HjeHmev252mD^X***GE%Fon2dO^GUoTL7a%Ih~O=c-48@J5_0^Ocaz>RpkM)s_FnMEBEsC@tD&&V+3-z^S8wmZS|Y6 zFrrAkTySEcae9=lG5Iuv$R;N6rI<`)I$O|y4yIPTOLQBR792M}S)NA-jwCkqFD_{C`_sBmyn>N4J{3SQu@ zXusdAHX{D0fjX+GmF6KZcG{7ap7vz{V(Rv{Pz943}vTqGE4 z9gd*}jPdWhP#KE~6T_IY7RI_Jo;wR;p8;CT!uVhHA_7j*ls;==--+Y~9)%!wB`bf`>czdcd2r+9y|^?i?|>aN%G zuhbAwlk<_V#K@xCs;db9d`bi3d2~D-?s}bnb$T~t3C+G+|JbLpukf%5VX`bRfK32G z4iH39nm^rgIpE;;@5_Z(iUkiv5Q$3Zs4B8kDeXXw99AkE-UPt=hoNi%ZQN&(O$;Q! zaM+km?hhCiEes*C?O-Sf2H!d^pvX*T^!<#2KEbQ=YROq6Cy|=aipYmCIay7W3&vPK z{q7UE_#o_JzoW=m`|OYPOlc(xYw5A4ri!%3CzeJZ2-jVif}|FT-<(+C*ig|XPl`vH zCvKi3+DV-Ir&sXEb)GE~hgBRIJWYG8*Dq+p%HGCKXc>?qhKTaB;99fD(;xbi@!1ul z`^~2y!kfR-c~a^*I#u*I_1)wUGcE?nyu78;Q_}(7-%C(Tg zd{jTG);T#aDFs=t4FC0XsZLw&H3h9x4hYaR%#>CutDXpf&sjhSs=*b)iTa6|zzn5g zCRS6X%%r!2nNI$`nQ7zu2tAFZ>N)$5z6fA_se2fwZmS+NL#c8qB_n&$G2pk3;LTtr z-mS$Cdl^bUAV=+_Jrx_8pX@B%RIp7re8=M>uFa@W+NW%kAGzF)=R|7cjTH+*9 ze_#y8)ZYBhVSrAhlb|Ys3ILx}Iw{=(MK0;Y5rCFXWKxuT!4OuOlXO~4(uq&rNjfdk zu85M_5Ty!PKq9f5;zX2lE`=yXl84v<5E3fRo_iiL@LiGcsFNqzexWT9x>^F5`Z!-GkuSWscz5W4;?8R6 z(DCEdH=&%gl3I;8-TIGz_Q_v<|NDRG@%J7(l#PBsI)zMgJ@~i3_fx<1pC0(%zvEA` z<^j2WG_c((2iN^z>nmhgG9nsXO~04wmrr|enpbrPr^zf`&0*O)bbIg)ig$3!$+bLB zIrDtIgJ)OWQ7!X?n%_Y6r9)qNHycrw4i)dLc5r={RLs($3*X7Ociny0prehJs++-SP$1u(HhpVYAW85szV^2bT9)j~B-eZ&J7NqqbJxAWVG?|F-F zvvU{~(iT;B)~Mh>ge^veK9EHpQr0k3YgCAJX7zP4KpK4=M#ZVyQvk+G2~r>!6+Q08 zSOYdHu-hA>g2lSe>$%&n#~|*j0%qC2rY<_ zG}VHtA9J5-L7nY^7W_mqDj26Et#zQxQY9}YdD!fp;EVMf8jq!TkquX;!pN9S^4m!; zHY!+-nHm*(JB*5xzi)ZC@qLe^>a5qLMMNDk^dJ=?wY`em`qZs{`J{m|v98*Zk;@u4C zppM~VFPd*ycT@8X`8@jW=VZD4Ns2q5v{)~b*P?$CVqYVT|~h>L<@`V8zOCOccj_rMONjpZlaFWz!AeyC zoPrHX^84?O|PlpdhoCtdA26FhO={M8LKNYJN-bYYgA*{4Dv zA<|Ze0mzD0c+0PXv|fBMgbznfzZl~4q6RbfoGyPT`#PUDHvwrt>W;~LHMshy$5q6* zoR&mx6dY0K>nJO&bffY0RS~w-Ud=h@d`HQ*bKigl8h+Dx`m~8w-)FuxVu?8?Yf<)e z#Rm$o9;7v$u!WlSS4T*12d`E7>WB}IGB<%l?Kw{vWy(To(?TS@oxxW~?tPc2lPwm? z@4Fhjc(=}$uaJE9pCI|(%kpzlz!POzA4l7X{XlnIr=#ofe)tI7q2mL2^<9S^6FmlD zV65+kY;Zg6hoEhxW`an=anD=FU66!!*El?nFcwC|3N2D1MJtY+=f%JH-V+)6?R#<& znk^~!b7t+nT+y-FCWD~kusZmxo7^t9jd@|$i_i6>;E+C4)Vf}>DaL2T)Rw@vzu1i> znaKbc=&<-?QY4P7<}}?L*X|;*D=r~P(&F1>Qb6`G(+NC|Nl}E0rMD+)_7v~iq}cer zY+7DfuLm+I=#|e!eW`mGr*5k`PHOsYfH`oe!d2GXx9l&;5WQ~SO3!3c#KdCMdOevG zek=q9Fyvb;^E%E`pPsn{tHas^{r4|~Xr^?V}rCu9v6Gf8&#u+u)6D%W5YFu%x=K@V0) zN`pmN@Seg{2wKpOQj>?Rx83Y1-Z%O;z8^+oo-9hmx@A$u$RI7cC4sxXU(*ST(p92w zrUGT3?XF!hQGu$63O2WrsKAd!1!5jE&`2N=g(GrfR}w9NNPT1wc_8hgwvY!2Mkj?( zBM6J$fn4n1 zUHQ5&)lf908dq0pea{eES5m&n>FSV)c-lI+q^GR|C!em4 zJV9$(AswsX3~~M!(k&b4h}Eb)@{{Q@xi|jEou*IAKtd}1q!0DTr%=l9^e0|gB8nl2 zN-a-=ytS`gL&a_lPMoScEvU_qcOtl7FnuHnH)Dx}S}H$%^INDqh_65dn%r!11+G(k z0IH3dLtQDj9{_47!~mKh4W<%wNYj>^ta+$yt)vM+jq{)0YXDp8fF3Fsb*G=mwy2|P za3gvRa!`BXtFb<#{Je>op9{82X2%O4W`x-0p99Denw_%9Guy7_{Xf(ohNDLG5VbfR z?|({fEOMw;D|)u!eVqb$I=+_CAcmj^21?->(Mx&t_(N_l22RGb(F{_i14IK5?~%n66%stSxcM}%tUvFwWPP*>?z*2wY2g5N+YQj*6Xf}WqKvO>`UFlICWbs ztkpqZHkMr_`Zkz2Xr~=`vX)du)>6zb2Cr6ocKwhyq}q)h;dp4HrpQ?Udx+)#|Eg&~umd(HWCVgK<;b&zcn&8OM{IImOL3F-vi0 zLanp!*1w?c#majdljT`A@z0wkI2}BUE~n9-PR_B2o9O;u8U)XV?)C1rbRSI`uv-Q4 znar#im6~|AfSrAJ8^B8WpH>=>Cvw_4VI9JityTbth!-! zcBM~vzrdEhuL&otBY8T;*=9&U^=D`+b_vH z*}xpLHXvM%(6k?GP0*O;&M}#q=2M`D`5i#lxsA#6`x^>$hh+pVg=J*^j+rjMAaSk! zkboXx8CQ9}fZp1dBVyGGz{tid^PbEz#$LUHcct*jtt_sY#Mg1<-=&Qht zTh#AVfoeQwWJ%@mMGc7n_I^283UNb8GAj9!tBiXkw-A|_bw-;f4p?Z(5HG`dNUkec z8H}lYQ>Sf@37)nNlRRA=5)VRrDb&UK=*Z`@uxXTt&>Yw6lev_3Rcu-zB@UM4%95r! zP3EbV+7;5-I)=)os*Ep0&so(H{lhq1q*l*TtEwMBnKI5&yrOU?x}C@g1sV zUKo9uBA}ziB+3-u+Z61CRyGAY*&3%{r<`3$cRRaWH1?bIr0q96H|)1!bFlN|?{5lr z>iuAxGUb!dtMf_JuToCcEr*xYKPF$Omx7&CA+Dx(9mmz_i6P2pCB;06u)~{MT8Ugo zb<*UMAZZj=T*mWts7}iZnmheBfltWWF(gSN_-;HTt^_G5@JarWKotp(Lq$7fN{)vq z+9~^y2$_^mn8XSos?Y&M$?(l4u>gwvW1)sP77c^XUXxD5Y#cc-{7)6L`c3655Poa| zR=l8wY{UEx&%l@oqiK){Gp11ek?u%I;^5|s9wNY*m;oHuJaOaV;P~W;qOa7|$55DG z3c#GMz1DCLtl>Q6agGZ!-iCC?;U>N_M|)8_iI|2%;3e^xB;AapIk}k8bgcL1oDc$1 zxk$`6r}<1-ddhr>U(H|AT3}6aQS+B35{n5C)F%FNzE$r0G69~2mmu^+492hdOF2^- znWM>GOi;6tueI&_oA^ubi%@xGz3#+f0&2hEjMOce@b!b@FTPSs-Xjgm6Z5;~FOZk` ztI5|=m6pF|T4~o5Qoa_9vdrN-6Rjwu*hOP0h#;5AU%-GAvnhXpALlRdyIV`oalE*b zk0lMcNC+{3ZEr@{`V>Oc9V>~VYrgf;XeLS$UC)PRQr->-o7GIs6APDF&E&cpHPdO^ z130Ix1C5@pPV-S1ubCm}wXO!lPPY^nF}K+@Gs2}SvIlmz=}Wr>fob}ZIOe1e^=L&3 zJyM%g*BO1uWK(+G8IG)36krasi-byaPIgO**2%0AF3+%Cg-b0qHaF{4Ew5+ci(BV> zmSAkmszj3_N4TPqKgq<}{-NC_fl+zrq&8JrZf1feT0p3^Wfo+e(4oa@KtSzSt=8kn z8B32F(p3XKago|e*kD0hU8J0zf7y-G8mC#1IHOABlGWvWL@S8h(|ez58((1ZbCMu) zc)6{=s{0Gtdnt?#Ey420G^30WYXmT|5sDacub?*b2xHy?~~41VQ=nt z>v^28>-qp%To}&<=tAc>@^@ym2iLiuna!nv9KEC2C@{`wNomv=uc-4A^c zAEy$JGY&uJ^3uq3;MhgZlFxJ+*OoFHU7P9=gV|D#@WGZc>~obdROZ5{E^>BHj6fqf zxK5|U15RHF^X&AMkTqL|0C7Gf=j0L|-Hpriu>6ou2-^BmW6%%szd8DgTF&Gg?uary zKqrm9qZrOn!qv~_!|&>I0!FhrlPvIjm#ry!&jbHm0wL0I-r$QzIcNJOseu#=lN}H#%%Pja|kCN z{c_HSZGJ6pj?8K(fhUiedXR9mg-$>5_FvWn^`XH|{gLLTBx~`1%?W*X)DmY*txd3y zUr7N!>*P!I>f_vEWQ{%)D~r@41+s84rw2*XzwP+om6Wijtn<~k>T?40Ga+Y;vFn7P zqW(NSj&!`kytN~Yv=9!nVqBtp(m?p!pZ#xT4xyBpOwDO1x`xo#bqmXM>PH!}|Ij$E z_15{gl%&*CD%T%%3Ig~Cob==|J<%UM0c7H&SLz8go}h|0C@{!h#RLJo;K=B?_!a4i zPV@6W`8=6Nq9u)+x4wG%O1#S}&S?ROb$(PM)(g&YG3@sOx6<*@==IrO?kswSF=WRG7IR!#%1=5v zkc*Tlog7Rl<{R>@{@`ce5B;HXeJ3PP-u`VgoK2zj)gGb&HamL(3?PgE7-BN#Qv<)E zUw_$s^wYU8&#=J*Rv2_tzoovzgnFJx0o=dpJS;+J`ymGv`cbicaIT+VV7qbX8{2X8 zI3F*(ztg7wW&1$02xh>CJe;c!aVf}JvgF&%2w6ANaq&(U!P?(Z?@ z1ps6HrkxK9J8%s$YRG1uc(b6E4wd!yHsr9j3QGU7RZuN)eOa6B$2rRvP;d`z>cnJK z98pn+42yM$GXH^2*_2^qUU5{@T@JECzwtBoKKj0Q{Oo_Z>)6*Jl)NobeZKv9=u_*f zbQp(A?pv$>Z*dT9lc$(2(R7+pMZeN{&P=S|k-Fw*L~Z5?9C+_g8S{MdsZ-2TUUlJA zcR*QMp#e{cFsN&c8G{>eFdaH7Zox0qkI2fsg6#Px@M5KQ|cylPyzXLl*ZxHuR-6EspBtnW|s{Tcr2>ztxv^(WxW3p4ao{dDl? zVR3^>eO{7FZDU~TXsx<_PijNI^)X<=^y>SfaGd+9e&#&_PFCNWiVI)a8}R#XP*f%t z1gJB;9bKjjJKHG%Sm(m(I>9z`vozGQ#|wu0DemaumC8mpWtTn z`vBq0&UMG}F=FU~UmZ^`Ns~6#wCB42<}_zp*|I>7|CvPnS999`+j5OAB1IY|gH)mh z|0s+)zTE8^_M7* z7^(Ao9CV%ps9i9||5+V$eqwfnuV92aO8txvI^Q}H=s|wW86I?=Bt{%`zENcSN*<2O z86R~1=`@ovV67b6RZCD^o$jFXW+GaTFi4RfX>k7D)+TwzBuNZ@K@K{<|K1>(zgg2b z#~htaEQ$yi$$SA$?<|JDC;?; zU5NT4T-P>juyye<7`XO@K?B@5rT+9|`S55N7oIwp{y0G`{VzfbVe}nP3!n zyh6cqosaNx1{0#%U+s*Bd^FdbA!?twc~>#KEdxE)$wHHBah^<3cDn{2r)h&OnFmln z7*#W;X=9e2?2)aIlO37;R33IXacPC-#D%9kRxxkSW6o!f(v^uE2a3w7jsrz=g$@?* z&iK($y4{G3z+a;~6+M7tag6T7z~mrKnTwvEzm>(O{BZd+C*Q``$~BK>&kSa*NC^py zn$#8Q*`}v};H@mu&WiL7e{mS+Uf$ns?j_JOouy#C^`F+eE}fo*$=#R39lxEeFMU4e z8=`Mc{vYRnfv>WjtS=3VtoctkEIhW+j{ukrA4wdS@MJ@V7hKLIUo1Sz4@V&%#jOvR z^Am5{bHV0icnCS+T{B-;(v_gGz;}a-P)-~=OIJG5Hl3EeL&w76F9#O+W(b!)9rG@K z7IaK~Neamr5V>01p}4_n@fN&)C%b30kGiCXxRMFH075|?nN$T3r@`p8a<4tXR)ZJ= zJ)JU_x>o2=A5f(66?LU5dwJvK*-hLqp&Nk-3)IBCI>>;uY$EMUDWAlcX#I84qpz9( zfI6X@vIQ$wb4V;5UQKy7eS1=y;_+s+wOsKEoqt^8s#Cz~i9;o^?_HGF^Xb+6L=S3P z5N8Hl(WUCRA%h&w^o{6JPt>Dk>p~w^4E5S#=#8$5#f)wo)X5T=wlFDT;1-!6YZ(4Q znfE1>;oZ`%8*_+&z^#vVsk+jArRiJ%e2bRFF3jEvS*WqB_6edUhkH?kVohRc08XvR z!v)m}B$xLX5qF?c_gtZ~tPOY&bg#?bLdYu}Dr)S5X?ZVaq0)$y; zyL>|q2TTrqjqhdb|Dl_P6ci;+q_EnM!UZM;bcskoL06HgL$0GQ0->6#q=`vEF;K}L z0)V>gif{meKE>fe(b!dx$`9uz67KHN=N$G#9EDK1W6TP#fVL)*u6Tu8hXUw-wYX8Q za5A}y6-stECQp#;?9YMX!Qi}^p~gVXrA+{Odjv3Kn9ZYFbc8op^L^XGUp#+W_|pnG zrNRW!;l#FJHi-x#!HGH?|BXSx2~d;#cxcV2lvwqV#;sV@dAF$zi*VxH_pq;$S1f`P zZN>Ycugo7)YP1yB$p!68hD`gSWSL-mzf7>qN06?BChf{=sSs3Xn2EOM)@YaEDqVAmo49= zmlfbq%aC+IN_sXomn)Z_u|JCYYaZ~;_=7iWx&m6 ze#X4cmLMg@N6@ZjS^deMIH9uF^`>SJg)0 z)RO3j`Xex!1`1psymj*I6!WsjrY0gYcRm!3Fa4(FOk^{8rx~QDJ7=7w=4$7@;ix2 zM^X|N5}K-i@xVCDL5BG(>j1!W+#aPG6%>@8{NtUVWI-0=v{vk zlF{xjS0?k9l;rfWIPGxvIOqBTvi+#0lXF&!eTtWoLlYm8R43%CDx2$8rL|{-MHMEG zC769m>*F((Oq!n+&0FL(rFBC_p?oyCaM0t@fsTMLXCjN1^!ZmMpXrKGr$Ebw<(I%i zk#c=J=16-XjB7q1y-Iwrmq(xYsbCC&q<)$k^TDa#3EtuSHNDgF4o1fC|6#M6`2B$Q z#sq0i{~{-j7o@=@eqoa2Fa)9bNBku01Hay+qwiGu^t}#|pt`E#bSz%UVp{-I57Jbf zGv=Tkg!UzwZs3+r&E9k7#;0fR8T4K6Z|e(+hweYlf9z2aPMoQKs6*XA!SM5NfvVxSrC+6@-;gOVXo@CYqDgVuKX)ki=gN)3As{V52 z%jFa)4Q^FeN>A~ubq2`jqxlpPY0S=m5_{2a(2@V@Bj6iEV=ZX19W=&JBys7m zA(D1b4Z_v$6yf)FiahvmJ9KYCHb5kAHjuqR=GP~{Cn5p?Pp)MnEg*zLT7)!^H7YJf zeNI0GkOC^T5lUikYBEVcq2&W(P@O0q?%4>=qMv>41YB%OKOdUXgX!nt*?Z{cBeVCw z;L+LpYOQ{pdqQRxLw}~H4?<2SHqjIGz^)n71Nxw$hi1Qw_#V)2p@&b>^7BUzv0%NG z9*hIg!BpA`V9%8@-c=UGEM*91Y!x)>nyl*v*Aj<87XA^!CBN$53bKH1NUt__GEB$noy)MAFJcuj} z1@E60F)cE%#`Hx*9TVo{bB^K{r)JX}ih@q`Pfdf2xk+bfNJ2%Y+spW`kFj9n2$Ni4 zPO5=A*XO7C@v^Kxj^gEEwg=e#Y%Hd{wU{iYWYj%wv|y1)h<}uuP-br0bBh!Q^(17| zQ(9xNC(Er(5uVzri_<1eLl!ZEV9_u$r=0TPvJr!^BQ&O*z-SXEpuEABnnF3>7RuEY zD9Q*+cGdi3aHzVQ?3$&1o&nA*5>$-DRzC??1L_b&2)P4e%vBq-m{k#2G(S8$;C_4t zxR9e%v{1%X161HmR())6GWcZaftgKKx&e{o%oMX*%=Iu+5@x4n%5yOB-%xfI3=2JfJoBds2~T9rCTg^|M8r|qE+YwD zX$+1U4}-wc%KE{QMAE9Ld_=NL5?kDUv%=!$&6P1nXE!=SVhRZ(F=g>zN~p=qS;cI} z|L}_kv^!+ASRJ#6*e}8@GCB}Q@=^JbkE)!Nt(+N3h#=s?q_?en3$b{n^6hbQER%!} z>|7aM>tzf%Fv>Ag%G-Z<2BW8XDNveT`e6H#rQ#W*H0;&Y;)2#^3yUQj8X3GSqMO6X zIirq*rGkZgenF<^R9rqgZ*{Shp?V*wJb*{5g*e5W?`4Ne|B#qj~NbI5mk>moIcnh2i^^(zhb9Tvd0>8daq4Z{* zL^|ZutTsn)cwvUzQ!W5kgf8j{IVx2_hK+WOEjfMeer>9eKM}XswcH{w@oLzFKl(bo zTFDQL=VaS8&wrgn7ao4$L~&R;9)3yo1(WhC@>lcjs@K}OTzQA*_0V$ zI>TJnrH3Yz&WV=vA#x1$k>;b>DBV)eK%+7^6?wvk7|OuG|HD{CGzp3NrC5GGz+z&Y zr;Osr$(-on9Z)`(m<;gpP)FhS_!=tSWM@dFbU$Q5wttsB7|*Z`O?cMQHwKqLUyfe$ zZ00ARZJHmOb<+Iip8fn_PtUJAJ3mcY^TUGQFhAdKoS${4v1;ksVpX+9n){sDP}2>b zk+fS8$29V)laQ-DwWbrg#SPm#?wKGD>SjgAbw;50Qyi&DD=5aLW_<-%HHrH;9Sj@)@{X_HB^%8K)~9y>Fr^9d(xpBd{~%pu+TCiYwx=DtUbIx>(6pqoTH!V` zWL9BY;fC|dputtB8_vto(cBx(cbMWS^lV~or2m|32EMui{SXTntXp3}#S1i&Pw^S8$n7lzuPW5| zO_vn=;t+-O+Ry2={+Ya14dlW)xat!ZXh0Uom6H|c7VG-P$$5e1qUIA>F^FVm*odI_ zyK)A?miFUj_n69w*?;K8~(Ef$mIl^znSMBj&&n@%tIB`afF~?>V)z*>Q1klSENuNq0vG zaORJYQW3*HtCbvSNKE1^BV?b*LkR=CaNBr?er_4#SgjT}#lHEOk@Yu@Z1Y(~~s_{Sq-ySPTS7$Z~ZER6?!r`&F%>tj=b6XdR*!4{&w*BE3-E>Ik|A?SF@ z7gnwq?-Wj}#luI%HnB1_ILu;9wezTplA9AEozYxo3zPB1VI8sw>Wf?kP*DWnN^k`m zx{~1>N^qy~wx8vr^9kuJ2(xiY3z+W7T+*jO8_{R}##@oUt8d<5Yk+DoqPDmnT(>ae z3SVM=^gf82;Z4AkWJfR5O-~Qc*QqK!794|zdoo6BJodDr1U2a?=9JxPkIHIQ-{-4# zCNbDp;>@wSG{1i-(nT8TS;_WIK^A#SRjOWiClI~}QF`$-E?i9;{?R=9ZG z+Ux5#T?jb~>>Eo#9}qoEWv#DS0T<1ue@phOGLU2sM~TX1$9ePJ4A-H zb)a!#gi0$Ui$;G@{cfjzJKL$>C)zFG*qM#zD?yS%c3kc7-qf6@#4i>6 z;3^#7fedI>Ua;fq?;2w@-K}bDJ>@U%+UROo8TzN1_vDVebi+-0F!ra)Tz`mkXFh46 zy{b+9c;oxze3cwCcllyQ$qoeuiafJTMCWz1Q9mlB*|F06q@2+DVLZj;>&o@`5Kh|- zauNN8%%i($xb;#W%w?cQeED$?o%gY0WFgv3)%%a;Tw_X~NPg-GD((nB^~BUqjqV@Y z=%}7>_oQt*kF2Pl3I{!n`bs&jeJ!lpM-PMFk%0*re;z|kvy*--l-a)|9%8Fi9?V1# zWPhw&V_XV3I+LCJG@F@KRITyBxj|DSj>{~SF~(59Xt*iYH8GjSt+=6eD`eK&nXns# zPXVUGrx<;Wq6e*GBe$4Lz3^@Da(1RZ?cOZ5H_+RTxCyKXn1Pj9*ZTzL5C&eD&wenV z@$3{47BzTkF$9n}*$=}s(3^bk2X#J~%7l|e-fAgg(N{MZ(5*q7mAj9 zs4txO0@B8|G^?aKPib7ovE~f>WU(#I6y~YJSXxVq z*jAs|*2Y4VowHjul%6WK<&Fud5I9bOfLe?4qOsV9DR|vK?GPLmdF{< zl6sK6J`o@Rsqr6dY&)+SA&#=C`Glx?1-miKbI>Tzze=wh@GCm!cynLL4r=lXsJqwE zbknQEQBNoBbV4w};f;Z*Luz$q49{&R7JFL*vk2C)jcMc3YXZsx?Zg!sq@q?i2@1X{ z#E$_<{FUA>8j@!=V@j!YlXlpt>3AUDWW4DdC|OQG9>dnm+Xr!BJMrRfk~{mefoa{& zFt2WBn77}KrQb4dzh&NjFfV5!$P+%-av<&HtJ_ zG@p0R`0t;&DfXgg{Nl1>EAsxT zmL16+LJ_kUnxrTFCatejO1Z3aP3oUkn0Na&mZM4iBJI)1bJ%{d9Ie~X`VM~0wOW5J zY5hJG!er-j1flgwdTg{lmm9SHGIb*fU|Gx27FznGS}aE|qYoqaw<(R$%hpcwv;JRh zQ|abH>pK^4ZmRW{BObmS`3uCAmYWtz1t$EGhL3>2ERFJeWjeDdVMHk ziR#^0i0aku*o~!)>c!{>hCEh;ZaJ2tXFFCBY5G@1*Itg^+_m!&Hh0}un_Ie$gq4l? z2mt`)kji9l@&HLfev;_m5bI9iNc^Iq9pGUgHwv_DH{`WcLmAr<235*9ALY@DSCKb} zL&c|3U#*vxguY?@(KZ8SNjM(X)0CJcP(;DUXKGxa0%9M@t6mD!f-(}xo#R0wxjTX0 zl1(?w8ILPf)$sUg8&*BzO0P`Q7Byy)&Vm&xzQXKG_XX1GTiV`Bvi$-85amN|E51Fr zu3Phkp7QY>-OnrQWkCl(0tJlmg_MIsPJS57gj5$8?gWn0_UnbPsv#$(@srN}L%GK= zSt51=t?h~gnO#&1-q&%*6mAo7hQIRB$>^qYgf?SXfSn@-z z%`_0%pXS>1nCb$fb0x8$#?^zZHWt#9b8R-1HpVpSo#8mhybvypcFf$U!DvG%e~6fX zl?Xa}drht-85KD+q`hC%iYU;eQnbjsci3=jbWX-Dq7Zt~Ta!ylZFuG_$FVaBE4SpG z?{2``-TYowQ9Y~n>O(o_iunm$q^*uk@;V%bv03e%P{ zoyobmJz|b3W9;IB)#5VaCPtu<09<-SJ)A+UM6ai5%UfVK&5C`N+O(E-QGObfSZXvI z`QH-z$8KT}v5oRZT~TXxALXgux*rbUK!)?|lt{rJ2-6ws zB3SLoHc-ytFIDgNv9fbu{*cIjcr5Rx17b>;PkTGav(HMn(2P^%qi2ZUtH$k)1)c~czWB)+gS9kR z0W`>d)}O5Trp=T9Hl8P9I198I?M5)n!}$38$9Bb>(e&XmAIz|zSU|L=28y~A;UL&L zBymDub%#$|kornVHtDaeW*JA5uiT~=ZmW+U|8)OWcGK2_+w0?hS>DRk%I!ywP6m9t zLRLawK~p~Q6f5Ud_mzu9Fr2<;m)F_XsH^tGm(jn=q0vypupb%QIv$2iaPbwO9tZH` zn05Ujslw*$1%5Ed2K;b5j`-Y$+UzMgm~5m`>wkaKE-~e@xU<=NUe@=*UNS;UR3^q| zSwH$uVoS6Y`QzMpOEe3fY?RC}?cti}&*q?ybaJjlhOL*r5tiw*UktE*;&-C0%n$bQ zu9T&^(^ZG7Rb6SfgiM?I6Vz{ZZO3^We^%-viU+|(dE10U4thuI)cPb>ek;7sIrE*m ze=F|QF~;8KgTjQc!I*?mjuQc8$^01oKjWy=>iSD4JY+XF+{%t;#rf>>8ES>`H2i8cY!qiN$Se z>?}1=V7=DlNFdIGD9DY+I+F#AWT&A_GFEs8;ljJ|K=fECEIHwSW|+Q?3`IA@$s)t; zM@hsGDKiSrR;W6OpXnZc77MY;z|UYD)Q3BeL?u9H4)J|+DlnJzy5wXdI!F4(%lZaZ2Hj_T+bvE77mYs;cqB_lc;0z}PM%6<6pTrzmWKN{$- zFD({b{>#be&br->ZG=C8Q0ozgM2f5Gcm71W^Z7SyxSBa+BP`_~RE-7d+koRJ?)Y?N z{bMTEVUrqE-BCHv$m{>8_LqGKWf8RXld8E(HATzpRc(*gsB(t+5k2mWF6Ws}kc8{N z8pv#&`>Y?O9W)hIw5+pzyajY055F7TDe8aFz3A8CnpjT;nK5C>s4Z_w? z`q7+kA;H6J;LWA@D_L+td2ALpQf0VM8mF}6R;r!2amivy;+xTFv0P~=3&(baKWnRBWx4U&KLx_T>AEaP@^zDT_4S2`` zPh#=U{D2F*rn`7+^hrKcnT`I$29&<>HvGY2!_Y$Xo_uJt2kU+80m)n>YzTB_O>bhz zoDQ*~-tN(#@{Py0yuk!d`NoH~yy3Z^X2QQ|#_~xI4&hb*Z;VL_A)s;rSF@_&0#rja z9kF`%nTvl{WCFDg#>@uvjElq%!f{LOf_{idenc3dpoSmFc|EwmzHcRZw{rJMTdh`X z4vr&VBL-fy2PhU&Q>{g&VJo<_#3;5 z#bd>t#lb2YFT}tH`*`uca`!H9dR5ik|2gNm&O9@jCl_*uoaZT*0J%)=7j8KN1VVry z7xA7V48_qX;r&z!j=fuL{g8+hiNefDkbwbx#2?X}n5TP+vKIlU#18(*fU%9TDQ=fcc+ zU?+n}sj!B}OQyR^?W9JDrK-2KuR`z82|^BZ5&8W#-l#^$_+?j#9qBd8g0k@=mIx!< z_Y!_YEMm;=F_uIwaMLh%t?Dg89F;!^wIHh5XNsudhaT|FeXh62nU7{L%O_zzn$Cy| zd09K7Ql~mI!~*a1PTilDjW$R!WWfuma%*AK97$q#VI!DINSTw-$C_G}-&ifTti0*& z&bgkhhEQ{)_mr{3&c3llC*5&4*+K7yy(C+F)7{+mIFvF-QcjIi?mz1W@)cd^z^ohg zD%ZRbxg^rUa?9)ypSin1pQ|H2>mUS`d6Qsyu}S4m)%#0@8}>++kZt?BM+ zeKdL3Fer7Zh3>Z>{xxUihUL92Ge^`YV;p$PcOD8sbxQDx5LBO}d{qc4S*}qC!VoeR zf*O-LUMY%3w|Jb27z=exiWr4D*`q*E!yyqgJ^|^76f_}8`Kk~!(Q=JKkSXk=DQL1% zza|Qrq7p`-;TS7-EDDlw4g^g&B!Z?X!7HMm=}F30g`gRhYZQVouZ=}P$0l_gJp~=7 zBA}q`$iX*D5p3^E4?bz(bucQ9Rn4r!@RG%-Cbk7jyYm}}^Y5X0L>nS6dO)G?Yi1`l z2Gg_;iiX|Qv_7%E^nWlxF4W#$t?%L!W7}@azV_CDSFX6bUC@P zc1*HsrSghTBJ~`f%)l6{jZv^G;d|WRrbZzl^o6y7A(rSl=Gho!2Z;AAo^}pIGk5h3 zOJj@012$?8aZm3*@z}D08|H8 z7eHPLR&jG$O45RwI1n}OkXh5p(9yd@NV6H1pNoZRZLL#&M9eyEr8n77HH>N^w(p`LHcNzYbcV!jK*ti{ERv#`E{-i# zdr=)wQ7~X&_%MALFrR#q=Gk?qBJrEi3aqiwvwV+EiEdGQ|Cg|3XPU4hqx^2H7pQyC ze1kK0*n^cWw+2--t%>4m`a8{i_%5gLdeK}{|Dv1i13e(U$=8D^g&s_GQyHa~HGm$c zJ4(?z@CU#J+E8{rBe10PnBAFEBu@?+ma(YK;n-TtwnqaGmOP5l|N1lX5mFhC-Oc+; zd@xIK>E78v-L(^>g${zMCbT)clLcmzGt~N($qu9`ibCtHP8*9;FkCQ+bXFVGV+{~I zT3&2bLQ|U>=wnuD6a$E<<5XD>!YQgE%VVk(&?%8k3sey7q5;!a^w<}Hby4)>BS}9r zM44UHN%ytnudQY{gi*fPnY*j91+&72u|%hzKLey#0`9@93!x}=Z`~cFqS?0Kb@jDZipWWydBlXae1$fc~~9R|6-+)9*^pI zpktPJXj)upMBfB0jT~skqhZaA>IBVqCx#Q$G>?Oq>ZOsE`88%%#WbHa4e@0ZXYW#) z(5(lGTk&HoKNApGsCgGFfvi zSs|6IM6ydknV~{0UB0)37R_Q%ObcwH%C#)MG0e2Aym2p^ZRYW}fPTK0Gl#1Dt!tUd z-};ux{4KSVZ`=!Zmn->j1&j}AH6k-iQzvpr{*$n#WK&A4WK$?g_Ff&Ft|4`s(&nl1Zr~slK{1mE@RIl2l*alS(oaq91k9(^ApaUvcykE_!+@+WIPv ze#%A9NJU#e#nJm+^vqPW^-&!CoQpm-6>a?!M;~y}$EBjJZ-}-g%}PZ$u4fYDMc98f z9Dm>5y^ig1qr(RD|C>LEApO2H2MHD=nSC&Q&`Fo*4yCXUjZC+G$2yZU?KH&fTINYC zhE*mZ6!E<&hZ94;+PDrqkNu_5W4EF;%!^*);j}mD98#0acpW`*3(>z9JzR^%wl0Ox z@D*lajMc?#VJzQf?Ymhi^C44a_T!qA9( z4pBnK$TDlnpxkOttJ4F>J#n4RHcI3_k$!ZwwkF$Z1d4-`{8wp~Wv9WR0Axrtj;x6P z2_wWmAdI8KFXLEYNgm|hoTrXfckxG%4^@&R0N10TLw3tt{0akiaDbf-? zQ3U)bmr9Wq?uicINBLBWv|JbIU#huUR3HUZZ0H8*4&B94gtvv1+m4<>0^BXZ9>a&M^mYa4ac zs3tX)hIq>4l*l9f4JSo`bmekolE}e|X2*5d&?QCGbXB9a-I~s;#_A;Lovh1+4XeRE zvQ4x%QMBg|DJzYW;3~ly9KgomKj%o$MH>k=PEhnk%$pS*k0HzLcx{pB%tcI#743-6 z<#xQbp6KjFcoiwyQJ#x-ytaYp+(nIz7VXH+MLS-LwjAXzYHYG-M{_RP@!B%cg^L=; zTeKrM7wvfMM4LY_oneOjs_Ej83L^8DGdx(vE7lXwBsCk`=_S(@D-Gc!SRbRkt2#l3 z4fT(vSn4L5VN7OfF|h?jiYJR$_#IAGqRE{czpO5-l;g;N$npGiD8ocYJ{e6>L=KJN zjLyn*9ut_F^T6lsSoQqm=nTiFybBrUw|7Tp?zj&P z8nzftW`fT7N#U`ID~B^VPPAcqi97*^jKYRF``Mqt$$07(QecoJi8Zh?xnT+pm*MzM zjro?r|MbLWIpB1%ae@Y54I3>^-$|;n1bXCMFe7XjmJ3|y44LP}2+Rhc&||d_hiO9k z(bFkDfhKy4`yf7nJoTa%KSXXBNFw-abkl7~D2RgS_9R4i1)UXC_)?VNzk5>Ov3E2` zW^uAt^ib+MOY{wRu0=Wido=Yur|(=Yo#(%&Qr}?<4Vr`&`0u&YcY2{ggS>$`HEbdl zPz?#kv^9~`g0JiQaAGwWS6B43&ZyfWWX)jaYTgz&-lo>jWaoPhql7IWMe~<(sS&Fy z;3V;>n99OgnQu=CPd^l%iUPlkjWW_%&QYj2^K3wjnoAYLtC@ea(tqELn%!$f4DO>J zt1=Cu$!K}Shc2Q1)ezn!X7(hz`PLrM%u@s?6p8%c4WRAdW;{wwn)=xBHWRORG$igxTo^Gj%+#L>6a7wd< z@+Nj_qA*~J!8+gM{I9F3D8xK-aW3F$ij{qAWR(jY( zwIu000fszseCLtlM-O7*vBlu%2Rx4_pH})sJ-o#iFG0FmeQi+J+Iq1qZzl_#T-s!1 zki#vG`q3S6p+h-n@KJ&H)Ze{&@Tdwi+3{Kd22I%HeWCh7ExNl-KAzz3^_{dZmDvoL^gJYNG&9u{0? zMB%(;aV8~-g=3gi1*p)TF|FpAJ97L&dzW zKcQf~g62Z?VFk^*#XO$grJ#AYn6t|ZpCCA~=IpXx!L+l>!}>6mv&)w)A~a{0CwL$2 z?DE%{VGSDT>~hEkr9D!fvT>X8dU=qljL}iE<6^Y=usQA=l>@XKHpfk)a)7zR=6L?T zkx+r$!{&HwRE`n8IHOvA&!`;6g+}?}Ja?~y5(~}SFvwaOw1}Z6i zt4OChIi?{tk`JtMy{f-fhDf!+k!qn>S6{*vkWrJ|4;P3%>;A^)|4K0H9F@m-YK9~h zl^|e=C6q_!_DC+j3DauY> z!3P7!2qo<&RG5P0B|2?CYaAy79iig^t~p!|l#wuYlpr)ZCE|0A_R zUq$=vsG(6Ee9zGo#mG)Wl{EE%q^Yk0Duz5RWu1|-j6|gfErrS_$0+|*pb}Q`N^83J zwbcZRNuwtoN;lOCeWFGQM;uDjTbF5gWlB>kT6Ebj8j4y_Rr}M57q`zq}L5iUce?K&PMI*SKrsLM^ zTvXL=QGj5(@&6}6XVWki?jez+wlPvN{o+C5%16j_Q6%_tP3Wbn z={er5CNW29`mQoHj#1N?nZyRkbiXpC+awmKHhoSJLU#k2Ui2s-(?tY~#;uY(r6k%E zn8ez>0fhft5w940@isF3u`-ojDfr@IWO~0c701Z*2a1peoJN%R6`6h|B#xEo1_L2! zbAn&;47EANC7a|D?29!~=o2cmVGKx~Rs?ArB9m-KC{$dCLLWL5q-l!Vmp~$ZL#8_p z1xY&7JxL~U7BannD2*nJ0e(8u&2c8O;D1e%H0>{~A2xzPmZ|k35ZH;$cLK2~gl6RU zmQIZNpS96D8)|awL2P8U*n=hj#vyF{ZMJs14`nK;>KNB* z&bHOyOT{+Hg?3>>Mbj&yR3d&;om4?w>MCsPze=;pdvJJ_|BiPpS7uz}5_3Fl~A=W)o^4(V5xet7pBA&=|PxC(^H5t1KGGrsSd9@ha`{}$?a zVOSl|>u;fspA4%5$@E*O<442lK#=_w>iG9zb>PUEn2R$}sFf+m8uv??^#;qhVH%ld z*I{MTwve-S5DQBiXQ75&(SC(+tRyZkcV`#PDxtQ({T87Ag@gW85qa|%Z0iW1jgcj4 zj+W8NrXAI~sD8~1xXM^=`c|7CLE0D7ir)BPEaLNEb!@L#SCIdE{`^7Nknf3aL^h3i9}*cWhqc+A+odiD zgF|K+(a^CF7wOPZbO!`zyd%z*)3iZ{vgu7l*)C_PYY<17z7+oH5Lex)vKQS#^-wq0W|Xdo+O@<_!_mf$wO_+K5$^f#^engV`ON zJRh)BuFBa|5LaiEA05L5nO^Cj&u;Yy7o@;SH2TuQ20Yg)^K>~>W>r8nmWFNEa%N(i zU0v6><2^5%<^PfY(w{Oc8&SMEQ83U}=Ckhfj|>y-T=X537>LrM4ZujtquR$iJO==w z_maEc7%4&KY?pR&=v+XkQ|vR;d3tsv67w#~qWdg2f0R3Cxhq7yp`JSM3qFxjY)$!rW1t6p;@Om_s;uxPkLqeLf7Q%P2{iAIoT5c=4TNW&GmoL2#o zg+R6`APJ){cwOU8^z2{hkpGf+L}Etnh%#_${|<)|h_SOZM=XFtdYQIpxo;A{HtT4S zxH4VoM@1IQuR-a{M$aU{b&XsH7=6>jb3>jXlqSdoc)EoosdkOK+-pkx8x}}?AM@2E z_K6GP_zcf%Q?3E3w}sD)1c!t&W?2)wG84gzT{G<)tz>-5xTlrULuQDI5>6__WpEdM z9xekn^QJS%Xm|J;>W62L!S3)Ga6(DfAY>wfab+sn`k`Lcf|G^T@1A!l9huJ zM3Rm6|4nQ!phK6@<&G?iyO28&Od%l{4{FT~k&Gq~xirZz*o|cDsK}g3()o~Bg~_KK zlCHSot1Ygm!EePCQ^if)<;dCY7q+ouwbTe&&6Jn(&nLgoLzj&aELW%O$MbwYrs_EL1%}x zaI8K0vdBj%WPx$BO0$qqq?#FKjQ8v{nyQxk(fx`if9Mn|DB|kJqBIY^38IM7m=YWOK9}5d8nncJ( z$LtvslSGeM^%2>)J$ojPU@>x-#6J}A;*J0^1`h{99B9~v4PZuNUXm8JX0C*?2f}la z{UL;JQiv21z)B+LAk7fdKJ@T@Q#TW#72BZGLJPk&9G@~0vvinBvLkpQOjW@CIOc6u zqlB-NY3C@HQxBS-5>!e`iXo0}uw^DXpEp+1s2xTY-TqmvSj`TDWRdO``=IrBTwxUJ zPH)1$l7VINUgA;5(bAFeX%#Ap)2uk-tvXI7SI;&Xlua2BaO2z?S#+Y6Xrh)s&Qr_Z zWck%Lmnm#=&UnJDVE0T}Ie@92Ce>M!5IpD@(d`cd>-S{>MBi{B^F>$OO~c|Wq_}P9 z_VA!&vP73vvo-ZgvXkip1UsbEj@GCd9gu^>_K@a|pDpCXC}8KVoeyNQ|I#9xstl_w zvqr{TNW^X6MUg1E3{deJ1V`y#+ zoNCK>(Wl~Ile>%K<8iP-?odJWfjBrr?oiwn_qVR785)g2^yhK#anCqb^e+$zLm@id zm{#;a99&^TM(9MZoQXA!Eec4hC+U#?uV+xo;ZP3^C9H_F-y7!|8SNbC8W8 z!*O>^^VPEz&t@Z3Eiawg3}z0=N0s)HD=l4?XcyQ>p11(*eM&HhXaA5VLT9++4^62- z;#-R#UgSbo1?52-sWMuI(kO@pcFG?p_PiOY;YV=|YKVytS68hDCtz66Rzi&tWDN-A zP0kte_`0J8ZMrO3Ur1!&3Gs0oYUQfcw$eKC6iDXH8Y8daxUq+gE)o+{(_xMq8=kT> zi;e_fGdF5|O*pCAsj+rsEV_w*ol;1!$RFJrM;g7Fi2kqf2L3o&1yCTyUz<1ZANr<)~a64@~KF0U$?@2^;}93y=26v;JM!W5#1YRP0F zh$>4FCT2|!G9!f8ap?z@pvf%{!wfiHOOS#4Ur4(}r@e;LtubQfbv&;m{m}| z*AG_3of7(5epcL9l-4gl3YCCxO1li8=mm$WW{Ftu+u8N~F_=iSf0?KuT z-r5;4#Tb1sM)Vv4hUNpRzpIMVl-ZtY=+IU_59*51FYNPS6!rr!ZuAErLTq-Gy25=F z{`oJnwwf`_gEwB(OK}$fy~8qO4wh>;mc=f{F?0rwhx$nK8erXpIj)9Y&S-I6Sjp5{ z#)LV{4^;DPNuxsH+4k;w(RKZzep%cpfKGZ)JtT@vW)uMFx~*!HcY^8y)`A@FU1#N@ zYeVm<9UAboP({%hfcltNL;({9)%&d0>=qG-?nt zmsMA|8KK6NyU{^33SROtrRT#!QW)dkh?;p*++ZVkxC1qeDohM^O!9|E$Mn4_d8P)o zuM=AyN=A8@#rzp_VFuAiMl8Dn3>k7L?^@+mJd8Xx6nSW*4_+hIdEM%&KSSD%zQV9E z2oWT$5t4W^&1GL;LYE0o2U&EE!J{Zsl@r>=1|W<%^_jXvP@Y2^1|cvhcEnAi!m1GA zFzwVE8zh!SY{_N9oS?Igu){v0EOr1R=P~mRkhb9DMUSdN{Sn-Z6aEYAbZ6rd`&cGj@x{N5yyc$3=MOQi8v>uhGu!_sWkW8OZYlwm#NYG!CgIip#C$ zFEVQ_UuD%_n~PXiMGsVALnVSTigZU#Lt|XO5kn&ofyhR;dEHQsAQB@4U+KD8tSBY5 zrt;Tv8~0Yr0!V|rt{~~96-`#H)m3(X87r-h>x!nJ=YwUKkc4-bhtcX>uv#|- zs~-wb_BazHG09cx;&LjmYsZ@#3^p1n{=tEbRwl=_HIh%4ws=OoFbK>U4R)@Xw#jmw zn@Fx6ON7sGLb$uqN=f+*N%@URL|JU5ZNPR@?CNAz#_EFb%z+FdCWG=T+`Ygz%pz<| z*5!TClP)L|N+Fa@C3=c4Zg@YTHwLX|nH)(fy&a{MfmARELa}sTWEXdEB2`t=33Ws` z&962KBu>FPwo^F%s$c$lrFPO(Uy!Cyv9T`BE=Z&)E3OGAgrkAAfvPWQs%}eICCJPq zJccrjdGn3Y!qnI?EQ}}Ot(f7+$cl`}Oqk$52og%u__iKFxuch*>8O9`28HlpQ%POA z$|G)QO=Q8$_^wuEJ2lbq65_)-Ea3?uOK8MUmF`>S_=#LV6QsZ3UgPu$M54G|JnJ{^ z9vi*nWM(&Ha(?-)6|B?f0cqn5LDMz$r3LD}~fEM8=6ycqF--Kmsp*R{eQ!mImhG z2kS#yg#4&o-l0BfnU2%+_wPg3EV`6z*V=>%p9gBvTyQZawxR);$X~2u;I(d%# z!^Y2g2J$=>KfehUCe?-A5sqt#J72^U-D>4M#Wqu{_J|Bz=V;1diW%ys0vvP1zNc2Q z!KwhkrGU;Y2{8cJG;|W{j#BqBGi-K+8ATw;wju^6Ws?kQvStwR+=@3;D3+G651>J0 zw9JJfPEoQMRqgJ!P0h+q8X z4dcG4j1pTEf{n4`*hRi-jPQ zTvBxD&jK8ULQhUAK!5-s0(lXeYqS~~n`>C7Bu3_%z?o};nz;sC$&wkwHXFGWx&IP~ zs~D=nV4#|lQY6GNWec$9$O@u~Il2bgQAJzeEen#%Ssu*VU<(q;?=Ck1Wib4>aXejA|EMx4h8$3mn)8vADAWw2#Eh(J&T4ijoe|*U=Hx{GnC{d$ zbhuRCcyd3s&KQ*cPN%md6+$e*s)SpFfePbR631VF*Xc{@R5yuD^d;;pHmWEFeTj4I zOz*UG;zkLFl07C#m*|e^(oF}mT(xO47?ABrHYOR^p!8Vrk|jxMvo;ig@G4XqqrgF( zpdjWs*7~tg;D82$sdfqy>;00tAg)pg@3TIUm4%%q$y6n6TggOp-9R-MW%y%Q+Em5Y z))S~fLm{4{SXB*lf`BdETrjT7{RnV$n<|(-Oyl+6A*qb=btUXrR0fA0L1k1#*zZLE+WD-ikgDrOWd7-$TFO1;K9jD)t$Y7-l5C5Sx6d!j%vhC;!s*;18L;A#_E zlniGZGFuEuD7R)!;rx?C+{@sO{1?lQ4Kogj(>a+T^2(p|yVS99bxBJv;*%O3T?bk; z-WhK44HEk9<8)_5=?`_vVMhEx%L$Y=y-CB9fjG?OnI4VE)0(Aom>E7b8fCt=(FoHQ z+XR8`fzT?Jdi{p$%s@i*rkbQ@UV!TmlShw1he0xGa61XYgKZGdw9yehK^PO50h<4; z@T4~J;ovO$v({M_OYh3C2<^s3paD?_p5qS2i{9 zn8-t2q%zZua%JPvob}vF&X!%t8L@h77*^7B4ijnlkMFZQuICYI> z2D{v{j27BCnc&fX-lsII@c)R*p0NGlg+(nI0gTm?Gez@JQX!yU(Q%|`&Xi?sj$r?Q zJ9SILJ5Sm1?MKp0hHgKiH%`t>l?hPn&J;=;Xwe`rI4h5d?!YaP-{+@&B^)XkNNH54 zmq7(&r-H^th17g&aEuDoorFVoqvx2Y5Xx*Pii!s32`ao4xDbd+wH5tyVG3?s+VG^G z;E7pIfifiM)pS2Vc2s3~z37%`=Z9Q(fvFu<~D-3=O^(w zDVcik+2|53SvJC|8)h-H+i8QWd}|nhQSnRDWs318ECOo0d_j2{g^#{w^)DEX#7bOf z{(^Cx0Xq7g)$a(yR$e7_k$fHC*dUsJA z%fY7!E&Qtd391(h$IwU6c{S+^4FI&2o~>LoYK&8{6o*rH$0`uRxe}bJ2{GU@EED6duZ3?qcBvUS^y-z~ zpRqsYi17(~1EPdg;coULuxN87+j5284*5j1v};F6TdSB- zG6&+NtFKh=UP5n2X#%g&G)3=1AVsrQ&mdO4o{g^FQG)CkJKWKN4SiQF!rxIU#StuP zmrml{<+b72^~nNV_W313{2J6sYD7OlmmPVe~Mp=E|Oag@{;wiyAq zYvSX`Y*~w3kke7g6Lov4veB|?gpfE2IrBR$HH=U-0#j1s(?fj+Zpt?}dvJNLJ@w^1 zL6f|22Q}${JxQsmcpB4;$LJtiWVBJA)0}pod$LiVNx(`Eie!K@&b2!)yQ`w%(d5>s zDF^`(?Xit1DmJ?J2N0Z{HjP1o_egUk$|hk%L0#n+A$f&#nX? zZl`=h^zIkqB5vb_v8hvrvu2;;1ztx@wrR?*Bo@)CPdDKrD6VQy{PO!0f$o@w!c845 z`acxykBk;bZgIkj_s%Q*XC`2Wg?7EhTt)4tJ8dq+%7UQ-z(-->;20G+Eac3)&GcE+ zT2N5QQ~WAektz7uV3p34kt9%K-O`A@sbX8fVEdf&vSYf=2uER#d@KRPO^sf5)#^6& z8uD>?Gy}eN#to(XnNmtjrc%OhHSJevl)2L5a;|7`XLJimB`u_`@n?!uJlHZ089HW; zDdkkD_dJU_Gv{R1ROtRNGuI1Oddu~OVAFboAJ#3)=;*29vP{TB5@u=8j1vO))N>CV ztQMfhd$`}I6Pu%-Iv9Ch?C7XsdM%z2sl+-9A`rB2bj@J|yUx6$FR_Nm29k(g!z zck%BVx-#-^*N(NPA#lm9j71zT$&OqU_IT5l41LfU5g|`zo`I=JM_=FbKRQf(R*_Zt z8>{c;A0JJ9Kg-+ZC8rla;NZGgE#kzYw=#UxKQDGBWvvNxV~N2LDp?!Li$)*^XB)KR z4v9Wc>tOoExM+leQaaNs~X2!IR# zkaokGKK^cBqdQ=D8CGRBu99a`C9k8Zbms0bC%q7(ptN9APMnOT`T<5z%{rsB3j>

>N{q@2NEYqjFJZ^$hc+va3O1hO%$5Vkht+$z7Dl zgGuME3Olp}GhbrDqf$s$=;SfA;svV!iX?ChLn8>*sxb@>cww`ccR>SnI>G_bAylq3 zl9{k|dQTMS?)o*1D8xp1SYg0F4VX^@_P8B^5@6~Ao z8BN{5qqy5l9(*(|1%Ec~_L_OqzN6w5CkQjr#8`zu`o8q?K6AGQ@z2Gt<^61|rW=<8 zBrV?@l=cl-&dl;434yUs4b#EG)>_Ux-LG~_4m%7Kouv2R@Byq?Hunb1(V+jaZ|(D< zQ=|RgMk9Gfa~qX#)bb<<}u3(i1~HdjK5 z*(6vu)G{_RjREAqLJ444FFP4&DgmmIN%)#uHFPM!LY>irX5*zYMhE&t+3o-G)bC0K zfJ$}eSg8hceto=Q&5_IT&O8CRaTpXL#Pq(wtOvidU1)eGsGqGY9)#rRd5iu0k3h7SMXF0 z3A6LQG6PIthLB8dVOYAgp;mm66#|a@aNCCEY-Qa!*s=fbjCyC7#yP6@^e!AW7S@|s<@r)WrgfCaNStuTe6MyE*s`H z1^}Abpmn@lFepo+FEB$zm??cOW*eIRVV!clL$!jqitsa)gw)#IQ)4!`PsD^+@#xb4 zvVn~!v&CeNma*w#X4rI*St6vT86(&OirQpR!+U6UNLi`bA=Lr0>$uU?#go(DWNlKi z03bDU9T5~g$*GI+<+bd2=;I&y#m|5E{G`%g-qy6D7Z7AokW6KUaHlO1g6ydc@UqJJl>=TG#s&ckNT9vwfb@fI7q7rJDVO$wG^5X)T*n2=UH_X_B3re} z$Mx+nOM!sxQ6rkR8bbXY4%1=u&@YjII_Xv5MNid2YFqSZ5(Emwlp&zDq@kCh7Et`? zi$B|^+qM7j-+Aowqi_D4=ch8|e`9l{>cQ^zJYQxBE_Fpa*7hl4@Br`ox2)CcU_)2*;Q>oO zc>VIO=&N^KP9g*CzzxgM{;4Cfd9dqh+32@KTxnhCcjk^KxOEJMChjBtfjn>m)roqT zOjywBDVD;5PG75Yq~Q7n><;J{TL#g~cxM%NnfyWYRT@oY)Sd1X9eRmT1KUR@vuYYV zmnlQ+BT~|>d_|-bzK=TR(Ch$(uqZlXJCPl$saw*0D~{E4Up*@OluDuf(5)Xfs(&Ge zIvp-BqBNcFSd8|9eRm>-EWZ}A6Djg)2V=qMzB+xS;%fv!j+9K4U}c48Aey?9k%Xo9 zy3j)_=AT^Yv%jx%8r!Z^Yp%RM}t%cbMKII35Ber!xd_rk-YQ={7i z(=#GJlI$pbD8oU@W}v}>;+9A?O+iSS=qr423;>3nepmt0tsPzLR>!G&iLD&kRwfcQSw8C-ZnvPyr?g(VqWa$&s;E}Gq- zP*6%UqMbICUyvNs$G9!-gSd)rzm$sQA(x~D)NC=lC$<=EdU19aWV`Gxx!CTK+%|y8 z%oImynb<+3B1*qToJ+sfOg?h@r<-&z(7~uvNN*rwrU(Y$)M_Pnw;p)$6l6Sf>~ueR zH!Jo3E!Zb(+5$vwc$VaF>H$qMI*^GkS!5J`r6?xhQ2UmgJ{#~kWj1EhzN^luLP?#I z01UcvaWTe9R~{LVqk>`3ck?$#>GY@Jm2suX#;}EZx*|EXAjfi8wAb*QbH^<(--Hy6 zmLlPqbGS+044y?QqB&hf;iyHl;;6xFQqSc4I%X$!gO^Yck1g>s&1VY61PY9PF^Kx; z9+5n!?m1=;$B_PdX)1-OqAtC55}*>lN9ve%D)ifujd;)+ffzsZwx7c&=+r@rvvS{s&suOqD|^C^~M(gszCI~C5!6G89kkp zen%btv9OT?BtxFKan-;>Q~HEN^>hck!)NxWUfl2pDQS*37|5K3`4CH?Hw@3RO=D0pY`zauPsKd(FZ+-$QI3PL#N}g4e6U94 zp@mA3K^sLKFhI?njxSOVcnCex=uvZrjDQ)bdDh5~tawCYDFZF)V6cyHgqN#Kwxpuv zW@$cMDpMw10}q8Ts*FyELCSMoY}BI&**={lB(u^ZwZVTn0m`$9N|w}J06pMb7xhf;K~zSSUT9};y98h|Oc^s|&(5vC|kL0FI< zqR~xvdJe>d@HLSj4JaCGMbu_eiX3Y_v{Z$EW7lwNtt^IqjHx=hb^x=Z+hx(Sy_zBDHlaD_5xJqdjxn6cf{N*%Me*Rl;(hu*J! zXSLY!tT$M#T& z&H00OGX%DeuAspZJbM3~CmbrpI7@NoZGZm0V@YDiY>rV9J=m$L2LI)TPkwi@5@OyQ zBORyl(-iJ=fiFil{%{{w`{*tnv7uQQL(zyaCb)$yp5y?P&w4#D=`o5$<>&%kV5;XZ zAfo@%HClfGWh5LMM3L*WUU!#l%<94@P|?G?#-y+y`oPybn~LJ1WCC2kSM8=52MtL8 zs+;AT1g@Sc+QRUD7V=aJ2Yp!0F6r<@rixeu2>O9l%9Pwy%B(W3G;1i*-)VyWO=H@LK)&ZIU*uW*# zUo8QSP)A9CwDKSxT@bV4ElmN@=Qh0LrC7kaP*ZoH6zj|cdYE$2XM9D3)gtO`Y8lQC zFpZ5UT>2w9j2yJN&;Vv8qpm-XH*O=xjh+x>A%rP|5y3bta>VN^wd&JV5 zTI?h+fTbE{Wx$|Oozq4E1uCRe1t<+nXs)9YU8KaCFAnwzMAQXCPU`9=5WdduwwCOMnht=Vb=T`!U=mdp%Ku@92^Il}wfA(B+MZA^SQL{$UtW*F)8mi~bLOL|wSTfK+7PP}xRw zp?2&@EOHig$O97w*%^X4ek#p%M%uDcde(Q7<=Ag0(2`UGdA0acTVZpKdVqcC1T!&32Cqf@W^LyN z<3*Cxj@4t-@6eP{rr*%6Ov~sC6IbX==az9FsWD(T_sB?sz{YIJioUMNiGabF3Zx_m zQ^8tHMRbS+(Gmp`1dA&Y1eXzyQJpHyk}70z zhj9Y0^X$QYHcMdur|c#?=zdsj!rP@Y%+(4bO-Gm zBGQS&u_8f~jFeUQoy=F7nKF?DVVJ^bCPQ^sba2m01uma+&(3JiV78mH#!#8)PRVd( zQrnbIS{5pd)NXs>KsmaX7G-vTf3_+>5s*wg8-0m11tt{w@?Y6}0LKA<1p%P|ogoIk zOG^!h>lDKtcu;nz&9WZ>XGjs-sbvNskqOe&avN$)ozy^4#SE6(xbV`0#7nDL8mvh& zjV}$7baPCz8(x|vgY-OLl~!pTpDnHR82#+uFv*HdF7lng*soG!-Pljf!P^Lg0$OMJ}fU~=rVJMBS-xGvYKkx`W+gV zONHstrV}uVm}s%ja?1zE%jlwtKGPr4yENjJeZ^;O@yY%MS5yVCKPGF7cob8CFme9wR#9l13|XQaT!13finkd z-59W%33HrW6Z`;3YY^d)P=gexYb^k3SZP=o0dzB0gV-u-FtAH5{46W5n*gDBXy8kl zQpw5#*(6p#UWcrJA}3h^HOWLP&4=T=Bod@mm)$aP$t^rUB8Y|OewdilGfo1Uo8xfu zp%~GD<7O9XV^T~QBpV_OFVt8Rjw_AOrzxjlqgWAx8p#~Jm{e7Q!Rf13?7o+&-4&ZV zKDJ+JT<4>c$P%xUma7FD)l8toB|Ply3=aCIK}!u_OADBMXY9ybsbb?suUUk<=n}3; zhx-*yl%gLZ-=(k)_mU20!f39yB%((fiz8`M%2jNB*a;VYau=Ea8{~xD6>!0(z)|Z+;Ng!t1zzhTew0 z@G9}t$KYvt(VYkr*wDkrInJ8WqBk!?5ElqHUZGY<)wD5y$0tB^C%;{7OCK zl5#{T;>XTwMjerX6L3#NMwyv@t!ZS^j#xM`XB^tBQ2Uw>97a24cfxV8A8&_gWR@$%tK1an|*qCd{ILzq63tZ=SM0Z|y zUSplB=g#XcZZzvvA)4iCY>-*4z+Tp<=RA@RL1xLaR+$aJ1P<93tg#jq+w+D#z?~(m zjh`A;#p~!%onMhHm0E%rIKS3|#>32@5|wa4)G8x;lsd!uGwcm-ot*ooMGwcdTx#vc zkbMsV(R556#tX<|9>xl=wcQ0iA7C5zHeGGvtffyW8P zq|oY`L4k`B-zl|Lqio4zmn^LT0cG~lbP16BFjJ}sD}YPXs(|g8O_ZT7uS{4#i~v}L z+v>&*akvhaW`am~e{|rNq>?EqamOH-YNizXNtwW*I`duTsR^JS9)JhHOG_-Gz|U5s*J%ZR;-c&7KTh$^%M(_D+uc_u*!W*xt;+IErm<80o{yt)h*OI*M^81Jj zNpRENYp#(byjCr__L^&OOe;MkhtdFyvf$OE`5OwThG$kVqpj6LQ!mF z2h-SpxD>=Nh1at%RTQQ$G@0>3niS$+=ggsZUDzlEimMJdDL_k3vKz|eNUzZ!*)DxW zl@Vp-Gc2sombzVH6KHQ-RqRftv*f0kfh5D80JqY?U&XhK%A@Yk-j9m3e0n8LjcHN6 zBBy2fw$j4@Ck`GvG>fd%#vy7_8}U{VHSqh+wHf&1;6AVP#MW*7TXuGLx3%~5Zfo7v zyR&CtV|VYSu7SSRp8nQN10B6Rn|gZ)@!HeYe)ZP&jxAdU20FI2Z`#`0(X+mzt-qb` zeVcdowDq^Pwe_|4_jmN{YVGc53$N(t8CbeFJn5uxZs>WJdS(9eyp8iJr$0fOFv ztsVVg|JL4}-EE=5l>3>ueA?wb#e0Tt`sts~Pj%<`<@u$*7YG;m)$!ZZ+rRCq*8Xkl z`v=-quB1&ny9fGLu1qko-hElQ^6VHjms*O`50Q=3+k1QZ+gGk6oxPnoJmtXd?d=qQ z5x8sJ(!Qo=bFbR6a^;$y{(;t>fsWRJ_KW(rjG5=$o?R~OxmUMu+G*+HcB!5E)$=Ry zYv4C7e(HM@KlKNqz-tZ9>FD3y-MTyM*tWg9eOr6aK&!ew>}wy`+1JzF7Pj_;?R|Z{ zec{fY_N%wIZyIQC>)t)TZ)g9&ruoa3En3#zym85<#S5AjEnKj)ZRzH=<(oFISiE54 zveu0&HnweSZQazqY}5Sij*We-eY@wkcGLIs`}_C}^mX)Xnb+5kLqkyZ)&k3BIzVtv z;HQ7;vx)q6_H_01Uey!sYVGR)DdC0 ziLOji@NFw`f-^}oN#*iS>5t*3dZzGG8`5#p2v6rXgWpVk$MQRl-zV5yFs5np+-=(jb^~7;zoJbL+sz=^;P}AGl{TBIT`{WHF zV~C-%;oQEy4G?Je&UWtv(ue%SYfj{s=9UWGB{H<)v@aVt;Z<|KXzo@VoYGQZyy zJpB?Fhv8`#97J5Lb$|iB5x&$PC2w8ryA2Vi0Kfi;)`i1_H*RxWuzx6PyGrYCYaM7k z8@}Az4=)sR-URdM-L|o{r>lh@A2-6PoCuRl8t7dg%cCnvEdJTu-rC2vZ5=g{W+`@V zr|5PUVX@mfw)F9(r~Rt+n|j;Yk#XDlw{#5g;`pP9yzbVG?cME;_x?uNp?4}cN&0&Z z?}+r*(%;?%h2ec=Xk%-C`_jd8 zo98W9G;e`%A6FgBXG^i{T>%_@{3Per#g&CuZEf!v0t2qxyK`Xs&Vg{_&dr)mDvs3~NkARw-4@9qx!cW#&d zBE5D%N+eZF=baZ`#xv~Q47=!~p15=EWiu*lzhF`!Z5?7G=x|^B_iGR^h}48fMEeQsN35ZybVod)58yyAF}A}LAmelc)Kej{UKG(C6qG*IINzn zJGZs=kRcU65Z4pW1TXLHH5xb3AR^h?x_x_l4^$xJ^M5NtXA3=Q9sBx==G{hq@sk86 zMFzFxP7*#L4zF=D^z&Q$x32E(+r}Vx#Z`DOP>1lElzCQMCMquI6c-2=!T=e$Z6On) zP3<+>2@&B-4h=kIo?k9wy%{R|%n|TQZl>GwwmAHolo@AHeW6Mq`Pq+PGU(`GKEychhtXk&&_wfW$9fU0(3SgK)8p=$P&WPRLY{8{7RgoV zIG62)6>l@jjI|_8Hzv7;g3cn-)4Lw+cPk3NGj9{ZoXk@+ROKnV(#bp}*Ciagc^7Yr<)wFZoJKt1rZ_H^u?{rS-o|&?tp13nbceVR zweJtcWt>Z#=B6rtHNPujn~9YNAA6c~f;S<9KJ<3FdUv?JwXbzsJK_UrQIm~MimpTz zl^9!q(*FYaH5QWm{T*9+TCose(=ax&c#_jWlK8DKm^jM2oH*eihKWuwsBDULKHmki zerxn|{OQsdyh{XK{Oz)&O2@e3uS1-yx66w4yvL~z(c^ucr*Nk_620pJ-hbn?x()TD zZ#R^BDaI8f`F0E+639|Ku&`cwjI$fP2t041{uTTLSDYG49|jfaBTAfPCVr57vhO7M z#GjNe88IVll>J8XH4CL10nRRQDEnkW^R-NeHEV9{=)s1!a%GD>&pfjuw)Q%%voc&Y z*^PmbwD$(SzZTltPX09QZAa(n*koFkBR+8Q0BK|!i>U(nGn_u3Bwjjl5}&5e7l;#m zp2x($kAh<|^2$@nrdPDI4s6;Qf1S;@5^2YxW%2q~NXwV(+=!AmjF68+-Z6BH9)pMH zK48&5I*p;+FUm8}8SdVr#7SPB)3K`qxx8_A`1ba`-j(6Ad{?eyzO1w_@lA7RibRh0 zg9E8Ers`qH36;bvPj!0GNjx>STw0iiSw126-cVMb@O0vZ=OmqJ-kVumX!E=T-Zs*x zzL>AOIlT!c;B?bnigN~HRX#|1*~@Bu*M4;^_5tF=_mVi-is<~eGx197zGs9iVeD+} zKI1XcO4dEcQ~V&w(_&_ZT9KYN&9!wHJpf3^chPaooI>bOntl!E%ZZ;%{OiHsW*K}_ zJ@N+P1m{p+B|XrOw!f+Ua^e!&kzK>}Tg&b@(QE0r*AtiIOn<+U@0Z0r*G}iSQrD|b z%qEbO{RYxu(}J(|D;cb3OZ$K&ySR5?wfaetD#pwe1Dlt}ujjX49lxCehA#ub33|O@ z<-d{g9lGP>4!J|b8zavR03aZJx*g(=Y5XZgI{wYXU$(XTvaNlW^j>w*&Tec~QCnL~ zNzO20GV80;o&5bePuZHk$y2;D!5!uH_VsRW$J|FR4Ts?}(pgkb+k*JHaCE;}3BzEM z{$Y|cA#6AHlELS_aYotMhIoqp(tSJxPfy!#Qm1_@^&~p&+jw8kPrS7C=+=F_+kri; z)2eUuFVShg0-hh?_XU2R3CI(Gs7VnHzVvkZ-DQzmmR%KhF`U{&+Y7I z0xsJy*1{#Rv5=Vg+j`rO%bs^L^{D;d;V1p@w^3hP`+U~O`Zu+1m%0AtmTj5>NWoNHhgDnr;hSjt_)Ffk%-u7diyifA|5qW-FxB=D#HQqhcD>`{6zbd~Z zyodKW{AM5L`tE|u)?Lg*RFhB41>0J~*3AN6riE@{^*t+&tq+)X20QgTqdS?G~o%7&^9gAe1+0by8** zRcqDAqQqCtnPqjd=}(*N7)*TTE}yqWRk(uciy@2TB$Ra)EX#AOyQ$mgV(ikC^c3d@#e4{8!yOh z4L1z*?QCZmbHnD=?tZ<UNwZ*aP~Q8 zH#dKO@I&XUUcLI{S6e(_o%Gh>rOU!JtoY@w_?9CVuhLekv~{c1+nBi$bz?Z{#)yu4 zbc~!mVXslZn5A|@Nb^hu?(H6;NjE-4U?T{{h`xXKwvD8wTQ+Z&MROi@-HMa-7xEOZ zxq_$o^Y?w)U+Zon77A zw(sa0o^D;7@Jdozy3Jc$%AQ`*_7Cjbb=B3o-#%2$sdMJde{Chqn?F?A(Uf#Fd4_77 zyZ*K1KXtwwvJU&tV`q6bmoF6S>Prm=4>pc#DvzHqando9U9Krpr%j(R^Vs8Nh1Qb? z(PS;>C=^`oqq7(8E2m5GXD4bYmhtgq$y{_4H$->A?$z`mmrOugw7q& z{P)AaLC@FVRO@Tqn4*qht)D)_wQqfq^ zhBFTye3kTn*1`XG=%3afJnL1q|KRU>`=6a%_MSb7---NA;CDQ~-z&d{`Oj$KUt429 z-oJFRlm8#&U4BbDWs5o7sse7J&V6AhujW0{9g?y>#e0|vf0}pAsgn4Yc$Zx#3ICe+ zN-8`NnFPO(t;L=60GfzAR#gv3W7X^4b%c7gS#ndSs z@_CFTvSDuFm)P&O^4`I(Gxe>D_rwox-FDe?M*87}8<=~y$9{P6?2zei$L8HOd$nrA zt-ZZn&T*jC0TQovYu(BFB`__fp2U$Ar$}pqWmQ6E{EO#0`=aL2qL(DR8br&_CJCQM zSU#KE_$9WP9^QNTCGFhK`wo7ZdCPVuI~gX0VQB^k?~K1C_Pt$%ui|$#zXaAHr`x{P ztJdQ+46GO_TERH0_Lz?4rA7LefM5P3`{Q=xfm1fK)_5Vu+$=O_XSRI=XW`LRZ{9W_ zqsW`*Is5Pxl&vv)^5~QR7}LeciGw$D+0)Mup9p6&Yv0g1upz{0S#ZcR-9A#*LzFE$ z%SU-m;klQmX#4khs;)nR_%(N0jdO@hn`Uz}i?iqL=6iy}xAWdE`ykKs_jkl$9#-ze z5%JfI2#XG`<#!#wcoue*`K!|$S>uIPa~!dNYzuKJxheE-quXRH*lf)Vou$@{?5R}U zvfqxKsv};VY3sntcjO#49s|zQkgWZhONnzjiD$a=yh^j<6R%=?t?Zuf>_u0SSNKn! z@8Vtm^z9~oZtOT$oRdzP6W$!Be;>~b@ku$Zlkwvd6Wb_bS^r9Bb%G$E2lFCw4lbew zzF@9Vhq-p0jiC^>8&CSgVnin=NYF^yDqH>f<+4!FIci* z>4IeomM>VbuzBHvg$oxhTDW-Ol7&kbE?c;K;fh7gixw7u2Jmo8blbm_9C%a^WL*1T-NvW090SiEe>vZc$GEnB{9#q#Fm3zjcjzG(U4@C z_I|=2;CBnZF;N#=I3HW+aCaljReU!IzmKqF@2I@}NF(f{?b|kO?F0A4MXqnP_8=J8 zAj6<@Ry;?WaxxWhx)=>>D?*=Q$JphRAv(B#XSG%a&dMjtXZ{AzY*cD@z z(L8MA3#S`A?;DHVI_!R)rav);#aA}60^cKHA=J*+%gN3pCWOk=Oy2Smx8`shPw|8* zPvQQhxQrpou*|lOFjkNbvw^HO7Cz?^u4L(#DqQ`Pn8hCvQzzOndyZY{>)(3)_?g!Mgjd-u>S9{b}=+Z+P#`x6J&`xTdui{_3T9^Ur$A zTi1Vo@B7|=>j(ehlYjHsFMav%zxv&0e|XT#j-PPyg2l^Lo_5BX3*Nf-{X{Qt`X?X$`>#FTIR0clt-12eZ+YALw)Xek`WIyR z(%*mY*&iNg9DnYbw)VljfA#R^KL3qx9{AY}zyIF5KK8lKf9Welfm#3K$*&!}c-@=cTqrh`Pn!RepZ4@FJL9aDb8orzvMoCw{re}r z{?xaA{PICBTwlHZd)e#HDbC2|$M3m!+~8m4X4UPPk(pNXv-7iyvjvX)$QQ=fU(z(8 za77`LompR(DP{_pfT7Wl&1Fh?f7~&-iwiRfR~CZ&) z8N8RM`3o+}4Bk~dJ=2sqy|BD^YVP`jO+;m%Re(tnF zFm7ty;OD9X4TJwQy&*SvFgN(UhJXKXW?9{yw@ey*s5tl!x%#Q6W$N?Gi>r$b`GL}L znKxzMST}gX)S2~@>n_X=z9;{ecQs7OF8FA6&$mx3G~{xFA1m+qMZphG$rJm&?BM4z zGcrw$Uf%aWWzV={wero@NIv8?wR1n+2?|vga@)O1`w*>aMEdKUcBxDANk1t_m1~|=nww% zum0x7Pv#4COV2p-^*?{&>)ARanzD4o%6tCesc+RSyXDq<3iYR*xw+#5AM9QK`JepsO&ec$>EIv#$-Ma| z&A#HpcYgHG?z;P)`~K$PNAjhHV~$;U*150y*xir)S4A-WBl+BbLgU;WPO-gDQ-?|)$56Q8)hr}sl|tG*+b$X_(i)R;4 znLPc(nUki}T}%b%G)^nj=g%*mRJXHqR&+}Kv|N4ub$LHm&g2H)yYaa5i}iyadt3F~ zQhmO0;>vve(mB~FgP%FQ?XrgR>*`mZJLCM~WsPh06js+Cn>laIvdp+*eSSrue$Ucr zgP-=B7B=4SC!2Sc1|NCPg_|1p&i}yIuRrgjpSgZT;gsxK@+a1>uAiNoc>M!!ZeN>S zQ5e5UH1LNn7We+sDRqDP<2{S!X2xfWdv1Prwky||sVkH}xZ%9Ifzt>7qrShm{g~B* ze>|z-%DQQT@7i--=J#8gj@f(3tifka9sI`J%=B!qXVt9nD|7zd{e!3C~Kem5PaLK3So&-K znWcVxW!dqK&n)}Pajh%nPyOhM=9$l&_w(Z_7ar(*X5G5p$|WCu_@kG2kGHmYpPH`cwTU1K&-cCA-PzqXjbhWLF>BPKv0_YAjEzF7vYU zVg1XG@9Q1+U}G15H{3%#b~vTvggUTN_NVLEQeY$DkD_YbEJt~cS&v+CAUSE5!on;% zLlO9(0G1VOV-(4K(2#<2AQu%dJQXle(NM;Iq5(L-hQf(P3p*gQf)y@`c0!b0!3$N+ zgU?h%DxyY_#FVjrkc*OUk4qaX@On7{1gxpZ)kL@r=4HCdmhgaK4dR%Tn9p&?Bb88W z(pz2sMNFp9Qy_EJW~F0U8`c9@=1>^NBObwH^URUjR~bRlW)YDgEr|Z1f$yuIpsQjs z9VrRBppzoBQ6S$MCXq#k#?Q+R+lQS!$7aW+cj-Ke4zE#ne97Kqf;XJoKZ#?ZS@x_i z-N@s(D$7$F<^xXStWZ_8MS3qV;8!#olt|UOb}BUuTyIDap*%^&K=#&5i>x3$ zbT4zb;@9H$9%qy&>y=js%qsuN+|Zv1sG*TyN=W<0D2Zk)mb}aEXKwS^?*ILoF(-?; T-Cp~nb?!H{PiimKw4VG2-=`A) literal 0 HcmV?d00001 diff --git a/tools/integration-test/src/tests/async_icq/simple_query.rs b/tools/integration-test/src/tests/async_icq/simple_query.rs index 2efa49081f..493d034b1a 100644 --- a/tools/integration-test/src/tests/async_icq/simple_query.rs +++ b/tools/integration-test/src/tests/async_icq/simple_query.rs @@ -1,10 +1,14 @@ +use std::env; + use ibc_relayer::channel::version::Version; use ibc_relayer::config::ChainConfig; use ibc_test_framework::chain::config::{ - add_allow_message_interchainquery, set_max_deposit_period, set_voting_period, + add_allow_message_interchainquery, set_floor_gas_price, set_max_deposit_period, + set_min_deposit_amount, set_voting_period, }; use ibc_test_framework::chain::ext::async_icq::AsyncIcqMethodsExt; use ibc_test_framework::chain::ext::bootstrap::ChainBootstrapMethodsExt; +use ibc_test_framework::chain::ext::wasm_client::StoreWasmClientCodeMethodsExt; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::{ assert_eventually_channel_established, init_channel_version, @@ -18,10 +22,21 @@ fn test_async_icq() -> Result<(), Error> { run_binary_connection_test(&AsyncIcqTest) } +#[test] +fn test_failed_async_icq() -> Result<(), Error> { + run_binary_connection_test(&FailedAsyncIcqTest) +} + const MAX_DEPOSIT_PERIOD: &str = "10s"; +const MIN_DEPOSIT: u64 = 10000; const VOTING_PERIOD: u64 = 10; const MAX_RETRIES: usize = 10; +enum EventOracleQueryStatus { + Success(Event), + Error(Event), +} + pub struct AsyncIcqTest; impl TestOverrides for AsyncIcqTest { @@ -33,8 +48,10 @@ impl TestOverrides for AsyncIcqTest { // Allow Oracle message on host side fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?; + set_min_deposit_amount(genesis, MIN_DEPOSIT)?; set_voting_period(genesis, VOTING_PERIOD)?; add_allow_message_interchainquery(genesis, "/provenance.oracle.v1.Query/Oracle")?; + set_floor_gas_price(genesis, "5", "nhash", "25000")?; Ok(()) } @@ -52,8 +69,8 @@ impl BinaryConnectionTest for AsyncIcqTest { chains: ConnectedChains, connection: ConnectedConnection, ) -> Result<(), Error> { - let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(0))); + let fee_denom_b: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(1))); let port_a = DualTagged::new(PortId::oracle()); let port_b = DualTagged::new(PortId::icqhost()); let (channel_id_b, channel_id_a) = init_channel_version( @@ -76,39 +93,229 @@ impl BinaryConnectionTest for AsyncIcqTest { &port_b.as_ref(), )?; - let driver = chains.node_a.chain_driver(); + let driver_b = chains.node_b.chain_driver(); let wallet_a = chains.node_a.wallets().user1().cloned(); - let relayer_a = chains.node_a.wallets().relayer().cloned(); + let relayer_b = chains.node_b.wallets().relayer().cloned(); - driver.update_oracle( - &relayer_a.address().to_string(), + let oracle_auth_address = driver_b.query_auth_module("gov")?; + + let current_dir = env::current_dir()?; + let echo_wasm_path = format!( + "{}/src/tests/async_icq/contracts/counter.wasm", + current_dir.display() + ); + + driver_b.store_wasm_contract( + "counter wasm", + "counter wasm", + &echo_wasm_path, + &oracle_auth_address, + &relayer_b.address().to_string(), + &fee_denom_b.with_amount(923290636u64).to_string(), + &fee_denom_b.with_amount(11000000000u64).to_string(), + "14472508", + )?; + + driver_b.value().assert_proposal_status( + driver_b.value().chain_id.as_str(), + &driver_b.value().command_path, + &driver_b.value().home_path, + &driver_b.value().rpc_listen_address(), + ProposalStatus::VotingPeriod, + "1", + )?; + + driver_b.vote_proposal(&fee_denom_b.with_amount(381000000u64).to_string(), "1")?; + + info!("Assert that the wasm contract is successfully uploaded"); + + driver_b.value().assert_proposal_status( + driver_b.value().chain_id.as_str(), + &driver_b.value().command_path, + &driver_b.value().home_path, + &driver_b.value().rpc_listen_address(), + ProposalStatus::Passed, + "1", + )?; + + let init_args = r#"{"count": 1}"#; + driver_b.update_oracle( + &relayer_b.address().to_string(), + &fee_denom_b.with_amount(381000000u64).to_string(), + init_args, + )?; + + driver_b.value().assert_proposal_status( + driver_b.value().chain_id.as_str(), + &driver_b.value().command_path, + &driver_b.value().home_path, + &driver_b.value().rpc_listen_address(), + ProposalStatus::VotingPeriod, + "2", + )?; + + driver_b.vote_proposal(&fee_denom_b.with_amount(381000000u64).to_string(), "2")?; + + info!("Assert that the update oracle proposal is eventually passed"); + + driver_b.value().assert_proposal_status( + driver_b.value().chain_id.as_str(), + &driver_b.value().command_path, + &driver_b.value().home_path, + &driver_b.value().rpc_listen_address(), + ProposalStatus::Passed, + "2", + )?; + + let query = r#"{"get_count":{"addr": "{my_addr}"}}"#; + let query = query.replace("{my_addr}", &relayer_b.address().to_string()); + + chains.node_a.chain_driver().async_icq( + channel_id_a.a_side.channel_id().unwrap(), + &query, &wallet_a.address().to_string(), )?; - driver.value().assert_proposal_status( - driver.value().chain_id.as_str(), - &driver.value().command_path, - &driver.value().home_path, - &driver.value().rpc_listen_address(), + assert_eventual_async_icq_success(&chains, &relayer)?; + + Ok(()) + } +} + +pub struct FailedAsyncIcqTest; + +impl TestOverrides for FailedAsyncIcqTest { + fn modify_relayer_config(&self, config: &mut Config) { + config.mode.channels.enabled = true; + config.mode.clients.misbehaviour = false; + } + + // Allow Oracle message on host side + fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error> { + set_max_deposit_period(genesis, MAX_DEPOSIT_PERIOD)?; + set_min_deposit_amount(genesis, MIN_DEPOSIT)?; + set_voting_period(genesis, VOTING_PERIOD)?; + add_allow_message_interchainquery(genesis, "/provenance.oracle.v1.Query/Oracle")?; + set_floor_gas_price(genesis, "5", "nhash", "25000")?; + + Ok(()) + } + + fn channel_version(&self) -> Version { + Version::new("icq-1".to_owned()) + } +} + +impl BinaryConnectionTest for FailedAsyncIcqTest { + fn run( + &self, + config: &TestConfig, + relayer: RelayerDriver, + chains: ConnectedChains, + connection: ConnectedConnection, + ) -> Result<(), Error> { + let fee_denom_b: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(1))); + let port_a = DualTagged::new(PortId::oracle()); + let port_b = DualTagged::new(PortId::icqhost()); + let (channel_id_b, channel_id_a) = init_channel_version( + &chains.handle_a, + &chains.handle_b, + &chains.client_id_a(), + &chains.client_id_b(), + &connection.connection_id_a.as_ref(), + &connection.connection_id_b.as_ref(), + &port_a.as_ref(), + &port_b.as_ref(), + Version::new("icq-1".to_owned()), + )?; + + // Check that the oracle channel is eventually established + let _counterparty_channel_id = assert_eventually_channel_established( + chains.handle_b(), + chains.handle_a(), + &channel_id_b.as_ref(), + &port_b.as_ref(), + )?; + + let driver_b = chains.node_b.chain_driver(); + + let wallet_a = chains.node_a.wallets().user1().cloned(); + + let relayer_b = chains.node_b.wallets().relayer().cloned(); + + let oracle_auth_address = driver_b.query_auth_module("gov")?; + + let current_dir = env::current_dir()?; + let echo_wasm_path = format!( + "{}/src/tests/async_icq/contracts/echo.wasm", + current_dir.display() + ); + + driver_b.store_wasm_contract( + "echo wasm", + "echo wasm", + &echo_wasm_path, + &oracle_auth_address, + &relayer_b.address().to_string(), + &fee_denom_b.with_amount(923290636u64).to_string(), + &fee_denom_b.with_amount(11000000000u64).to_string(), + "9972508", + )?; + + driver_b.value().assert_proposal_status( + driver_b.value().chain_id.as_str(), + &driver_b.value().command_path, + &driver_b.value().home_path, + &driver_b.value().rpc_listen_address(), ProposalStatus::VotingPeriod, "1", )?; - driver.vote_proposal(&fee_denom_a.with_amount(381000000u64).to_string(), "1")?; + driver_b.vote_proposal(&fee_denom_b.with_amount(381000000u64).to_string(), "1")?; info!("Assert that the update oracle proposal is eventually passed"); - driver.value().assert_proposal_status( - driver.value().chain_id.as_str(), - &driver.value().command_path, - &driver.value().home_path, - &driver.value().rpc_listen_address(), + driver_b.value().assert_proposal_status( + driver_b.value().chain_id.as_str(), + &driver_b.value().command_path, + &driver_b.value().home_path, + &driver_b.value().rpc_listen_address(), ProposalStatus::Passed, "1", )?; + let init_args = r#"{}"#; + driver_b.update_oracle( + &relayer_b.address().to_string(), + &fee_denom_b.with_amount(381000000u64).to_string(), + init_args, + )?; + + driver_b.value().assert_proposal_status( + driver_b.value().chain_id.as_str(), + &driver_b.value().command_path, + &driver_b.value().home_path, + &driver_b.value().rpc_listen_address(), + ProposalStatus::VotingPeriod, + "2", + )?; + + driver_b.vote_proposal(&fee_denom_b.with_amount(381000000u64).to_string(), "2")?; + + info!("Assert that the update oracle proposal is eventually passed"); + + driver_b.value().assert_proposal_status( + driver_b.value().chain_id.as_str(), + &driver_b.value().command_path, + &driver_b.value().home_path, + &driver_b.value().rpc_listen_address(), + ProposalStatus::Passed, + "2", + )?; + let query = r#"{"query_version":{}}"#; chains.node_a.chain_driver().async_icq( channel_id_a.a_side.channel_id().unwrap(), @@ -116,7 +323,7 @@ impl BinaryConnectionTest for AsyncIcqTest { &wallet_a.address().to_string(), )?; - assert_eventual_async_icq_success(&chains, &relayer)?; + assert_eventual_async_icq_error(&chains, &relayer)?; Ok(()) } @@ -133,11 +340,56 @@ fn assert_eventual_async_icq_success( }; let mut rpc_client = HttpClient::new(rpc_addr).unwrap(); - rpc_client.set_compat_mode(tendermint_rpc::client::CompatMode::V0_34); + rpc_client.set_compat_mode(tendermint_rpc::client::CompatMode::V0_37); for _ in 0..MAX_RETRIES { - if check_events(chains, &rpc_client).is_ok() { - return Ok(()); + if let Ok(result) = check_events_for_success(chains, &rpc_client) { + match result { + EventOracleQueryStatus::Success(e) => { + debug!("async query successful with event: {e:#?}"); + return Ok(()); + } + EventOracleQueryStatus::Error(e) => { + return Err(Error::generic(eyre!( + "async query failed with response event: {e:#?}" + ))) + } + } + } + sleep(Duration::from_secs(1)); + } + + Err(Error::generic(eyre!( + "failed to find EventOracleQueryError or EventOracleQuerySuccess after {MAX_RETRIES} tries" + ))) +} + +/// Listen to events on the controller side to assert if the async ICQ is eventually +/// successful +fn assert_eventual_async_icq_error( + chains: &ConnectedChains, + relayer: &RelayerDriver, +) -> Result<(), Error> { + let rpc_addr = match relayer.config.chains.first().unwrap() { + ChainConfig::CosmosSdk(c) => c.rpc_addr.clone(), + }; + + let mut rpc_client = HttpClient::new(rpc_addr).unwrap(); + rpc_client.set_compat_mode(tendermint_rpc::client::CompatMode::V0_37); + + for _ in 0..MAX_RETRIES { + if let Ok(result) = check_events_for_error(chains, &rpc_client) { + match result { + EventOracleQueryStatus::Success(e) => { + debug!("async query successful with event: {e:#?}"); + return Ok(()); + } + EventOracleQueryStatus::Error(e) => { + return Err(Error::generic(eyre!( + "async query failed with response event: {e:#?}" + ))) + } + } } sleep(Duration::from_secs(1)); } @@ -148,10 +400,37 @@ fn assert_eventual_async_icq_success( } /// Checks if there is an Oracle event in the given events -fn check_events( +fn check_events_for_success( chains: &ConnectedChains, rpc_client: &HttpClient, -) -> Result<(), Error> { +) -> Result { + let response = chains + .node_a + .chain_driver() + .value() + .runtime + .block_on(rpc_client.latest_block_results()) + .map_err(|err| Error::generic(eyre!("Failed to fetch block results: {}", err)))?; + + if let Some(txs_results) = response.txs_results { + if let Some(events) = txs_results + .iter() + .find_map(|v| find_oracle_event(&v.events)) + { + return Ok(assert_async_icq_success(events)); + } + } + + Err(Error::generic(eyre!( + "No EventOracleQueryError or EventOracleQuerySuccess" + ))) +} + +/// Checks if there is an Oracle event in the given events +fn check_events_for_error( + chains: &ConnectedChains, + rpc_client: &HttpClient, +) -> Result { let response = chains .node_a .chain_driver() @@ -165,7 +444,7 @@ fn check_events( .iter() .find_map(|v| find_oracle_event(&v.events)) { - return assert_async_icq_success(events); + return Ok(assert_async_icq_error(events)); } } @@ -179,18 +458,41 @@ fn check_events( fn find_oracle_event(event: &[Event]) -> Option { event .iter() - .find(|&e| e.kind.contains("provenance.oracle.v1.EventOracleQuery")) + .find(|&e| { + e.kind.contains("provenance.oracle.v1.EventOracleQuery") + || e.kind + .contains("provenance.oracle.v1.EventOracleQueryError") + }) .cloned() } /// This method is used to assert if the found Oracle event is successful or not -fn assert_async_icq_success(event: Event) -> Result<(), Error> { +fn assert_async_icq_success(event: Event) -> EventOracleQueryStatus { if event.kind == "provenance.oracle.v1.EventOracleQuerySuccess" { - debug!("async query successful with event: {event:#?}"); - Ok(()) + EventOracleQueryStatus::Success(event) + } else { + EventOracleQueryStatus::Error(event) + } +} + +/// This method is used to assert if the found Oracle event is successful or not +fn assert_async_icq_error(event: Event) -> EventOracleQueryStatus { + if event.kind == "provenance.oracle.v1.EventOracleQueryError" { + let error_message = event + .attributes + .iter() + .find(|attribute| attribute.key_str().unwrap() == "error") + .and_then(|error_attribute| error_attribute.value_str().ok()) + .unwrap(); + // The ABCI error code 29 refers to the following: + // Error calling the VM: Error resolving Wasm function: Could not get export: Missing export query: wasmvm error + // This is caused by the echo.wasm contract not having a query endpoint, causing the ICQ to fail. + assert_eq!( + error_message, + "\"ABCI code: 29: error handling packet: see events for details\"" + ); + EventOracleQueryStatus::Success(event) } else { - Err(Error::generic(eyre!( - "async query failed with response event: {event:#?}" - ))) + EventOracleQueryStatus::Error(event) } } diff --git a/tools/test-framework/src/chain/cli/async_icq.rs b/tools/test-framework/src/chain/cli/async_icq.rs index f662a4beb9..345bf80058 100644 --- a/tools/test-framework/src/chain/cli/async_icq.rs +++ b/tools/test-framework/src/chain/cli/async_icq.rs @@ -1,5 +1,4 @@ -use std::str; - +use crate::chain::cli::query::query_tx_hash; use crate::chain::exec::simple_exec; use crate::error::Error; @@ -11,7 +10,7 @@ pub fn update_oracle( account: &str, relayer: &str, ) -> Result<(), Error> { - simple_exec( + let raw_output = simple_exec( chain_id, command_path, &[ @@ -21,8 +20,8 @@ pub fn update_oracle( chain_id, "--node", rpc_listen_address, - "-b", - "block", + "--keyring-backend", + "test", "tx", "oracle", "update", @@ -33,10 +32,26 @@ pub fn update_oracle( relayer, "--fees", "381000000nhash", + "--title", + "Update oracle", + "--summary", + "Update oracle", + "--output", + "json", "--yes", ], )?; + std::thread::sleep(core::time::Duration::from_secs(1)); + + query_tx_hash( + chain_id, + command_path, + home_path, + rpc_listen_address, + &raw_output.stdout, + )?; + Ok(()) } @@ -49,7 +64,7 @@ pub fn async_icq( query_json: &str, from: &str, ) -> Result<(), Error> { - simple_exec( + let raw_output = simple_exec( chain_id, command_path, &[ @@ -59,21 +74,33 @@ pub fn async_icq( chain_id, "--node", rpc_listen_address, + "--keyring-backend", + "test", "tx", "oracle", "send-query", channel_id, query_json, - "-b", - "block", "--from", from, "--fees", "381000000nhash", + "--output", + "json", "--yes", ], )?; + std::thread::sleep(core::time::Duration::from_secs(1)); + + query_tx_hash( + chain_id, + command_path, + home_path, + rpc_listen_address, + &raw_output.stdout, + )?; + Ok(()) } diff --git a/tools/test-framework/src/chain/cli/mod.rs b/tools/test-framework/src/chain/cli/mod.rs index f1deb65c39..2d68ec6820 100644 --- a/tools/test-framework/src/chain/cli/mod.rs +++ b/tools/test-framework/src/chain/cli/mod.rs @@ -4,8 +4,10 @@ pub mod bootstrap; pub mod fee_grant; pub mod host_zone; pub mod ica; +pub mod proposal; pub mod provider; pub mod query; pub mod transfer; pub mod upgrade; pub mod version; +pub mod wasm; diff --git a/tools/test-framework/src/chain/cli/proposal.rs b/tools/test-framework/src/chain/cli/proposal.rs new file mode 100644 index 0000000000..b8a0bc95e5 --- /dev/null +++ b/tools/test-framework/src/chain/cli/proposal.rs @@ -0,0 +1,181 @@ +/*! + Methods for voting on a proposal. +*/ +use eyre::eyre; +use tracing::warn; + +use crate::chain::cli::query::query_tx_hash; +use crate::chain::exec::simple_exec; +use crate::error::Error; +use crate::prelude::{handle_generic_error, ChainDriver}; + +pub fn vote_proposal(driver: &ChainDriver, proposal_id: &str, fees: &str) -> Result<(), Error> { + let output = simple_exec( + driver.chain_id.as_str(), + &driver.command_path, + &[ + "tx", + "gov", + "vote", + proposal_id, + "yes", + "--chain-id", + driver.chain_id.as_str(), + "--home", + &driver.home_path, + "--node", + &driver.rpc_listen_address(), + "--keyring-backend", + "test", + "--from", + "validator", + "--fees", + fees, + "--yes", + "--output", + "json", + ], + )?; + + std::thread::sleep(core::time::Duration::from_secs(1)); + + query_tx_hash( + driver.chain_id.as_str(), + &driver.command_path, + &driver.home_path, + &driver.rpc_listen_address(), + &output.stdout, + )?; + + Ok(()) +} + +pub fn deposit_proposal( + driver: &ChainDriver, + amount: &str, + proposal_id: &str, + fees: &str, + gas: &str, +) -> Result<(), Error> { + let output = simple_exec( + driver.chain_id.as_str(), + &driver.command_path, + &[ + "tx", + "gov", + "deposit", + proposal_id, + amount, + "--chain-id", + driver.chain_id.as_str(), + "--home", + &driver.home_path, + "--node", + &driver.rpc_listen_address(), + "--keyring-backend", + "test", + "--from", + "validator", + "--gas", + gas, + "--yes", + "--output", + "json", + "--fees", + fees, + ], + )?; + + std::thread::sleep(core::time::Duration::from_secs(1)); + + query_tx_hash( + driver.chain_id.as_str(), + &driver.command_path, + &driver.home_path, + &driver.rpc_listen_address(), + &output.stdout, + )?; + + Ok(()) +} + +pub fn submit_gov_proposal( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + signer: &str, + proposal_file: &str, +) -> Result<(), Error> { + let proposal_file = format!("{}/{}", home_path, proposal_file); + let output = simple_exec( + chain_id, + command_path, + &[ + "--node", + rpc_listen_address, + "tx", + "gov", + "submit-proposal", + &proposal_file, + "--chain-id", + chain_id, + "--home", + home_path, + "--keyring-backend", + "test", + "--gas", + "20000000", + "--from", + signer, + "--output", + "json", + "--yes", + ], + )?; + + let json_output: serde_json::Value = + serde_json::from_str(&output.stdout).map_err(handle_generic_error)?; + + if json_output + .get("code") + .ok_or_else(|| eyre!("expected `code` field in output"))? + .as_u64() + .ok_or_else(|| eyre!("expected `code` to be a u64"))? + != 0 + { + let raw_log = json_output + .get("raw_log") + .ok_or_else(|| eyre!("expected `code` field in output"))? + .as_str() + .ok_or_else(|| eyre!("expected `raw_log` to be a str"))?; + warn!("failed to submit governance proposal due to `{raw_log}`. Will retry..."); + simple_exec( + chain_id, + command_path, + &[ + "--node", + rpc_listen_address, + "tx", + "gov", + "submit-proposal", + &proposal_file, + "--chain-id", + chain_id, + "--home", + home_path, + "--keyring-backend", + "test", + "--gas", + "20000000", + "--from", + signer, + "--output", + "json", + "--yes", + ], + )?; + } + + Ok(()) +} diff --git a/tools/test-framework/src/chain/cli/query.rs b/tools/test-framework/src/chain/cli/query.rs index 5bfb0801b5..9c662a7161 100644 --- a/tools/test-framework/src/chain/cli/query.rs +++ b/tools/test-framework/src/chain/cli/query.rs @@ -292,3 +292,59 @@ pub fn query_auth_module( Ok(res.to_owned()) } + +pub fn query_tx_hash( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + command_output: &str, +) -> Result<(), Error> { + let json_output: serde_json::Value = + serde_json::from_str(command_output).map_err(handle_generic_error)?; + + let output_tx_hash = json_output + .get("txhash") + .and_then(|code| code.as_str()) + .ok_or_else(|| { + Error::generic(eyre!( + "failed to extract 'txhash' from command output: {command_output}" + )) + })?; + + let raw_output = simple_exec( + chain_id, + command_path, + &[ + "--home", + home_path, + "--node", + rpc_listen_address, + "query", + "tx", + output_tx_hash, + "--output", + "json", + ], + )?; + + let json_output: serde_json::Value = + serde_json::from_str(&raw_output.stdout).map_err(handle_generic_error)?; + + let code = json_output + .get("code") + .and_then(|code| code.as_u64()) + .ok_or_else(|| eyre!("Failed to retrieve 'code' from 'query tx' command output"))?; + + if code != 0 { + let raw_log = json_output + .get("raw_log") + .and_then(|code| code.as_str()) + .ok_or_else(|| eyre!("Failed to retrieve 'raw_log' from 'query tx' command output"))?; + return Err(Error::generic(eyre!( + "command failed with error code {code}. Detail: {raw_log}" + ))); + } + + Ok(()) +} diff --git a/tools/test-framework/src/chain/cli/upgrade.rs b/tools/test-framework/src/chain/cli/upgrade.rs index b83c6a315b..a781fbaa38 100644 --- a/tools/test-framework/src/chain/cli/upgrade.rs +++ b/tools/test-framework/src/chain/cli/upgrade.rs @@ -3,6 +3,7 @@ */ use eyre::eyre; +use crate::chain::cli::query::query_tx_hash; use crate::chain::exec::simple_exec; use crate::prelude::*; @@ -14,7 +15,7 @@ pub fn vote_proposal( fees: &str, proposal_id: &str, ) -> Result<(), Error> { - let raw_output = simple_exec( + let output = simple_exec( chain_id, command_path, &[ @@ -41,27 +42,15 @@ pub fn vote_proposal( ], )?; - let output: serde_json::Value = - serde_json::from_str(&raw_output.stdout).map_err(handle_generic_error)?; - - let output_code = output - .get("code") - .and_then(|code| code.as_u64()) - .ok_or_else(|| { - Error::generic(eyre!("failed to extract 'code' from 'tx gov vote' command")) - })?; + std::thread::sleep(core::time::Duration::from_secs(1)); - if output_code != 0 { - let output_logs = output - .get("raw_log") - .and_then(|code| code.as_str()) - .ok_or_else(|| { - Error::generic(eyre!( - "failed to extract 'raw_logs' from 'tx gov vote' command" - )) - })?; - return Err(Error::generic(eyre!("output code for commande 'tx gov vote' should be 0, but is instead '{output_code}'. Detail: {output_logs}", ))); - } + query_tx_hash( + chain_id, + command_path, + home_path, + rpc_listen_address, + &output.stdout, + )?; Ok(()) } diff --git a/tools/test-framework/src/chain/cli/wasm/contract.rs b/tools/test-framework/src/chain/cli/wasm/contract.rs new file mode 100644 index 0000000000..f8dc207b60 --- /dev/null +++ b/tools/test-framework/src/chain/cli/wasm/contract.rs @@ -0,0 +1,162 @@ +use std::path::Path; + +use crate::chain::cli::query::query_tx_hash; +use crate::chain::exec::simple_exec; +use crate::error::Error; +use crate::prelude::ChainDriver; + +pub fn store_wasm_contract( + driver: &ChainDriver, + title: &str, + summary: &str, + wasm_file: &str, + authority: &str, + from: &str, + deposit: &str, + fees: &str, + gas: &str, +) -> Result { + let output = simple_exec( + driver.chain_id.as_str(), + &driver.command_path, + &[ + "--chain-id", + driver.chain_id.as_str(), + "--node", + &driver.rpc_listen_address(), + "--home", + &driver.home_path, + "--keyring-backend", + "test", + "tx", + "wasm", + "submit-proposal", + "wasm-store", + wasm_file, + "--title", + title, + "--summary", + summary, + "--authority", + authority, + "--deposit", + deposit, + "--output", + "json", + "--from", + from, + "--fees", + fees, + "--yes", + "--gas", + gas, + ], + )?; + + std::thread::sleep(core::time::Duration::from_secs(1)); + + query_tx_hash( + driver.chain_id.as_str(), + &driver.command_path, + &driver.home_path, + &driver.rpc_listen_address(), + &output.stdout, + )?; + + Ok(output.stdout) +} + +pub fn store_wasm_client_code( + driver: &ChainDriver, + code_path: &Path, + title: &str, + summary: &str, + signer: &str, +) -> Result { + let output = simple_exec( + driver.chain_id.as_str(), + &driver.command_path, + &[ + "tx", + "ibc-wasm", + "store-code", + code_path.to_str().unwrap(), + "--title", + title, + "--summary", + summary, + "--chain-id", + driver.chain_id.as_str(), + "--node", + &driver.rpc_listen_address(), + "--home", + &driver.home_path, + "--from", + signer, + "--keyring-backend", + "test", + "--gas", + "auto", + "--deposit", + "200000stake", + "-y", + "--output", + "json", + ], + )?; + + Ok(output.stdout) +} + +pub fn instantiate_wasm_contract( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + address: &str, + fees: &str, + code: &str, + init_args: &str, +) -> Result<(), Error> { + let exec_output = simple_exec( + chain_id, + command_path, + &[ + "--home", + home_path, + "--chain-id", + chain_id, + "--node", + rpc_listen_address, + "--keyring-backend", + "test", + "tx", + "wasm", + "instantiate", + code, + init_args, + "--from", + address, + "--yes", + "--label", + "echo", + "--no-admin", + "--fees", + fees, + "--output", + "json", + ], + )?; + + std::thread::sleep(core::time::Duration::from_secs(1)); + + query_tx_hash( + chain_id, + command_path, + home_path, + rpc_listen_address, + &exec_output.stdout, + )?; + + Ok(()) +} diff --git a/tools/test-framework/src/chain/cli/wasm/mod.rs b/tools/test-framework/src/chain/cli/wasm/mod.rs new file mode 100644 index 0000000000..fec57bbb9f --- /dev/null +++ b/tools/test-framework/src/chain/cli/wasm/mod.rs @@ -0,0 +1,2 @@ +pub mod contract; +pub mod query; diff --git a/tools/test-framework/src/chain/cli/wasm/query.rs b/tools/test-framework/src/chain/cli/wasm/query.rs new file mode 100644 index 0000000000..fb2835c54b --- /dev/null +++ b/tools/test-framework/src/chain/cli/wasm/query.rs @@ -0,0 +1,81 @@ +use eyre::eyre; + +use crate::chain::exec::simple_exec; +use crate::error::{handle_generic_error, Error}; + +pub fn query_wasm_list_code( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, +) -> Result { + let exec_output = simple_exec( + chain_id, + command_path, + &[ + "--home", + home_path, + "--chain-id", + chain_id, + "--node", + rpc_listen_address, + "query", + "wasm", + "list-codes", + "--output", + "json", + ], + )?; + + let json_output: serde_json::Value = + serde_json::from_str(&exec_output.stdout).map_err(handle_generic_error)?; + + let code_id = json_output + .get("code_infos") + .and_then(|code_infos| code_infos.as_array()) + .and_then(|code_infos| code_infos.first()) + .and_then(|code_info| code_info.get("code_id")) + .and_then(|code_infos| code_infos.as_str()) + .ok_or_else(|| eyre!("Failed to retrieve wasm code ID"))?; + + Ok(code_id.to_string()) +} + +pub fn query_wasm_list_contracts_by_code( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + code_id: &str, +) -> Result { + let exec_output = simple_exec( + chain_id, + command_path, + &[ + "--home", + home_path, + "--chain-id", + chain_id, + "--node", + rpc_listen_address, + "query", + "wasm", + "list-contract-by-code", + code_id, + "--output", + "json", + ], + )?; + + let json_output: serde_json::Value = + serde_json::from_str(&exec_output.stdout).map_err(handle_generic_error)?; + + let contrat = json_output + .get("contracts") + .and_then(|contracts| contracts.as_array()) + .and_then(|contracts| contracts.first()) + .and_then(|contract| contract.as_str()) + .ok_or_else(|| eyre!("Failed to retrieve wasm contract address"))?; + + Ok(contrat.to_string()) +} diff --git a/tools/test-framework/src/chain/config.rs b/tools/test-framework/src/chain/config.rs index 011fe08e37..9d98f9702d 100644 --- a/tools/test-framework/src/chain/config.rs +++ b/tools/test-framework/src/chain/config.rs @@ -468,6 +468,41 @@ pub fn set_retry_delay_period( Ok(()) } +pub fn set_floor_gas_price( + genesis: &mut serde_json::Value, + amount: &str, + denom: &str, + nhash_per_usd_mil: &str, +) -> Result<(), Error> { + let params = genesis + .get_mut("app_state") + .and_then(|app_state| app_state.get_mut("msgfees")) + .and_then(|msgfees| msgfees.get_mut("params")) + .and_then(|params| params.as_object_mut()) + .ok_or_else(|| eyre!("failed to get `msgfees params` in genesis file"))?; + + params.insert( + "nhash_per_usd_mil".to_owned(), + serde_json::Value::String(nhash_per_usd_mil.to_string()), + ); + + let floor_gas_price = params + .get_mut("floor_gas_price") + .and_then(|floor_gas_price| floor_gas_price.as_object_mut()) + .ok_or_else(|| eyre!("failed to get `floor_gas_price` params in genesis file"))?; + + floor_gas_price.insert( + "amount".to_owned(), + serde_json::Value::String(amount.to_string()), + ); + floor_gas_price.insert( + "denom".to_owned(), + serde_json::Value::String(denom.to_string()), + ); + + Ok(()) +} + /// Look up a key in a JSON object, falling back to the second key if the first one cannot be found. /// /// This lets us support both Tendermint 0.34 and 0.37, which sometimes use different keys for the diff --git a/tools/test-framework/src/chain/ext/async_icq.rs b/tools/test-framework/src/chain/ext/async_icq.rs index 407a760302..88dd7f7aa6 100644 --- a/tools/test-framework/src/chain/ext/async_icq.rs +++ b/tools/test-framework/src/chain/ext/async_icq.rs @@ -1,22 +1,51 @@ use crate::chain::cli::async_icq::{async_icq, update_oracle}; +use crate::chain::cli::wasm::contract::instantiate_wasm_contract; +use crate::chain::cli::wasm::query::{query_wasm_list_code, query_wasm_list_contracts_by_code}; use crate::prelude::*; use crate::types::tagged::*; pub trait AsyncIcqMethodsExt { - fn update_oracle(&self, relayer: &str, account: &str) -> Result<(), Error>; + fn update_oracle(&self, relayer: &str, fees: &str, init_args: &str) -> Result<(), Error>; fn async_icq(&self, channel_id: &ChannelId, query_json: &str, from: &str) -> Result<(), Error>; } impl<'a, Chain: Send> AsyncIcqMethodsExt for MonoTagged { - fn update_oracle(&self, relayer: &str, account: &str) -> Result<(), Error> { + fn update_oracle(&self, relayer: &str, fees: &str, init_args: &str) -> Result<(), Error> { let driver = *self.value(); + + let wasm_code = query_wasm_list_code( + driver.chain_id.as_str(), + &driver.command_path, + &driver.home_path, + &driver.rpc_listen_address(), + )?; + + instantiate_wasm_contract( + driver.chain_id.as_str(), + &driver.command_path, + &driver.home_path, + &driver.rpc_listen_address(), + relayer, + fees, + &wasm_code, + init_args, + )?; + + let address = query_wasm_list_contracts_by_code( + driver.chain_id.as_str(), + &driver.command_path, + &driver.home_path, + &driver.rpc_listen_address(), + &wasm_code, + )?; + update_oracle( driver.chain_id.as_str(), &driver.command_path, &driver.home_path, &driver.rpc_listen_address(), - account, + &address, relayer, ) } diff --git a/tools/test-framework/src/chain/ext/mod.rs b/tools/test-framework/src/chain/ext/mod.rs index 24df39928c..e5a07cc45d 100644 --- a/tools/test-framework/src/chain/ext/mod.rs +++ b/tools/test-framework/src/chain/ext/mod.rs @@ -10,3 +10,4 @@ pub mod proposal; pub mod transfer; pub mod version; pub mod wait_chain; +pub mod wasm_client; diff --git a/tools/test-framework/src/chain/ext/proposal.rs b/tools/test-framework/src/chain/ext/proposal.rs index aecd1a072f..ec7010323a 100644 --- a/tools/test-framework/src/chain/ext/proposal.rs +++ b/tools/test-framework/src/chain/ext/proposal.rs @@ -7,6 +7,7 @@ use ibc_proto::cosmos::gov::v1beta1::{query_client::QueryClient, QueryProposalRe use ibc_proto::ibc::core::client::v1::{MsgIbcSoftwareUpgrade, UpgradeProposal}; use ibc_relayer::error::Error as RelayerError; +use crate::chain::cli::proposal::deposit_proposal; use crate::chain::cli::upgrade::{submit_gov_proposal, vote_proposal}; use crate::chain::driver::ChainDriver; use crate::error::Error; @@ -25,6 +26,14 @@ pub trait ChainProposalMethodsExt { fn vote_proposal(&self, fees: &str, proposal_id: &str) -> Result<(), Error>; + fn deposit_proposal( + &self, + amount: &str, + proposal_id: &str, + fees: &str, + gas: &str, + ) -> Result<(), Error>; + fn initialise_channel_upgrade( &self, port_id: &str, @@ -67,6 +76,17 @@ impl<'a, Chain: Send> ChainProposalMethodsExt for MonoTagged Result<(), Error> { + deposit_proposal(self.value(), amount, proposal_id, fees, gas)?; + Ok(()) + } + fn initialise_channel_upgrade( &self, port_id: &str, diff --git a/tools/test-framework/src/chain/ext/wasm_client.rs b/tools/test-framework/src/chain/ext/wasm_client.rs new file mode 100644 index 0000000000..cfcb657dd0 --- /dev/null +++ b/tools/test-framework/src/chain/ext/wasm_client.rs @@ -0,0 +1,85 @@ +use std::path::Path; + +use crate::chain::cli::wasm::contract::{store_wasm_client_code, store_wasm_contract}; +use crate::chain::driver::ChainDriver; +use crate::error::Error; +use crate::types::tagged::*; + +pub trait StoreWasmClientCodeMethodsExt { + fn store_wasm_client_code( + &self, + wasm_path: &Path, + title: &str, + summary: &str, + signer: &str, + ) -> Result; + + fn store_wasm_contract( + &self, + title: &str, + summary: &str, + wasm_file: &str, + authority: &str, + from: &str, + deposit: &str, + fees: &str, + gas: &str, + ) -> Result; +} + +impl<'a, Chain: Send> StoreWasmClientCodeMethodsExt for MonoTagged { + fn store_wasm_client_code( + &self, + wasm_path: &Path, + title: &str, + summary: &str, + signer: &str, + ) -> Result { + self.value() + .store_wasm_client_code(wasm_path, title, summary, signer) + } + + fn store_wasm_contract( + &self, + title: &str, + summary: &str, + wasm_file: &str, + authority: &str, + from: &str, + deposit: &str, + fees: &str, + gas: &str, + ) -> Result { + self.value().store_wasm_contract( + title, summary, wasm_file, authority, from, deposit, fees, gas, + ) + } +} + +impl StoreWasmClientCodeMethodsExt for ChainDriver { + fn store_wasm_client_code( + &self, + wasm_path: &Path, + title: &str, + summary: &str, + signer: &str, + ) -> Result { + store_wasm_client_code(self, wasm_path, title, summary, signer) + } + + fn store_wasm_contract( + &self, + title: &str, + summary: &str, + wasm_file: &str, + authority: &str, + from: &str, + deposit: &str, + fees: &str, + gas: &str, + ) -> Result { + store_wasm_contract( + self, title, summary, wasm_file, authority, from, deposit, fees, gas, + ) + } +} From f56570d95f8d56bf4a0eafb104b3574eb9ee6003 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 13 Aug 2024 12:00:17 +0200 Subject: [PATCH 178/200] Bump tokio version to v1.39.2 (#4140) --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c86d2e454..99874a3d39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3623,9 +3623,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.0" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3318c4fc7126c339a40fbc025927d0328ca32259f68bfe4321660644c1f626" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", diff --git a/Cargo.toml b/Cargo.toml index c2185ccb87..4e2109b73e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -108,7 +108,7 @@ thiserror = "1.0.63" time = "0.3" tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } -tokio = "1.26.0" +tokio = "1.39.2" tokio-stream = "0.1.14" toml = "0.8.19" tonic = "0.12" From 68b0e7405c8a584077285d2334538d111d4dbd52 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 13 Aug 2024 12:10:48 +0200 Subject: [PATCH 179/200] Remove MBT related parts (#4141) --- .github/workflows/integration.yaml | 39 --- Cargo.lock | 1 - Cargo.toml | 1 - tools/integration-test/Cargo.toml | 4 - tools/integration-test/src/lib.rs | 4 - tools/integration-test/src/mbt/README.md | 7 - tools/integration-test/src/mbt/handlers.rs | 291 ---------------- tools/integration-test/src/mbt/itf.rs | 132 -------- tools/integration-test/src/mbt/mod.rs | 8 - tools/integration-test/src/mbt/state.rs | 85 ----- tools/integration-test/src/mbt/transfer.rs | 373 --------------------- tools/integration-test/src/mbt/utils.rs | 132 -------- 12 files changed, 1077 deletions(-) delete mode 100644 tools/integration-test/src/mbt/README.md delete mode 100644 tools/integration-test/src/mbt/handlers.rs delete mode 100644 tools/integration-test/src/mbt/itf.rs delete mode 100644 tools/integration-test/src/mbt/mod.rs delete mode 100644 tools/integration-test/src/mbt/state.rs delete mode 100644 tools/integration-test/src/mbt/transfer.rs delete mode 100644 tools/integration-test/src/mbt/utils.rs diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 899ac76fd4..8475a2e18b 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -294,42 +294,3 @@ jobs: nix shell .#python ${{ matrix.chain.package }} -c \ cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \ --features celestia - - model-based-test: - runs-on: ubuntu-20.04 - timeout-minutes: 60 - strategy: - matrix: - gaiad: - - gaia6 - steps: - - uses: actions/checkout@v4 - - name: Install Nix - uses: DeterminateSystems/nix-installer-action@main - with: - extra-conf: | - substituters = https://cache.nixos.org - trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= - - name: Install Cachix - uses: cachix/cachix-action@v15 - with: - name: cosmos-nix - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: stable - - uses: actions-rs/cargo@v1 - with: - command: test - args: -p ibc-integration-test --features mbt --no-fail-fast --no-run - # Disable running MBT tests until flakiness is addressed - # - env: - # RUST_LOG: debug - # RUST_BACKTRACE: 1 - # NO_COLOR_LOG: 1 - # run: | - # nix shell \ - # .#${{ matrix.gaiad }} \ - # .#apalache \ - # -c cargo \ - # test -p ibc-integration-test --features mbt --no-fail-fast -- \ - # --failure-output final --test-threads=2 --test-threads=1 mbt diff --git a/Cargo.lock b/Cargo.lock index 99874a3d39..d1d527a186 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1537,7 +1537,6 @@ dependencies = [ "prost", "serde", "serde_json", - "tempfile", "tendermint", "tendermint-rpc", "time", diff --git a/Cargo.toml b/Cargo.toml index 4e2109b73e..537e56f982 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -102,7 +102,6 @@ signal-hook = "0.3.17" signature = "2.1.0" strum = "0.25" subtle-encoding = "0.5.1" -tempfile = "3.10.1" test-log = "0.2.14" thiserror = "1.0.63" time = "0.3" diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index f23398217a..180f33f2e5 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -36,7 +36,6 @@ ordered = [] ica = [] ics29-fee = [] experimental = [] -mbt = [] forward-packet = [] ics31 = [] clean-workers = [] @@ -54,6 +53,3 @@ benchmark = [] [[bin]] name = "test_setup_with_binary_channel" doc = true - -[dev-dependencies] -tempfile = { workspace = true } diff --git a/tools/integration-test/src/lib.rs b/tools/integration-test/src/lib.rs index f4b83a25c4..75d580024e 100644 --- a/tools/integration-test/src/lib.rs +++ b/tools/integration-test/src/lib.rs @@ -1,7 +1,3 @@ #[allow(clippy::too_many_arguments)] #[cfg(test)] pub mod tests; - -#[cfg(any(all(test, feature = "mbt"), doc))] -#[macro_use] -pub mod mbt; diff --git a/tools/integration-test/src/mbt/README.md b/tools/integration-test/src/mbt/README.md deleted file mode 100644 index f2c0311b28..0000000000 --- a/tools/integration-test/src/mbt/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# MBT for Hermes Integration Test - -Make sure [`apalache-mc`](https://github.com/informalsystems/apalache) is installed and setup properly. Check `apalache-mc version`. - -```bash -cargo test -p ibc-integration-test --features mbt mbt::transfer -``` diff --git a/tools/integration-test/src/mbt/handlers.rs b/tools/integration-test/src/mbt/handlers.rs deleted file mode 100644 index 53421f20c8..0000000000 --- a/tools/integration-test/src/mbt/handlers.rs +++ /dev/null @@ -1,291 +0,0 @@ -use ibc_relayer::util::task::TaskHandle; -use ibc_relayer::worker::client::spawn_refresh_client; - -use ibc_test_framework::bootstrap::binary::chain::bootstrap_foreign_client_pair; -use ibc_test_framework::bootstrap::binary::connection::bootstrap_connection; -use ibc_test_framework::prelude::*; -use ibc_test_framework::relayer::channel::{assert_eventually_channel_established, init_channel}; -use ibc_test_framework::relayer::connection::{ - assert_eventually_connection_established, init_connection, -}; -use ibc_test_framework::types::binary::client::ClientIdPair; -use ibc_test_framework::types::tagged::mono::Tagged; - -use super::state::Packet; - -use super::utils::{get_denom, get_wallet, wait_for_client}; - -pub fn setup_chains( - chains: &ConnectedChains, -) -> Result<(), Error> { - { - let _refresh_task_a = spawn_refresh_client(chains.foreign_clients.client_b_to_a.clone()) - .ok_or_else(|| eyre!("expect refresh task spawned"))?; - - let _refresh_task_b = spawn_refresh_client(chains.foreign_clients.client_a_to_b.clone()) - .ok_or_else(|| eyre!("expect refresh task spawned"))?; - - bootstrap_connection(&chains.foreign_clients, Default::default())?; - }; - - wait_for_client(); - - Ok(()) -} - -pub fn local_transfer_handler( - node: Tagged, - source: u128, - target: u128, - denom: u128, - amount: u128, - fees: &TaggedTokenRef, -) -> Result<(), Error> { - let wallets = node.wallets(); - - let source_wallet = get_wallet(&wallets, source); - let target_wallet = get_wallet(&wallets, target); - let denom = get_denom(&node, denom); - - node.chain_driver().local_transfer_token( - &source_wallet, - &target_wallet.address(), - &denom.with_amount(amount).as_ref(), - fees, - )?; - - Ok(()) -} - -pub fn create_channel( - chain_handle_a: &ChainA, - chain_handle_b: &ChainB, - channel: &mut Option>, - refresh_task_a: &mut Option, - refresh_task_b: &mut Option, -) -> Result<(), Error> { - let port_a = tagged_transfer_port(); - let port_b = tagged_transfer_port(); - - let clients2 = - bootstrap_foreign_client_pair(chain_handle_a, chain_handle_b, Default::default())?; - - *refresh_task_a = Some( - spawn_refresh_client(clients2.client_b_to_a.clone()) - .ok_or_else(|| eyre!("expect refresh task spawned"))?, - ); - - *refresh_task_b = Some( - spawn_refresh_client(clients2.client_a_to_b.clone()) - .ok_or_else(|| eyre!("expect refresh task spawned"))?, - ); - - let (connection_id_b, new_connection_b) = init_connection( - chain_handle_a, - chain_handle_b, - &clients2.client_b_to_a.tagged_client_id(), - &clients2.client_a_to_b.tagged_client_id(), - )?; - - let connection_id_a = assert_eventually_connection_established( - chain_handle_b, - chain_handle_a, - &connection_id_b.as_ref(), - )?; - - let (channel_id_b_2, channel_b_2) = init_channel( - chain_handle_a, - chain_handle_b, - &clients2.client_b_to_a.tagged_client_id(), - &clients2.client_a_to_b.tagged_client_id(), - &connection_id_a.as_ref(), - &connection_id_b.as_ref(), - &port_a.as_ref(), - &port_b.as_ref(), - )?; - - let channel_id_a_2 = assert_eventually_channel_established( - chain_handle_b, - chain_handle_a, - &channel_id_b_2.as_ref(), - &port_b.as_ref(), - )?; - - let client_ids = ClientIdPair::new( - clients2.client_b_to_a.tagged_client_id().cloned(), - clients2.client_a_to_b.tagged_client_id().cloned(), - ); - - let new_connected_connection = ConnectedConnection::new( - client_ids, - new_connection_b.flipped(), - connection_id_a, - connection_id_b, - ); - - let connected_channel = ConnectedChannel { - connection: new_connected_connection, - channel: channel_b_2.flipped(), - channel_id_a: channel_id_a_2, - channel_id_b: channel_id_b_2, - port_a, - port_b, - }; - - *channel = Some(connected_channel); - - info!("Channel is created"); - - Ok(()) -} - -pub fn expire_channel( - channel: &mut Option>, - refresh_task_a: &mut Option, - refresh_task_b: &mut Option, -) -> Result<(), Error> { - // dropping the client handler to expire the clients - super::utils::drop(refresh_task_a.take()); - super::utils::drop(refresh_task_b.take()); - - wait_for_client(); - - super::utils::drop(channel.take()); - - info!("Channel expired"); - - Ok(()) -} - -pub fn ibc_transfer_send_packet( - node_source: Tagged, - node_target: Tagged, - channels: &ConnectedChannel, - packet: &Packet, -) -> Result<(), Error> { - let wallets_source = node_source.wallets(); - let wallets_target = node_target.wallets(); - - let wallet_source = get_wallet(&wallets_source, packet.from); - let wallet_target = get_wallet(&wallets_target, packet.to); - let denom_source = get_denom(&node_source, packet.denom); - let amount_source_to_target = packet.amount; - - let (port_source, channel_id_source) = ( - DualTagged::new(channels.port_a.value()), - DualTagged::new(channels.channel_id_a.value()), - ); - - let balance_source = node_source - .chain_driver() - .query_balance(&wallet_source.address(), &denom_source)?; - - info!( - "Sending IBC transfer from chain {} to chain {} with amount of {} {}", - node_source.chain_id(), - node_target.chain_id(), - amount_source_to_target, - denom_source, - ); - - node_source.chain_driver().ibc_transfer_token( - &port_source, - &channel_id_source, - &wallet_source, - &wallet_target.address(), - &denom_source.with_amount(amount_source_to_target).as_ref(), - )?; - - node_source.chain_driver().assert_eventual_wallet_amount( - &wallet_source.address(), - &(balance_source - amount_source_to_target).as_ref(), - )?; - - Ok(()) -} - -pub fn ibc_transfer_receive_packet( - node_source: Tagged, - node_target: Tagged, - channels: &ConnectedChannel, - packet: &Packet, -) -> Result<(), Error> { - let wallets_target = node_target.wallets(); - - let wallet_target = get_wallet(&wallets_target, packet.to); - let denom_source = get_denom(&node_source, packet.denom); - let amount_source_to_target = packet.amount; - - let (port_target, channel_id_target) = ( - DualTagged::new(channels.port_b.value()), - DualTagged::new(channels.channel_id_b.value()), - ); - - let denom_target = derive_ibc_denom(&port_target, &channel_id_target, &denom_source)?; - - info!( - "Waiting for user on chain {} to receive IBC transferred amount of {} {} (chain {}/{})", - node_target.chain_id(), - amount_source_to_target, - denom_target, - node_source.chain_id(), - denom_source - ); - - node_target.chain_driver().assert_eventual_wallet_amount( - &wallet_target.address(), - &denom_target.with_amount(amount_source_to_target).as_ref(), - )?; - - Ok(()) -} - -pub fn ibc_transfer_acknowledge_packet( - node_source: Tagged, - node_target: Tagged, - _channels: &Option>, - packet: &Packet, -) -> Result<(), Error> { - let denom_source = get_denom(&node_source, packet.denom); - let amount_source_to_target = packet.amount; - - info!( - "Waiting for user on chain {} to confirm IBC transferred amount of {} {}", - node_source.chain_id(), - amount_source_to_target, - denom_source - ); - - info!( - "Successfully performed IBC transfer from chain {} to chain {}", - node_source.chain_id(), - node_target.chain_id(), - ); - - Ok(()) -} - -pub fn ibc_transfer_expire_packet( - node_source: Tagged, - node_target: Tagged, - _channels: &Option>, - packet: &Packet, -) -> Result<(), Error> { - let denom_source = get_denom(&node_source, packet.denom); - let amount_source_to_target = packet.amount; - - info!( - "Waiting for user on chain {} to get refund of previously IBC transferred amount of {} {}", - node_source.chain_id(), - amount_source_to_target, - denom_source - ); - - info!( - "Successfully performed IBC packet expiry intended from chain {} to chain {}", - node_source.chain_id(), - node_target.chain_id(), - ); - - Ok(()) -} diff --git a/tools/integration-test/src/mbt/itf.rs b/tools/integration-test/src/mbt/itf.rs deleted file mode 100644 index 44bb354ed9..0000000000 --- a/tools/integration-test/src/mbt/itf.rs +++ /dev/null @@ -1,132 +0,0 @@ -use serde::{Deserialize, Deserializer, Serialize}; - -#[derive(Debug, Serialize, Deserialize)] -pub struct Meta { - pub format: String, - #[serde(rename = "format-description")] - pub format_description: String, - pub description: String, -} - -#[derive(Debug, Serialize, Deserialize)] -pub struct InformalTrace { - #[serde(rename = "#meta")] - pub meta: Meta, - pub vars: Vec, - pub states: Vec, -} - -#[derive(Debug, Serialize)] -pub struct Map(pub Vec<(K, V)>); - -impl<'de, K, V> Deserialize<'de> for Map -where - K: Deserialize<'de>, - V: Deserialize<'de>, -{ - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - #[derive(Debug, Deserialize)] - struct Meta { - #[serde(rename = "#map")] - map: Vec<(K, V)>, - } - let s: Meta<_, _> = Deserialize::deserialize(deserializer)?; - Ok(Self(s.map)) - } -} - -#[derive(Debug, Serialize)] -pub struct Set(pub Vec); - -impl<'de, E> Deserialize<'de> for Set -where - E: Deserialize<'de>, -{ - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - #[derive(Debug, Deserialize)] - pub struct Meta { - #[serde(rename = "#set")] - set: Vec, - } - let s: Meta<_> = Deserialize::deserialize(deserializer)?; - Ok(Self(s.set)) - } -} - -mod test { - use super::{Map, Set}; - - #[test] - fn test_empty_set() { - let itf = r##"{ "#set": [] }"##; - let s: Set = serde_json::from_str(itf).unwrap(); - assert!(s.0.is_empty()); - } - - #[test] - fn test_set() { - let itf = r##"{ "#set": [1,2,3] }"##; - let s: Set = serde_json::from_str(itf).unwrap(); - assert_eq!(s.0, vec![1, 2, 3]); - } - - #[test] - fn test_empty_map() { - let itf = r##"{ "#map": [ ] }"##; - let m: Map = serde_json::from_str(itf).unwrap(); - assert!(m.0.is_empty()); - } - - #[test] - #[should_panic] - fn test_singleton_map() { - let itf = r##"{ "#map": [1, 11] }"##; - let m: Map = serde_json::from_str(itf).unwrap(); - assert_eq!(m.0, vec![(1, 11)]); - } - - #[test] - fn test_normal_map() { - let itf = r##"{ "#map": [[1, 11], [2, 22]] }"##; - let m: Map = serde_json::from_str(itf).unwrap(); - assert_eq!(m.0, vec![(1, 11), (2, 22)]); - } - - #[test] - #[cfg(feature = "manual")] - fn parse_itf() { - use super::super::itf::InformalTrace; - use super::super::state::State; - - let itf_path = concat!( - env!("CARGO_MANIFEST_DIR"), - "/spec/example/counterexample.itf.json" - ); - - let itf_json = std::fs::read_to_string(itf_path).expect("itf file does not exist"); - - let t: InformalTrace = - serde_json::from_str(&itf_json).expect("deserialization error"); - - for state in t.states { - println!( - "action: {}", - serde_json::to_string_pretty(&state.action).unwrap() - ); - println!( - "outcome: {}", - serde_json::to_string_pretty(&state.outcome).unwrap() - ); - println!( - "chains: {}", - serde_json::to_string_pretty(&state.chains).unwrap() - ); - } - } -} diff --git a/tools/integration-test/src/mbt/mod.rs b/tools/integration-test/src/mbt/mod.rs deleted file mode 100644 index 173f132abb..0000000000 --- a/tools/integration-test/src/mbt/mod.rs +++ /dev/null @@ -1,8 +0,0 @@ -pub mod utils; - -pub mod itf; -pub mod state; - -pub mod handlers; - -pub mod transfer; diff --git a/tools/integration-test/src/mbt/state.rs b/tools/integration-test/src/mbt/state.rs deleted file mode 100644 index b9ddf34e9e..0000000000 --- a/tools/integration-test/src/mbt/state.rs +++ /dev/null @@ -1,85 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use super::itf::{Map, Set}; - -pub type ChainId = u128; -pub type DenomId = ChainId; -pub type AccountId = u128; -pub type PacketId = u128; -pub type Balance = u128; - -#[derive(Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct Packet { - pub id: PacketId, - pub from: AccountId, - pub source_chain_id: ChainId, - pub to: AccountId, - pub target_chain_id: ChainId, - pub denom: DenomId, - pub amount: Balance, -} - -#[derive(Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct LocalPackets { - pub list: Map, - pub pending: Set, - pub expired: Set, - pub success: Set, -} - -#[derive(Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct Chain { - pub id: ChainId, - pub bank: Map>, - pub supply: Map, - pub local_packets: LocalPackets, - pub remote_packets: Map>, - pub escrow: Map>, - pub next_packet_id: PacketId, -} - -#[derive(Debug, Serialize, Deserialize)] -#[serde(tag = "name")] -pub enum Action { - Null, - #[serde(rename_all = "camelCase")] - LocalTransfer { - chain_id: ChainId, - source: AccountId, - target: AccountId, - denom: DenomId, - amount: Balance, - }, - RestoreRelay, - InterruptRelay, - IBCTransferSendPacket { - packet: Packet, - }, - IBCTransferReceivePacket { - packet: Packet, - }, - IBCTransferAcknowledgePacket { - packet: Packet, - }, - IBCTransferTimeoutPacket { - packet: Packet, - }, -} - -#[derive(Debug, Serialize, Deserialize)] -#[serde(tag = "name")] -pub enum Outcome { - Success, - Error, -} - -#[derive(Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct State { - pub chains: Map, - pub action: Action, - pub outcome: Outcome, -} diff --git a/tools/integration-test/src/mbt/transfer.rs b/tools/integration-test/src/mbt/transfer.rs deleted file mode 100644 index e10b595112..0000000000 --- a/tools/integration-test/src/mbt/transfer.rs +++ /dev/null @@ -1,373 +0,0 @@ -use std::io::Write; -use std::panic::{RefUnwindSafe, UnwindSafe}; - -use ibc_relayer::config::{ - ChainConfig, Channels as ConfigChannels, Clients as ConfigClients, - Connections as ConfigConnections, ModeConfig, Packets as ConfigPackets, -}; - -use ibc_test_framework::prelude::*; -use ibc_test_framework::types::tagged::mono::Tagged; - -use super::state::{Action, State}; - -use super::itf::InformalTrace; -use super::utils::{get_chain, CLIENT_EXPIRY}; - -const TEST_NAMES: &[&str] = &[ - "LocalTransferInv", - "IBCTransferAcknowledgePacketInv", - "IBCTransferTimeoutPacketInv", -]; -const NUM_TRACES: Option<&str> = option_env!("MBT_TRACES"); -const APALACHE: Option<&str> = option_env!("APALACHE"); - -const ITF_TRACE_DIRECTORY: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/data/mbt"); - -fn generate_mbt_traces( - apalache_path: &str, - test_name: &str, - num_traces: usize, -) -> Result, Error> { - let temp_dir = tempfile::TempDir::new()?; - let run_dir = temp_dir.path().join("run"); - let tla_path = concat!(env!("CARGO_MANIFEST_DIR"), "/spec/MC_Transfer.tla"); - let mut cmd = std::process::Command::new(apalache_path); - cmd.arg("check") - .arg("--init=Init") - .arg("--next=Next") - .arg(&format!("--inv={test_name}")) - .arg(&format!("--max-error={num_traces}")) - .arg(&format!( - "--run-dir={}", - run_dir.to_str().expect("no panic") - )) - .arg(&format!( - "--out-dir={}", - temp_dir.path().to_str().expect("no panic") - )) - .arg(tla_path); - let _ = cmd.status().expect("failed to execute process"); - - std::fs::read_dir(run_dir)? - .flatten() - .map(|entry| entry.path()) - .filter(|file_path| file_path.is_file()) - .flat_map(|file_path| { - file_path - .file_name() - .and_then(|file_name| file_name.to_str()) - .and_then(|file_name| { - (file_name != "counterexample.itf.json" - && file_name.starts_with("counterexample") - && file_name.ends_with(".itf.json")) - .then(|| { - let name = format!("{test_name}_{file_name}"); - Ok(( - name, - std::fs::read_to_string(file_path.to_str().expect("should not panic")) - .expect("error while reading counterexample.itf.json"), - )) - }) - }) - }) - .collect() -} - -fn execute_mbt(f: F) -> Result<(), Error> -where - F: FnOnce(Vec) -> Result<(), Error> + UnwindSafe + RefUnwindSafe + Copy, -{ - let apalache = APALACHE.unwrap_or("apalache-mc"); - let num_traces = NUM_TRACES - .unwrap_or("2") - .parse() - .expect("an number for number of traces per test"); - - let success_traces = &format!("{ITF_TRACE_DIRECTORY}/success"); - let failure_traces = &format!("{ITF_TRACE_DIRECTORY}/failure"); - - std::fs::create_dir_all(success_traces)?; - std::fs::create_dir_all(failure_traces)?; - - for test_name in TEST_NAMES { - for (itf_name, itf_json) in generate_mbt_traces(apalache, test_name, num_traces)? { - let itf: InformalTrace = - serde_json::from_str(&itf_json).expect("deserialization error"); - - let result = std::panic::catch_unwind(|| f(itf.states).expect("to fail")); - - let unique_itf_trace_path = if result.is_ok() { - format!("{success_traces}/{itf_name}") - } else { - format!("{failure_traces}/{itf_name}") - }; - - let mut file = std::fs::File::create(unique_itf_trace_path)?; - file.write_all(itf_json.as_bytes())?; - - if let Err(err) = result { - std::panic::resume_unwind(err); - } - } - } - Ok(()) -} - -#[test] -fn test_ibc_transfer() -> Result<(), Error> { - execute_mbt(|trace| run_binary_channel_test(&IbcTransferMBT(trace))) -} - -/** - Test that IBC token transfer can still work with a single - chain that is connected to itself. -*/ -#[test] -#[cfg(feature = "manual")] -fn test_self_connected_ibc_transfer() -> Result<(), Error> { - use ibc_test_framework::framework::binary::chain::run_self_connected_binary_chain_test; - use ibc_test_framework::framework::binary::channel::RunBinaryChannelTest; - - execute_mbt(|trace| { - run_self_connected_binary_chain_test(&RunBinaryConnectionTest::new( - &RunBinaryChannelTest::new(&IbcTransferMBT(trace)), - )) - }) -} - -pub struct IbcTransferMBT(Vec); - -impl TestOverrides for IbcTransferMBT { - fn modify_relayer_config(&self, config: &mut Config) { - config.mode = ModeConfig { - clients: ConfigClients { - enabled: true, - refresh: true, - misbehaviour: true, - }, - connections: ConfigConnections { enabled: true }, - channels: ConfigChannels { enabled: true }, - packets: ConfigPackets { - enabled: true, - clear_interval: 10, - clear_on_start: true, - tx_confirmation: true, - ..Default::default() - }, - }; - - for chain_config in config.chains.iter_mut() { - match chain_config { - ChainConfig::CosmosSdk(chain_config) => { - chain_config.trusting_period = Some(CLIENT_EXPIRY); - } - } - } - } - - fn should_spawn_supervisor(&self) -> bool { - false - } -} - -impl BinaryChannelTest for IbcTransferMBT { - fn run( - &self, - config: &TestConfig, - relayer: RelayerDriver, - chains: ConnectedChains, - channels: ConnectedChannel, - ) -> Result<(), Error> { - let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(0))); - // relayer is spawned - let mut supervisor = Some(relayer.spawn_supervisor()?); - - for state in &self.0 { - match &state.action { - Action::Null => { - info!("[Init] Done"); - } - Action::LocalTransfer { - chain_id, - source, - target, - denom, - amount, - } => { - info!("[LocalTransfer] Init"); - let node: Tagged = get_chain(&chains, *chain_id); - super::handlers::local_transfer_handler( - node, - *source, - *target, - *denom, - *amount, - &fee_denom_a.with_amount(381000000u64).as_ref(), - )?; - info!("[LocalTransfer] Done"); - } - Action::RestoreRelay => { - if supervisor.is_none() { - supervisor = Some(relayer.spawn_supervisor()?); - } - - info!("[RestoreRelay] Done"); - } - Action::InterruptRelay => { - supervisor.take().expect("one").shutdown(); - - info!("[InterruptRelay] Done"); - } - Action::IBCTransferSendPacket { packet } => { - info!("[IBCTransferSendPacket] {:?}", packet); - - match (packet.source_chain_id, packet.target_chain_id) { - (1, 2) => { - assert!( - super::utils::get_committed_packets_at_src( - &chains.handle_a, - &channels - )? - .is_empty(), - "no packets present" - ); - - super::handlers::ibc_transfer_send_packet( - chains.node_a.as_ref(), - chains.node_b.as_ref(), - &channels, - packet, - )?; - - assert_eq!( - super::utils::get_committed_packets_at_src( - &chains.handle_a, - &channels, - )? - .len(), - 1, - "one packet is sent" - ); - } - (2, 1) => { - assert!( - super::utils::get_committed_packets_at_src( - &chains.handle_b, - &channels.clone().flip() - )? - .is_empty(), - "no packets present" - ); - - super::handlers::ibc_transfer_send_packet( - chains.node_b.as_ref(), - chains.node_a.as_ref(), - &channels.clone().flip(), - packet, - )?; - - assert_eq!( - super::utils::get_committed_packets_at_src( - &chains.handle_b, - &channels.clone().flip() - )? - .len(), - 1, - "one packet is present" - ); - } - _ => unreachable!(), - } - - info!("[IBCTransferSendPacket] Done"); - } - Action::IBCTransferReceivePacket { packet } => { - info!("[IBCTransferReceivePacket] {:?}", packet); - match (packet.source_chain_id, packet.target_chain_id) { - (1, 2) => { - super::handlers::ibc_transfer_receive_packet( - chains.node_a.as_ref(), - chains.node_b.as_ref(), - &channels, - packet, - )?; - assert_eq!( - super::utils::get_acknowledged_packets_at_dst( - &chains.handle_b, - &channels.clone().flip() - )? - .len(), - 1, - "one packet is received and sent acknowledgement" - ); - } - (2, 1) => { - super::handlers::ibc_transfer_receive_packet( - chains.node_b.as_ref(), - chains.node_a.as_ref(), - &channels.clone().flip(), - packet, - )?; - assert_eq!( - super::utils::get_acknowledged_packets_at_dst( - &chains.handle_a, - &channels - )? - .len(), - 1, - "one packet is received and sent acknowledgement" - ); - } - _ => unreachable!(), - } - - info!("[IBCTransferReceivePacket] Done"); - } - Action::IBCTransferAcknowledgePacket { packet } => { - info!("[IBCTransferAcknowledgePacket] {:?}", packet); - super::utils::wait_for_client(); - match (packet.source_chain_id, packet.target_chain_id) { - (1, 2) => { - assert!( - super::utils::get_committed_packets_at_src( - &chains.handle_a, - &channels - )? - .is_empty(), - "commitment is completed" - ); - } - (2, 1) => { - assert!( - super::utils::get_committed_packets_at_src( - &chains.handle_b, - &channels.clone().flip() - )? - .is_empty(), - "commitment is completed" - ); - } - _ => unreachable!(), - } - - info!("[IBCTransferAcknowledgePacket] Done"); - } - Action::IBCTransferTimeoutPacket { packet } => { - info!("[IBCTransferTimeoutPacket] {:?}", packet); - - match (packet.source_chain_id, packet.target_chain_id) { - (1, 2) => {} - (2, 1) => {} - _ => unreachable!(), - } - - info!("[IBCTransferTimeoutPacket] Done") - } - } - } - - Ok(()) - } -} diff --git a/tools/integration-test/src/mbt/utils.rs b/tools/integration-test/src/mbt/utils.rs deleted file mode 100644 index 308dc45ab3..0000000000 --- a/tools/integration-test/src/mbt/utils.rs +++ /dev/null @@ -1,132 +0,0 @@ -use ibc_relayer::chain::requests::{ - Paginate, QueryPacketAcknowledgementsRequest, QueryPacketCommitmentsRequest, - QueryUnreceivedAcksRequest, QueryUnreceivedPacketsRequest, -}; -use ibc_relayer_types::core::ics04_channel::packet::Sequence; -use ibc_test_framework::prelude::*; -use ibc_test_framework::types::tagged::mono::Tagged; - -use super::{ - itf::InformalTrace, - state::{DenomId, State}, -}; - -pub const CLIENT_EXPIRY: Duration = Duration::from_secs(15); - -pub fn get_chain( - chains: &ConnectedChains, - chain_id: u128, -) -> Tagged -where - ChainA: ChainHandle, - ChainB: ChainHandle, - ChainX: ChainHandle, -{ - Tagged::new(match chain_id { - 1 => chains.node_a.value(), - 2 => chains.node_b.value(), - _ => unreachable!(), - }) -} - -pub fn get_wallet<'a, ChainX>( - wallets: &'a Tagged, - user: u128, -) -> Tagged { - match user { - 1 => wallets.user1(), - 2 => wallets.user2(), - _ => unreachable!(), - } -} - -pub fn get_denom<'a, ChainX>( - chain: &'a Tagged, - denom: DenomId, -) -> Tagged { - match denom { - 1 => chain.denom(), - 2 => chain.denom(), - _ => unreachable!(), - } -} - -pub fn wait_for_client() { - let sleep_time = CLIENT_EXPIRY + Duration::from_secs(5); - - info!( - "Sleeping for {} seconds to wait for IBC client to expire", - sleep_time.as_secs() - ); - - sleep(sleep_time); -} - -pub fn parse_itf_from_json(itf_path: &str) -> Vec { - let itf_json = std::fs::read_to_string(itf_path).expect("itf file does not exist. did you run `apalache check --inv=Invariant --run-dir=run main.tla` first?"); - - let trace: InformalTrace = - serde_json::from_str(&itf_json).expect("deserialization error"); - - trace.states -} - -pub fn get_unreceived_packets_at_dst( - chain: &ChainA, - channel: &ConnectedChannel, -) -> Result, Error> { - let port_id_a = channel.port_a.value(); - let channel_id_a = channel.channel_id_a.value(); - let request = QueryUnreceivedPacketsRequest { - port_id: port_id_a.clone(), - channel_id: channel_id_a.clone(), - packet_commitment_sequences: Vec::new(), - }; - Ok(chain.query_unreceived_packets(request)?) -} - -pub fn get_committed_packets_at_src( - chain: &ChainA, - channel: &ConnectedChannel, -) -> Result, Error> { - let port_id_a = channel.port_a.value(); - let channel_id_a = channel.channel_id_a.value(); - let request = QueryPacketCommitmentsRequest { - port_id: port_id_a.clone(), - channel_id: channel_id_a.clone(), - pagination: Paginate::All, - }; - let (sequences, _) = chain.query_packet_commitments(request)?; - Ok(sequences) -} - -pub fn get_unacknowledged_packets_at_src( - chain: &ChainA, - channel: &ConnectedChannel, -) -> Result, Error> { - let port_id_a = channel.port_a.value(); - let channel_id_a = channel.channel_id_a.value(); - let request = QueryUnreceivedAcksRequest { - port_id: port_id_a.clone(), - channel_id: channel_id_a.clone(), - packet_ack_sequences: Vec::new(), - }; - Ok(chain.query_unreceived_acknowledgements(request)?) -} - -pub fn get_acknowledged_packets_at_dst( - chain: &ChainA, - channel: &ConnectedChannel, -) -> Result, Error> { - let port_id_a = channel.port_a.value(); - let channel_id_a = channel.channel_id_a.value(); - let request = QueryPacketAcknowledgementsRequest { - port_id: port_id_a.clone(), - channel_id: channel_id_a.clone(), - pagination: Paginate::All, - packet_commitment_sequences: Vec::new(), - }; - Ok(chain.query_packet_acknowledgements(request)?.0) -} - -pub fn drop(_: X) {} From 39689c7e7f350125992a5f946152608e8af00b96 Mon Sep 17 00:00:00 2001 From: Sergey <83376337+freak12techno@users.noreply.github.com> Date: Wed, 14 Aug 2024 12:18:04 +0300 Subject: [PATCH 180/200] fix: fixed dynamic_gas_queried_success_fees metric name (#4146) --- .../{bug-fixe => bug-fixes}/4104-memo-overwrite-bug.md | 0 .../bug-fixes/4145-fix-dynamic-gas-price-metric-name.md | 3 +++ crates/telemetry/src/state.rs | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) rename .changelog/unreleased/{bug-fixe => bug-fixes}/4104-memo-overwrite-bug.md (100%) create mode 100644 .changelog/unreleased/bug-fixes/4145-fix-dynamic-gas-price-metric-name.md diff --git a/.changelog/unreleased/bug-fixe/4104-memo-overwrite-bug.md b/.changelog/unreleased/bug-fixes/4104-memo-overwrite-bug.md similarity index 100% rename from .changelog/unreleased/bug-fixe/4104-memo-overwrite-bug.md rename to .changelog/unreleased/bug-fixes/4104-memo-overwrite-bug.md diff --git a/.changelog/unreleased/bug-fixes/4145-fix-dynamic-gas-price-metric-name.md b/.changelog/unreleased/bug-fixes/4145-fix-dynamic-gas-price-metric-name.md new file mode 100644 index 0000000000..fc0b9f836c --- /dev/null +++ b/.changelog/unreleased/bug-fixes/4145-fix-dynamic-gas-price-metric-name.md @@ -0,0 +1,3 @@ +- Fix the `dynamic_gas_queried_success_fees` Prometheus metric name. + ([\#4104](https://github.com/informalsystems/hermes/issues/4104)) + \ No newline at end of file diff --git a/crates/telemetry/src/state.rs b/crates/telemetry/src/state.rs index 465a367044..8414b38dcd 100644 --- a/crates/telemetry/src/state.rs +++ b/crates/telemetry/src/state.rs @@ -415,7 +415,7 @@ impl TelemetryState { .init(), dynamic_gas_queried_success_fees: meter - .f64_observable_gauge("dynamic_gas_queried_fees") + .f64_observable_gauge("dynamic_gas_queried_success_fees") .with_description("The EIP-1559 base fee successfully queried") .init(), From f69a6d702785083d8ac05d49a06fc590050eef94 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Wed, 14 Aug 2024 11:20:33 +0200 Subject: [PATCH 181/200] Use gRPC query `ConnectionParams` instead of `/genesis` to verify `max_block_time` (#4144) * Use gRPC query to retrieve 'max_block_time' instead of querying the entire genesis data * Add changelog entry * Apply suggestions from code review Co-authored-by: Romain Ruetschi Co-authored-by: Anca Zamfir Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * Override configured if it differs from queried value * Add debug log with queried value for 'max_expected_time_per_block' --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Romain Ruetschi Co-authored-by: Anca Zamfir --- ...se-connection-params-in-validate-params.md | 4 ++ crates/relayer/src/chain/cosmos.rs | 39 ++++++++------- crates/relayer/src/chain/cosmos/query.rs | 1 + .../src/chain/cosmos/query/connection.rs | 30 ++++++++++++ .../src/chain/cosmos/types/app_state.rs | 47 ------------------- crates/relayer/src/chain/cosmos/types/mod.rs | 1 - crates/relayer/src/error.rs | 3 ++ 7 files changed, 59 insertions(+), 66 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/4143-use-connection-params-in-validate-params.md create mode 100644 crates/relayer/src/chain/cosmos/query/connection.rs delete mode 100644 crates/relayer/src/chain/cosmos/types/app_state.rs diff --git a/.changelog/unreleased/improvements/ibc-relayer/4143-use-connection-params-in-validate-params.md b/.changelog/unreleased/improvements/ibc-relayer/4143-use-connection-params-in-validate-params.md new file mode 100644 index 0000000000..4578129c46 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/4143-use-connection-params-in-validate-params.md @@ -0,0 +1,4 @@ +- Use the `ibc.core.connection.v1.ConnectionParams` gRPC query to retrieve `maxExpectedTimePerBlock` + and check it against the configured `max_block_time` instead of using the `/genesis` endpoint. + This improves both startup times and reliability for most chains. + ([\#4143](https://github.com/informalsystems/hermes/issues/4143)) \ No newline at end of file diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 81ffa8a375..e6512a628d 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -1,5 +1,6 @@ use alloc::sync::Arc; use core::{future::Future, str::FromStr, time::Duration}; +use query::connection::query_connection_params; use std::{cmp::Ordering, thread}; use bytes::{Buf, Bytes}; @@ -8,7 +9,7 @@ use num_bigint::BigInt; use tokio::runtime::Runtime as TokioRuntime; use tonic::codegen::http::Uri; use tonic::metadata::AsciiMetadataValue; -use tracing::{debug, error, info, instrument, trace, warn}; +use tracing::{debug, error, instrument, trace, warn}; use ibc_proto::cosmos::base::node::v1beta1::ConfigResponse; use ibc_proto::cosmos::base::tendermint::v1beta1::service_client::ServiceClient; @@ -113,7 +114,6 @@ use crate::util::pretty::{ use crate::HERMES_VERSION; use self::gas::dynamic_gas_price; -use self::types::app_state::GenesisAppState; use self::types::gas::GasConfig; use self::version::Specs; @@ -296,27 +296,30 @@ impl CosmosSdkChain { )); } - // Query /genesis RPC endpoint to retrieve the `max_expected_time_per_block` value to use as `max_block_time`. - // If it is not found, keep the configured `max_block_time`. - match self.block_on(self.rpc_client.genesis::()) { - Ok(genesis_reponse) => { - let old_max_block_time = self.config.max_block_time; - let new_max_block_time = - Duration::from_nanos(genesis_reponse.app_state.max_expected_time_per_block()); - - if old_max_block_time.as_secs() != new_max_block_time.as_secs() { - self.config.max_block_time = new_max_block_time; - - info!( - "Updated `max_block_time` using /genesis endpoint. Old value: `{}s`, new value: `{}s`", - old_max_block_time.as_secs(), - self.config.max_block_time.as_secs() + // Query Connection Params with gRPC endpoint to retrieve the `max_expected_time_per_block` value and verify the + // configured `max_block_time`. + // If it is not found, the verification for the configured `max_block_time` is skipped. + match self.block_on(query_connection_params(&self.grpc_addr)) { + Ok(params) => { + debug!( + "queried `max_expected_time_per_block`: `{}ns`", + params.max_expected_time_per_block + ); + let new_max_block_time = Duration::from_nanos(params.max_expected_time_per_block); + + if new_max_block_time != self.config.max_block_time { + warn!( + "configured `max_block_time` value of `{}s` does not match queried value of `{}s`. \ + `max_block_time` will be updated with queried value", + self.config.max_block_time.as_secs(), + new_max_block_time.as_secs(), ); + self.config.max_block_time = new_max_block_time; } } Err(e) => { warn!( - "Will use fallback value for max_block_time: `{}s`. Error: {e}", + "configured value for max_block_time: `{}s` could not be verified. Error: {e}", self.config.max_block_time.as_secs() ); } diff --git a/crates/relayer/src/chain/cosmos/query.rs b/crates/relayer/src/chain/cosmos/query.rs index 4869056b7b..9570587172 100644 --- a/crates/relayer/src/chain/cosmos/query.rs +++ b/crates/relayer/src/chain/cosmos/query.rs @@ -16,6 +16,7 @@ use crate::error::Error; pub mod account; pub mod balance; +pub mod connection; pub mod consensus_state; pub mod custom; pub mod denom_trace; diff --git a/crates/relayer/src/chain/cosmos/query/connection.rs b/crates/relayer/src/chain/cosmos/query/connection.rs new file mode 100644 index 0000000000..34c939a36d --- /dev/null +++ b/crates/relayer/src/chain/cosmos/query/connection.rs @@ -0,0 +1,30 @@ +use http::uri::Uri; + +use ibc_proto::ibc::core::connection::v1::query_client::QueryClient; +use ibc_proto::ibc::core::connection::v1::Params; +use ibc_proto::ibc::core::connection::v1::QueryConnectionParamsRequest; + +use crate::config::default::max_grpc_decoding_size; +use crate::error::Error; + +/// Uses the GRPC client to retrieve the connection params +pub async fn query_connection_params(grpc_address: &Uri) -> Result { + let mut client = QueryClient::connect(grpc_address.clone()) + .await + .map_err(Error::grpc_transport)?; + + client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); + + let request = tonic::Request::new(QueryConnectionParamsRequest {}); + + let response = client + .connection_params(request) + .await + .map(|r| r.into_inner()) + .map_err(|e| Error::grpc_status(e, "query_connection_params".to_owned()))?; + + // Querying connection params might not be found + let params = response.params.ok_or_else(Error::empty_connection_params)?; + + Ok(params) +} diff --git a/crates/relayer/src/chain/cosmos/types/app_state.rs b/crates/relayer/src/chain/cosmos/types/app_state.rs deleted file mode 100644 index 256a1017a2..0000000000 --- a/crates/relayer/src/chain/cosmos/types/app_state.rs +++ /dev/null @@ -1,47 +0,0 @@ -//! Structure used to parse queried Genesis state using -//! /genesis RPC endpoint. - -use serde::Deserialize as SerdeDeserialize; -use serde_derive::Deserialize; -use serde_derive::Serialize; - -#[derive(Debug, Deserialize, Serialize)] -pub struct GenesisAppState { - ibc: IbcConfig, -} - -impl GenesisAppState { - pub fn max_expected_time_per_block(&self) -> u64 { - self.ibc - .connection_genesis - .params - .max_expected_time_per_block - } -} - -#[derive(Debug, Deserialize, Serialize)] -struct IbcConfig { - connection_genesis: ConnectionGenesisConfig, -} - -#[derive(Debug, Deserialize, Serialize)] -struct ConnectionGenesisConfig { - params: ConnectionGenesisParams, -} - -#[derive(Debug, Deserialize, Serialize)] -struct ConnectionGenesisParams { - #[serde(deserialize_with = "deserialize_max_expected_per_block")] - max_expected_time_per_block: u64, -} - -fn deserialize_max_expected_per_block<'de, T, D>(de: D) -> Result -where - D: serde::Deserializer<'de>, - T: std::str::FromStr, - ::Err: std::fmt::Display, -{ - String::deserialize(de)? - .parse() - .map_err(serde::de::Error::custom) -} diff --git a/crates/relayer/src/chain/cosmos/types/mod.rs b/crates/relayer/src/chain/cosmos/types/mod.rs index 9951b58784..8877d47c36 100644 --- a/crates/relayer/src/chain/cosmos/types/mod.rs +++ b/crates/relayer/src/chain/cosmos/types/mod.rs @@ -1,5 +1,4 @@ pub mod account; -pub mod app_state; pub mod config; pub mod events; pub mod gas; diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index 537470552c..cbadb37506 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -143,6 +143,9 @@ define_error! { EmptyUpgradedClientState |_| { "found no upgraded client state" }, + EmptyConnectionParams + |_| { "connection params not found" }, + ConsensusStateTypeMismatch { expected: ClientType, From de82f8a6d06807d17533ce46036dbda2a415ddc5 Mon Sep 17 00:00:00 2001 From: bytetigers Date: Wed, 14 Aug 2024 18:44:01 +0800 Subject: [PATCH 182/200] chore: fix some comments (#4142) Signed-off-by: bytetigers --- crates/relayer/src/connection/error.rs | 2 +- crates/telemetry/src/state.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/relayer/src/connection/error.rs b/crates/relayer/src/connection/error.rs index ee017b5cc9..d22c19aea1 100644 --- a/crates/relayer/src/connection/error.rs +++ b/crates/relayer/src/connection/error.rs @@ -112,7 +112,7 @@ define_error! { destination_chain_id: ChainId } |e| { - format!("the source chain of client a ({}) does not not match the destination chain of client b ({})", + format!("the source chain of client a ({}) does not match the destination chain of client b ({})", e.source_chain_id, e.destination_chain_id) }, diff --git a/crates/telemetry/src/state.rs b/crates/telemetry/src/state.rs index 8414b38dcd..e5a9c9cf96 100644 --- a/crates/telemetry/src/state.rs +++ b/crates/telemetry/src/state.rs @@ -171,7 +171,7 @@ pub struct TelemetryState { backlog_oldest_sequence: ObservableGauge, /// Record the timestamp of the last time the `backlog_*` metrics have been updated. - /// The timestamp is the time passed since since the unix epoch in seconds. + /// The timestamp is the time passed since the unix epoch in seconds. backlog_latest_update_timestamp: ObservableGauge, /// Records the length of the backlog, i.e., how many packets are pending. From 524ee6ce0be38db5b0673c62d400b85f3b945646 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:37:28 +0200 Subject: [PATCH 183/200] Release Hermes v1.10.2 (#4149) * Create .changelog release * Update CHANGELOG.md * Bump versions * Update Hermes version in guide template * Move integration test framework changes to the bottom --- .../ibc-relayer}/4104-memo-overwrite-bug.md | 0 .../4145-fix-dynamic-gas-price-metric-name.md | 0 .../4114-update-gaia-to-v18.md | 0 .../4115-update-provenance-to-v1-19-1.md | 0 .../4116-update-osmosis-to-v25-2-0.md | 0 .../4117-update-juno-to-v23.md | 0 .../4118-update-migaloo-to-v4-2-0.md | 0 .../4120-update-wasmd-to-v0-52.md | 0 .../4121-update-stride-to-v23.md | 0 .../4122-update-neutron-to-v4.md | 0 .../4071-split-packet-clear-scheduling.md | 0 .../ibc-relayer/4101-add-pagination.md | 0 ...se-connection-params-in-validate-params.md | 2 +- .changelog/v1.10.2/summary.md | 1 + CHANGELOG.md | 48 ++++ Cargo.lock | 256 ++++++++++-------- Cargo.toml | 16 +- crates/chain-registry/Cargo.toml | 2 +- crates/relayer-cli/Cargo.toml | 2 +- crates/relayer-rest/Cargo.toml | 2 +- crates/relayer-rest/tests/mock.rs | 2 +- crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 2 +- crates/relayer/src/lib.rs | 4 +- crates/telemetry/Cargo.toml | 2 +- guide/README.md | 2 +- guide/src/SUMMARY.md | 2 +- guide/src/templates/hermes-version.md | 2 +- tools/integration-test/Cargo.toml | 2 +- tools/test-framework/Cargo.toml | 2 +- 30 files changed, 222 insertions(+), 129 deletions(-) rename .changelog/{unreleased/bug-fixes => v1.10.2/bug-fixes/ibc-relayer}/4104-memo-overwrite-bug.md (100%) rename .changelog/{unreleased/bug-fixes => v1.10.2/bug-fixes/ibc-telemetry}/4145-fix-dynamic-gas-price-metric-name.md (100%) rename .changelog/{unreleased => v1.10.2}/improvements/ibc-integration-test/4114-update-gaia-to-v18.md (100%) rename .changelog/{unreleased => v1.10.2}/improvements/ibc-integration-test/4115-update-provenance-to-v1-19-1.md (100%) rename .changelog/{unreleased => v1.10.2}/improvements/ibc-integration-test/4116-update-osmosis-to-v25-2-0.md (100%) rename .changelog/{unreleased => v1.10.2}/improvements/ibc-integration-test/4117-update-juno-to-v23.md (100%) rename .changelog/{unreleased => v1.10.2}/improvements/ibc-integration-test/4118-update-migaloo-to-v4-2-0.md (100%) rename .changelog/{unreleased => v1.10.2}/improvements/ibc-integration-test/4120-update-wasmd-to-v0-52.md (100%) rename .changelog/{unreleased => v1.10.2}/improvements/ibc-integration-test/4121-update-stride-to-v23.md (100%) rename .changelog/{unreleased => v1.10.2}/improvements/ibc-integration-test/4122-update-neutron-to-v4.md (100%) rename .changelog/{unreleased => v1.10.2}/improvements/ibc-relayer/4071-split-packet-clear-scheduling.md (100%) rename .changelog/{unreleased => v1.10.2}/improvements/ibc-relayer/4101-add-pagination.md (100%) rename .changelog/{unreleased => v1.10.2}/improvements/ibc-relayer/4143-use-connection-params-in-validate-params.md (88%) create mode 100644 .changelog/v1.10.2/summary.md diff --git a/.changelog/unreleased/bug-fixes/4104-memo-overwrite-bug.md b/.changelog/v1.10.2/bug-fixes/ibc-relayer/4104-memo-overwrite-bug.md similarity index 100% rename from .changelog/unreleased/bug-fixes/4104-memo-overwrite-bug.md rename to .changelog/v1.10.2/bug-fixes/ibc-relayer/4104-memo-overwrite-bug.md diff --git a/.changelog/unreleased/bug-fixes/4145-fix-dynamic-gas-price-metric-name.md b/.changelog/v1.10.2/bug-fixes/ibc-telemetry/4145-fix-dynamic-gas-price-metric-name.md similarity index 100% rename from .changelog/unreleased/bug-fixes/4145-fix-dynamic-gas-price-metric-name.md rename to .changelog/v1.10.2/bug-fixes/ibc-telemetry/4145-fix-dynamic-gas-price-metric-name.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4114-update-gaia-to-v18.md b/.changelog/v1.10.2/improvements/ibc-integration-test/4114-update-gaia-to-v18.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4114-update-gaia-to-v18.md rename to .changelog/v1.10.2/improvements/ibc-integration-test/4114-update-gaia-to-v18.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4115-update-provenance-to-v1-19-1.md b/.changelog/v1.10.2/improvements/ibc-integration-test/4115-update-provenance-to-v1-19-1.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4115-update-provenance-to-v1-19-1.md rename to .changelog/v1.10.2/improvements/ibc-integration-test/4115-update-provenance-to-v1-19-1.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4116-update-osmosis-to-v25-2-0.md b/.changelog/v1.10.2/improvements/ibc-integration-test/4116-update-osmosis-to-v25-2-0.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4116-update-osmosis-to-v25-2-0.md rename to .changelog/v1.10.2/improvements/ibc-integration-test/4116-update-osmosis-to-v25-2-0.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4117-update-juno-to-v23.md b/.changelog/v1.10.2/improvements/ibc-integration-test/4117-update-juno-to-v23.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4117-update-juno-to-v23.md rename to .changelog/v1.10.2/improvements/ibc-integration-test/4117-update-juno-to-v23.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4118-update-migaloo-to-v4-2-0.md b/.changelog/v1.10.2/improvements/ibc-integration-test/4118-update-migaloo-to-v4-2-0.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4118-update-migaloo-to-v4-2-0.md rename to .changelog/v1.10.2/improvements/ibc-integration-test/4118-update-migaloo-to-v4-2-0.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4120-update-wasmd-to-v0-52.md b/.changelog/v1.10.2/improvements/ibc-integration-test/4120-update-wasmd-to-v0-52.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4120-update-wasmd-to-v0-52.md rename to .changelog/v1.10.2/improvements/ibc-integration-test/4120-update-wasmd-to-v0-52.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4121-update-stride-to-v23.md b/.changelog/v1.10.2/improvements/ibc-integration-test/4121-update-stride-to-v23.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4121-update-stride-to-v23.md rename to .changelog/v1.10.2/improvements/ibc-integration-test/4121-update-stride-to-v23.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4122-update-neutron-to-v4.md b/.changelog/v1.10.2/improvements/ibc-integration-test/4122-update-neutron-to-v4.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4122-update-neutron-to-v4.md rename to .changelog/v1.10.2/improvements/ibc-integration-test/4122-update-neutron-to-v4.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4071-split-packet-clear-scheduling.md b/.changelog/v1.10.2/improvements/ibc-relayer/4071-split-packet-clear-scheduling.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/4071-split-packet-clear-scheduling.md rename to .changelog/v1.10.2/improvements/ibc-relayer/4071-split-packet-clear-scheduling.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4101-add-pagination.md b/.changelog/v1.10.2/improvements/ibc-relayer/4101-add-pagination.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/4101-add-pagination.md rename to .changelog/v1.10.2/improvements/ibc-relayer/4101-add-pagination.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4143-use-connection-params-in-validate-params.md b/.changelog/v1.10.2/improvements/ibc-relayer/4143-use-connection-params-in-validate-params.md similarity index 88% rename from .changelog/unreleased/improvements/ibc-relayer/4143-use-connection-params-in-validate-params.md rename to .changelog/v1.10.2/improvements/ibc-relayer/4143-use-connection-params-in-validate-params.md index 4578129c46..81073cdfb7 100644 --- a/.changelog/unreleased/improvements/ibc-relayer/4143-use-connection-params-in-validate-params.md +++ b/.changelog/v1.10.2/improvements/ibc-relayer/4143-use-connection-params-in-validate-params.md @@ -1,4 +1,4 @@ -- Use the `ibc.core.connection.v1.ConnectionParams` gRPC query to retrieve `maxExpectedTimePerBlock` +- Use the `ibc.core.connection.v1.ConnectionParams` gRPC query to retrieve `maxExpectedTimePerBlock` and check it against the configured `max_block_time` instead of using the `/genesis` endpoint. This improves both startup times and reliability for most chains. ([\#4143](https://github.com/informalsystems/hermes/issues/4143)) \ No newline at end of file diff --git a/.changelog/v1.10.2/summary.md b/.changelog/v1.10.2/summary.md new file mode 100644 index 0000000000..220dccc7e8 --- /dev/null +++ b/.changelog/v1.10.2/summary.md @@ -0,0 +1 @@ +This release brings significant performance improvements and introduces a new configuration options for better control over packet clearing. Enhancements include faster startup times through optimized queries and the introduction of a `clear_limit` setting for packet clearing. Additionally, bug fixes and updates to the integration test framework ensure greater stability and compatibility across various environments. \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b5ef94e12c..30c45e4840 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,53 @@ # CHANGELOG +## v1.10.2 + +*August 14th, 2024* + +This release brings significant performance improvements and introduces a new configuration options for better control over packet clearing. Enhancements include faster startup times through optimized queries and the introduction of a `clear_limit` setting for packet clearing. Additionally, bug fixes and updates to the integration test framework ensure greater stability and compatibility across various environments. + +### BUG FIXES + +- [Relayer Library](relayer) + - Fix the `memo_overwrite` configuration to correctly apply the + overwrite if it is configured. + ([\#4104](https://github.com/informalsystems/hermes/issues/4104)) +- [Telemetry & Metrics](telemetry) + - Fix the `dynamic_gas_queried_success_fees` Prometheus metric name. + ([\#4104](https://github.com/informalsystems/hermes/issues/4104)) + + +### IMPROVEMENTS +- [Relayer Library](relayer) + - Add a new configuration `clear_limit` to specify the maximum number + of packets cleared every time packet clearing is triggered. + Defaults to 50. + ([\#4071](https://github.com/informalsystems/hermes/issues/4071)) + - Paginate results of `query_packet_commitments` and `query_packet_acknowledgements` + queries to speed up the scanning phase. + ([\#4101](https://github.com/informalsystems/hermes/issues/4101)) + - Use the `ibc.core.connection.v1.ConnectionParams` gRPC query to retrieve `maxExpectedTimePerBlock` + and check it against the configured `max_block_time` instead of using the `/genesis` endpoint. + This improves both startup times and reliability for most chains. + ([\#4143](https://github.com/informalsystems/hermes/issues/4143)) +- [Integration Test Framework](tools/test-framework) + - Update the version of Gaia running the integration tests in the CI from `v17.2.1` + to `v18.1.0` ([\#4114](https://github.com/informalsystems/hermes/issues/4114)) + - Update the version of Provenance running the integration tests in the CI from `v1.17.0` + to `v1.19.1` ([\#4115](https://github.com/informalsystems/hermes/issues/4115)) + - Update the version of Osmosis running the integration tests in the CI from `v25.0.0` + to `v25.2.0` ([\#4116](https://github.com/informalsystems/hermes/issues/4116)) + - Update the version of Juno running the integration tests in the CI from `v22.0.0` + to `v23.0.0` ([\#4117](https://github.com/informalsystems/hermes/issues/4117)) + - Update the version of Migaloo Chain running the integration tests in the CI from `v4.1.3` + to `v4.2.0` ([\#4118](https://github.com/informalsystems/hermes/issues/4118)) + - Update the version of `wasmd` running the integration tests in the CI from `v0.51.0` + to `v0.52.0` ([\#4120](https://github.com/informalsystems/hermes/issues/4120)) + - Update the version of Stride running the integration tests in the CI from `v21.0.0` + to `v23.0.1` ([\#4121](https://github.com/informalsystems/hermes/issues/4121)) + - Update the version of Neutron running the integration tests in the CI from `v3.0.5` + to `v4.1.0` ([\#4122](https://github.com/informalsystems/hermes/issues/4122)) + ## v1.10.1 *July 23th, 2024* diff --git a/Cargo.lock b/Cargo.lock index d1d527a186..e23e5e51a1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,9 +67,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -82,33 +82,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -157,7 +157,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -168,7 +168,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -493,9 +493,12 @@ checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" [[package]] name = "cc" -version = "1.1.6" +version = "1.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +checksum = "5fb8dd288a69fc53a1996d7ecfbf4a20d59065bff137ce7e56bbd620de191189" +dependencies = [ + "shlex", +] [[package]] name = "cfg-if" @@ -580,9 +583,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "console" @@ -632,15 +635,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] @@ -721,7 +724,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -789,7 +792,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -954,9 +957,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6dc8c8ff84895b051f07a0e65f975cf225131742531338752abfb324e4449ff" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" dependencies = [ "log", "regex", @@ -1122,7 +1125,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -1228,7 +1231,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.6", + "indexmap 2.4.0", "slab", "tokio", "tokio-util", @@ -1247,7 +1250,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.2.6", + "indexmap 2.4.0", "slab", "tokio", "tokio-util", @@ -1487,9 +1490,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" dependencies = [ "bytes", "futures-channel", @@ -1507,7 +1510,7 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.29.1" +version = "0.29.2" dependencies = [ "async-trait", "flex-error", @@ -1527,7 +1530,7 @@ dependencies = [ [[package]] name = "ibc-integration-test" -version = "0.29.1" +version = "0.29.2" dependencies = [ "byte-unit", "http 1.1.0", @@ -1564,7 +1567,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.29.1" +version = "0.29.2" dependencies = [ "anyhow", "async-stream", @@ -1633,7 +1636,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "1.10.1" +version = "1.10.2" dependencies = [ "abscissa_core", "clap", @@ -1674,7 +1677,7 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.29.1" +version = "0.29.2" dependencies = [ "axum 0.6.20", "crossbeam-channel", @@ -1689,7 +1692,7 @@ dependencies = [ [[package]] name = "ibc-relayer-types" -version = "0.29.1" +version = "0.29.2" dependencies = [ "bytes", "derive_more", @@ -1720,7 +1723,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.29.1" +version = "0.29.2" dependencies = [ "axum 0.6.20", "dashmap", @@ -1739,7 +1742,7 @@ dependencies = [ [[package]] name = "ibc-test-framework" -version = "0.29.1" +version = "0.29.2" dependencies = [ "color-eyre", "crossbeam-channel", @@ -1832,9 +1835,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown 0.14.5", @@ -1858,9 +1861,9 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -1879,9 +1882,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -1989,9 +1992,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi 0.3.9", "libc", @@ -2275,7 +2278,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2308,9 +2311,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +dependencies = [ + "zerocopy", +] [[package]] name = "primitive-types" @@ -2391,7 +2397,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -2711,7 +2717,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.2", + "rustls-pemfile 2.1.3", "rustls-pki-types", "schannel", "security-framework", @@ -2728,9 +2734,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ "base64 0.22.1", "rustls-pki-types", @@ -2738,9 +2744,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" @@ -2786,9 +2792,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.4" +version = "2.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4465c22496331e20eb047ff46e7366455bc01c0c02015c4a376de0b2cd3a1af" +checksum = "79da19444d9da7a9a82b80ecf059eceba6d3129d84a8610fd25ff2364f255466" dependencies = [ "sdd", ] @@ -2820,9 +2826,9 @@ dependencies = [ [[package]] name = "sdd" -version = "1.7.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85f05a494052771fc5bd0619742363b5e24e5ad72ab3111ec2e27925b8edc5f3" +checksum = "0495e4577c672de8254beb68d01a9b62d0e8a13c099edecdbedccce3223cd29f" [[package]] name = "sec1" @@ -2903,9 +2909,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.206" +version = "1.0.207" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b3e4cd94123dd520a128bcd11e34d9e9e423e7e3e50425cb1b4b1e3549d0284" +checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2" dependencies = [ "serde_derive", ] @@ -2931,20 +2937,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.206" +version = "1.0.207" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabfb6138d2383ea8208cf98ccf69cdfb1aff4088460681d84189aa259762f97" +checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] name = "serde_json" -version = "1.0.122" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" +checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d" dependencies = [ "itoa", "memchr", @@ -2970,7 +2976,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3000,7 +3006,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.4.0", "itoa", "ryu", "serde", @@ -3029,7 +3035,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3092,6 +3098,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.3.17" @@ -3199,7 +3211,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3236,9 +3248,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" dependencies = [ "proc-macro2", "quote", @@ -3298,14 +3310,15 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3508,7 +3521,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3534,7 +3547,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3646,7 +3659,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -3741,7 +3754,7 @@ version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.4.0", "serde", "serde_spanned", "toml_datetime", @@ -3770,7 +3783,7 @@ dependencies = [ "pin-project", "prost", "rustls-native-certs 0.7.1", - "rustls-pemfile 2.1.2", + "rustls-pemfile 2.1.3", "socket2", "tokio", "tokio-rustls 0.26.0", @@ -3803,15 +3816,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -3833,7 +3846,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] [[package]] @@ -4057,9 +4070,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "wait-timeout" @@ -4097,34 +4110,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -4134,9 +4148,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4144,28 +4158,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", @@ -4189,11 +4203,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4220,6 +4234,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -4360,6 +4383,27 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "byteorder", + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.74", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -4377,5 +4421,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.74", ] diff --git a/Cargo.toml b/Cargo.toml index 537e56f982..e8f4b9da71 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,14 +20,14 @@ exclude = [ [workspace.dependencies] # Hermes dependencies -ibc-relayer-cli = { version = "1.10.1", path = "crates/relayer-cli" } -ibc-relayer = { version = "0.29.1", path = "crates/relayer" } -ibc-relayer-rest = { version = "0.29.1", path = "crates/relayer-rest" } -ibc-relayer-types = { version = "0.29.1", path = "crates/relayer-types" } -ibc-chain-registry = { version = "0.29.1", path = "crates/chain-registry" } -ibc-telemetry = { version = "0.29.1", path = "crates/telemetry" } -ibc-test-framework = { version = "0.29.1", path = "tools/test-framework" } -ibc-integration-test = { version = "0.29.1", path = "tools/integration-test" } +ibc-relayer-cli = { version = "1.10.2", path = "crates/relayer-cli" } +ibc-relayer = { version = "0.29.2", path = "crates/relayer" } +ibc-relayer-rest = { version = "0.29.2", path = "crates/relayer-rest" } +ibc-relayer-types = { version = "0.29.2", path = "crates/relayer-types" } +ibc-chain-registry = { version = "0.29.2", path = "crates/chain-registry" } +ibc-telemetry = { version = "0.29.2", path = "crates/telemetry" } +ibc-test-framework = { version = "0.29.2", path = "tools/test-framework" } +ibc-integration-test = { version = "0.29.2", path = "tools/integration-test" } # Tendermint dependencies tendermint = { version = "0.38.1", default-features = false } diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index a828b7b38a..ad083f6582 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-chain-registry" -version = "0.29.1" +version = "0.29.2" edition = "2021" license = "Apache-2.0" keywords = ["cosmos", "ibc", "relayer", "chain", "registry"] diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index af7cc5aa23..7a5000c57a 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-cli" -version = "1.10.1" +version = "1.10.2" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index d22041ceeb..646ec45365 100644 --- a/crates/relayer-rest/Cargo.toml +++ b/crates/relayer-rest/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-rest" -version = "0.29.1" +version = "0.29.2" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index fc639a7517..2f916413ba 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -64,7 +64,7 @@ async fn version() { let rest_api_version = VersionInfo { name: "ibc-relayer-rest".to_string(), - version: "0.29.1".to_string(), + version: "0.29.2".to_string(), }; let result: JsonResult<_, ()> = JsonResult::Success(vec![version.clone(), rest_api_version]); diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 6c20d94516..416a5c7f2e 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-types" -version = "0.29.1" +version = "0.29.2" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index b470743bca..af2863ccd3 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer" -version = "0.29.1" +version = "0.29.2" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index 91c496b04f..f342fa9b8a 100644 --- a/crates/relayer/src/lib.rs +++ b/crates/relayer/src/lib.rs @@ -14,7 +14,7 @@ //! //! For the IBC relayer binary, please see [Hermes] (`ibc-relayer-cli` crate). //! -//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.10.1/ +//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.10.2/ extern crate alloc; @@ -48,4 +48,4 @@ pub mod upgrade_chain; pub mod util; pub mod worker; -pub const HERMES_VERSION: &str = "1.10.1"; +pub const HERMES_VERSION: &str = "1.10.2"; diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index 782d5f0817..4c5abda644 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-telemetry" -version = "0.29.1" +version = "0.29.2" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/guide/README.md b/guide/README.md index 5b3e24d2ab..3666489bfc 100644 --- a/guide/README.md +++ b/guide/README.md @@ -10,7 +10,7 @@ mdBook is a utility to create modern online books from Markdown files. This guide should be permanently deployed at its latest stable version at [hermes.informal.systems](https://hermes.informal.systems). -Current version: `v1.10.1`. +Current version: `v1.10.2`. The version of this guide is aligned with the [versioning of the ibc crates](../README.md). diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index 4e07270962..268a9c016b 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -1,6 +1,6 @@ # Summary -# Hermes v1.10.1 +# Hermes v1.10.2 --- - [Introduction](./index.md) diff --git a/guide/src/templates/hermes-version.md b/guide/src/templates/hermes-version.md index 804a616da1..460c8b939d 100644 --- a/guide/src/templates/hermes-version.md +++ b/guide/src/templates/hermes-version.md @@ -1 +1 @@ -v1.8.0 +v1.10.2 diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 180f33f2e5..3582dedd61 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-integration-test" -version = "0.29.1" +version = "0.29.2" edition = "2021" rust-version = "1.76.0" license = "Apache-2.0" diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 9661d0c97b..fc1faee539 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-test-framework" -version = "0.29.1" +version = "0.29.2" edition = "2021" license = "Apache-2.0" readme = "README.md" From 7dfd856abd8ba02b56cca706ec9742abf3db2294 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Wed, 14 Aug 2024 17:08:41 +0200 Subject: [PATCH 184/200] Update Celestia version running in CI to `v1.14.0` (#4150) * Update nix flake * Add changelog entry --- .../4123-update-celestia-to-v1-14-0.md | 2 + flake.lock | 44 +++++++++++++------ 2 files changed, 33 insertions(+), 13 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4123-update-celestia-to-v1-14-0.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4123-update-celestia-to-v1-14-0.md b/.changelog/unreleased/improvements/ibc-integration-test/4123-update-celestia-to-v1-14-0.md new file mode 100644 index 0000000000..6de196f323 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4123-update-celestia-to-v1-14-0.md @@ -0,0 +1,2 @@ +- Update the version of Celestia running the integration tests in the CI from `v1.11.0` + to `v1.14.0` ([\#4123](https://github.com/informalsystems/hermes/issues/4123)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index fad9651323..9a71a2fcca 100644 --- a/flake.lock +++ b/flake.lock @@ -68,16 +68,16 @@ "celestia-app-src": { "flake": false, "locked": { - "lastModified": 1717487173, - "narHash": "sha256-/17ysw5QX8hHdMPkp05eNqJFPYKU7NIn1jTFw688Fjg=", + "lastModified": 1722019080, + "narHash": "sha256-NN3O1nN+LTxDzYBzXjksfKl9DMCbFy+MsuxPBKgv9Dc=", "owner": "celestiaorg", "repo": "celestia-app", - "rev": "21b5bc747c8500e4888474df7d828e66c33f332d", + "rev": "b6db108a444c234e4b4656031d876bc45421c5f3", "type": "github" }, "original": { "owner": "celestiaorg", - "ref": "v1.11.0", + "ref": "v1.14.0", "repo": "celestia-app", "type": "github" } @@ -174,6 +174,7 @@ "ibc-go-v6-src": "ibc-go-v6-src", "ibc-go-v7-src": "ibc-go-v7-src", "ibc-go-v8-src": "ibc-go-v8-src", + "ibc-go-v9-src": "ibc-go-v9-src", "ibc-rs-src": "ibc-rs-src", "ica-src": "ica-src", "ignite-cli-src": "ignite-cli-src", @@ -218,11 +219,11 @@ "wasmvm_2_1_0-src": "wasmvm_2_1_0-src" }, "locked": { - "lastModified": 1723019846, - "narHash": "sha256-FcTJj2nGC9Jr9JmQPZATKxQ9kDIE5eHSwZvqqJI8Y50=", + "lastModified": 1723637281, + "narHash": "sha256-PVodBpj6BF+Cv8d8/tHZmWh29bAEHeAlalJdQTmBBP4=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "fbece4c8894ff01329f401021a2b8e4c661eb79e", + "rev": "5115762f60f6c700d9b211a3e7d10f4c909843dd", "type": "github" }, "original": { @@ -984,6 +985,23 @@ "type": "github" } }, + "ibc-go-v9-src": { + "flake": false, + "locked": { + "lastModified": 1723037346, + "narHash": "sha256-ba8gbJ0l4l8ZRT9XVN3hTcnxZSb5Fn20p1xiEG4/54c=", + "owner": "cosmos", + "repo": "ibc-go", + "rev": "66ebf864d7bfe2193a96c972a9e74196b2ddf104", + "type": "github" + }, + "original": { + "owner": "cosmos", + "ref": "v9.0.0-beta.1", + "repo": "ibc-go", + "type": "github" + } + }, "ibc-rs-src": { "flake": false, "locked": { @@ -1332,11 +1350,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1717868076, - "narHash": "sha256-c83Y9t815Wa34khrux81j8K8ET94ESmCuwORSKm2bQY=", + "lastModified": 1722895844, + "narHash": "sha256-kGwDuefMQgzdzMXx1BN3+pS7oKafQd6LTDG6XMwcqrU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "cd18e2ae9ab8e2a0a8d715b60c91b54c0ac35ff9", + "rev": "d3f42bd62aa840084563e3b93e4eab73cb0a0448", "type": "github" }, "original": { @@ -1379,11 +1397,11 @@ }, "nixpkgs_6": { "locked": { - "lastModified": 1722957468, - "narHash": "sha256-SQ0TCC4aklOhN/OzcztrKqDLY8SjpIZcyvTulzhDXs0=", + "lastModified": 1723603349, + "narHash": "sha256-VMg6N7MryOuvSJ8Sj6YydarnUCkL7cvMdrMcnsJnJCE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "2a13929e1f191b3690dd2f2db13098b04adb9043", + "rev": "daf7bb95821b789db24fc1ac21f613db0c1bf2cb", "type": "github" }, "original": { From 0d3b57ccaddabc7761b8434b15dd32ecfcf41529 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Thu, 15 Aug 2024 13:15:23 +0200 Subject: [PATCH 185/200] Add ibc-go v9 to chains running tests in CI (#4152) * Add ibc-go v9 to flake.nix * Add ibc-go v9 to github workflow * Add changelog entry * Use legacy message register interchain account in tests only when needed * Fix registering ICA account in tests * Disable query denom trace test for ibc-go v9 --- .../4151-add-ibc-go-v9.md | 2 + .github/workflows/integration.yaml | 5 ++ .github/workflows/multi-chains.yaml | 3 ++ flake.nix | 1 + tools/integration-test/Cargo.toml | 1 + tools/integration-test/src/tests/ica.rs | 6 +-- .../ica_ordered_channel.rs | 9 ++-- .../tests/interchain_security/ica_transfer.rs | 9 ++-- tools/integration-test/src/tests/mod.rs | 1 + tools/test-framework/src/chain/ext/ica.rs | 48 +++++++++++++------ 10 files changed, 62 insertions(+), 23 deletions(-) create mode 100644 .changelog/unreleased/features/ibc-integration-test/4151-add-ibc-go-v9.md diff --git a/.changelog/unreleased/features/ibc-integration-test/4151-add-ibc-go-v9.md b/.changelog/unreleased/features/ibc-integration-test/4151-add-ibc-go-v9.md new file mode 100644 index 0000000000..806a0e0372 --- /dev/null +++ b/.changelog/unreleased/features/ibc-integration-test/4151-add-ibc-go-v9.md @@ -0,0 +1,2 @@ +- Add ibc-go `v9` to the chains running the integration tests in the CI. + ([\#4151](https://github.com/informalsystems/hermes/issues/4151)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 8475a2e18b..bfd1e1b1c8 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -65,6 +65,11 @@ jobs: account_prefix: cosmos native_token: stake features: ica,ics29-fee,new-register-interchain-account,channel-upgrade,authz + - package: ibc-go-v9-simapp + command: simd + account_prefix: cosmos + native_token: stake + features: ica,ics29-fee,new-register-interchain-account,channel-upgrade,authz,no-denom-trace - package: wasmd command: wasmd account_prefix: wasm diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index a4063ee878..43846c1347 100644 --- a/.github/workflows/multi-chains.yaml +++ b/.github/workflows/multi-chains.yaml @@ -67,6 +67,9 @@ jobs: - package: ibc-go-v8-simapp command: simd account_prefix: cosmos + - package: ibc-go-v9-simapp + command: simd + account_prefix: cosmos second-package: - package: osmosis command: osmosisd diff --git a/flake.nix b/flake.nix index ed71fd6581..1a9ae4229a 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,7 @@ ibc-go-v6-simapp ibc-go-v7-simapp ibc-go-v8-simapp + ibc-go-v9-simapp interchain-security migaloo neutron diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 3582dedd61..d3af8f3c49 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -49,6 +49,7 @@ dynamic-gas-fee = [] new-register-interchain-account = [] authz = [] benchmark = [] +no-denom-trace = [] [[bin]] name = "test_setup_with_binary_channel" diff --git a/tools/integration-test/src/tests/ica.rs b/tools/integration-test/src/tests/ica.rs index 090c18d2df..0fe90d43ad 100644 --- a/tools/integration-test/src/tests/ica.rs +++ b/tools/integration-test/src/tests/ica.rs @@ -18,7 +18,7 @@ use ibc_relayer_types::tx_msg::Msg; use ibc_test_framework::chain::{ config::add_allow_message_interchainaccounts, - ext::ica::{register_interchain_account, register_ordered_interchain_account}, + ext::ica::{register_ordered_interchain_account, register_unordered_interchain_account}, }; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::{ @@ -99,7 +99,7 @@ impl BinaryConnectionTest for IcaFilterTestAllow { // Register an interchain account on behalf of // controller wallet `user1` where the counterparty chain is the interchain accounts host. let (wallet, channel_id, port_id) = - register_interchain_account(&chains.node_a, chains.handle_a(), &connection)?; + register_unordered_interchain_account(&chains.node_a, chains.handle_a(), &connection)?; // Check that the corresponding ICA channel is eventually established. let _counterparty_channel_id = assert_eventually_channel_established( @@ -211,7 +211,7 @@ impl BinaryConnectionTest for IcaFilterTestDeny { // Register an interchain account on behalf of controller wallet `user1` // where the counterparty chain is the interchain accounts host. let (_, channel_id, port_id) = - register_interchain_account(&chains.node_a, chains.handle_a(), &connection)?; + register_unordered_interchain_account(&chains.node_a, chains.handle_a(), &connection)?; // Wait a bit, the relayer will refuse to complete the channel handshake // because the port is explicitly disallowed by the filter. diff --git a/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs b/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs index b54786c85c..7498d724f2 100644 --- a/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs +++ b/tools/integration-test/src/tests/interchain_security/ica_ordered_channel.rs @@ -18,7 +18,7 @@ use ibc_relayer_types::signer::Signer; use ibc_relayer_types::timestamp::Timestamp; use ibc_relayer_types::tx_msg::Msg; use ibc_test_framework::chain::config::add_allow_message_interchainaccounts; -use ibc_test_framework::chain::ext::ica::register_interchain_account; +use ibc_test_framework::chain::ext::ica::register_ordered_interchain_account; use ibc_test_framework::framework::binary::channel::run_binary_interchain_security_channel_test; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::assert_eventually_channel_established; @@ -74,8 +74,11 @@ impl BinaryChannelTest for IcaOrderedChannelTest { let fee_denom_a: MonoTagged = MonoTagged::new(Denom::base(config.native_token(0))); let connection_b_to_a = channel.connection.clone().flip(); - let (wallet, channel_id, port_id) = - register_interchain_account(&chains.node_b, chains.handle_b(), &connection_b_to_a)?; + let (wallet, channel_id, port_id) = register_ordered_interchain_account( + &chains.node_b, + chains.handle_b(), + &connection_b_to_a, + )?; relayer.with_supervisor(|| { // Check that the corresponding ICA channel is eventually established. diff --git a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs index 35df6a56aa..ec12f6b591 100644 --- a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs +++ b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs @@ -12,7 +12,7 @@ use ibc_relayer_types::signer::Signer; use ibc_relayer_types::timestamp::Timestamp; use ibc_relayer_types::tx_msg::Msg; use ibc_test_framework::chain::config::add_allow_message_interchainaccounts; -use ibc_test_framework::chain::ext::ica::register_interchain_account; +use ibc_test_framework::chain::ext::ica::register_unordered_interchain_account; use ibc_test_framework::framework::binary::channel::run_binary_interchain_security_channel_test; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::assert_eventually_channel_established; @@ -57,8 +57,11 @@ impl BinaryChannelTest for InterchainSecurityIcaTransferTest { let fee_denom_a: MonoTagged = MonoTagged::new(Denom::base(config.native_token(0))); let connection_b_to_a = channel.connection.clone().flip(); - let (wallet, channel_id, port_id) = - register_interchain_account(&chains.node_b, chains.handle_b(), &connection_b_to_a)?; + let (wallet, channel_id, port_id) = register_unordered_interchain_account( + &chains.node_b, + chains.handle_b(), + &connection_b_to_a, + )?; // Check that the corresponding ICA channel is eventually established. let _counterparty_channel_id = assert_eventually_channel_established( diff --git a/tools/integration-test/src/tests/mod.rs b/tools/integration-test/src/tests/mod.rs index 6fdcc4e915..e8812377d6 100644 --- a/tools/integration-test/src/tests/mod.rs +++ b/tools/integration-test/src/tests/mod.rs @@ -14,6 +14,7 @@ pub mod client_settings; pub mod client_upgrade; pub mod connection_delay; pub mod consensus_states; +#[cfg(not(feature = "no-denom-trace"))] pub mod denom_trace; pub mod error_events; pub mod execute_schedule; diff --git a/tools/test-framework/src/chain/ext/ica.rs b/tools/test-framework/src/chain/ext/ica.rs index b90b5bb881..b97b3ad2d8 100644 --- a/tools/test-framework/src/chain/ext/ica.rs +++ b/tools/test-framework/src/chain/ext/ica.rs @@ -1,3 +1,4 @@ +use ibc_relayer::upgrade_chain::requires_legacy_upgrade_proposal; use serde_json::json; use ibc_relayer::chain::tracking::TrackedMsgs; @@ -63,7 +64,7 @@ impl<'a, Chain: Send> InterchainAccountMethodsExt for MonoTagged( +pub fn register_unordered_interchain_account( chain: &MonoTagged, handle: &Chain, connection: &ConnectedConnection, @@ -87,14 +88,24 @@ pub fn register_interchain_account Date: Mon, 26 Aug 2024 09:04:27 +0200 Subject: [PATCH 186/200] Fix sequences filtering when clearing packets with CLI (#4159) * Filter packets using excluded_sequences when calling clear packet CLI * Add changelog entry * Apply excluded sequences to acks when clearing packets with CLI --- .../3951-exclude-sequences-with-clear-cli.md | 3 +++ crates/relayer/src/link/cli.rs | 24 ++++++++++++++----- 2 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer-cli/3951-exclude-sequences-with-clear-cli.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3951-exclude-sequences-with-clear-cli.md b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3951-exclude-sequences-with-clear-cli.md new file mode 100644 index 0000000000..aca6d720ec --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3951-exclude-sequences-with-clear-cli.md @@ -0,0 +1,3 @@ +- Correctly filter out sequences from the `excluded_sequences` configuration + when clearing packets with the `clear packet` CLI. + ([\#4158](https://github.com/informalsystems/hermes/issues/4158)) \ No newline at end of file diff --git a/crates/relayer/src/link/cli.rs b/crates/relayer/src/link/cli.rs index f7b7372f4f..f07cd39e23 100644 --- a/crates/relayer/src/link/cli.rs +++ b/crates/relayer/src/link/cli.rs @@ -110,10 +110,16 @@ impl Link { sequences.retain(|seq| sequence_filter.iter().any(|range| range.contains(seq))); } + // Retain only sequences which should not be filtered out + let raw_sequences: Vec = sequences + .into_iter() + .filter(|sequence| !self.a_to_b.exclude_src_sequences.contains(sequence)) + .collect(); + info!( "{} unreceived packets found: {} ", - sequences.len(), - PrettySlice(&sequences) + raw_sequences.len(), + PrettySlice(&raw_sequences) ); let query_height = match packet_data_query_height { @@ -128,7 +134,7 @@ impl Link { .map_or(50, |cfg| cfg.query_packets_chunk_size()); self.relay_packet_messages( - sequences, + raw_sequences, query_height, chunk_size, query_send_packet_events, @@ -179,10 +185,16 @@ impl Link { sequences.retain(|seq| sequence_filter.iter().any(|range| range.contains(seq))); } + // Retain only sequences which should not be filtered out + let raw_sequences: Vec = sequences + .into_iter() + .filter(|sequence| !self.a_to_b.exclude_src_sequences.contains(sequence)) + .collect(); + info!( "{} unreceived acknowledgements found: {} ", - sequences.len(), - sequences.iter().copied().collated().format(", "), + raw_sequences.len(), + raw_sequences.iter().copied().collated().format(", "), ); let query_height = match packet_data_query_height { @@ -197,7 +209,7 @@ impl Link { .map_or(50, |cfg| cfg.query_packets_chunk_size()); self.relay_packet_messages( - sequences, + raw_sequences, query_height, chunk_size, query_write_ack_events, From 908cc8218d490ca880f472e9d0d60b3dbaa8eaf4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:35:51 +0200 Subject: [PATCH 187/200] Bump serde from 1.0.207 to 1.0.208 (#4156) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.207 to 1.0.208. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.207...v1.0.208) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e23e5e51a1..b072a09b4f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2909,9 +2909,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.207" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5665e14a49a4ea1b91029ba7d3bca9f299e1f7cfa194388ccc20f14743e784f2" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] @@ -2937,9 +2937,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.207" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aea2634c86b0e8ef2cfdc0c340baede54ec27b1e46febd7f80dffb2aa44a00e" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index e8f4b9da71..1da2fa0f4f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,7 +92,7 @@ retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" secp256k1 = "0.28.2" semver = "1.0.21" -serde = "1.0.206" +serde = "1.0.208" serde_derive = "1.0.104" serde_json = "1.0.122" serde_yaml = "0.9.34" From cb9c738459a23c3031eae173bcdc03c8e406a7bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 11:36:26 +0200 Subject: [PATCH 188/200] Bump serde_json from 1.0.124 to 1.0.125 (#4155) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.124 to 1.0.125. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.124...1.0.125) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b072a09b4f..ff08d7739c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2948,9 +2948,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.124" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66ad62847a56b3dba58cc891acd13884b9c61138d330c0d7b6181713d4fce38d" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 1da2fa0f4f..741c42c49b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ secp256k1 = "0.28.2" semver = "1.0.21" serde = "1.0.208" serde_derive = "1.0.104" -serde_json = "1.0.122" +serde_json = "1.0.125" serde_yaml = "0.9.34" serial_test = "3.1.1" sha2 = "0.10.6" From d496ebcdc0a92b73a377a9cd62d4adddd1f49d36 Mon Sep 17 00:00:00 2001 From: Elias Rad <146735585+nnsW3@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:23:07 +0300 Subject: [PATCH 189/200] Docs fix spelling issues (#4157) * fix adr-002-ibc-relayer.md Signed-off-by: Elias Rad <146735585+nnsW3@users.noreply.github.com> * fix adr-003-handler-implementation.md Signed-off-by: Elias Rad <146735585+nnsW3@users.noreply.github.com> * fix adr-004-relayer-domain-decomposition.md Signed-off-by: Elias Rad <146735585+nnsW3@users.noreply.github.com> * fix adr-006-hermes-v0.2-usecases.md Signed-off-by: Elias Rad <146735585+nnsW3@users.noreply.github.com> --------- Signed-off-by: Elias Rad <146735585+nnsW3@users.noreply.github.com> --- docs/architecture/adr-002-ibc-relayer.md | 4 ++-- docs/architecture/adr-003-handler-implementation.md | 6 +++--- docs/architecture/adr-004-relayer-domain-decomposition.md | 4 ++-- docs/architecture/adr-006-hermes-v0.2-usecases.md | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/architecture/adr-002-ibc-relayer.md b/docs/architecture/adr-002-ibc-relayer.md index 983ff24805..0ed5e63439 100644 --- a/docs/architecture/adr-002-ibc-relayer.md +++ b/docs/architecture/adr-002-ibc-relayer.md @@ -45,12 +45,12 @@ IBC protocol defines the minimal data set that must be made available to relayer #### Query Functionality IBC host state machines MUST expose an interface for inspecting their state. For Cosmos/Tendermint chains this means: - the IBC modules on chain correctly implement and respond to queries - - [IBC-Modules-Rust] an implementation for some queries currently exist in Cosmos-SDK and same and more need to be implemented in Rust. The full requirements are detailed in section Relayer Queries. + - [IBC-Modules-Rust] an implementation for some queries currently exists in Cosmos-SDK and the same and more need to be implemented in Rust. The full requirements are detailed in section Relayer Queries. - the relayer needs the ability to send rpc/http ABCI queries to and receive replies from Tendermint/Cosmos-SDK - [[ABCI Rust](https://github.com/tendermint/rust-abci)] - ABCI Rust implementation - [IBC-Modules-Rust] identifier validation is required (ICS-024) - [IBC-Modules-Rust] requires Rust types for all query responses - - [[Merkle-Proofs-Rust](https://github.com/confio/ics23/tree/master/rust)] (candidate implementation) - some query responses include proofs and included in IBC transactions by the relayer (some may be validated, TBD) + - [[Merkle-Proofs-Rust](https://github.com/confio/ics23/tree/master/rust)] (candidate implementation) - some query responses include proofs and are included in IBC transactions by the relayer (some may be validated, TBD) #### IBC Messages The relayer creates transactions that include IBC messages to manage clients, connections and channels, and send application packets to destination chains. These messages must be defined in the IBC Rust implementation [IBC-Modules-Rust]. diff --git a/docs/architecture/adr-003-handler-implementation.md b/docs/architecture/adr-003-handler-implementation.md index e552f7672e..dc78a0f56d 100644 --- a/docs/architecture/adr-003-handler-implementation.md +++ b/docs/architecture/adr-003-handler-implementation.md @@ -369,7 +369,7 @@ to deal with chain-specific datatypes, such as `Header`, `ClientState`, and To abstract over chain-specific datatypes, we introduce a trait which specifies both which types we need to abstract over, and their interface. -For the ICS 002 Client submodule, this trait looks as follow: +For the ICS 002 Client submodule, this trait looks as follows: ```rust pub trait ClientDef { @@ -379,7 +379,7 @@ pub trait ClientDef { } ``` -The `ClientDef` trait specifies three datatypes, and their corresponding interface, which is provided +The `ClientDef` trait specifies three datatypes, and their corresponding interface, which are provided via a trait defined in the same submodule. A production implementation of this interface would instantiate these types with the concrete @@ -632,4 +632,4 @@ Proposed ### Neutral -## References \ No newline at end of file +## References diff --git a/docs/architecture/adr-004-relayer-domain-decomposition.md b/docs/architecture/adr-004-relayer-domain-decomposition.md index b97f376339..c65aa638a3 100644 --- a/docs/architecture/adr-004-relayer-domain-decomposition.md +++ b/docs/architecture/adr-004-relayer-domain-decomposition.md @@ -91,7 +91,7 @@ Channel datagrams are built similarly. Packet datagrams are triggered by events, ### IBC Module -For every a transaction in a block of height H: +For every transaction in a block of height H: - call appropriate handler (this is realized by ICS26 routing sub-module), - If handler succeeds (transaction does not abort), then @@ -236,7 +236,7 @@ fn main() -> Result<(), Box> { let src_chain = ChainRuntime::new(); let dst_chain = ChainRuntime::new(); - /// chains expose handlers for commuicating with the chain related runtime + /// chains expose handlers for communicating with the chain related runtime /// which move into their own threads let src_chain_handle = src_chain.handle(); thread::spawn(move || { diff --git a/docs/architecture/adr-006-hermes-v0.2-usecases.md b/docs/architecture/adr-006-hermes-v0.2-usecases.md index e6e6488fec..2b4bad5dc3 100644 --- a/docs/architecture/adr-006-hermes-v0.2-usecases.md +++ b/docs/architecture/adr-006-hermes-v0.2-usecases.md @@ -80,7 +80,7 @@ connection, or reuse a connection in the creation of a new channel). #### Patterns -We propose two basic patterns that Hermes should be able to fulfil. +We propose two basic patterns that Hermes should be able to fulfill. 1. Simple invocations to perform basic actions. - By _action_ here we mean doing the complete handshake for an object from From 7106351f0bb06064a88b2361a624b2d67fc36c8b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 15:51:43 +0200 Subject: [PATCH 190/200] Bump serde_json from 1.0.124 to 1.0.127 (#4162) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.124 to 1.0.127. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.124...1.0.127) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Luca Joss --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ff08d7739c..5a92a1fd66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2948,9 +2948,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 741c42c49b..5e389e3a36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ secp256k1 = "0.28.2" semver = "1.0.21" serde = "1.0.208" serde_derive = "1.0.104" -serde_json = "1.0.125" +serde_json = "1.0.127" serde_yaml = "0.9.34" serial_test = "3.1.1" sha2 = "0.10.6" From 4b97bfaebf27be1f202d8b333da77008f3ea9128 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 26 Aug 2024 17:20:15 +0200 Subject: [PATCH 191/200] Use `abci_query` instead of gRPC queries during health-check (#4102) * Use Abci query instead of gRPC queries during health-check * Add changelog entry --- .../4102-abci-query-during-health-check.md | 3 + crates/relayer/src/chain/cosmos.rs | 155 +++++------------- crates/relayer/src/chain/cosmos/query.rs | 52 +++--- 3 files changed, 70 insertions(+), 140 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/4102-abci-query-during-health-check.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4102-abci-query-during-health-check.md b/.changelog/unreleased/improvements/ibc-relayer/4102-abci-query-during-health-check.md new file mode 100644 index 0000000000..6f2613b12d --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/4102-abci-query-during-health-check.md @@ -0,0 +1,3 @@ +- Use `abci_query` instead of gRPC queries when retrieving staking params + and service config during health-check, and when retrieving version information. + ([\#4102](https://github.com/informalsystems/hermes/issues/4102)) \ No newline at end of file diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index e6512a628d..43fdbaf620 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -1,20 +1,19 @@ use alloc::sync::Arc; +use bytes::Buf; +use bytes::Bytes; use core::{future::Future, str::FromStr, time::Duration}; -use query::connection::query_connection_params; -use std::{cmp::Ordering, thread}; - -use bytes::{Buf, Bytes}; use futures::future::join_all; use num_bigint::BigInt; +use prost::Message; +use std::cmp::Ordering; +use std::thread; use tokio::runtime::Runtime as TokioRuntime; use tonic::codegen::http::Uri; use tonic::metadata::AsciiMetadataValue; use tracing::{debug, error, instrument, trace, warn}; use ibc_proto::cosmos::base::node::v1beta1::ConfigResponse; -use ibc_proto::cosmos::base::tendermint::v1beta1::service_client::ServiceClient; -use ibc_proto::cosmos::base::tendermint::v1beta1::{GetSyncingRequest, GetSyncingResponse}; -use ibc_proto::cosmos::staking::v1beta1::Params as StakingParams; +use ibc_proto::cosmos::staking::v1beta1::{Params as StakingParams, QueryParamsResponse}; use ibc_proto::ibc::apps::fee::v1::{ QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, }; @@ -76,6 +75,7 @@ use crate::chain::cosmos::fee::maybe_register_counterparty_payee; use crate::chain::cosmos::gas::{calculate_fee, mul_ceil}; use crate::chain::cosmos::query::account::get_or_fetch_account; use crate::chain::cosmos::query::balance::{query_all_balances, query_balance}; +use crate::chain::cosmos::query::connection::query_connection_params; use crate::chain::cosmos::query::consensus_state::query_consensus_state_heights; use crate::chain::cosmos::query::custom::cross_chain_query_via_rpc; use crate::chain::cosmos::query::denom_trace::query_denom_trace; @@ -411,26 +411,20 @@ impl CosmosSdkChain { ); crate::telemetry!(query, self.id(), "query_staking_params"); - let mut client = self - .block_on( - ibc_proto::cosmos::staking::v1beta1::query_client::QueryClient::connect( - self.grpc_addr.clone(), - ), - ) - .map_err(Error::grpc_transport)?; - - client = client - .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); - - let request = - tonic::Request::new(ibc_proto::cosmos::staking::v1beta1::QueryParamsRequest {}); - - let response = self - .block_on(client.params(request)) - .map_err(|e| Error::grpc_status(e, "query_staking_params".to_owned()))?; + let query_response = self.block_on(abci_query( + &self.rpc_client, + &self.config().rpc_addr, + "/cosmos.staking.v1beta1.Query/Params".to_owned(), + "".to_owned(), + QueryHeight::Latest.into(), + false, + ))?; + let params_response = + QueryParamsResponse::decode(query_response.value.as_ref()).map_err(|e| { + Error::protobuf_decode("cosmos.staking.v1beta1.Query/Params".to_owned(), e) + })?; - let params = response - .into_inner() + let params = params_response .params .ok_or_else(|| Error::grpc_response_param("no staking params".to_string()))?; @@ -454,45 +448,20 @@ impl CosmosSdkChain { ); crate::telemetry!(query, self.id(), "query_config_params"); - // Helper function to diagnose if the node config query is unimplemented - // by matching on the error details. - fn is_unimplemented_node_query(err_status: &tonic::Status) -> bool { - if err_status.code() != tonic::Code::Unimplemented { - return false; - } - - err_status - .message() - .contains("unknown service cosmos.base.node.v1beta1.Service") - } - - let mut client = self - .block_on( - ibc_proto::cosmos::base::node::v1beta1::service_client::ServiceClient::connect( - self.grpc_addr.clone(), - ), - ) - .map_err(Error::grpc_transport)?; - - client = client - .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); - - let request = tonic::Request::new(ibc_proto::cosmos::base::node::v1beta1::ConfigRequest {}); - - match self.block_on(client.config(request)) { - Ok(response) => { - let params = response.into_inner(); + let query_response = self.block_on(abci_query( + &self.rpc_client, + &self.config().rpc_addr, + "/cosmos.base.node.v1beta1.Service/Config".to_owned(), + "".to_owned(), + QueryHeight::Latest.into(), + false, + ))?; + let config_response = + ConfigResponse::decode(query_response.value.as_ref()).map_err(|e| { + Error::protobuf_decode("cosmos.base.node.v1beta1.Service/Config".to_owned(), e) + })?; - Ok(Some(params)) - } - Err(e) => { - if is_unimplemented_node_query(&e) { - Ok(None) - } else { - Err(Error::grpc_status(e, "query_config_params".to_owned())) - } - } - } + Ok(Some(config_response)) } /// The minimum gas price that this node accepts @@ -664,43 +633,6 @@ impl CosmosSdkChain { } } - /// Query the chain syncing status via a gRPC query. - /// - /// Returns an error if the node is still syncing and has not caught up, - /// ie. if `sync_info.syncing` is `true`. - fn chain_grpc_status(&self) -> Result { - crate::time!( - "chain_grpc_status", - { - "src_chain": self.config().id.to_string(), - } - ); - crate::telemetry!(query, self.id(), "grpc_status"); - - let grpc_addr = self.grpc_addr.clone(); - let grpc_addr_string = grpc_addr.to_string(); - - let mut client = self - .block_on(ServiceClient::connect(grpc_addr.clone())) - .map_err(Error::grpc_transport)?; - - let request = tonic::Request::new(GetSyncingRequest {}); - - let sync_info = self - .block_on(client.get_syncing(request)) - .map_err(|e| Error::grpc_status(e, "get_syncing".to_string()))? - .into_inner(); - - if sync_info.syncing { - Err(Error::chain_not_caught_up( - grpc_addr_string, - self.config().id.clone(), - )) - } else { - Ok(sync_info) - } - } - /// Query the chain status of the RPC and gRPC nodes. /// /// Returns an error if any of the node is still syncing and has not caught up. @@ -722,15 +654,6 @@ impl CosmosSdkChain { )); } - let grpc_status = self.chain_grpc_status()?; - - if grpc_status.syncing { - return Err(Error::chain_not_caught_up( - self.config.grpc_addr.to_string(), - self.config().id.clone(), - )); - } - Ok(rpc_status) } @@ -1190,7 +1113,11 @@ impl ChainEndpoint for CosmosSdkChain { } fn version_specs(&self) -> Result { - let version_specs = self.block_on(fetch_version_specs(self.id(), &self.grpc_addr))?; + let version_specs = self.block_on(fetch_version_specs( + self.id(), + &self.rpc_client, + &self.config.rpc_addr, + ))?; Ok(version_specs) } @@ -2857,7 +2784,11 @@ fn do_health_check(chain: &CosmosSdkChain) -> Result<(), Error> { ), } - let version_specs = chain.block_on(fetch_version_specs(&chain.config.id, &chain.grpc_addr))?; + let version_specs = chain.block_on(fetch_version_specs( + &chain.config.id, + &chain.rpc_client, + &chain.config.rpc_addr, + ))?; if let Err(diagnostic) = compatibility::run_diagnostic(&version_specs) { return Err(Error::compat_check_failed( diff --git a/crates/relayer/src/chain/cosmos/query.rs b/crates/relayer/src/chain/cosmos/query.rs index 9570587172..ad6a2c91b8 100644 --- a/crates/relayer/src/chain/cosmos/query.rs +++ b/crates/relayer/src/chain/cosmos/query.rs @@ -1,16 +1,16 @@ -use http::uri::Uri; -use ibc_proto::cosmos::base::tendermint::v1beta1::service_client::ServiceClient; -use ibc_proto::cosmos::base::tendermint::v1beta1::GetNodeInfoRequest; +use ibc_proto::cosmos::base::tendermint::v1beta1::GetNodeInfoResponse; use ibc_relayer_types::core::ics04_channel::packet::Sequence; use ibc_relayer_types::core::ics23_commitment::merkle::{ convert_tm_to_ics_merkle_proof, MerkleProof, }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use prost::Message; use tendermint::block::Height; use tendermint_rpc::query::Query; use tendermint_rpc::{Client, HttpClient, Url}; use crate::chain::cosmos::version::Specs; +use crate::chain::requests::QueryHeight; use crate::chain::requests::{QueryClientEventRequest, QueryPacketEventDataRequest, QueryTxHash}; use crate::error::Error; @@ -121,36 +121,32 @@ pub async fn abci_query( } /// Queries the chain to obtain the version information. -pub async fn fetch_version_specs(chain_id: &ChainId, grpc_address: &Uri) -> Result { - let grpc_addr_string = grpc_address.to_string(); - - // Construct a gRPC client - let mut client = ServiceClient::connect(grpc_address.clone()) - .await - .map_err(|e| { - Error::fetch_version_grpc_transport( - chain_id.clone(), - grpc_addr_string.clone(), - "tendermint::ServiceClient".to_string(), +pub async fn fetch_version_specs( + chain_id: &ChainId, + rpc_client: &HttpClient, + rpc_addr: &Url, +) -> Result { + let query_response = abci_query( + rpc_client, + rpc_addr, + "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo".to_owned(), + "".to_owned(), + QueryHeight::Latest.into(), + false, + ) + .await?; + let node_info_response = + GetNodeInfoResponse::decode(query_response.value.as_ref()).map_err(|e| { + Error::protobuf_decode( + "cosmos.base.tendermint.v1beta1.Service/GetNodeInfo".to_owned(), e, ) })?; - let request = tonic::Request::new(GetNodeInfoRequest {}); - - let response = client.get_node_info(request).await.map_err(|e| { - Error::fetch_version_grpc_status( - chain_id.clone(), - grpc_addr_string.clone(), - "tendermint::ServiceClient".to_string(), - e, - ) - })?; - - let version = response.into_inner().application_version.ok_or_else(|| { + let version = node_info_response.application_version.ok_or_else(|| { Error::fetch_version_invalid_version_response( chain_id.clone(), - grpc_addr_string.clone(), + rpc_addr.to_string(), "tendermint::GetNodeInfoRequest".to_string(), ) })?; @@ -158,5 +154,5 @@ pub async fn fetch_version_specs(chain_id: &ChainId, grpc_address: &Uri) -> Resu // Parse the raw version info into a domain-type `version::Specs` version .try_into() - .map_err(|e| Error::fetch_version_parsing(chain_id.clone(), grpc_addr_string.clone(), e)) + .map_err(|e| Error::fetch_version_parsing(chain_id.clone(), rpc_addr.to_string(), e)) } From 19610ca37cc42f340082b9b697c6536860298bdf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Aug 2024 09:06:37 +0200 Subject: [PATCH 192/200] Bump serde from 1.0.208 to 1.0.209 (#4164) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.208 to 1.0.209. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.208...v1.0.209) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a92a1fd66..a8f9426fd1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2909,9 +2909,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] @@ -2937,9 +2937,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 5e389e3a36..981ea46d28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,7 +92,7 @@ retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" secp256k1 = "0.28.2" semver = "1.0.21" -serde = "1.0.208" +serde = "1.0.209" serde_derive = "1.0.104" serde_json = "1.0.127" serde_yaml = "0.9.34" From f2d4e7f819a2742c5b8ffb783703e991ae095e08 Mon Sep 17 00:00:00 2001 From: Leo Pang <34628052+allthatjazzleo@users.noreply.github.com> Date: Tue, 27 Aug 2024 15:48:04 +0800 Subject: [PATCH 193/200] fix: Add explicit root TLS configuration to gRPC clients (#4161) * fix: add explicit root tls * fix other gRPC client construct * add changelog --- .../4160-explicit-rootls-config.md | 2 + .../4160-explicit-rootls-config.md | 2 + crates/chain-registry/src/querier.rs | 3 +- crates/relayer/src/chain/cosmos.rs | 143 +++++++----------- .../relayer/src/chain/cosmos/query/account.rs | 5 +- .../relayer/src/chain/cosmos/query/balance.rs | 9 +- .../src/chain/cosmos/query/connection.rs | 5 +- .../src/chain/cosmos/query/consensus_state.rs | 19 ++- .../src/chain/cosmos/query/denom_trace.rs | 5 +- crates/relayer/src/chain/cosmos/query/fee.rs | 13 +- crates/relayer/src/chain/cosmos/simulate.rs | 5 +- crates/relayer/src/error.rs | 1 - crates/relayer/src/util.rs | 15 ++ 13 files changed, 103 insertions(+), 124 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-chain-registry/4160-explicit-rootls-config.md create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer/4160-explicit-rootls-config.md diff --git a/.changelog/unreleased/bug-fixes/ibc-chain-registry/4160-explicit-rootls-config.md b/.changelog/unreleased/bug-fixes/ibc-chain-registry/4160-explicit-rootls-config.md new file mode 100644 index 0000000000..ef68992992 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-chain-registry/4160-explicit-rootls-config.md @@ -0,0 +1,2 @@ +- add explicit root TLS configuration to gRPC clients + ([\#4160](https://github.com/informalsystems/hermes/issues/4160)) \ No newline at end of file diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/4160-explicit-rootls-config.md b/.changelog/unreleased/bug-fixes/ibc-relayer/4160-explicit-rootls-config.md new file mode 100644 index 0000000000..8bccf778ae --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer/4160-explicit-rootls-config.md @@ -0,0 +1,2 @@ +- Add explicit root TLS configuration to gRPC clients + ([\#4160](https://github.com/informalsystems/hermes/issues/4160)) \ No newline at end of file diff --git a/crates/chain-registry/src/querier.rs b/crates/chain-registry/src/querier.rs index 9df2504e41..3a3f1e02f6 100644 --- a/crates/chain-registry/src/querier.rs +++ b/crates/chain-registry/src/querier.rs @@ -13,6 +13,7 @@ use tendermint_rpc::HttpClientUrl; use tracing::{debug, info}; use ibc_proto::cosmos::bank::v1beta1::query_client::QueryClient; +use ibc_relayer::util::create_grpc_client; use ibc_relayer::HERMES_VERSION; use tendermint_rpc::{Client, Url}; @@ -159,7 +160,7 @@ impl QueryContext for GrpcHealthCheckQuerier { info!("Querying gRPC server at {tendermint_url}"); - QueryClient::connect(uri) + create_grpc_client(uri, QueryClient::new) .await .map_err(|_| RegistryError::unable_to_connect_with_grpc())?; diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 43fdbaf620..338a7f9af1 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -107,6 +107,7 @@ use crate::light_client::tendermint::LightClient as TmLightClient; use crate::light_client::{LightClient, Verified}; use crate::misbehaviour::MisbehaviourEvidence; use crate::util::compat_mode::compat_mode_from_version; +use crate::util::create_grpc_client; use crate::util::pretty::PrettySlice; use crate::util::pretty::{ PrettyIdentifiedChannel, PrettyIdentifiedClientState, PrettyIdentifiedConnection, @@ -374,13 +375,10 @@ impl CosmosSdkChain { ); crate::telemetry!(query, self.id(), "query_ccv_consumer_chain_params"); - let mut client = self - .block_on( - ibc_proto::interchain_security::ccv::consumer::v1::query_client::QueryClient::connect( - self.grpc_addr.clone() - ), - ) - .map_err(Error::grpc_transport)?; + let mut client = self.block_on(create_grpc_client( + self.grpc_addr.clone(), + ibc_proto::interchain_security::ccv::consumer::v1::query_client::QueryClient::new, + ))?; client = client .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); @@ -1228,13 +1226,10 @@ impl ChainEndpoint for CosmosSdkChain { ); crate::telemetry!(query, self.id(), "query_clients"); - let mut client = self - .block_on( - ibc_proto::ibc::core::client::v1::query_client::QueryClient::connect( - self.grpc_addr.clone(), - ), - ) - .map_err(Error::grpc_transport)?; + let mut client = self.block_on(create_grpc_client( + self.grpc_addr.clone(), + ibc_proto::ibc::core::client::v1::query_client::QueryClient::new, + ))?; client = client .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); @@ -1419,13 +1414,10 @@ impl ChainEndpoint for CosmosSdkChain { ); crate::telemetry!(query, self.id(), "query_client_connections"); - let mut client = self - .block_on( - ibc_proto::ibc::core::connection::v1::query_client::QueryClient::connect( - self.grpc_addr.clone(), - ), - ) - .map_err(Error::grpc_transport)?; + let mut client = self.block_on(create_grpc_client( + self.grpc_addr.clone(), + ibc_proto::ibc::core::connection::v1::query_client::QueryClient::new, + ))?; client = client .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); @@ -1465,13 +1457,10 @@ impl ChainEndpoint for CosmosSdkChain { ); crate::telemetry!(query, self.id(), "query_connections"); - let mut client = self - .block_on( - ibc_proto::ibc::core::connection::v1::query_client::QueryClient::connect( - self.grpc_addr.clone(), - ), - ) - .map_err(Error::grpc_transport)?; + let mut client = self.block_on(create_grpc_client( + self.grpc_addr.clone(), + ibc_proto::ibc::core::connection::v1::query_client::QueryClient::new, + ))?; client = client .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); @@ -1523,10 +1512,11 @@ impl ChainEndpoint for CosmosSdkChain { use ibc_proto::ibc::core::connection::v1 as connection; use tonic::IntoRequest; - let mut client = - connection::query_client::QueryClient::connect(chain.grpc_addr.clone()) - .await - .map_err(Error::grpc_transport)?; + let mut client = create_grpc_client( + chain.grpc_addr.clone(), + connection::query_client::QueryClient::new, + ) + .await?; client = client.max_decoding_message_size( chain.config().max_grpc_decoding_size.get_bytes() as usize, @@ -1604,13 +1594,10 @@ impl ChainEndpoint for CosmosSdkChain { ); crate::telemetry!(query, self.id(), "query_connection_channels"); - let mut client = self - .block_on( - ibc_proto::ibc::core::channel::v1::query_client::QueryClient::connect( - self.grpc_addr.clone(), - ), - ) - .map_err(Error::grpc_transport)?; + let mut client = self.block_on(create_grpc_client( + self.grpc_addr.clone(), + ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, + ))?; client = client .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); @@ -1676,13 +1663,10 @@ impl ChainEndpoint for CosmosSdkChain { ); crate::telemetry!(query, self.id(), "query_channels"); - let mut client = self - .block_on( - ibc_proto::ibc::core::channel::v1::query_client::QueryClient::connect( - self.grpc_addr.clone(), - ), - ) - .map_err(Error::grpc_transport)?; + let mut client = self.block_on(create_grpc_client( + self.grpc_addr.clone(), + ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, + ))?; client = client .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); @@ -1800,13 +1784,10 @@ impl ChainEndpoint for CosmosSdkChain { ); crate::telemetry!(query, self.id(), "query_channel_client_state"); - let mut client = self - .block_on( - ibc_proto::ibc::core::channel::v1::query_client::QueryClient::connect( - self.grpc_addr.clone(), - ), - ) - .map_err(Error::grpc_transport)?; + let mut client = self.block_on(create_grpc_client( + self.grpc_addr.clone(), + ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, + ))?; client = client .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); @@ -1871,17 +1852,15 @@ impl ChainEndpoint for CosmosSdkChain { crate::telemetry!(query, self.id(), "query_packet_commitments"); let mut client = self - .block_on( - ibc_proto::ibc::core::channel::v1::query_client::QueryClient::connect( - self.grpc_addr.clone(), - ), - ) + .block_on(create_grpc_client( + self.grpc_addr.clone(), + ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, + )) .map(|client| { client.max_decoding_message_size( self.config().max_grpc_decoding_size.get_bytes() as usize ) - }) - .map_err(Error::grpc_transport)?; + })?; if request.pagination.is_enabled() { let mut results = Vec::new(); @@ -2033,13 +2012,10 @@ impl ChainEndpoint for CosmosSdkChain { ); crate::telemetry!(query, self.id(), "query_unreceived_packets"); - let mut client = self - .block_on( - ibc_proto::ibc::core::channel::v1::query_client::QueryClient::connect( - self.grpc_addr.clone(), - ), - ) - .map_err(Error::grpc_transport)?; + let mut client = self.block_on(create_grpc_client( + self.grpc_addr.clone(), + ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, + ))?; client = client .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); @@ -2109,17 +2085,15 @@ impl ChainEndpoint for CosmosSdkChain { } let mut client = self - .block_on( - ibc_proto::ibc::core::channel::v1::query_client::QueryClient::connect( - self.grpc_addr.clone(), - ), - ) + .block_on(create_grpc_client( + self.grpc_addr.clone(), + ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, + )) .map(|client| { client.max_decoding_message_size( self.config().max_grpc_decoding_size.get_bytes() as usize ) - }) - .map_err(Error::grpc_transport)?; + })?; if request.pagination.is_enabled() { let mut results = Vec::new(); @@ -2229,13 +2203,10 @@ impl ChainEndpoint for CosmosSdkChain { ); crate::telemetry!(query, self.id(), "query_unreceived_acknowledgements"); - let mut client = self - .block_on( - ibc_proto::ibc::core::channel::v1::query_client::QueryClient::connect( - self.grpc_addr.clone(), - ), - ) - .map_err(Error::grpc_transport)?; + let mut client = self.block_on(create_grpc_client( + self.grpc_addr.clone(), + ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, + ))?; client = client .max_decoding_message_size(self.config().max_grpc_decoding_size.get_bytes() as usize); @@ -2570,12 +2541,10 @@ impl ChainEndpoint for CosmosSdkChain { ); crate::telemetry!(query, self.id(), "query_consumer_chains"); - let mut client = self.block_on( - ibc_proto::interchain_security::ccv::provider::v1::query_client::QueryClient::connect( - self.grpc_addr.clone(), - ), - ) - .map_err(Error::grpc_transport)?; + let mut client = self.block_on(create_grpc_client( + self.grpc_addr.clone(), + ibc_proto::interchain_security::ccv::provider::v1::query_client::QueryClient::new, + ))?; let request = tonic::Request::new( ibc_proto::interchain_security::ccv::provider::v1::QueryConsumerChainsRequest {}, diff --git a/crates/relayer/src/chain/cosmos/query/account.rs b/crates/relayer/src/chain/cosmos/query/account.rs index e24c414ff7..aeafea7529 100644 --- a/crates/relayer/src/chain/cosmos/query/account.rs +++ b/crates/relayer/src/chain/cosmos/query/account.rs @@ -7,6 +7,7 @@ use tracing::info; use crate::chain::cosmos::types::account::Account; use crate::config::default::max_grpc_decoding_size; use crate::error::Error; +use crate::util::create_grpc_client; /// Get a `&mut Account` from an `&mut Option` if it is `Some(Account)`. /// Otherwise query for the account information, update the `Option` to `Some`, @@ -54,9 +55,7 @@ pub async fn query_account( grpc_address: &Uri, account_address: &str, ) -> Result { - let mut client = QueryClient::connect(grpc_address.clone()) - .await - .map_err(Error::grpc_transport)?; + let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); diff --git a/crates/relayer/src/chain/cosmos/query/balance.rs b/crates/relayer/src/chain/cosmos/query/balance.rs index 114bd27e74..c197b94331 100644 --- a/crates/relayer/src/chain/cosmos/query/balance.rs +++ b/crates/relayer/src/chain/cosmos/query/balance.rs @@ -7,6 +7,7 @@ use ibc_proto::cosmos::bank::v1beta1::{ use crate::account::Balance; use crate::config::default::max_grpc_decoding_size; use crate::error::Error; +use crate::util::create_grpc_client; /// Uses the GRPC client to retrieve the account balance for a specific denom pub async fn query_balance( @@ -14,9 +15,7 @@ pub async fn query_balance( account_address: &str, denom: &str, ) -> Result { - let mut client = QueryClient::connect(grpc_address.clone()) - .await - .map_err(Error::grpc_transport)?; + let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); @@ -47,9 +46,7 @@ pub async fn query_all_balances( grpc_address: &Uri, account_address: &str, ) -> Result, Error> { - let mut client = QueryClient::connect(grpc_address.clone()) - .await - .map_err(Error::grpc_transport)?; + let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); diff --git a/crates/relayer/src/chain/cosmos/query/connection.rs b/crates/relayer/src/chain/cosmos/query/connection.rs index 34c939a36d..2fbfe29650 100644 --- a/crates/relayer/src/chain/cosmos/query/connection.rs +++ b/crates/relayer/src/chain/cosmos/query/connection.rs @@ -6,12 +6,11 @@ use ibc_proto::ibc::core::connection::v1::QueryConnectionParamsRequest; use crate::config::default::max_grpc_decoding_size; use crate::error::Error; +use crate::util::create_grpc_client; /// Uses the GRPC client to retrieve the connection params pub async fn query_connection_params(grpc_address: &Uri) -> Result { - let mut client = QueryClient::connect(grpc_address.clone()) - .await - .map_err(Error::grpc_transport)?; + let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); diff --git a/crates/relayer/src/chain/cosmos/query/consensus_state.rs b/crates/relayer/src/chain/cosmos/query/consensus_state.rs index 538b5cb140..3f95b47013 100644 --- a/crates/relayer/src/chain/cosmos/query/consensus_state.rs +++ b/crates/relayer/src/chain/cosmos/query/consensus_state.rs @@ -7,6 +7,7 @@ use crate::chain::requests::{QueryConsensusStateHeightsRequest, QueryConsensusSt use crate::config::default::max_grpc_decoding_size; use crate::consensus_state::AnyConsensusStateWithHeight; use crate::error::Error; +use crate::util::create_grpc_client; use crate::util::pretty::{PrettyConsensusStateWithHeight, PrettyHeight}; /// Performs a `QueryConsensusStateHeightsRequest` gRPC query to fetch all the consensus state @@ -36,10 +37,11 @@ pub async fn query_consensus_state_heights( .contains("unknown method ConsensusStateHeights") } - let mut client = - ibc_proto::ibc::core::client::v1::query_client::QueryClient::connect(grpc_addr.clone()) - .await - .map_err(Error::grpc_transport)?; + let mut client = create_grpc_client( + grpc_addr.clone(), + ibc_proto::ibc::core::client::v1::query_client::QueryClient::new, + ) + .await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); @@ -105,10 +107,11 @@ pub async fn query_consensus_states( } ); - let mut client = - ibc_proto::ibc::core::client::v1::query_client::QueryClient::connect(grpc_addr.clone()) - .await - .map_err(Error::grpc_transport)?; + let mut client = create_grpc_client( + grpc_addr.clone(), + ibc_proto::ibc::core::client::v1::query_client::QueryClient::new, + ) + .await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); diff --git a/crates/relayer/src/chain/cosmos/query/denom_trace.rs b/crates/relayer/src/chain/cosmos/query/denom_trace.rs index a0ef33cff0..050aea8c48 100644 --- a/crates/relayer/src/chain/cosmos/query/denom_trace.rs +++ b/crates/relayer/src/chain/cosmos/query/denom_trace.rs @@ -7,12 +7,11 @@ use ibc_proto::ibc::applications::transfer::v1::{ use crate::config::default::max_grpc_decoding_size; use crate::denom::DenomTrace; use crate::error::Error; +use crate::util::create_grpc_client; // Uses the GRPC client to retrieve the denom trace for a specific hash pub async fn query_denom_trace(grpc_address: &Uri, hash: &str) -> Result { - let mut client = QueryClient::connect(grpc_address.clone()) - .await - .map_err(Error::grpc_transport)?; + let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); diff --git a/crates/relayer/src/chain/cosmos/query/fee.rs b/crates/relayer/src/chain/cosmos/query/fee.rs index fab58fcc2a..e59e70bc41 100644 --- a/crates/relayer/src/chain/cosmos/query/fee.rs +++ b/crates/relayer/src/chain/cosmos/query/fee.rs @@ -13,15 +13,14 @@ use tonic::Code; use crate::config::default::max_grpc_decoding_size; use crate::error::Error; +use crate::util::create_grpc_client; pub async fn query_counterparty_payee( grpc_address: &Uri, channel_id: &ChannelId, address: &Signer, ) -> Result, Error> { - let mut client = QueryClient::connect(grpc_address.clone()) - .await - .map_err(Error::grpc_transport)?; + let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); @@ -53,9 +52,7 @@ pub async fn query_incentivized_packets( channel_id: &ChannelId, port_id: &PortId, ) -> Result, Error> { - let mut client = QueryClient::connect(grpc_address.clone()) - .await - .map_err(Error::grpc_transport)?; + let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); @@ -87,9 +84,7 @@ pub async fn query_incentivized_packet( grpc_address: &Uri, request: QueryIncentivizedPacketRequest, ) -> Result { - let mut client = QueryClient::connect(grpc_address.clone()) - .await - .map_err(Error::grpc_transport)?; + let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); diff --git a/crates/relayer/src/chain/cosmos/simulate.rs b/crates/relayer/src/chain/cosmos/simulate.rs index 0cb142d698..c48d3027a3 100644 --- a/crates/relayer/src/chain/cosmos/simulate.rs +++ b/crates/relayer/src/chain/cosmos/simulate.rs @@ -4,6 +4,7 @@ use tonic::codegen::http::Uri; use crate::config::default::max_grpc_decoding_size; use crate::error::Error; +use crate::util::create_grpc_client; pub async fn send_tx_simulate(grpc_address: &Uri, tx: Tx) -> Result { let mut tx_bytes = vec![]; @@ -15,9 +16,7 @@ pub async fn send_tx_simulate(grpc_address: &Uri, tx: Tx) -> Result ] |e| { format!("failed while fetching version info from endpoint {0} on the gRPC interface of chain {1}:{2}", e.endpoint, e.chain_id, e.address) diff --git a/crates/relayer/src/util.rs b/crates/relayer/src/util.rs index 852764ca50..765792e92b 100644 --- a/crates/relayer/src/util.rs +++ b/crates/relayer/src/util.rs @@ -15,3 +15,18 @@ pub mod retry; pub mod seq_range; pub mod stream; pub mod task; + +/// Helper function to create a gRPC client. +pub async fn create_grpc_client( + grpc_addr: tonic::transport::Uri, + client_constructor: impl FnOnce(tonic::transport::Channel) -> T, +) -> Result { + let tls_config = tonic::transport::ClientTlsConfig::new().with_native_roots(); + let channel = tonic::transport::Channel::builder(grpc_addr) + .tls_config(tls_config) + .map_err(crate::error::Error::grpc_transport)? + .connect() + .await + .map_err(crate::error::Error::grpc_transport)?; + Ok(client_constructor(channel)) +} From ccd1d907df4853203349057bba200077254bb83d Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Thu, 29 Aug 2024 16:42:55 +0200 Subject: [PATCH 194/200] Update Neutron to `v4.2.2` and Juno to `v24.0.0` (#4173) * Update nix flake * Add ICS29 feature to Juno tests * Add changelog entries * Disable Injective tests --- .../4168-update-neutron-v4-2-2.md | 2 + .../4171-update-juno-v24.md | 2 + .github/workflows/integration.yaml | 14 +- flake.lock | 193 +++++++++++++----- 4 files changed, 149 insertions(+), 62 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4168-update-neutron-v4-2-2.md create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4171-update-juno-v24.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4168-update-neutron-v4-2-2.md b/.changelog/unreleased/improvements/ibc-integration-test/4168-update-neutron-v4-2-2.md new file mode 100644 index 0000000000..1ca212bf53 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4168-update-neutron-v4-2-2.md @@ -0,0 +1,2 @@ +- Update the version of Neutron running the integration tests in the CI from `v4.1.0` + to `v4.2.2` ([\#4168](https://github.com/informalsystems/hermes/issues/4168)) \ No newline at end of file diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4171-update-juno-v24.md b/.changelog/unreleased/improvements/ibc-integration-test/4171-update-juno-v24.md new file mode 100644 index 0000000000..e5d46c87f5 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4171-update-juno-v24.md @@ -0,0 +1,2 @@ +- Update the version of Juno running the integration tests in the CI from `v23.0.0` + to `v24.0.0` ([\#4171](https://github.com/informalsystems/hermes/issues/4171)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index bfd1e1b1c8..59f90f2caf 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -84,7 +84,7 @@ jobs: command: junod account_prefix: juno native_token: stake - features: juno,forward-packet,ica + features: juno,forward-packet,ica,ics29-fee - package: provenance command: provenanced account_prefix: pb @@ -95,11 +95,13 @@ jobs: account_prefix: migaloo native_token: stake features: ics29-fee,ica,forward-packet - - package: injective - command: injectived - account_prefix: inj - native_token: stake - features: forward-packet,fee-grant + # Disable Injective because wasmvm hasn't been correctly + # wired for Injective in Cosmos Nix + #- package: injective + # command: injectived + # account_prefix: inj + # native_token: stake + # features: forward-packet,fee-grant steps: - uses: actions/checkout@v4 diff --git a/flake.lock b/flake.lock index 9a71a2fcca..08de203ba9 100644 --- a/flake.lock +++ b/flake.lock @@ -157,6 +157,7 @@ "gaia15-src": "gaia15-src", "gaia17-src": "gaia17-src", "gaia18-src": "gaia18-src", + "gaia19-src": "gaia19-src", "gaia5-src": "gaia5-src", "gaia6-ordered-src": "gaia6-ordered-src", "gaia6-src": "gaia6-src", @@ -173,7 +174,9 @@ "ibc-go-v5-src": "ibc-go-v5-src", "ibc-go-v6-src": "ibc-go-v6-src", "ibc-go-v7-src": "ibc-go-v7-src", + "ibc-go-v7-wasm-src": "ibc-go-v7-wasm-src", "ibc-go-v8-src": "ibc-go-v8-src", + "ibc-go-v8-wasm-src": "ibc-go-v8-wasm-src", "ibc-go-v9-src": "ibc-go-v9-src", "ibc-rs-src": "ibc-rs-src", "ica-src": "ica-src", @@ -188,7 +191,7 @@ "neutron-src": "neutron-src", "nix-std": "nix-std", "nix2container": "nix2container", - "nixpkgs": "nixpkgs_3", + "nixpkgs": "nixpkgs_2", "osmosis-src": "osmosis-src", "provenance-src": "provenance-src", "regen-src": "regen-src", @@ -214,16 +217,18 @@ "wasmvm_1_3_0-src": "wasmvm_1_3_0-src", "wasmvm_1_5_0-src": "wasmvm_1_5_0-src", "wasmvm_1_5_2-src": "wasmvm_1_5_2-src", + "wasmvm_1_5_4-src": "wasmvm_1_5_4-src", "wasmvm_1_beta7-src": "wasmvm_1_beta7-src", "wasmvm_2_0_0-src": "wasmvm_2_0_0-src", + "wasmvm_2_0_3-src": "wasmvm_2_0_3-src", "wasmvm_2_1_0-src": "wasmvm_2_1_0-src" }, "locked": { - "lastModified": 1723637281, - "narHash": "sha256-PVodBpj6BF+Cv8d8/tHZmWh29bAEHeAlalJdQTmBBP4=", + "lastModified": 1724849157, + "narHash": "sha256-z/WaStYl8ww43EKIwnCUf25p66MWurcvwH0dmgCm7As=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "5115762f60f6c700d9b211a3e7d10f4c909843dd", + "rev": "8963f6bd1440a7d0223b0970f71fa1c2b0b7adf0", "type": "github" }, "original": { @@ -389,6 +394,7 @@ "systems": "systems" }, "locked": { + "lastModified": 1694529238, "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "owner": "numtide", "repo": "flake-utils", @@ -649,6 +655,23 @@ "type": "github" } }, + "gaia19-src": { + "flake": false, + "locked": { + "lastModified": 1724235134, + "narHash": "sha256-iAljnCnviTZ0wpgUYtTj+adH6imx6g6+niLq72yuoTk=", + "owner": "cosmos", + "repo": "gaia", + "rev": "4106e7a673da18b518fd81231a8e8b99bbf0fd0d", + "type": "github" + }, + "original": { + "owner": "cosmos", + "ref": "v19.1.0", + "repo": "gaia", + "type": "github" + } + }, "gaia5-src": { "flake": false, "locked": { @@ -787,18 +810,21 @@ "gomod2nix": { "inputs": { "flake-utils": "flake-utils", - "nixpkgs": "nixpkgs" + "nixpkgs": [ + "cosmos-nix", + "nixpkgs" + ] }, "locked": { - "narHash": "sha256-f1NuMA2mZ3Chw2CjlUkRAzNgDw0TYyj1i5YZJRByDdo=", - "owner": "JonathanLorimer", + "lastModified": 1722589758, + "narHash": "sha256-sbbA8b6Q2vB/t/r1znHawoXLysCyD4L/6n6/RykiSnA=", + "owner": "nix-community", "repo": "gomod2nix", - "rev": "6d2fce6003d08eee42648f2931de8449d3de1f5f", + "rev": "4e08ca09253ef996bd4c03afa383b23e35fe28a1", "type": "github" }, "original": { - "owner": "JonathanLorimer", - "ref": "jonathan/update-go", + "owner": "nix-community", "repo": "gomod2nix", "type": "github" } @@ -835,7 +861,7 @@ "devenv": "devenv", "flake-utils": "flake-utils_3", "gomod2nix": "gomod2nix_2", - "nixpkgs": "nixpkgs_2", + "nixpkgs": "nixpkgs", "nixpkgs-unstable": "nixpkgs-unstable" }, "locked": { @@ -968,6 +994,23 @@ "type": "github" } }, + "ibc-go-v7-wasm-src": { + "flake": false, + "locked": { + "lastModified": 1722365763, + "narHash": "sha256-ZYGCvm1Ek1RaXKzkkwQCc56I2HzmbrLR/lFD5IZZdLc=", + "owner": "cosmos", + "repo": "ibc-go", + "rev": "13c071f0b34d67342f0b7a8874d84d2e68b887e1", + "type": "github" + }, + "original": { + "owner": "cosmos", + "ref": "modules/light-clients/08-wasm/v0.3.1+ibc-go-v7.4-wasmvm-v1.5", + "repo": "ibc-go", + "type": "github" + } + }, "ibc-go-v8-src": { "flake": false, "locked": { @@ -985,6 +1028,23 @@ "type": "github" } }, + "ibc-go-v8-wasm-src": { + "flake": false, + "locked": { + "lastModified": 1722365433, + "narHash": "sha256-mgfbibipk09LtO0h0hQDfnVA0cQADaI6Bq+ruyP6xI4=", + "owner": "cosmos", + "repo": "ibc-go", + "rev": "ccd4dc278e720be87418028026ebd93a80fa5ac0", + "type": "github" + }, + "original": { + "owner": "cosmos", + "ref": "modules/light-clients/08-wasm/v0.4.1+ibc-go-v8.4-wasmvm-v2.0", + "repo": "ibc-go", + "type": "github" + } + }, "ibc-go-v9-src": { "flake": false, "locked": { @@ -1053,15 +1113,16 @@ "injective-src": { "flake": false, "locked": { - "narHash": "sha256-Vr/l8/wtZ47wi1OTWhsfLetKZH8c1fUFeoQaxF+QS3c=", + "lastModified": 1722874193, + "narHash": "sha256-zDG32ogXMep0wKegDN8zm1YmadcVpwlrY+ITokefcVI=", "owner": "OpenDeFiFoundation", "repo": "injective-core", - "rev": "e1ab66c240524b05b872f63890fefcd4fced5f7a", + "rev": "725af8f9ca6809d6b1026d5e8dddeb309ff97b42", "type": "github" }, "original": { "owner": "OpenDeFiFoundation", - "ref": "v1.12.1", + "ref": "v1.13.1", "repo": "injective-core", "type": "github" } @@ -1117,16 +1178,16 @@ "juno-src": { "flake": false, "locked": { - "lastModified": 1720542396, - "narHash": "sha256-niG12wn49bt184zqctrGsT73mgKfZUPTZAzSKX+ZLVs=", + "lastModified": 1724278445, + "narHash": "sha256-XvJqp36HSYqm6OMLQqJPX5sCT52GxSLFDMO+fJovh+0=", "owner": "CosmosContracts", "repo": "juno", - "rev": "bf140aa60045ba92b83d0cb7f3bc47a2661a4e7e", + "rev": "2f119adacca3a1668ff150c225a3f423501e748c", "type": "github" }, "original": { "owner": "CosmosContracts", - "ref": "v23.0.0", + "ref": "v24.0.0", "repo": "juno", "type": "github" } @@ -1182,16 +1243,16 @@ "neutron-src": { "flake": false, "locked": { - "lastModified": 1722341371, - "narHash": "sha256-dhBhWytamqp1hRsQH+xqpq1UJmPi6CRHHDQwveCQ2WQ=", + "lastModified": 1724773633, + "narHash": "sha256-pHubObIv3p6IrzI/U7aeDjdF5kWBpI9qgDoH/Hjk+i8=", "owner": "neutron-org", "repo": "neutron", - "rev": "db33d3302abb45ee3887a97ea3d53923241fc167", + "rev": "1b10cd282d5809ccdd87208918fd175aebec2b0b", "type": "github" }, "original": { "owner": "neutron-org", - "ref": "v4.1.0", + "ref": "v4.2.2", "repo": "neutron", "type": "github" } @@ -1260,17 +1321,15 @@ }, "nixpkgs": { "locked": { - "narHash": "sha256-D+zHwkwPc6oYQ4G3A1HuadopqRwUY/JkMwHz1YF7j4Q=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "e97b3e4186bcadf0ef1b6be22b8558eab1cdeb5d", - "type": "github" + "narHash": "sha256-LahKBAfGbY836gtpVNnWwBTIzN7yf/uYM/S0g393r0Y=", + "rev": "9f2ee8c91ac42da3ae6c6a1d21555f283458247e", + "revCount": 555392, + "type": "tarball", + "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2311.555392%2Brev-9f2ee8c91ac42da3ae6c6a1d21555f283458247e/018d7c73-3161-76d5-aca1-5929105b0aa0/source.tar.gz" }, "original": { - "owner": "NixOS", - "ref": "master", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://flakehub.com/f/NixOS/nixpkgs/0.2311.%2A.tar.gz" } }, "nixpkgs-lib": { @@ -1337,24 +1396,11 @@ }, "nixpkgs_2": { "locked": { - "narHash": "sha256-LahKBAfGbY836gtpVNnWwBTIzN7yf/uYM/S0g393r0Y=", - "rev": "9f2ee8c91ac42da3ae6c6a1d21555f283458247e", - "revCount": 555392, - "type": "tarball", - "url": "https://api.flakehub.com/f/pinned/NixOS/nixpkgs/0.2311.555392%2Brev-9f2ee8c91ac42da3ae6c6a1d21555f283458247e/018d7c73-3161-76d5-aca1-5929105b0aa0/source.tar.gz" - }, - "original": { - "type": "tarball", - "url": "https://flakehub.com/f/NixOS/nixpkgs/0.2311.%2A.tar.gz" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1722895844, - "narHash": "sha256-kGwDuefMQgzdzMXx1BN3+pS7oKafQd6LTDG6XMwcqrU=", + "lastModified": 1723603349, + "narHash": "sha256-VMg6N7MryOuvSJ8Sj6YydarnUCkL7cvMdrMcnsJnJCE=", "owner": "nixos", "repo": "nixpkgs", - "rev": "d3f42bd62aa840084563e3b93e4eab73cb0a0448", + "rev": "daf7bb95821b789db24fc1ac21f613db0c1bf2cb", "type": "github" }, "original": { @@ -1364,7 +1410,7 @@ "type": "github" } }, - "nixpkgs_4": { + "nixpkgs_3": { "locked": { "lastModified": 1706487304, "narHash": "sha256-LE8lVX28MV2jWJsidW13D2qrHU/RUUONendL2Q/WlJg=", @@ -1380,7 +1426,7 @@ "type": "github" } }, - "nixpkgs_5": { + "nixpkgs_4": { "locked": { "narHash": "sha256-4zOyp+hFW2Y7imxIpZqZGT8CEqKmDjwgfD6BzRUE0mQ=", "owner": "NixOS", @@ -1395,13 +1441,13 @@ "type": "github" } }, - "nixpkgs_6": { + "nixpkgs_5": { "locked": { - "lastModified": 1723603349, - "narHash": "sha256-VMg6N7MryOuvSJ8Sj6YydarnUCkL7cvMdrMcnsJnJCE=", + "lastModified": 1724748588, + "narHash": "sha256-NlpGA4+AIf1dKNq76ps90rxowlFXUsV9x7vK/mN37JM=", "owner": "nixos", "repo": "nixpkgs", - "rev": "daf7bb95821b789db24fc1ac21f613db0c1bf2cb", + "rev": "a6292e34000dc93d43bccf78338770c1c5ec8a99", "type": "github" }, "original": { @@ -1528,13 +1574,13 @@ "inputs": { "cosmos-nix": "cosmos-nix", "flake-utils": "flake-utils_7", - "nixpkgs": "nixpkgs_6" + "nixpkgs": "nixpkgs_5" } }, "rust-overlay": { "inputs": { "flake-utils": "flake-utils_5", - "nixpkgs": "nixpkgs_4" + "nixpkgs": "nixpkgs_3" }, "locked": { "lastModified": 1710468700, @@ -1553,7 +1599,7 @@ "sbt-derivation": { "inputs": { "flake-utils": "flake-utils_6", - "nixpkgs": "nixpkgs_5" + "nixpkgs": "nixpkgs_4" }, "locked": { "narHash": "sha256-Pnej7WZIPomYWg8f/CZ65sfW85IfIUjYhphMMg7/LT0=", @@ -1681,6 +1727,7 @@ }, "systems": { "locked": { + "lastModified": 1681028828, "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", "repo": "default", @@ -1945,6 +1992,23 @@ "type": "github" } }, + "wasmvm_1_5_4-src": { + "flake": false, + "locked": { + "lastModified": 1723135235, + "narHash": "sha256-DGQHC20eMa1CDIx9fWYTTBxdFDCPoS/SsEDJnWJ+7bA=", + "owner": "CosmWasm", + "repo": "wasmvm", + "rev": "9f85c0f44fb8a5573be8e461cad12f784c544c4b", + "type": "github" + }, + "original": { + "owner": "CosmWasm", + "ref": "v1.5.4", + "repo": "wasmvm", + "type": "github" + } + }, "wasmvm_1_beta7-src": { "flake": false, "locked": { @@ -1978,6 +2042,23 @@ "type": "github" } }, + "wasmvm_2_0_3-src": { + "flake": false, + "locked": { + "lastModified": 1723134607, + "narHash": "sha256-fFFP9sqlfgFbjAPP6VVXEcDQ3is2RHZYNE003Ls8Sfk=", + "owner": "CosmWasm", + "repo": "wasmvm", + "rev": "64b8c846dadb664eeb9da765a98fc370eb594f6d", + "type": "github" + }, + "original": { + "owner": "CosmWasm", + "ref": "v2.0.3", + "repo": "wasmvm", + "type": "github" + } + }, "wasmvm_2_1_0-src": { "flake": false, "locked": { From 394c95b09efdd79fb9213fe614a376e8a0cf196e Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 2 Sep 2024 12:31:12 +0200 Subject: [PATCH 195/200] Update `wasmd` to `v0.53.0` (#4177) * Nix flake update * Add changelog --- .../4169-update-wasmd-to-v0-53-0.md | 2 + flake.lock | 40 ++++++++++++++----- 2 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4169-update-wasmd-to-v0-53-0.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4169-update-wasmd-to-v0-53-0.md b/.changelog/unreleased/improvements/ibc-integration-test/4169-update-wasmd-to-v0-53-0.md new file mode 100644 index 0000000000..3caa36c8e6 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4169-update-wasmd-to-v0-53-0.md @@ -0,0 +1,2 @@ +- Update the version of `wasmd` running the integration tests in the CI from `v0.52.0` + to `v0.53.0` ([\#4169](https://github.com/informalsystems/hermes/issues/4169)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index 08de203ba9..ae1418f0a4 100644 --- a/flake.lock +++ b/flake.lock @@ -221,14 +221,15 @@ "wasmvm_1_beta7-src": "wasmvm_1_beta7-src", "wasmvm_2_0_0-src": "wasmvm_2_0_0-src", "wasmvm_2_0_3-src": "wasmvm_2_0_3-src", - "wasmvm_2_1_0-src": "wasmvm_2_1_0-src" + "wasmvm_2_1_0-src": "wasmvm_2_1_0-src", + "wasmvm_2_1_2-src": "wasmvm_2_1_2-src" }, "locked": { - "lastModified": 1724849157, - "narHash": "sha256-z/WaStYl8ww43EKIwnCUf25p66MWurcvwH0dmgCm7As=", + "lastModified": 1725007328, + "narHash": "sha256-DMRDFFpXIJyKRNhiVhXaIoOJkmVyKbt6DO6M5F8CCec=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "8963f6bd1440a7d0223b0970f71fa1c2b0b7adf0", + "rev": "d87f011075da3ee1afbbe3443ca25461af7d49fd", "type": "github" }, "original": { @@ -1443,11 +1444,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1724748588, - "narHash": "sha256-NlpGA4+AIf1dKNq76ps90rxowlFXUsV9x7vK/mN37JM=", + "lastModified": 1725194671, + "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a6292e34000dc93d43bccf78338770c1c5ec8a99", + "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", "type": "github" }, "original": { @@ -1832,16 +1833,16 @@ "wasmd-src": { "flake": false, "locked": { - "lastModified": 1720696698, - "narHash": "sha256-b2u3PWtjZAgmTdm/b3UcGn9K9qVQj9DR4FMcqg67T1w=", + "lastModified": 1724231006, + "narHash": "sha256-X8Q93gqk+gBJwn4EIxFVeWqRpHcIxNAplfARejHwfbk=", "owner": "CosmWasm", "repo": "wasmd", - "rev": "1ff818801d4aa5dd6f483571ac7a38660c59c671", + "rev": "de7db0dc672e7beb201e06e7eb12b2de356ac7c9", "type": "github" }, "original": { "owner": "CosmWasm", - "ref": "v0.52.0", + "ref": "v0.53.0", "repo": "wasmd", "type": "github" } @@ -2075,6 +2076,23 @@ "repo": "wasmvm", "type": "github" } + }, + "wasmvm_2_1_2-src": { + "flake": false, + "locked": { + "lastModified": 1723135029, + "narHash": "sha256-Y3BVRR2T5MLOtXdPK38W8MX8etIuqGcTjvxkaEOyvVM=", + "owner": "CosmWasm", + "repo": "wasmvm", + "rev": "d8f06b73e4d49f8246e1569f032962122427882b", + "type": "github" + }, + "original": { + "owner": "CosmWasm", + "ref": "v2.1.2", + "repo": "wasmvm", + "type": "github" + } } }, "root": "root", From e26d356abe23be2d401d1ba3d6ebb2768f77ebd5 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:16:48 +0200 Subject: [PATCH 196/200] Release `v1.10.3` (#4175) * Update Changelog * Create v1.10.3 summary * Bump versions * cargo update * Update changelog Signed-off-by: Romain Ruetschi * Update release date * Improve .changelog release v1.10.3 summary --------- Signed-off-by: Romain Ruetschi Co-authored-by: Romain Ruetschi --- .../4160-explicit-rootls-config.md | 0 .../3951-exclude-sequences-with-clear-cli.md | 0 .../4160-explicit-rootls-config.md | 2 +- .../4151-add-ibc-go-v9.md | 0 .../4123-update-celestia-to-v1-14-0.md | 0 .../4168-update-neutron-v4-2-2.md | 0 .../4169-update-wasmd-to-v0-53-0.md | 0 .../4171-update-juno-v24.md | 0 .../4102-abci-query-during-health-check.md | 0 .changelog/v1.10.3/summary.md | 5 + CHANGELOG.md | 43 ++++++ Cargo.lock | 138 +++++++++--------- Cargo.toml | 16 +- crates/chain-registry/Cargo.toml | 2 +- crates/relayer-cli/Cargo.toml | 2 +- crates/relayer-rest/Cargo.toml | 2 +- crates/relayer-rest/tests/mock.rs | 2 +- crates/relayer-types/Cargo.toml | 2 +- crates/relayer/Cargo.toml | 2 +- crates/relayer/src/lib.rs | 4 +- crates/telemetry/Cargo.toml | 2 +- guide/README.md | 2 +- guide/src/SUMMARY.md | 2 +- guide/src/templates/hermes-version.md | 2 +- tools/integration-test/Cargo.toml | 2 +- tools/test-framework/Cargo.toml | 2 +- 26 files changed, 140 insertions(+), 92 deletions(-) rename .changelog/{unreleased/bug-fixes/ibc-relayer => v1.10.3/bug-fixes/ibc-chain-registry}/4160-explicit-rootls-config.md (100%) rename .changelog/{unreleased => v1.10.3}/bug-fixes/ibc-relayer-cli/3951-exclude-sequences-with-clear-cli.md (100%) rename .changelog/{unreleased/bug-fixes/ibc-chain-registry => v1.10.3/bug-fixes/ibc-relayer}/4160-explicit-rootls-config.md (55%) rename .changelog/{unreleased => v1.10.3}/features/ibc-integration-test/4151-add-ibc-go-v9.md (100%) rename .changelog/{unreleased => v1.10.3}/improvements/ibc-integration-test/4123-update-celestia-to-v1-14-0.md (100%) rename .changelog/{unreleased => v1.10.3}/improvements/ibc-integration-test/4168-update-neutron-v4-2-2.md (100%) rename .changelog/{unreleased => v1.10.3}/improvements/ibc-integration-test/4169-update-wasmd-to-v0-53-0.md (100%) rename .changelog/{unreleased => v1.10.3}/improvements/ibc-integration-test/4171-update-juno-v24.md (100%) rename .changelog/{unreleased => v1.10.3}/improvements/ibc-relayer/4102-abci-query-during-health-check.md (100%) create mode 100644 .changelog/v1.10.3/summary.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/4160-explicit-rootls-config.md b/.changelog/v1.10.3/bug-fixes/ibc-chain-registry/4160-explicit-rootls-config.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer/4160-explicit-rootls-config.md rename to .changelog/v1.10.3/bug-fixes/ibc-chain-registry/4160-explicit-rootls-config.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer-cli/3951-exclude-sequences-with-clear-cli.md b/.changelog/v1.10.3/bug-fixes/ibc-relayer-cli/3951-exclude-sequences-with-clear-cli.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer-cli/3951-exclude-sequences-with-clear-cli.md rename to .changelog/v1.10.3/bug-fixes/ibc-relayer-cli/3951-exclude-sequences-with-clear-cli.md diff --git a/.changelog/unreleased/bug-fixes/ibc-chain-registry/4160-explicit-rootls-config.md b/.changelog/v1.10.3/bug-fixes/ibc-relayer/4160-explicit-rootls-config.md similarity index 55% rename from .changelog/unreleased/bug-fixes/ibc-chain-registry/4160-explicit-rootls-config.md rename to .changelog/v1.10.3/bug-fixes/ibc-relayer/4160-explicit-rootls-config.md index ef68992992..8bccf778ae 100644 --- a/.changelog/unreleased/bug-fixes/ibc-chain-registry/4160-explicit-rootls-config.md +++ b/.changelog/v1.10.3/bug-fixes/ibc-relayer/4160-explicit-rootls-config.md @@ -1,2 +1,2 @@ -- add explicit root TLS configuration to gRPC clients +- Add explicit root TLS configuration to gRPC clients ([\#4160](https://github.com/informalsystems/hermes/issues/4160)) \ No newline at end of file diff --git a/.changelog/unreleased/features/ibc-integration-test/4151-add-ibc-go-v9.md b/.changelog/v1.10.3/features/ibc-integration-test/4151-add-ibc-go-v9.md similarity index 100% rename from .changelog/unreleased/features/ibc-integration-test/4151-add-ibc-go-v9.md rename to .changelog/v1.10.3/features/ibc-integration-test/4151-add-ibc-go-v9.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4123-update-celestia-to-v1-14-0.md b/.changelog/v1.10.3/improvements/ibc-integration-test/4123-update-celestia-to-v1-14-0.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4123-update-celestia-to-v1-14-0.md rename to .changelog/v1.10.3/improvements/ibc-integration-test/4123-update-celestia-to-v1-14-0.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4168-update-neutron-v4-2-2.md b/.changelog/v1.10.3/improvements/ibc-integration-test/4168-update-neutron-v4-2-2.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4168-update-neutron-v4-2-2.md rename to .changelog/v1.10.3/improvements/ibc-integration-test/4168-update-neutron-v4-2-2.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4169-update-wasmd-to-v0-53-0.md b/.changelog/v1.10.3/improvements/ibc-integration-test/4169-update-wasmd-to-v0-53-0.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4169-update-wasmd-to-v0-53-0.md rename to .changelog/v1.10.3/improvements/ibc-integration-test/4169-update-wasmd-to-v0-53-0.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4171-update-juno-v24.md b/.changelog/v1.10.3/improvements/ibc-integration-test/4171-update-juno-v24.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4171-update-juno-v24.md rename to .changelog/v1.10.3/improvements/ibc-integration-test/4171-update-juno-v24.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4102-abci-query-during-health-check.md b/.changelog/v1.10.3/improvements/ibc-relayer/4102-abci-query-during-health-check.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/4102-abci-query-during-health-check.md rename to .changelog/v1.10.3/improvements/ibc-relayer/4102-abci-query-during-health-check.md diff --git a/.changelog/v1.10.3/summary.md b/.changelog/v1.10.3/summary.md new file mode 100644 index 0000000000..c7343de8ea --- /dev/null +++ b/.changelog/v1.10.3/summary.md @@ -0,0 +1,5 @@ +*September 2nd, 2024* + +This release fixes an issue where Hermes could not connect to gRPC servers over TLS. Additionally, this release also fixes a bug in the `clear packet` CLI where the `excluded_sequences` configuration option was not always taken into account. + +Furthermore, Hermes now uses `abci_query` instead of gRPC for some queries, for instance for querying staking parameters and service configuration during health checks, and when retrieving version information. diff --git a/CHANGELOG.md b/CHANGELOG.md index 30c45e4840..f901697dd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,48 @@ # CHANGELOG +## v1.10.3 + +*September 2nd, 2024* + +This release fixes an issue where Hermes could not connect to gRPC servers over TLS. Additionally, this release also fixes a bug in the `clear packet` CLI where the `excluded_sequences` configuration option was not always taken into account. + +Furthermore, Hermes now uses `abci_query` instead of gRPC for some queries, for instance for querying staking parameters and service configuration during health checks, and when retrieving version information. + +### BUG FIXES + +- [Chain Registry](chain-registry) + - Add explicit root TLS configuration to gRPC clients + ([\#4160](https://github.com/informalsystems/hermes/issues/4160)) +- [Relayer Library](relayer) + - Add explicit root TLS configuration to gRPC clients + ([\#4160](https://github.com/informalsystems/hermes/issues/4160)) +- [Relayer CLI](relayer-cli) + - Correctly filter out sequences from the `excluded_sequences` configuration + when clearing packets with the `clear packet` CLI. + ([\#4158](https://github.com/informalsystems/hermes/issues/4158)) + +### IMPROVEMENTS + +- [Relayer Library](relayer) + - Use `abci_query` instead of gRPC queries when retrieving staking params + and service config during health-check, and when retrieving version information. + ([\#4102](https://github.com/informalsystems/hermes/issues/4102)) +- [Integration Test Framework](tools/test-framework) + - Update the version of Celestia running the integration tests in the CI from `v1.11.0` + to `v1.14.0` ([\#4123](https://github.com/informalsystems/hermes/issues/4123)) + - Update the version of Neutron running the integration tests in the CI from `v4.1.0` + to `v4.2.2` ([\#4168](https://github.com/informalsystems/hermes/issues/4168)) + - Update the version of `wasmd` running the integration tests in the CI from `v0.52.0` + to `v0.53.0` ([\#4169](https://github.com/informalsystems/hermes/issues/4169)) + - Update the version of Juno running the integration tests in the CI from `v23.0.0` + to `v24.0.0` ([\#4171](https://github.com/informalsystems/hermes/issues/4171)) + +### FEATURES + +- [Integration Test Framework](tools/test-framework) + - Add ibc-go `v9` to the chains running the integration tests in the CI. + ([\#4151](https://github.com/informalsystems/hermes/issues/4151)) + ## v1.10.2 *August 14th, 2024* diff --git a/Cargo.lock b/Cargo.lock index a8f9426fd1..2e4f2e7523 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -134,9 +134,9 @@ checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-stream" @@ -157,7 +157,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -168,7 +168,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -181,7 +181,7 @@ dependencies = [ "futures-util", "log", "pin-project-lite", - "rustls-native-certs 0.7.1", + "rustls-native-certs 0.7.3", "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", @@ -416,9 +416,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.3" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ec96fe9a81b5e365f9db71fe00edc4fe4ca2cc7dcb7861f0603012a7caa210" +checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" dependencies = [ "arrayref", "arrayvec", @@ -493,9 +493,9 @@ checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" [[package]] name = "cc" -version = "1.1.11" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb8dd288a69fc53a1996d7ecfbf4a20d59065bff137ce7e56bbd620de191189" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ "shlex", ] @@ -608,9 +608,9 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "constant_time_eq" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "contracts" @@ -724,7 +724,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -792,7 +792,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -1006,9 +1006,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "ff" @@ -1125,7 +1125,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -1240,9 +1240,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", "bytes", @@ -1449,7 +1449,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.5", + "h2 0.4.6", "http 1.1.0", "http-body 1.0.1", "httparse", @@ -1510,7 +1510,7 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.29.2" +version = "0.29.3" dependencies = [ "async-trait", "flex-error", @@ -1530,7 +1530,7 @@ dependencies = [ [[package]] name = "ibc-integration-test" -version = "0.29.2" +version = "0.29.3" dependencies = [ "byte-unit", "http 1.1.0", @@ -1567,7 +1567,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.29.2" +version = "0.29.3" dependencies = [ "anyhow", "async-stream", @@ -1636,7 +1636,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "1.10.2" +version = "1.10.3" dependencies = [ "abscissa_core", "clap", @@ -1677,7 +1677,7 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.29.2" +version = "0.29.3" dependencies = [ "axum 0.6.20", "crossbeam-channel", @@ -1692,7 +1692,7 @@ dependencies = [ [[package]] name = "ibc-relayer-types" -version = "0.29.2" +version = "0.29.3" dependencies = [ "bytes", "derive_more", @@ -1723,7 +1723,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.29.2" +version = "0.29.3" dependencies = [ "axum 0.6.20", "dashmap", @@ -1742,7 +1742,7 @@ dependencies = [ [[package]] name = "ibc-test-framework" -version = "0.29.2" +version = "0.29.3" dependencies = [ "color-eyre", "crossbeam-channel", @@ -1918,9 +1918,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libredox" @@ -2278,7 +2278,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -2397,7 +2397,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -2432,9 +2432,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -2489,9 +2489,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -2637,18 +2637,18 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags 2.6.0", "errno", @@ -2678,7 +2678,7 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] @@ -2693,7 +2693,7 @@ dependencies = [ "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.7", "subtle", "zeroize", ] @@ -2712,9 +2712,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", "rustls-pemfile 2.1.3", @@ -2760,9 +2760,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" dependencies = [ "ring", "rustls-pki-types", @@ -2792,9 +2792,9 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.14" +version = "2.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79da19444d9da7a9a82b80ecf059eceba6d3129d84a8610fd25ff2364f255466" +checksum = "aeb7ac86243095b70a7920639507b71d51a63390d1ba26c4f60a552fbb914a37" dependencies = [ "sdd", ] @@ -2943,7 +2943,7 @@ checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -2976,7 +2976,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -3035,7 +3035,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -3211,7 +3211,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -3248,9 +3248,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.74" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -3521,7 +3521,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -3547,7 +3547,7 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -3635,9 +3635,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.2" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", "bytes", @@ -3659,7 +3659,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -3763,16 +3763,16 @@ dependencies = [ [[package]] name = "tonic" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38659f4a91aba8598d27821589f5db7dddd94601e7a01b1e485a50e5484c7401" +checksum = "c6f6ba989e4b2c58ae83d862d3a3e27690b6e3ae630d0deb59f3697f32aa88ad" dependencies = [ "async-stream", "async-trait", "axum 0.7.5", "base64 0.22.1", "bytes", - "h2 0.4.5", + "h2 0.4.6", "http 1.1.0", "http-body 1.0.1", "http-body-util", @@ -3782,7 +3782,7 @@ dependencies = [ "percent-encoding", "pin-project", "prost", - "rustls-native-certs 0.7.1", + "rustls-native-certs 0.7.3", "rustls-pemfile 2.1.3", "socket2", "tokio", @@ -3846,7 +3846,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -4002,9 +4002,9 @@ checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" [[package]] name = "unsafe-libyaml" @@ -4130,7 +4130,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", "wasm-bindgen-shared", ] @@ -4164,7 +4164,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4401,7 +4401,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] [[package]] @@ -4421,5 +4421,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.74", + "syn 2.0.76", ] diff --git a/Cargo.toml b/Cargo.toml index 981ea46d28..ef8483f32a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,14 +20,14 @@ exclude = [ [workspace.dependencies] # Hermes dependencies -ibc-relayer-cli = { version = "1.10.2", path = "crates/relayer-cli" } -ibc-relayer = { version = "0.29.2", path = "crates/relayer" } -ibc-relayer-rest = { version = "0.29.2", path = "crates/relayer-rest" } -ibc-relayer-types = { version = "0.29.2", path = "crates/relayer-types" } -ibc-chain-registry = { version = "0.29.2", path = "crates/chain-registry" } -ibc-telemetry = { version = "0.29.2", path = "crates/telemetry" } -ibc-test-framework = { version = "0.29.2", path = "tools/test-framework" } -ibc-integration-test = { version = "0.29.2", path = "tools/integration-test" } +ibc-relayer-cli = { version = "1.10.3", path = "crates/relayer-cli" } +ibc-relayer = { version = "0.29.3", path = "crates/relayer" } +ibc-relayer-rest = { version = "0.29.3", path = "crates/relayer-rest" } +ibc-relayer-types = { version = "0.29.3", path = "crates/relayer-types" } +ibc-chain-registry = { version = "0.29.3", path = "crates/chain-registry" } +ibc-telemetry = { version = "0.29.3", path = "crates/telemetry" } +ibc-test-framework = { version = "0.29.3", path = "tools/test-framework" } +ibc-integration-test = { version = "0.29.3", path = "tools/integration-test" } # Tendermint dependencies tendermint = { version = "0.38.1", default-features = false } diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index ad083f6582..967fbdc54e 100644 --- a/crates/chain-registry/Cargo.toml +++ b/crates/chain-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-chain-registry" -version = "0.29.2" +version = "0.29.3" edition = "2021" license = "Apache-2.0" keywords = ["cosmos", "ibc", "relayer", "chain", "registry"] diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index 7a5000c57a..c2f947ad0b 100644 --- a/crates/relayer-cli/Cargo.toml +++ b/crates/relayer-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-cli" -version = "1.10.2" +version = "1.10.3" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index 646ec45365..7b406f4443 100644 --- a/crates/relayer-rest/Cargo.toml +++ b/crates/relayer-rest/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-rest" -version = "0.29.2" +version = "0.29.3" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index 2f916413ba..c5c3df0dbc 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -64,7 +64,7 @@ async fn version() { let rest_api_version = VersionInfo { name: "ibc-relayer-rest".to_string(), - version: "0.29.2".to_string(), + version: "0.29.3".to_string(), }; let result: JsonResult<_, ()> = JsonResult::Success(vec![version.clone(), rest_api_version]); diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 416a5c7f2e..b9ae3c2f9b 100644 --- a/crates/relayer-types/Cargo.toml +++ b/crates/relayer-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer-types" -version = "0.29.2" +version = "0.29.3" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index af2863ccd3..12e14792e8 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer" -version = "0.29.2" +version = "0.29.3" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index f342fa9b8a..3ceac0c335 100644 --- a/crates/relayer/src/lib.rs +++ b/crates/relayer/src/lib.rs @@ -14,7 +14,7 @@ //! //! For the IBC relayer binary, please see [Hermes] (`ibc-relayer-cli` crate). //! -//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.10.2/ +//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.10.3/ extern crate alloc; @@ -48,4 +48,4 @@ pub mod upgrade_chain; pub mod util; pub mod worker; -pub const HERMES_VERSION: &str = "1.10.2"; +pub const HERMES_VERSION: &str = "1.10.3"; diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index 4c5abda644..b6ab30faf6 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-telemetry" -version = "0.29.2" +version = "0.29.3" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/guide/README.md b/guide/README.md index 3666489bfc..37a44860ba 100644 --- a/guide/README.md +++ b/guide/README.md @@ -10,7 +10,7 @@ mdBook is a utility to create modern online books from Markdown files. This guide should be permanently deployed at its latest stable version at [hermes.informal.systems](https://hermes.informal.systems). -Current version: `v1.10.2`. +Current version: `v1.10.3`. The version of this guide is aligned with the [versioning of the ibc crates](../README.md). diff --git a/guide/src/SUMMARY.md b/guide/src/SUMMARY.md index 268a9c016b..1813766c20 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -1,6 +1,6 @@ # Summary -# Hermes v1.10.2 +# Hermes v1.10.3 --- - [Introduction](./index.md) diff --git a/guide/src/templates/hermes-version.md b/guide/src/templates/hermes-version.md index 460c8b939d..d9c8fd4074 100644 --- a/guide/src/templates/hermes-version.md +++ b/guide/src/templates/hermes-version.md @@ -1 +1 @@ -v1.10.2 +v1.10.3 diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index d3af8f3c49..8d896cdab1 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-integration-test" -version = "0.29.2" +version = "0.29.3" edition = "2021" rust-version = "1.76.0" license = "Apache-2.0" diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index fc1faee539..34f5a08182 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-test-framework" -version = "0.29.2" +version = "0.29.3" edition = "2021" license = "Apache-2.0" readme = "README.md" From f9d8b7fe25dcdf0bd44e573eac15d2789e144854 Mon Sep 17 00:00:00 2001 From: elizabeth Date: Tue, 8 Oct 2024 08:31:55 -0400 Subject: [PATCH 197/200] unformat everything --- .rustfmt.toml | 8 +- crates/chain-registry/src/asset_list.rs | 10 +- crates/chain-registry/src/chain.rs | 10 +- crates/chain-registry/src/error.rs | 10 +- crates/chain-registry/src/fetchable.rs | 7 +- crates/chain-registry/src/formatter.rs | 22 +-- crates/chain-registry/src/paths.rs | 22 +-- crates/chain-registry/src/querier.rs | 32 +-- crates/relayer-cli/build.rs | 5 +- crates/relayer-cli/src/application.rs | 41 +--- crates/relayer-cli/src/bin/hermes/main.rs | 5 +- crates/relayer-cli/src/chain_registry.rs | 38 +--- crates/relayer-cli/src/cli_utils.rs | 21 +- crates/relayer-cli/src/commands.rs | 38 +--- crates/relayer-cli/src/commands/clear.rs | 37 +--- .../relayer-cli/src/commands/completions.rs | 5 +- crates/relayer-cli/src/commands/config.rs | 6 +- .../relayer-cli/src/commands/config/auto.rs | 31 +-- .../src/commands/config/validate.rs | 12 +- crates/relayer-cli/src/commands/create.rs | 11 +- .../src/commands/create/channel.rs | 45 +---- .../src/commands/create/connection.rs | 32 +-- crates/relayer-cli/src/commands/evidence.rs | 60 ++---- crates/relayer-cli/src/commands/fee.rs | 10 +- .../fee/register_counterparty_payee.rs | 28 +-- .../src/commands/fee/register_payee.rs | 28 +-- .../relayer-cli/src/commands/fee/transfer.rs | 40 +--- crates/relayer-cli/src/commands/health.rs | 16 +- crates/relayer-cli/src/commands/keys.rs | 6 +- crates/relayer-cli/src/commands/keys/add.rs | 30 +-- .../relayer-cli/src/commands/keys/balance.rs | 17 +- .../relayer-cli/src/commands/keys/delete.rs | 21 +- crates/relayer-cli/src/commands/keys/list.rs | 16 +- crates/relayer-cli/src/commands/listen.rs | 39 +--- crates/relayer-cli/src/commands/logs.rs | 6 +- .../src/commands/logs/log_level.rs | 16 +- crates/relayer-cli/src/commands/logs/raw.rs | 18 +- crates/relayer-cli/src/commands/logs/reset.rs | 14 +- .../relayer-cli/src/commands/misbehaviour.rs | 37 +--- crates/relayer-cli/src/commands/query.rs | 12 +- .../relayer-cli/src/commands/query/channel.rs | 29 +-- .../src/commands/query/channel_client.rs | 28 +-- .../src/commands/query/channel_ends.rs | 45 +---- .../src/commands/query/channels.rs | 44 +---- .../relayer-cli/src/commands/query/client.rs | 40 +--- .../relayer-cli/src/commands/query/clients.rs | 21 +- .../src/commands/query/connection.rs | 32 +-- .../src/commands/query/connections.rs | 21 +- .../relayer-cli/src/commands/query/packet.rs | 6 +- .../src/commands/query/packet/ack.rs | 34 +--- .../src/commands/query/packet/acks.rs | 30 +-- .../src/commands/query/packet/commitment.rs | 34 +--- .../src/commands/query/packet/commitments.rs | 25 +-- .../src/commands/query/packet/pending.rs | 36 +--- .../src/commands/query/packet/pending_acks.rs | 30 +-- .../commands/query/packet/pending_sends.rs | 30 +-- .../src/commands/query/packet/util.rs | 10 +- .../src/commands/query/transfer.rs | 6 +- .../commands/query/transfer/denom_trace.rs | 12 +- crates/relayer-cli/src/commands/query/tx.rs | 6 +- .../src/commands/query/tx/events.rs | 16 +- crates/relayer-cli/src/commands/start.rs | 38 +--- crates/relayer-cli/src/commands/tx.rs | 7 +- crates/relayer-cli/src/commands/tx/channel.rs | 47 +---- crates/relayer-cli/src/commands/tx/client.rs | 54 +---- .../relayer-cli/src/commands/tx/connection.rs | 37 +--- crates/relayer-cli/src/commands/tx/packet.rs | 37 +--- .../relayer-cli/src/commands/tx/transfer.rs | 35 +--- crates/relayer-cli/src/commands/tx/upgrade.rs | 25 +-- crates/relayer-cli/src/commands/update.rs | 6 +- crates/relayer-cli/src/commands/upgrade.rs | 11 +- crates/relayer-cli/src/commands/version.rs | 6 +- crates/relayer-cli/src/components.rs | 18 +- crates/relayer-cli/src/entry.rs | 23 +-- crates/relayer-cli/src/error.rs | 24 +-- crates/relayer-cli/src/prelude.rs | 5 +- crates/relayer-cli/src/tracing_handle.rs | 17 +- crates/relayer-rest/src/handle.rs | 7 +- crates/relayer-rest/src/server.rs | 36 +--- crates/relayer-rest/tests/mock.rs | 17 +- .../src/applications/ics27_ica/cosmos_tx.rs | 12 +- .../src/applications/ics27_ica/error.rs | 5 +- .../applications/ics27_ica/msgs/register.rs | 10 +- .../applications/ics27_ica/msgs/send_tx.rs | 18 +- .../src/applications/ics27_ica/packet_data.rs | 5 +- .../ics28_ccv/msgs/ccv_double_voting.rs | 6 +- .../ics28_ccv/msgs/ccv_misbehaviour.rs | 11 +- .../src/applications/ics29_fee/error.rs | 10 +- .../src/applications/ics29_fee/events.rs | 15 +- .../applications/ics29_fee/msgs/pay_packet.rs | 15 +- .../ics29_fee/msgs/pay_packet_async.rs | 14 +- .../ics29_fee/msgs/register_payee.rs | 10 +- .../src/applications/ics29_fee/packet_fee.rs | 8 +- .../src/applications/ics31_icq/events.rs | 20 +- .../src/applications/ics31_icq/response.rs | 15 +- .../applications/transfer/acknowledgement.rs | 13 +- .../src/applications/transfer/amount.rs | 17 +- .../src/applications/transfer/coin.rs | 16 +- .../src/applications/transfer/denom.rs | 21 +- .../src/applications/transfer/error.rs | 23 +-- .../src/applications/transfer/events.rs | 5 +- .../src/applications/transfer/msgs/send.rs | 20 +- .../applications/transfer/msgs/transfer.rs | 33 +--- .../src/applications/transfer/packet.rs | 17 +- .../clients/ics07_tendermint/client_state.rs | 49 ++--- .../ics07_tendermint/consensus_state.rs | 24 +-- .../src/clients/ics07_tendermint/error.rs | 21 +- .../src/clients/ics07_tendermint/header.rs | 40 +--- .../clients/ics07_tendermint/misbehaviour.rs | 15 +- .../src/core/ics02_client/client_state.rs | 10 +- .../src/core/ics02_client/client_type.rs | 16 +- .../src/core/ics02_client/consensus_state.rs | 10 +- .../src/core/ics02_client/error.rs | 15 +- .../src/core/ics02_client/events.rs | 21 +- .../src/core/ics02_client/header.rs | 19 +- .../src/core/ics02_client/height.rs | 30 +-- .../src/core/ics02_client/misbehaviour.rs | 5 +- .../src/core/ics02_client/msgs.rs | 6 +- .../core/ics02_client/msgs/create_client.rs | 10 +- .../core/ics02_client/msgs/misbehaviour.rs | 8 +- .../core/ics02_client/msgs/update_client.rs | 14 +- .../core/ics02_client/msgs/upgrade_client.rs | 28 +-- .../src/core/ics02_client/trust_threshold.rs | 26 +-- .../src/core/ics03_connection/connection.rs | 24 +-- .../src/core/ics03_connection/error.rs | 5 +- .../src/core/ics03_connection/events.rs | 21 +- .../src/core/ics03_connection/msgs.rs | 14 +- .../ics03_connection/msgs/conn_open_ack.rs | 32 +-- .../msgs/conn_open_confirm.rs | 22 +-- .../ics03_connection/msgs/conn_open_init.rs | 15 +- .../ics03_connection/msgs/conn_open_try.rs | 48 ++--- .../src/core/ics03_connection/version.rs | 21 +- .../src/core/ics04_channel/channel.rs | 39 +--- .../src/core/ics04_channel/commitment.rs | 5 +- .../src/core/ics04_channel/error.rs | 17 +- .../src/core/ics04_channel/events.rs | 28 +-- .../src/core/ics04_channel/msgs.rs | 13 +- .../ics04_channel/msgs/acknowledgement.rs | 28 +-- .../ics04_channel/msgs/chan_close_confirm.rs | 27 +-- .../ics04_channel/msgs/chan_close_init.rs | 18 +- .../core/ics04_channel/msgs/chan_open_ack.rs | 34 +--- .../ics04_channel/msgs/chan_open_confirm.rs | 27 +-- .../core/ics04_channel/msgs/chan_open_init.rs | 13 +- .../core/ics04_channel/msgs/chan_open_try.rs | 35 +--- .../core/ics04_channel/msgs/recv_packet.rs | 28 +-- .../src/core/ics04_channel/msgs/timeout.rs | 23 +-- .../ics04_channel/msgs/timeout_on_close.rs | 21 +- .../src/core/ics04_channel/packet.rs | 35 +--- .../src/core/ics04_channel/packet_id.rs | 15 +- .../src/core/ics04_channel/timeout.rs | 18 +- .../src/core/ics04_channel/version.rs | 11 +- .../src/core/ics23_commitment/commitment.rs | 30 +-- .../src/core/ics23_commitment/error.rs | 5 +- .../src/core/ics23_commitment/merkle.rs | 19 +- .../src/core/ics23_commitment/specs.rs | 5 +- .../src/core/ics24_host/identifier.rs | 22 +-- .../relayer-types/src/core/ics24_host/mod.rs | 7 +- .../relayer-types/src/core/ics24_host/path.rs | 12 +- .../src/core/ics24_host/validate.rs | 7 +- .../src/core/ics26_routing/error.rs | 11 +- .../src/core/ics26_routing/msgs.rs | 31 +-- crates/relayer-types/src/events.rs | 41 +--- crates/relayer-types/src/mock/client_state.rs | 22 +-- .../relayer-types/src/mock/consensus_state.rs | 15 +- crates/relayer-types/src/mock/header.rs | 23 +-- crates/relayer-types/src/mock/misbehaviour.rs | 15 +- crates/relayer-types/src/proofs.rs | 10 +- crates/relayer-types/src/serializers.rs | 22 +-- crates/relayer-types/src/signer.rs | 5 +- crates/relayer-types/src/test.rs | 5 +- crates/relayer-types/src/test_utils.rs | 7 +- crates/relayer-types/src/timestamp.rs | 27 +-- crates/relayer-types/src/tx_msg.rs | 5 +- crates/relayer-types/src/utils/pretty.rs | 17 +- crates/relayer/src/account.rs | 5 +- crates/relayer/src/cache.rs | 11 +- crates/relayer/src/chain/astria/endpoint.rs | 115 +++-------- crates/relayer/src/chain/astria/utils.rs | 8 +- crates/relayer/src/chain/client.rs | 6 +- crates/relayer/src/chain/cosmos.rs | 185 ++++-------------- crates/relayer/src/chain/cosmos/batch.rs | 36 +--- crates/relayer/src/chain/cosmos/client.rs | 3 +- crates/relayer/src/chain/cosmos/config.rs | 22 +-- .../relayer/src/chain/cosmos/config/error.rs | 3 +- crates/relayer/src/chain/cosmos/encode.rs | 39 +--- crates/relayer/src/chain/cosmos/estimate.rs | 19 +- crates/relayer/src/chain/cosmos/fee.rs | 20 +- crates/relayer/src/chain/cosmos/gas.rs | 15 +- crates/relayer/src/chain/cosmos/query.rs | 21 +- .../relayer/src/chain/cosmos/query/account.rs | 9 +- .../relayer/src/chain/cosmos/query/balance.rs | 10 +- .../src/chain/cosmos/query/consensus_state.rs | 20 +- .../relayer/src/chain/cosmos/query/custom.rs | 13 +- .../src/chain/cosmos/query/denom_trace.rs | 9 +- crates/relayer/src/chain/cosmos/query/fee.rs | 18 +- .../relayer/src/chain/cosmos/query/status.rs | 16 +- crates/relayer/src/chain/cosmos/query/tx.rs | 34 +--- crates/relayer/src/chain/cosmos/retry.rs | 25 +-- crates/relayer/src/chain/cosmos/simulate.rs | 10 +- crates/relayer/src/chain/cosmos/tx.rs | 27 +-- .../relayer/src/chain/cosmos/types/account.rs | 6 +- .../src/chain/cosmos/types/app_state.rs | 5 +- .../relayer/src/chain/cosmos/types/config.rs | 15 +- .../src/chain/cosmos/types/events/channel.rs | 29 +-- .../src/chain/cosmos/types/events/fee.rs | 5 +- .../src/chain/cosmos/types/events/mod.rs | 5 +- crates/relayer/src/chain/cosmos/types/gas.rs | 5 +- crates/relayer/src/chain/cosmos/types/tx.rs | 5 +- crates/relayer/src/chain/cosmos/version.rs | 6 +- crates/relayer/src/chain/cosmos/wait.rs | 28 +-- crates/relayer/src/chain/counterparty.rs | 49 ++--- crates/relayer/src/chain/endpoint.rs | 63 ++---- crates/relayer/src/chain/handle.rs | 57 ++---- crates/relayer/src/chain/handle/base.rs | 62 ++---- crates/relayer/src/chain/handle/cache.rs | 62 ++---- crates/relayer/src/chain/handle/counting.rs | 69 ++----- crates/relayer/src/chain/requests.rs | 23 +-- crates/relayer/src/chain/runtime.rs | 59 ++---- crates/relayer/src/chain/tracking.rs | 6 +- crates/relayer/src/channel.rs | 71 ++----- crates/relayer/src/channel/error.rs | 18 +- crates/relayer/src/channel/version.rs | 5 +- crates/relayer/src/client_state.rs | 17 +- crates/relayer/src/config.rs | 47 +---- crates/relayer/src/config/compat_mode.rs | 13 +- crates/relayer/src/config/error.rs | 5 +- crates/relayer/src/config/filter.rs | 28 +-- crates/relayer/src/config/gas_multiplier.rs | 10 +- crates/relayer/src/config/proof_specs.rs | 7 +- crates/relayer/src/config/refresh_rate.rs | 7 +- crates/relayer/src/config/types.rs | 39 +--- crates/relayer/src/connection.rs | 57 ++---- crates/relayer/src/connection/error.rs | 21 +- crates/relayer/src/consensus_state.rs | 14 +- crates/relayer/src/denom.rs | 5 +- crates/relayer/src/error.rs | 53 ++--- crates/relayer/src/event.rs | 48 +---- crates/relayer/src/event/bus.rs | 5 +- crates/relayer/src/event/error.rs | 10 +- crates/relayer/src/event/source.rs | 31 +-- crates/relayer/src/event/source/rpc.rs | 45 +---- .../relayer/src/event/source/rpc/extract.rs | 10 +- crates/relayer/src/event/source/websocket.rs | 56 +----- .../src/event/source/websocket/extract.rs | 21 +- crates/relayer/src/extension_options.rs | 5 +- crates/relayer/src/foreign_client.rs | 63 ++---- crates/relayer/src/keyring.rs | 15 +- .../src/keyring/any_signing_key_pair.rs | 7 +- .../relayer/src/keyring/ed25519_key_pair.rs | 34 +--- crates/relayer/src/keyring/errors.rs | 6 +- crates/relayer/src/keyring/key_utils.rs | 10 +- crates/relayer/src/keyring/pub_key.rs | 15 +- .../relayer/src/keyring/secp256k1_key_pair.rs | 45 +---- .../relayer/src/keyring/signing_key_pair.rs | 12 +- crates/relayer/src/light_client.rs | 9 +- crates/relayer/src/light_client/io.rs | 12 +- crates/relayer/src/light_client/tendermint.rs | 48 +---- .../src/light_client/tendermint/detector.rs | 40 +--- crates/relayer/src/link.rs | 23 +-- crates/relayer/src/link/cli.rs | 32 +-- crates/relayer/src/link/error.rs | 11 +- crates/relayer/src/link/operational_data.rs | 37 +--- crates/relayer/src/link/packet_events.rs | 19 +- crates/relayer/src/link/pending.rs | 31 +-- crates/relayer/src/link/relay_path.rs | 127 +++--------- crates/relayer/src/link/relay_sender.rs | 21 +- crates/relayer/src/link/relay_summary.rs | 6 +- crates/relayer/src/link/tx_hashes.rs | 6 +- crates/relayer/src/misbehaviour.rs | 14 +- crates/relayer/src/object.rs | 31 +-- crates/relayer/src/path.rs | 5 +- crates/relayer/src/registry.rs | 21 +- crates/relayer/src/rest.rs | 11 +- crates/relayer/src/rest/error.rs | 11 +- crates/relayer/src/rest/request.rs | 13 +- crates/relayer/src/spawn.rs | 10 +- crates/relayer/src/supervisor.rs | 73 ++----- .../src/supervisor/client_state_filter.rs | 18 +- crates/relayer/src/supervisor/dump_state.rs | 22 +-- crates/relayer/src/supervisor/error.rs | 11 +- crates/relayer/src/supervisor/scan.rs | 61 ++---- crates/relayer/src/supervisor/spawn.rs | 27 +-- crates/relayer/src/transfer.rs | 47 +---- crates/relayer/src/upgrade_chain.rs | 24 +-- crates/relayer/src/util.rs | 5 +- crates/relayer/src/util/collate.rs | 12 +- crates/relayer/src/util/compat_mode.rs | 5 +- crates/relayer/src/util/diff.rs | 5 +- crates/relayer/src/util/lock.rs | 7 +- crates/relayer/src/util/pretty.rs | 24 +-- crates/relayer/src/util/profiling.rs | 10 +- crates/relayer/src/util/queue.rs | 5 +- crates/relayer/src/util/retry.rs | 9 +- crates/relayer/src/util/stream.rs | 6 +- crates/relayer/src/util/task.rs | 22 +-- crates/relayer/src/worker.rs | 27 +-- crates/relayer/src/worker/channel.rs | 32 +-- crates/relayer/src/worker/client.rs | 35 +--- crates/relayer/src/worker/cmd.rs | 11 +- crates/relayer/src/worker/connection.rs | 22 +-- .../relayer/src/worker/cross_chain_query.rs | 19 +- crates/relayer/src/worker/error.rs | 11 +- crates/relayer/src/worker/handle.rs | 35 +--- crates/relayer/src/worker/map.rs | 21 +- crates/relayer/src/worker/packet.rs | 58 +----- crates/relayer/src/worker/retry_strategy.rs | 5 +- crates/relayer/src/worker/wallet.rs | 13 +- crates/telemetry/src/encoder.rs | 15 +- crates/telemetry/src/lib.rs | 10 +- crates/telemetry/src/server.rs | 24 +-- crates/telemetry/src/state.rs | 49 +---- .../src/bin/test_setup_with_binary_channel.rs | 10 +- ...t_setup_with_fee_enabled_binary_channel.rs | 12 +- .../bin/test_setup_with_ternary_channel.rs | 12 +- tools/integration-test/src/mbt/handlers.rs | 36 +--- tools/integration-test/src/mbt/itf.rs | 16 +- tools/integration-test/src/mbt/state.rs | 10 +- tools/integration-test/src/mbt/transfer.rs | 31 +-- tools/integration-test/src/mbt/utils.rs | 20 +- .../src/tests/async_icq/simple_query.rs | 25 +-- .../src/tests/clean_workers.rs | 9 +- .../src/tests/clear_packet.rs | 14 +- .../src/tests/client_expiration.rs | 22 +-- .../src/tests/client_filter.rs | 11 +- .../src/tests/client_refresh.rs | 11 +- .../src/tests/client_settings.rs | 6 +- .../src/tests/client_upgrade.rs | 17 +- .../src/tests/connection_delay.rs | 4 +- .../src/tests/consensus_states.rs | 6 +- .../integration-test/src/tests/denom_trace.rs | 5 +- .../src/tests/error_events.rs | 5 +- .../src/tests/execute_schedule.rs | 10 +- .../src/tests/fee/auto_forward_relayer.rs | 5 +- .../src/tests/fee/filter_fees.rs | 15 +- .../src/tests/fee/forward_relayer.rs | 5 +- .../src/tests/fee/no_forward_relayer.rs | 5 +- .../src/tests/fee/non_fee_channel.rs | 5 +- .../src/tests/fee/pay_fee_async.rs | 10 +- .../src/tests/fee/register_payee.rs | 5 +- .../src/tests/fee/timeout_fee.rs | 5 +- tools/integration-test/src/tests/fee_grant.rs | 5 +- .../src/tests/forward/forward_hop_transfer.rs | 6 +- .../src/tests/forward/forward_transfer.rs | 12 +- .../src/tests/forward/memo.rs | 5 +- .../src/tests/handshake_on_start.rs | 11 +- tools/integration-test/src/tests/ica.rs | 9 +- tools/integration-test/src/tests/ics31.rs | 10 +- .../tests/interchain_security/ica_transfer.rs | 18 +- .../src/tests/interchain_security/icq.rs | 13 +- .../interchain_security/simple_transfer.rs | 3 +- .../src/tests/manual/simulation.rs | 11 +- tools/integration-test/src/tests/memo.rs | 11 +- .../src/tests/ordered_channel.rs | 4 +- .../src/tests/ordered_channel_clear.rs | 19 +- tools/integration-test/src/tests/python.rs | 10 +- .../src/tests/query_packet.rs | 15 +- .../integration-test/src/tests/supervisor.rs | 16 +- .../src/tests/tendermint/sequential.rs | 11 +- .../src/tests/ternary_transfer.rs | 5 +- tools/integration-test/src/tests/transfer.rs | 5 +- .../src/bootstrap/binary/chain.rs | 33 +--- .../src/bootstrap/binary/channel.rs | 29 +-- .../src/bootstrap/binary/connection.rs | 18 +- .../test-framework/src/bootstrap/consumer.rs | 19 +- tools/test-framework/src/bootstrap/init.rs | 16 +- .../src/bootstrap/nary/chain.rs | 19 +- .../src/bootstrap/nary/channel.rs | 40 +--- .../src/bootstrap/nary/connection.rs | 25 +-- tools/test-framework/src/bootstrap/single.rs | 24 +-- tools/test-framework/src/chain/builder.rs | 4 +- tools/test-framework/src/chain/chain_type.rs | 5 +- .../test-framework/src/chain/cli/async_icq.rs | 5 +- .../test-framework/src/chain/cli/bootstrap.rs | 10 +- .../test-framework/src/chain/cli/fee_grant.rs | 5 +- .../test-framework/src/chain/cli/host_zone.rs | 5 +- tools/test-framework/src/chain/cli/ica.rs | 5 +- .../test-framework/src/chain/cli/provider.rs | 10 +- tools/test-framework/src/chain/cli/query.rs | 5 +- .../test-framework/src/chain/cli/transfer.rs | 5 +- tools/test-framework/src/chain/cli/upgrade.rs | 5 +- tools/test-framework/src/chain/cli/version.rs | 6 +- tools/test-framework/src/chain/config.rs | 5 +- tools/test-framework/src/chain/driver.rs | 23 +-- tools/test-framework/src/chain/exec.rs | 18 +- .../test-framework/src/chain/ext/async_icq.rs | 5 +- .../test-framework/src/chain/ext/bootstrap.rs | 38 +--- .../src/chain/ext/crosschainquery.rs | 6 +- tools/test-framework/src/chain/ext/fee.rs | 23 +-- .../test-framework/src/chain/ext/fee_grant.rs | 5 +- tools/test-framework/src/chain/ext/forward.rs | 11 +- tools/test-framework/src/chain/ext/ica.rs | 19 +- .../test-framework/src/chain/ext/proposal.rs | 20 +- .../test-framework/src/chain/ext/transfer.rs | 25 +-- tools/test-framework/src/chain/ext/version.rs | 5 +- tools/test-framework/src/chain/tagged.rs | 31 +-- tools/test-framework/src/chain/version.rs | 5 +- tools/test-framework/src/error.rs | 25 +-- tools/test-framework/src/framework/base.rs | 4 +- .../src/framework/binary/chain.rs | 29 +-- .../src/framework/binary/channel.rs | 42 +--- .../src/framework/binary/connection.rs | 31 +-- .../src/framework/binary/ics.rs | 21 +- .../src/framework/binary/node.rs | 12 +- .../src/framework/nary/chain.rs | 30 +-- .../src/framework/nary/channel.rs | 28 +-- .../src/framework/nary/connection.rs | 30 +-- .../test-framework/src/framework/nary/node.rs | 17 +- .../test-framework/src/framework/overrides.rs | 31 +-- tools/test-framework/src/ibc/denom.rs | 20 +- tools/test-framework/src/ibc/token.rs | 22 +-- tools/test-framework/src/prelude.rs | 131 +++---------- tools/test-framework/src/relayer/chain.rs | 52 +---- tools/test-framework/src/relayer/channel.rs | 28 +-- .../test-framework/src/relayer/connection.rs | 22 +-- tools/test-framework/src/relayer/driver.rs | 11 +- tools/test-framework/src/relayer/fee.rs | 28 +-- .../src/relayer/foreign_client.rs | 10 +- tools/test-framework/src/relayer/refresh.rs | 9 +- tools/test-framework/src/relayer/transfer.rs | 35 +--- tools/test-framework/src/relayer/tx.rs | 20 +- .../test-framework/src/types/binary/chains.rs | 16 +- .../src/types/binary/channel.rs | 15 +- .../test-framework/src/types/binary/client.rs | 5 +- .../src/types/binary/connection.rs | 10 +- .../src/types/binary/foreign_client.rs | 10 +- tools/test-framework/src/types/env.rs | 11 +- tools/test-framework/src/types/nary/chains.rs | 21 +- .../test-framework/src/types/nary/channel.rs | 15 +- .../src/types/nary/connection.rs | 10 +- .../src/types/nary/foreign_client.rs | 15 +- tools/test-framework/src/types/single/node.rs | 36 +--- tools/test-framework/src/types/tagged/dual.rs | 19 +- tools/test-framework/src/types/tagged/mono.rs | 24 +-- tools/test-framework/src/types/wallet.rs | 11 +- tools/test-framework/src/util/file.rs | 6 +- .../src/util/interchain_security.rs | 5 +- tools/test-framework/src/util/random.rs | 6 +- tools/test-framework/src/util/retry.rs | 5 +- tools/test-framework/src/util/suspend.rs | 11 +- 439 files changed, 1755 insertions(+), 7246 deletions(-) diff --git a/.rustfmt.toml b/.rustfmt.toml index 3f8091e26c..280ea58d10 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -1,8 +1,8 @@ max_width = 100 -reorder_imports = true -imports_layout = "Vertical" -imports_granularity = "Crate" -group_imports = "StdExternalCrate" +# reorder_imports = true +# imports_layout = "Vertical" +# imports_granularity = "Crate" +# group_imports = "StdExternalCrate" # nightly only diff --git a/crates/chain-registry/src/asset_list.rs b/crates/chain-registry/src/asset_list.rs index da8df1fcbe..8c695f1685 100644 --- a/crates/chain-registry/src/asset_list.rs +++ b/crates/chain-registry/src/asset_list.rs @@ -3,10 +3,7 @@ use std::path::PathBuf; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use crate::fetchable::Fetchable; @@ -56,10 +53,7 @@ impl Fetchable for AssetList { #[cfg(test)] mod tests { use super::*; - use crate::{ - constants::ALL_CHAINS, - error::RegistryError, - }; + use crate::{constants::ALL_CHAINS, error::RegistryError}; #[tokio::test] #[ignore] diff --git a/crates/chain-registry/src/chain.rs b/crates/chain-registry/src/chain.rs index 5649d597a5..ae4eee7061 100644 --- a/crates/chain-registry/src/chain.rs +++ b/crates/chain-registry/src/chain.rs @@ -3,10 +3,7 @@ use std::path::PathBuf; use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use crate::fetchable::Fetchable; @@ -166,10 +163,7 @@ impl Fetchable for ChainData { #[cfg(test)] mod tests { use super::*; - use crate::{ - constants::ALL_CHAINS, - error::RegistryError, - }; + use crate::{constants::ALL_CHAINS, error::RegistryError}; #[tokio::test] #[ignore] diff --git a/crates/chain-registry/src/error.rs b/crates/chain-registry/src/error.rs index 13e7fdf1f2..366eb843e4 100644 --- a/crates/chain-registry/src/error.rs +++ b/crates/chain-registry/src/error.rs @@ -1,18 +1,12 @@ use std::path::PathBuf; -use flex_error::{ - define_error, - TraceError, -}; +use flex_error::{define_error, TraceError}; use http; use itertools::Itertools; use reqwest; use serde_json; use tendermint_rpc; -use tokio::{ - task::JoinError, - time::error::Elapsed, -}; +use tokio::{task::JoinError, time::error::Elapsed}; define_error! { RegistryError { diff --git a/crates/chain-registry/src/fetchable.rs b/crates/chain-registry/src/fetchable.rs index e97098c07b..2c5ccacb07 100644 --- a/crates/chain-registry/src/fetchable.rs +++ b/crates/chain-registry/src/fetchable.rs @@ -6,12 +6,7 @@ use http::uri::Builder; use serde::de::DeserializeOwned; use crate::{ - constants::{ - DEFAULT_REF, - HOST, - PROTOCOL, - REGISTRY_PATH, - }, + constants::{DEFAULT_REF, HOST, PROTOCOL, REGISTRY_PATH}, error::RegistryError, }; diff --git a/crates/chain-registry/src/formatter.rs b/crates/chain-registry/src/formatter.rs index 90e0a8212c..ee01dc61ca 100644 --- a/crates/chain-registry/src/formatter.rs +++ b/crates/chain-registry/src/formatter.rs @@ -4,10 +4,7 @@ //! from an (in)complete GRPC URL. use std::str::FromStr; -use http::{ - uri::Scheme, - Uri, -}; +use http::{uri::Scheme, Uri}; use tendermint_rpc::Url; use crate::error::RegistryError; @@ -99,10 +96,7 @@ impl UriFormatter for SimpleGrpcFormatter { #[cfg(test)] mod tests { - use std::{ - cmp::PartialEq, - fmt::Debug, - }; + use std::{cmp::PartialEq, fmt::Debug}; use super::*; @@ -186,11 +180,7 @@ mod tests { #[tokio::test] #[ignore] async fn all_chain_registry_grpc_address() -> Result<(), RegistryError> { - use crate::{ - chain::ChainData, - constants::ALL_CHAINS, - fetchable::Fetchable, - }; + use crate::{chain::ChainData, constants::ALL_CHAINS, fetchable::Fetchable}; let mut handles = Vec::with_capacity(ALL_CHAINS.len()); @@ -211,11 +201,7 @@ mod tests { #[tokio::test] #[ignore] async fn all_chain_registry_rpc_address() -> Result<(), RegistryError> { - use crate::{ - chain::ChainData, - constants::ALL_CHAINS, - fetchable::Fetchable, - }; + use crate::{chain::ChainData, constants::ALL_CHAINS, fetchable::Fetchable}; let mut handles = Vec::with_capacity(ALL_CHAINS.len()); diff --git a/crates/chain-registry/src/paths.rs b/crates/chain-registry/src/paths.rs index 5cbff7b73e..f812aad1b4 100644 --- a/crates/chain-registry/src/paths.rs +++ b/crates/chain-registry/src/paths.rs @@ -1,15 +1,7 @@ use std::path::PathBuf; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChannelId, - ClientId, - ConnectionId, - PortId, -}; -use serde::{ - Deserialize, - Serialize, -}; +use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}; +use serde::{Deserialize, Serialize}; /// Models for serializing and deserializing IBC path JSON data found in the `_IBC/` directory of the registry repository use crate::fetchable::Fetchable; @@ -76,10 +68,7 @@ impl Fetchable for IBCPath { #[cfg(test)] mod tests { use super::*; - use crate::{ - constants::ALL_PATHS, - error::RegistryError, - }; + use crate::{constants::ALL_PATHS, error::RegistryError}; #[tokio::test] #[ignore] @@ -109,10 +98,7 @@ mod tests { use std::str::FromStr; use ibc_relayer_types::core::ics24_host::identifier::{ - ChannelId, - ClientId, - ConnectionId, - PortId, + ChannelId, ClientId, ConnectionId, PortId, }; let path = r#"{ diff --git a/crates/chain-registry/src/querier.rs b/crates/chain-registry/src/querier.rs index 4864fac5ac..1654ef4b3e 100644 --- a/crates/chain-registry/src/querier.rs +++ b/crates/chain-registry/src/querier.rs @@ -2,39 +2,19 @@ //! Contains struct to perform a health check on a gRPC/WebSocket endpoint and //! to retrieve the `max_block_size` from a RPC endpoint. -use std::{ - fmt::Debug, - str::FromStr, -}; +use std::{fmt::Debug, str::FromStr}; use async_trait::async_trait; -use futures::{ - stream::FuturesUnordered, - StreamExt, -}; +use futures::{stream::FuturesUnordered, StreamExt}; use http::Uri; use ibc_proto::cosmos::bank::v1beta1::query_client::QueryClient; -use tendermint_rpc::{ - Client, - SubscriptionClient, - Url, - WebSocketClient, -}; -use tokio::time::{ - timeout, - Duration, -}; -use tracing::{ - debug, - info, -}; +use tendermint_rpc::{Client, SubscriptionClient, Url, WebSocketClient}; +use tokio::time::{timeout, Duration}; +use tracing::{debug, info}; use crate::{ error::RegistryError, - formatter::{ - SimpleWebSocketFormatter, - UriFormatter, - }, + formatter::{SimpleWebSocketFormatter, UriFormatter}, }; /// `QueryTypes` represents the basic types required to query a node diff --git a/crates/relayer-cli/build.rs b/crates/relayer-cli/build.rs index 8f94e3f597..5983d57a8e 100644 --- a/crates/relayer-cli/build.rs +++ b/crates/relayer-cli/build.rs @@ -38,10 +38,7 @@ mod git { use core::marker::PhantomData; use std::{ ffi::OsStr, - process::{ - Command, - Output, - }, + process::{Command, Output}, }; // A wrapper over a git shell command that is only constructable if git is available & the diff --git a/crates/relayer-cli/src/application.rs b/crates/relayer-cli/src/application.rs index ddbe9466b4..0238e54bab 100644 --- a/crates/relayer-cli/src/application.rs +++ b/crates/relayer-cli/src/application.rs @@ -1,49 +1,24 @@ //! Definition of the application, based on the Abscissa framework -use std::{ - path::PathBuf, - thread, -}; +use std::{path::PathBuf, thread}; use abscissa_core::{ - application::{ - self, - AppCell, - }, + application::{self, AppCell}, component::Component, - config::{ - self, - CfgCell, - }, - terminal::{ - component::Terminal, - ColorChoice, - }, - Application, - Configurable, - FrameworkError, - FrameworkErrorKind, - StandardPaths, + config::{self, CfgCell}, + terminal::{component::Terminal, ColorChoice}, + Application, Configurable, FrameworkError, FrameworkErrorKind, StandardPaths, }; use ibc_relayer::{ - config::{ - Config, - TracingServerConfig, - }, + config::{Config, TracingServerConfig}, util::debug_section::DebugSection, }; use crate::{ commands::CliCmd, - components::{ - JsonTracing, - PrettyTracing, - }, + components::{JsonTracing, PrettyTracing}, entry::EntryPoint, - tracing_handle::{ - spawn_reload_handler, - ReloadHandle, - }, + tracing_handle::{spawn_reload_handler, ReloadHandle}, }; /// Application state diff --git a/crates/relayer-cli/src/bin/hermes/main.rs b/crates/relayer-cli/src/bin/hermes/main.rs index 45860088f5..061ec33720 100644 --- a/crates/relayer-cli/src/bin/hermes/main.rs +++ b/crates/relayer-cli/src/bin/hermes/main.rs @@ -3,10 +3,7 @@ #![deny(warnings, missing_docs, trivial_casts, unused_qualifications)] #![forbid(unsafe_code)] -use ibc_relayer_cli::{ - application::APPLICATION, - components::enable_ansi, -}; +use ibc_relayer_cli::{application::APPLICATION, components::enable_ansi}; fn main() -> eyre::Result<()> { install_error_reporter()?; diff --git a/crates/relayer-cli/src/chain_registry.rs b/crates/relayer-cli/src/chain_registry.rs index 94e09d8d8a..5ae3ba0eeb 100644 --- a/crates/relayer-cli/src/chain_registry.rs +++ b/crates/relayer-cli/src/chain_registry.rs @@ -1,10 +1,6 @@ //! Contains functions to generate a relayer config for a given chain -use std::{ - collections::HashMap, - fmt::Display, - marker::Send, -}; +use std::{collections::HashMap, fmt::Display, marker::Send}; use futures::future::join_all; use http::Uri; @@ -13,10 +9,7 @@ use ibc_chain_registry::{ chain::ChainData, error::RegistryError, fetchable::Fetchable, - formatter::{ - SimpleGrpcFormatter, - UriFormatter, - }, + formatter::{SimpleGrpcFormatter, UriFormatter}, paths::IBCPath, querier::*, }; @@ -24,29 +17,15 @@ use ibc_relayer::{ chain::cosmos::config::CosmosSdkConfig, config::{ default, - filter::{ - FilterPattern, - PacketFilter, - }, + filter::{FilterPattern, PacketFilter}, gas_multiplier::GasMultiplier, - types::{ - MaxMsgNum, - MaxTxSize, - Memo, - TrustThreshold, - }, - AddressType, - ChainConfig, - EventSourceMode, - GasPrice, + types::{MaxMsgNum, MaxTxSize, Memo, TrustThreshold}, + AddressType, ChainConfig, EventSourceMode, GasPrice, }, keyring::Store, }; use tendermint_rpc::Url; -use tokio::task::{ - JoinError, - JoinHandle, -}; +use tokio::task::{JoinError, JoinHandle}; use tracing::trace; const MAX_HEALTHY_QUERY_RETRIES: u8 = 5; @@ -353,10 +332,7 @@ mod tests { use std::str::FromStr; use ibc_relayer::config::filter::ChannelPolicy; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChannelId, - PortId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId}; use serial_test::serial; use super::*; diff --git a/crates/relayer-cli/src/cli_utils.rs b/crates/relayer-cli/src/cli_utils.rs index 6b3722ce3d..5441bb1594 100644 --- a/crates/relayer-cli/src/cli_utils.rs +++ b/crates/relayer-cli/src/cli_utils.rs @@ -5,30 +5,17 @@ use alloc::sync::Arc; use eyre::eyre; use ibc_relayer::{ chain::{ - counterparty::{ - channel_connection_client, - ChannelConnectionClient, - }, - handle::{ - BaseChainHandle, - ChainHandle, - }, + counterparty::{channel_connection_client, ChannelConnectionClient}, + handle::{BaseChainHandle, ChainHandle}, requests::{ - IncludeProof, - QueryChannelRequest, - QueryClientStateRequest, - QueryConnectionRequest, + IncludeProof, QueryChannelRequest, QueryClientStateRequest, QueryConnectionRequest, QueryHeight, }, }, config::Config, spawn, }; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, -}; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use tokio::runtime::Runtime as TokioRuntime; use tracing::debug; diff --git a/crates/relayer-cli/src/commands.rs b/crates/relayer-cli/src/commands.rs index 92cc7939f5..055231ffbf 100644 --- a/crates/relayer-cli/src/commands.rs +++ b/crates/relayer-cli/src/commands.rs @@ -22,40 +22,16 @@ use core::time::Duration; use std::path::PathBuf; use abscissa_core::{ - clap::Parser, - config::Override, - Command, - Configurable, - FrameworkError, - Runnable, -}; -use ibc_relayer::config::{ - ChainConfig, - Config, -}; -use tracing::{ - error, - info, + clap::Parser, config::Override, Command, Configurable, FrameworkError, Runnable, }; +use ibc_relayer::config::{ChainConfig, Config}; +use tracing::{error, info}; use self::{ - clear::ClearCmds, - completions::CompletionsCmd, - config::ConfigCmd, - create::CreateCmds, - evidence::EvidenceCmd, - fee::FeeCmd, - health::HealthCheckCmd, - keys::KeysCmd, - listen::ListenCmd, - logs::LogsCmd, - misbehaviour::MisbehaviourCmd, - query::QueryCmd, - start::StartCmd, - tx::TxCmd, - update::UpdateCmds, - upgrade::UpgradeCmds, - version::VersionCmd, + clear::ClearCmds, completions::CompletionsCmd, config::ConfigCmd, create::CreateCmds, + evidence::EvidenceCmd, fee::FeeCmd, health::HealthCheckCmd, keys::KeysCmd, listen::ListenCmd, + logs::LogsCmd, misbehaviour::MisbehaviourCmd, query::QueryCmd, start::StartCmd, tx::TxCmd, + update::UpdateCmds, upgrade::UpgradeCmds, version::VersionCmd, }; use crate::DEFAULT_CONFIG_PATH; diff --git a/crates/relayer-cli/src/commands/clear.rs b/crates/relayer-cli/src/commands/clear.rs index 83ca60c562..7762f4de87 100644 --- a/crates/relayer-cli/src/commands/clear.rs +++ b/crates/relayer-cli/src/commands/clear.rs @@ -1,42 +1,21 @@ use std::ops::RangeInclusive; -use abscissa_core::{ - clap::Parser, - config::Override, - Command, - FrameworkErrorKind, - Runnable, -}; +use abscissa_core::{clap::Parser, config::Override, Command, FrameworkErrorKind, Runnable}; use ibc_relayer::{ - chain::handle::{ - BaseChainHandle, - ChainHandle, - }, + chain::handle::{BaseChainHandle, ChainHandle}, config::Config, - link::{ - error::LinkError, - Link, - LinkParameters, - }, + link::{error::LinkError, Link, LinkParameters}, util::seq_range::parse_seq_range, }; use ibc_relayer_types::{ core::{ ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }, events::IbcEvent, }; -use crate::{ - application::app_config, - cli_utils::spawn_chain_counterparty, - conclude::Output, -}; +use crate::{application::app_config, cli_utils::spawn_chain_counterparty, conclude::Output}; /// `clear` subcommands #[derive(Command, Debug, Parser, Runnable)] @@ -232,11 +211,7 @@ mod tests { use abscissa_core::clap::Parser; use ibc_relayer_types::core::{ ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }; #[test] diff --git a/crates/relayer-cli/src/commands/completions.rs b/crates/relayer-cli/src/commands/completions.rs index ff2b2942c7..4e1b30cd62 100644 --- a/crates/relayer-cli/src/commands/completions.rs +++ b/crates/relayer-cli/src/commands/completions.rs @@ -1,9 +1,6 @@ use std::io; -use abscissa_core::{ - clap::Parser, - Runnable, -}; +use abscissa_core::{clap::Parser, Runnable}; use clap::IntoApp; use clap_complete::Shell; diff --git a/crates/relayer-cli/src/commands/config.rs b/crates/relayer-cli/src/commands/config.rs index 4e6bf10a1a..737b4e877b 100644 --- a/crates/relayer-cli/src/commands/config.rs +++ b/crates/relayer-cli/src/commands/config.rs @@ -1,10 +1,6 @@ //! `config` subcommand -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; mod auto; mod validate; diff --git a/crates/relayer-cli/src/commands/config/auto.rs b/crates/relayer-cli/src/commands/config/auto.rs index ff729a14d3..d838ed5102 100644 --- a/crates/relayer-cli/src/commands/config/auto.rs +++ b/crates/relayer-cli/src/commands/config/auto.rs @@ -1,27 +1,10 @@ -use std::{ - collections::HashSet, - path::PathBuf, -}; - -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; -use ibc_relayer::config::{ - store, - ChainConfig, - Config, -}; -use tracing::{ - info, - warn, -}; - -use crate::{ - chain_registry::get_configs, - conclude::Output, -}; +use std::{collections::HashSet, path::PathBuf}; + +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::config::{store, ChainConfig, Config}; +use tracing::{info, warn}; + +use crate::{chain_registry::get_configs, conclude::Output}; fn find_key(chain_config: &ChainConfig) -> Option { let keys = chain_config.list_keys().ok()?; diff --git a/crates/relayer-cli/src/commands/config/validate.rs b/crates/relayer-cli/src/commands/config/validate.rs index 3970e33c63..cecad2fff5 100644 --- a/crates/relayer-cli/src/commands/config/validate.rs +++ b/crates/relayer-cli/src/commands/config/validate.rs @@ -1,16 +1,8 @@ use std::fs; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; -use crate::{ - conclude::Output, - config, - prelude::*, -}; +use crate::{conclude::Output, config, prelude::*}; /// In order to validate the configuration file the command will check that the file exists, /// that it is readable and not empty. It will then check the validity of the fields inside diff --git a/crates/relayer-cli/src/commands/create.rs b/crates/relayer-cli/src/commands/create.rs index 91a7dd6ca5..d1b0433f53 100644 --- a/crates/relayer-cli/src/commands/create.rs +++ b/crates/relayer-cli/src/commands/create.rs @@ -1,15 +1,8 @@ //! `create` subcommand -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use crate::commands::{ - create::{ - channel::CreateChannelCommand, - connection::CreateConnectionCommand, - }, + create::{channel::CreateChannelCommand, connection::CreateConnectionCommand}, tx::client::TxCreateClientCmd, }; diff --git a/crates/relayer-cli/src/commands/create/channel.rs b/crates/relayer-cli/src/commands/create/channel.rs index 01b26dd79e..2763cbd2b3 100644 --- a/crates/relayer-cli/src/commands/create/channel.rs +++ b/crates/relayer-cli/src/commands/create/channel.rs @@ -1,19 +1,10 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use console::style; use dialoguer::Confirm; use ibc_relayer::{ chain::{ handle::ChainHandle, - requests::{ - IncludeProof, - QueryClientStateRequest, - QueryConnectionRequest, - QueryHeight, - }, + requests::{IncludeProof, QueryClientStateRequest, QueryConnectionRequest, QueryHeight}, }, channel::Channel, config::default::connection_delay, @@ -22,26 +13,13 @@ use ibc_relayer::{ }; use ibc_relayer_types::core::{ ics03_connection::connection::IdentifiedConnectionEnd, - ics04_channel::{ - channel::Ordering, - version::Version, - }, - ics24_host::identifier::{ - ChainId, - ConnectionId, - PortId, - }, + ics04_channel::{channel::Ordering, version::Version}, + ics24_host::identifier::{ChainId, ConnectionId, PortId}, }; use crate::{ - cli_utils::{ - spawn_chain_runtime, - ChainHandlePair, - }, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + cli_utils::{spawn_chain_runtime, ChainHandlePair}, + conclude::{exit_with_unrecoverable_error, Output}, prelude::*, }; @@ -297,15 +275,8 @@ mod tests { use abscissa_core::clap::Parser; use ibc_relayer_types::core::{ - ics04_channel::{ - channel::Ordering, - version::Version, - }, - ics24_host::identifier::{ - ChainId, - ConnectionId, - PortId, - }, + ics04_channel::{channel::Ordering, version::Version}, + ics24_host::identifier::{ChainId, ConnectionId, PortId}, }; use super::CreateChannelCommand; diff --git a/crates/relayer-cli/src/commands/create/connection.rs b/crates/relayer-cli/src/commands/create/connection.rs index 6e32016786..6b50b284e2 100644 --- a/crates/relayer-cli/src/commands/create/connection.rs +++ b/crates/relayer-cli/src/commands/create/connection.rs @@ -1,36 +1,19 @@ use core::time::Duration; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::{ chain::{ handle::ChainHandle, - requests::{ - IncludeProof, - QueryClientStateRequest, - QueryHeight, - }, + requests::{IncludeProof, QueryClientStateRequest, QueryHeight}, }, connection::Connection, foreign_client::ForeignClient, }; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ClientId, -}; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use crate::{ - cli_utils::{ - spawn_chain_runtime, - ChainHandlePair, - }, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + cli_utils::{spawn_chain_runtime, ChainHandlePair}, + conclude::{exit_with_unrecoverable_error, Output}, prelude::*, }; @@ -200,10 +183,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ClientId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use super::CreateConnectionCommand; diff --git a/crates/relayer-cli/src/commands/evidence.rs b/crates/relayer-cli/src/commands/evidence.rs index 5848e121fe..afce2c0321 100644 --- a/crates/relayer-cli/src/commands/evidence.rs +++ b/crates/relayer-cli/src/commands/evidence.rs @@ -1,38 +1,21 @@ use std::{ collections::HashMap, - ops::{ - ControlFlow, - Deref, - }, + ops::{ControlFlow, Deref}, sync::Arc, thread::sleep, time::Duration, }; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::{ chain::{ cosmos::CosmosSdkChain, endpoint::ChainEndpoint, - handle::{ - BaseChainHandle, - ChainHandle, - }, - requests::{ - IncludeProof, - PageRequest, - QueryHeight, - }, + handle::{BaseChainHandle, ChainHandle}, + requests::{IncludeProof, PageRequest, QueryHeight}, tracking::TrackedMsgs, }, - config::{ - ChainConfig, - Config, - }, + config::{ChainConfig, Config}, foreign_client::ForeignClient, spawn::spawn_chain_runtime_with_modified_config, }; @@ -42,40 +25,24 @@ use ibc_relayer_types::{ ccv_misbehaviour::MsgSubmitIcsConsumerMisbehaviour, }, clients::ics07_tendermint::{ - header::Header as TendermintHeader, - misbehaviour::Misbehaviour as TendermintMisbehaviour, + header::Header as TendermintHeader, misbehaviour::Misbehaviour as TendermintMisbehaviour, }, core::{ - ics02_client::{ - height::Height, - msgs::misbehaviour::MsgSubmitMisbehaviour, - }, - ics24_host::identifier::{ - ChainId, - ClientId, - }, + ics02_client::{height::Height, msgs::misbehaviour::MsgSubmitMisbehaviour}, + ics24_host::identifier::{ChainId, ClientId}, }, events::IbcEvent, tx_msg::Msg, }; use tendermint::{ block::Height as TendermintHeight, - evidence::{ - DuplicateVoteEvidence, - LightClientAttackEvidence, - }, + evidence::{DuplicateVoteEvidence, LightClientAttackEvidence}, validator, }; -use tendermint_rpc::{ - Client, - Paging, -}; +use tendermint_rpc::{Client, Paging}; use tokio::runtime::Runtime as TokioRuntime; -use crate::{ - conclude::Output, - prelude::*, -}; +use crate::{conclude::Output, prelude::*}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct EvidenceCmd { @@ -740,10 +707,7 @@ fn fetch_all_counterparty_clients( config: &Config, chain: &CosmosSdkChain, ) -> eyre::Result> { - use ibc_relayer::chain::requests::{ - QueryClientStateRequest, - QueryConnectionsRequest, - }; + use ibc_relayer::chain::requests::{QueryClientStateRequest, QueryConnectionsRequest}; let connections = chain.query_connections(QueryConnectionsRequest { pagination: Some(PageRequest::all()), diff --git a/crates/relayer-cli/src/commands/fee.rs b/crates/relayer-cli/src/commands/fee.rs index c7feb66dd2..bc713c621b 100644 --- a/crates/relayer-cli/src/commands/fee.rs +++ b/crates/relayer-cli/src/commands/fee.rs @@ -1,16 +1,10 @@ //! `fee` subcommand -use abscissa_core::{ - clap::Parser, - config::Override, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, config::Override, Command, Runnable}; use ibc_relayer::config::Config; use self::{ - register_counterparty_payee::RegisterCounterpartyPayeeCmd, - register_payee::RegisterPayeeCmd, + register_counterparty_payee::RegisterCounterpartyPayeeCmd, register_payee::RegisterPayeeCmd, transfer::FeeTransferCmd, }; diff --git a/crates/relayer-cli/src/commands/fee/register_counterparty_payee.rs b/crates/relayer-cli/src/commands/fee/register_counterparty_payee.rs index 536183397c..864f8a5f3d 100644 --- a/crates/relayer-cli/src/commands/fee/register_counterparty_payee.rs +++ b/crates/relayer-cli/src/commands/fee/register_counterparty_payee.rs @@ -1,31 +1,17 @@ use core::str::FromStr; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; -use ibc_relayer::chain::{ - handle::ChainHandle, - tracking::TrackedMsgs, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{handle::ChainHandle, tracking::TrackedMsgs}; use ibc_relayer_types::{ applications::ics29_fee::msgs::register_payee::build_register_counterparty_payee_message, - core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChainId, ChannelId, PortId}, signer::Signer, }; use crate::{ application::app_config, cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, error::Error, }; @@ -124,11 +110,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use super::RegisterCounterpartyPayeeCmd; diff --git a/crates/relayer-cli/src/commands/fee/register_payee.rs b/crates/relayer-cli/src/commands/fee/register_payee.rs index d486f0e417..a8aa42df58 100644 --- a/crates/relayer-cli/src/commands/fee/register_payee.rs +++ b/crates/relayer-cli/src/commands/fee/register_payee.rs @@ -1,31 +1,17 @@ use core::str::FromStr; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; -use ibc_relayer::chain::{ - handle::ChainHandle, - tracking::TrackedMsgs, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{handle::ChainHandle, tracking::TrackedMsgs}; use ibc_relayer_types::{ applications::ics29_fee::msgs::register_payee::build_register_payee_message, - core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChainId, ChannelId, PortId}, signer::Signer, }; use crate::{ application::app_config, cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, error::Error, }; @@ -115,11 +101,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use super::RegisterPayeeCmd; diff --git a/crates/relayer-cli/src/commands/fee/transfer.rs b/crates/relayer-cli/src/commands/fee/transfer.rs index 07a81edb17..58d471a659 100644 --- a/crates/relayer-cli/src/commands/fee/transfer.rs +++ b/crates/relayer-cli/src/commands/fee/transfer.rs @@ -1,47 +1,25 @@ use core::time::Duration; use abscissa_core::{ - clap::Parser, - config::Override, - Command, - FrameworkError, - FrameworkErrorKind, - Runnable, + clap::Parser, config::Override, Command, FrameworkError, FrameworkErrorKind, Runnable, }; use eyre::eyre; use ibc_relayer::{ chain::handle::ChainHandle, config::Config, - transfer::{ - build_transfer_messages, - send_messages, - TransferOptions, - }, + transfer::{build_transfer_messages, send_messages, TransferOptions}, }; use ibc_relayer_types::{ applications::{ ics29_fee::msgs::pay_packet::build_pay_packet_message, - transfer::{ - Amount, - Coin, - }, - }, - core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, + transfer::{Amount, Coin}, }, + core::ics24_host::identifier::{ChainId, ChannelId, PortId}, }; use crate::{ - cli_utils::{ - check_can_send_on_channel, - ChainHandlePair, - }, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + cli_utils::{check_can_send_on_channel, ChainHandlePair}, + conclude::{exit_with_unrecoverable_error, Output}, prelude::*, }; @@ -331,11 +309,7 @@ mod tests { use abscissa_core::clap::Parser; use ibc_relayer_types::{ applications::transfer::Amount, - core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChainId, ChannelId, PortId}, }; use super::FeeTransferCmd; diff --git a/crates/relayer-cli/src/commands/health.rs b/crates/relayer-cli/src/commands/health.rs index bf8c537302..7a4758f051 100644 --- a/crates/relayer-cli/src/commands/health.rs +++ b/crates/relayer-cli/src/commands/health.rs @@ -1,19 +1,9 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; -use ibc_relayer::chain::{ - endpoint::HealthCheck::*, - handle::ChainHandle, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{endpoint::HealthCheck::*, handle::ChainHandle}; use crate::{ cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, prelude::*, }; diff --git a/crates/relayer-cli/src/commands/keys.rs b/crates/relayer-cli/src/commands/keys.rs index 3afb56da13..4d1c3f0986 100644 --- a/crates/relayer-cli/src/commands/keys.rs +++ b/crates/relayer-cli/src/commands/keys.rs @@ -1,9 +1,5 @@ //! `keys` subcommand -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; mod add; mod balance; diff --git a/crates/relayer-cli/src/commands/keys/add.rs b/crates/relayer-cli/src/commands/keys/add.rs index 2288ba49b8..a28ac5c941 100644 --- a/crates/relayer-cli/src/commands/keys/add.rs +++ b/crates/relayer-cli/src/commands/keys/add.rs @@ -1,41 +1,23 @@ use core::str::FromStr; use std::{ fs, - path::{ - Path, - PathBuf, - }, + path::{Path, PathBuf}, }; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use eyre::eyre; use hdpath::StandardHDPath; use ibc_relayer::{ - config::{ - ChainConfig, - Config, - }, + config::{ChainConfig, Config}, keyring::{ - AnySigningKeyPair, - Ed25519KeyPair, - KeyRing, - Secp256k1KeyPair, - SigningKeyPair, - SigningKeyPairSized, - Store, + AnySigningKeyPair, Ed25519KeyPair, KeyRing, Secp256k1KeyPair, SigningKeyPair, + SigningKeyPairSized, Store, }, }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use tracing::warn; -use crate::{ - application::app_config, - conclude::Output, -}; +use crate::{application::app_config, conclude::Output}; /// The data structure that represents the arguments when invoking the `keys add` CLI command. /// diff --git a/crates/relayer-cli/src/commands/keys/balance.rs b/crates/relayer-cli/src/commands/keys/balance.rs index 95ead20f2b..9a08d79d87 100644 --- a/crates/relayer-cli/src/commands/keys/balance.rs +++ b/crates/relayer-cli/src/commands/keys/balance.rs @@ -1,24 +1,13 @@ use std::fmt::Write; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; -use ibc_relayer::{ - chain::handle::ChainHandle, - config::ChainConfig, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::{chain::handle::ChainHandle, config::ChainConfig}; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use crate::{ application::app_config, cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - json, - Output, - }, + conclude::{exit_with_unrecoverable_error, json, Output}, }; /// The data structure that represents the arguments when invoking the `keys balance` CLI command. diff --git a/crates/relayer-cli/src/commands/keys/delete.rs b/crates/relayer-cli/src/commands/keys/delete.rs index 2370165eb0..be99da43ce 100644 --- a/crates/relayer-cli/src/commands/keys/delete.rs +++ b/crates/relayer-cli/src/commands/keys/delete.rs @@ -1,25 +1,12 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use eyre::eyre; use ibc_relayer::{ - config::{ - ChainConfig, - Config, - }, - keyring::{ - KeyRing, - Store, - }, + config::{ChainConfig, Config}, + keyring::{KeyRing, Store}, }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use crate::{ - application::app_config, - conclude::Output, -}; +use crate::{application::app_config, conclude::Output}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] #[clap( diff --git a/crates/relayer-cli/src/commands/keys/list.rs b/crates/relayer-cli/src/commands/keys/list.rs index 2205cbb420..ac6c202755 100644 --- a/crates/relayer-cli/src/commands/keys/list.rs +++ b/crates/relayer-cli/src/commands/keys/list.rs @@ -1,23 +1,13 @@ use alloc::collections::btree_map::BTreeMap as HashMap; use core::fmt::Write; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; -use ibc_relayer::config::{ - ChainConfig, - Config, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::config::{ChainConfig, Config}; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use crate::{ application::app_config, - conclude::{ - json, - Output, - }, + conclude::{json, Output}, }; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] diff --git a/crates/relayer-cli/src/commands/listen.rs b/crates/relayer-cli/src/commands/listen.rs index 092877a041..e5b570723c 100644 --- a/crates/relayer-cli/src/commands/listen.rs +++ b/crates/relayer-cli/src/commands/listen.rs @@ -1,45 +1,23 @@ use alloc::sync::Arc; use core::{ - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, str::FromStr, }; use std::thread; -use abscissa_core::{ - application::fatal_error, - clap::Parser, - Runnable, -}; +use abscissa_core::{application::fatal_error, clap::Parser, Runnable}; use eyre::eyre; use ibc_relayer::{ chain::handle::Subscription, - config::{ - ChainConfig, - EventSourceMode, - }, + config::{ChainConfig, EventSourceMode}, event::source::EventSource, util::compat_mode::compat_mode_from_version, }; -use ibc_relayer_types::{ - core::ics24_host::identifier::ChainId, - events::IbcEvent, -}; +use ibc_relayer_types::{core::ics24_host::identifier::ChainId, events::IbcEvent}; use itertools::Itertools; -use tendermint_rpc::{ - client::CompatMode, - Client, - HttpClient, -}; +use tendermint_rpc::{client::CompatMode, Client, HttpClient}; use tokio::runtime::Runtime as TokioRuntime; -use tracing::{ - error, - info, - instrument, -}; +use tracing::{error, info, instrument}; use crate::prelude::*; @@ -221,10 +199,7 @@ mod tests { use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics24_host::identifier::ChainId; - use super::{ - EventFilter, - ListenCmd, - }; + use super::{EventFilter, ListenCmd}; #[test] fn test_listen_required_only() { diff --git a/crates/relayer-cli/src/commands/logs.rs b/crates/relayer-cli/src/commands/logs.rs index 7aaeb53c4d..46f5e8f1ec 100644 --- a/crates/relayer-cli/src/commands/logs.rs +++ b/crates/relayer-cli/src/commands/logs.rs @@ -1,8 +1,4 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; pub mod log_level; pub mod raw; diff --git a/crates/relayer-cli/src/commands/logs/log_level.rs b/crates/relayer-cli/src/commands/logs/log_level.rs index 46ffb05f05..58b115488a 100644 --- a/crates/relayer-cli/src/commands/logs/log_level.rs +++ b/crates/relayer-cli/src/commands/logs/log_level.rs @@ -1,17 +1,7 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; -use tracing::{ - info, - Level, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use tracing::{info, Level}; -use crate::{ - prelude::app_config, - tracing_handle::send_command, -}; +use crate::{prelude::app_config, tracing_handle::send_command}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct SetLogLevelCmd { diff --git a/crates/relayer-cli/src/commands/logs/raw.rs b/crates/relayer-cli/src/commands/logs/raw.rs index 3ab062cb18..82316d0e4e 100644 --- a/crates/relayer-cli/src/commands/logs/raw.rs +++ b/crates/relayer-cli/src/commands/logs/raw.rs @@ -1,17 +1,7 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; -use tracing::{ - error, - info, -}; - -use crate::{ - prelude::app_config, - tracing_handle::send_command, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use tracing::{error, info}; + +use crate::{prelude::app_config, tracing_handle::send_command}; // TODO `hermes set-raw-filter` #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] diff --git a/crates/relayer-cli/src/commands/logs/reset.rs b/crates/relayer-cli/src/commands/logs/reset.rs index 29b7e8cb00..901d9c6ba9 100644 --- a/crates/relayer-cli/src/commands/logs/reset.rs +++ b/crates/relayer-cli/src/commands/logs/reset.rs @@ -1,14 +1,6 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; - -use crate::{ - components::default_directive, - prelude::*, - tracing_handle::send_command, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; + +use crate::{components::default_directive, prelude::*, tracing_handle::send_command}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct ResetCmd {} diff --git a/crates/relayer-cli/src/commands/misbehaviour.rs b/crates/relayer-cli/src/commands/misbehaviour.rs index 9d091e35dc..63fc55c66c 100644 --- a/crates/relayer-cli/src/commands/misbehaviour.rs +++ b/crates/relayer-cli/src/commands/misbehaviour.rs @@ -1,46 +1,26 @@ use std::ops::Deref; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use eyre::eyre; use ibc_relayer::{ chain::{ handle::ChainHandle, - requests::{ - IncludeProof, - QueryClientStateRequest, - QueryHeight, - }, + requests::{IncludeProof, QueryClientStateRequest, QueryHeight}, }, config::Config, - foreign_client::{ - ForeignClient, - MisbehaviourResults, - }, + foreign_client::{ForeignClient, MisbehaviourResults}, util::pretty::PrettySlice, }; use ibc_relayer_types::{ core::{ - ics02_client::{ - client_state::ClientState, - events::UpdateClient, - }, - ics24_host::identifier::{ - ChainId, - ClientId, - }, + ics02_client::{client_state::ClientState, events::UpdateClient}, + ics24_host::identifier::{ChainId, ClientId}, }, events::IbcEvent, }; use crate::{ - cli_utils::{ - spawn_chain_runtime, - spawn_chain_runtime_generic, - }, + cli_utils::{spawn_chain_runtime, spawn_chain_runtime_generic}, conclude::Output, prelude::*, }; @@ -187,10 +167,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ClientId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use super::MisbehaviourCmd; diff --git a/crates/relayer-cli/src/commands/query.rs b/crates/relayer-cli/src/commands/query.rs index cac9bf1fb5..3dd73168a2 100644 --- a/crates/relayer-cli/src/commands/query.rs +++ b/crates/relayer-cli/src/commands/query.rs @@ -1,16 +1,10 @@ //! `query` subcommand -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use crate::commands::query::{ - channel_client::QueryChannelClientCmd, - channel_ends::QueryChannelEndsCmd, - channels::QueryChannelsCmd, - packet::QueryPacketCmds, + channel_client::QueryChannelClientCmd, channel_ends::QueryChannelEndsCmd, + channels::QueryChannelsCmd, packet::QueryPacketCmds, }; mod channel; diff --git a/crates/relayer-cli/src/commands/query/channel.rs b/crates/relayer-cli/src/commands/query/channel.rs index cfb02ee79b..2502983d20 100644 --- a/crates/relayer-cli/src/commands/query/channel.rs +++ b/crates/relayer-cli/src/commands/query/channel.rs @@ -1,34 +1,19 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::chain::{ handle::ChainHandle, - requests::{ - IncludeProof, - QueryChannelRequest, - QueryHeight, - }, + requests::{IncludeProof, QueryChannelRequest, QueryHeight}, }; use ibc_relayer_types::{ core::{ ics04_channel::channel::State, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }, Height, }; use crate::{ cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, prelude::*, }; @@ -112,11 +97,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use super::QueryChannelEndCmd; diff --git a/crates/relayer-cli/src/commands/query/channel_client.rs b/crates/relayer-cli/src/commands/query/channel_client.rs index 1fcdc4380b..e8a2ae0cca 100644 --- a/crates/relayer-cli/src/commands/query/channel_client.rs +++ b/crates/relayer-cli/src/commands/query/channel_client.rs @@ -1,25 +1,11 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; -use ibc_relayer::chain::{ - handle::ChainHandle, - requests::QueryChannelClientStateRequest, -}; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{handle::ChainHandle, requests::QueryChannelClientStateRequest}; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use crate::{ application::app_config, cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, }; /// The data structure that represents the arguments when invoking the `query channel client` CLI command. @@ -80,11 +66,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use super::QueryChannelClientCmd; diff --git a/crates/relayer-cli/src/commands/query/channel_ends.rs b/crates/relayer-cli/src/commands/query/channel_ends.rs index 72a7d85d96..0f372ab8d3 100644 --- a/crates/relayer-cli/src/commands/query/channel_ends.rs +++ b/crates/relayer-cli/src/commands/query/channel_ends.rs @@ -1,20 +1,10 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use eyre::eyre; use ibc_relayer::{ chain::{ - handle::{ - BaseChainHandle, - ChainHandle, - }, + handle::{BaseChainHandle, ChainHandle}, requests::{ - IncludeProof, - QueryChannelRequest, - QueryClientStateRequest, - QueryConnectionRequest, + IncludeProof, QueryChannelRequest, QueryClientStateRequest, QueryConnectionRequest, QueryHeight, }, }, @@ -24,30 +14,15 @@ use ibc_relayer::{ use ibc_relayer_types::{ core::{ ics03_connection::connection::ConnectionEnd, - ics04_channel::channel::{ - ChannelEnd, - State, - }, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, - }, + ics04_channel::channel::{ChannelEnd, State}, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, Height, }; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use crate::{ - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, prelude::*, }; @@ -290,11 +265,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use super::QueryChannelEndsCmd; diff --git a/crates/relayer-cli/src/commands/query/channels.rs b/crates/relayer-cli/src/commands/query/channels.rs index 9524928699..97b2e4075f 100644 --- a/crates/relayer-cli/src/commands/query/channels.rs +++ b/crates/relayer-cli/src/commands/query/channels.rs @@ -1,52 +1,24 @@ -use core::fmt::{ - Debug, - Error, - Formatter, -}; +use core::fmt::{Debug, Error, Formatter}; -use abscissa_core::{ - clap::Parser, - Runnable, -}; +use abscissa_core::{clap::Parser, Runnable}; use eyre::eyre; use ibc_relayer::{ chain::{ - handle::{ - BaseChainHandle, - ChainHandle, - }, + handle::{BaseChainHandle, ChainHandle}, requests::{ - IncludeProof, - PageRequest, - QueryChannelRequest, - QueryChannelsRequest, - QueryClientStateRequest, - QueryConnectionRequest, - QueryHeight, + IncludeProof, PageRequest, QueryChannelRequest, QueryChannelsRequest, + QueryClientStateRequest, QueryConnectionRequest, QueryHeight, }, }, registry::Registry, }; use ibc_relayer_types::core::{ - ics04_channel::channel::{ - ChannelEnd, - State, - }, - ics24_host::identifier::{ - ChainId, - ChannelId, - ConnectionId, - PortChannelId, - PortId, - }, + ics04_channel::channel::{ChannelEnd, State}, + ics24_host::identifier::{ChainId, ChannelId, ConnectionId, PortChannelId, PortId}, }; use serde::Serialize; -use crate::{ - commands::query::channel_ends::ChannelEnds, - conclude::Output, - prelude::*, -}; +use crate::{commands::query::channel_ends::ChannelEnds, conclude::Output, prelude::*}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryChannelsCmd { diff --git a/crates/relayer-cli/src/commands/query/client.rs b/crates/relayer-cli/src/commands/query/client.rs index 53316ab0e8..722f1e181a 100644 --- a/crates/relayer-cli/src/commands/query/client.rs +++ b/crates/relayer-cli/src/commands/query/client.rs @@ -1,30 +1,17 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use color_eyre::eyre::eyre; use ibc_relayer::chain::{ handle::ChainHandle, requests::{ - IncludeProof, - PageRequest, - QueryClientConnectionsRequest, - QueryClientEventRequest, - QueryClientStateRequest, - QueryConsensusStateHeightsRequest, - QueryConsensusStateRequest, - QueryHeight, - QueryTxRequest, + IncludeProof, PageRequest, QueryClientConnectionsRequest, QueryClientEventRequest, + QueryClientStateRequest, QueryConsensusStateHeightsRequest, QueryConsensusStateRequest, + QueryHeight, QueryTxRequest, }, }; use ibc_relayer_types::{ core::{ ics02_client::client_state::ClientState, - ics24_host::identifier::{ - ChainId, - ClientId, - }, + ics24_host::identifier::{ChainId, ClientId}, }, events::WithBlockDataType, Height, @@ -33,10 +20,7 @@ use ibc_relayer_types::{ use crate::{ application::app_config, cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, }; /// Query client state command @@ -430,17 +414,11 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ClientId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use super::{ - QueryClientConnectionsCmd, - QueryClientConsensusCmd, - QueryClientHeaderCmd, - QueryClientStateCmd, - QueryClientStatusCmd, + QueryClientConnectionsCmd, QueryClientConsensusCmd, QueryClientHeaderCmd, + QueryClientStateCmd, QueryClientStatusCmd, }; #[test] diff --git a/crates/relayer-cli/src/commands/query/clients.rs b/crates/relayer-cli/src/commands/query/clients.rs index e19476a3c2..242b12213f 100644 --- a/crates/relayer-cli/src/commands/query/clients.rs +++ b/crates/relayer-cli/src/commands/query/clients.rs @@ -1,27 +1,14 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::chain::{ handle::ChainHandle, - requests::{ - PageRequest, - QueryClientStatesRequest, - }, -}; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ClientId, + requests::{PageRequest, QueryClientStatesRequest}, }; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use serde::Serialize; use crate::{ cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, error::Error, prelude::*, }; diff --git a/crates/relayer-cli/src/commands/query/connection.rs b/crates/relayer-cli/src/commands/query/connection.rs index 2e9b52f882..10c27d61d3 100644 --- a/crates/relayer-cli/src/commands/query/connection.rs +++ b/crates/relayer-cli/src/commands/query/connection.rs @@ -1,36 +1,22 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::chain::{ handle::ChainHandle, requests::{ - IncludeProof, - PageRequest, - QueryConnectionChannelsRequest, - QueryConnectionRequest, + IncludeProof, PageRequest, QueryConnectionChannelsRequest, QueryConnectionRequest, QueryHeight, }, }; use ibc_relayer_types::{ core::{ ics03_connection::connection::State, - ics24_host::identifier::{ - ChainId, - ConnectionId, - PortChannelId, - }, + ics24_host::identifier::{ChainId, ConnectionId, PortChannelId}, }, Height, }; use crate::{ cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, error::Error, prelude::*, }; @@ -161,15 +147,9 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ConnectionId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ConnectionId}; - use super::{ - QueryConnectionChannelsCmd, - QueryConnectionEndCmd, - }; + use super::{QueryConnectionChannelsCmd, QueryConnectionEndCmd}; #[test] fn test_query_connection_channels() { diff --git a/crates/relayer-cli/src/commands/query/connections.rs b/crates/relayer-cli/src/commands/query/connections.rs index 08dd19c5ac..63bf6cc94b 100644 --- a/crates/relayer-cli/src/commands/query/connections.rs +++ b/crates/relayer-cli/src/commands/query/connections.rs @@ -1,28 +1,15 @@ -use abscissa_core::{ - clap::Parser, - Runnable, -}; +use abscissa_core::{clap::Parser, Runnable}; use ibc_relayer::chain::{ handle::ChainHandle, requests::{ - IncludeProof, - PageRequest, - QueryClientStateRequest, - QueryConnectionsRequest, - QueryHeight, + IncludeProof, PageRequest, QueryClientStateRequest, QueryConnectionsRequest, QueryHeight, }, }; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ConnectionId, -}; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ConnectionId}; use crate::{ cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, prelude::*, }; diff --git a/crates/relayer-cli/src/commands/query/packet.rs b/crates/relayer-cli/src/commands/query/packet.rs index f80cda2a2b..0920605ce3 100644 --- a/crates/relayer-cli/src/commands/query/packet.rs +++ b/crates/relayer-cli/src/commands/query/packet.rs @@ -1,8 +1,4 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; mod ack; mod acks; diff --git a/crates/relayer-cli/src/commands/query/packet/ack.rs b/crates/relayer-cli/src/commands/query/packet/ack.rs index ee2e09d812..7353acd594 100644 --- a/crates/relayer-cli/src/commands/query/packet/ack.rs +++ b/crates/relayer-cli/src/commands/query/packet/ack.rs @@ -1,38 +1,20 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::chain::{ handle::ChainHandle, - requests::{ - IncludeProof, - QueryHeight, - QueryPacketAcknowledgementRequest, - }, + requests::{IncludeProof, QueryHeight, QueryPacketAcknowledgementRequest}, }; use ibc_relayer_types::{ core::{ ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }, Height, }; -use subtle_encoding::{ - Encoding, - Hex, -}; +use subtle_encoding::{Encoding, Hex}; use crate::{ cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, error::Error, prelude::*, }; @@ -131,11 +113,7 @@ mod tests { use abscissa_core::clap::Parser; use ibc_relayer_types::core::{ ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }; use super::QueryPacketAcknowledgmentCmd; diff --git a/crates/relayer-cli/src/commands/query/packet/acks.rs b/crates/relayer-cli/src/commands/query/packet/acks.rs index 46a1cf9cd4..afa493321b 100644 --- a/crates/relayer-cli/src/commands/query/packet/acks.rs +++ b/crates/relayer-cli/src/commands/query/packet/acks.rs @@ -1,25 +1,9 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; -use ibc_relayer::chain::{ - counterparty::acknowledgements_on_chain, - handle::BaseChainHandle, -}; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::chain::{counterparty::acknowledgements_on_chain, handle::BaseChainHandle}; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use super::util::PacketSeqs; -use crate::{ - cli_utils::spawn_chain_counterparty, - conclude::Output, - error::Error, - prelude::*, -}; +use crate::{cli_utils::spawn_chain_counterparty, conclude::Output, error::Error, prelude::*}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryPacketAcknowledgementsCmd { @@ -93,11 +77,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use super::QueryPacketAcknowledgementsCmd; diff --git a/crates/relayer-cli/src/commands/query/packet/commitment.rs b/crates/relayer-cli/src/commands/query/packet/commitment.rs index cc4069fe60..26e49d56b1 100644 --- a/crates/relayer-cli/src/commands/query/packet/commitment.rs +++ b/crates/relayer-cli/src/commands/query/packet/commitment.rs @@ -1,39 +1,21 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::chain::{ handle::ChainHandle, - requests::{ - IncludeProof, - QueryHeight, - QueryPacketCommitmentRequest, - }, + requests::{IncludeProof, QueryHeight, QueryPacketCommitmentRequest}, }; use ibc_relayer_types::{ core::{ ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }, Height, }; use serde::Serialize; -use subtle_encoding::{ - Encoding, - Hex, -}; +use subtle_encoding::{Encoding, Hex}; use crate::{ cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, error::Error, prelude::*, }; @@ -141,11 +123,7 @@ mod tests { use abscissa_core::clap::Parser; use ibc_relayer_types::core::{ ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }; use super::QueryPacketCommitmentCmd; diff --git a/crates/relayer-cli/src/commands/query/packet/commitments.rs b/crates/relayer-cli/src/commands/query/packet/commitments.rs index 94e9941b6b..648770e762 100644 --- a/crates/relayer-cli/src/commands/query/packet/commitments.rs +++ b/crates/relayer-cli/src/commands/query/packet/commitments.rs @@ -1,22 +1,9 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::chain::counterparty::commitments_on_chain; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, -}; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use super::util::PacketSeqs; -use crate::{ - cli_utils::spawn_chain_runtime, - conclude::Output, - error::Error, - prelude::*, -}; +use crate::{cli_utils::spawn_chain_runtime, conclude::Output, error::Error, prelude::*}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryPacketCommitmentsCmd { @@ -82,11 +69,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use super::QueryPacketCommitmentsCmd; diff --git a/crates/relayer-cli/src/commands/query/packet/pending.rs b/crates/relayer-cli/src/commands/query/packet/pending.rs index c10898cd45..ed6a679e04 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending.rs @@ -1,35 +1,15 @@ use core::fmt; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::chain::{ - counterparty::{ - channel_on_destination, - pending_packet_summary, - PendingPackets, - }, - handle::{ - BaseChainHandle, - ChainHandle, - }, -}; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, + counterparty::{channel_on_destination, pending_packet_summary, PendingPackets}, + handle::{BaseChainHandle, ChainHandle}, }; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use serde::Serialize; use super::util::CollatedPendingPackets; -use crate::{ - cli_utils::spawn_chain_counterparty, - conclude::Output, - error::Error, - prelude::*, -}; +use crate::{cli_utils::spawn_chain_counterparty, conclude::Output, error::Error, prelude::*}; /// A structure to display pending packet commitment sequence IDs /// at both ends of a channel. @@ -185,11 +165,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use super::QueryPendingPacketsCmd; diff --git a/crates/relayer-cli/src/commands/query/packet/pending_acks.rs b/crates/relayer-cli/src/commands/query/packet/pending_acks.rs index e20de7f482..aef53a7511 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending_acks.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending_acks.rs @@ -1,31 +1,15 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::{ - chain::{ - counterparty::unreceived_acknowledgements, - handle::BaseChainHandle, - }, + chain::{counterparty::unreceived_acknowledgements, handle::BaseChainHandle}, path::PathIdentifiers, util::collate::CollatedIterExt, }; use ibc_relayer_types::core::{ ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }; -use crate::{ - cli_utils::spawn_chain_counterparty, - conclude::Output, - error::Error, - prelude::*, -}; +use crate::{cli_utils::spawn_chain_counterparty, conclude::Output, error::Error, prelude::*}; /// This command does the following: /// 1. queries the chain to get its counterparty, channel and port identifiers (needed in 2) @@ -107,11 +91,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use super::QueryPendingAcksCmd; diff --git a/crates/relayer-cli/src/commands/query/packet/pending_sends.rs b/crates/relayer-cli/src/commands/query/packet/pending_sends.rs index 9cbc305286..4cbbc81179 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending_sends.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending_sends.rs @@ -1,31 +1,15 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::{ - chain::{ - counterparty::unreceived_packets, - handle::BaseChainHandle, - }, + chain::{counterparty::unreceived_packets, handle::BaseChainHandle}, path::PathIdentifiers, util::collate::CollatedIterExt, }; use ibc_relayer_types::core::{ ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }; -use crate::{ - cli_utils::spawn_chain_counterparty, - conclude::Output, - error::Error, - prelude::*, -}; +use crate::{cli_utils::spawn_chain_counterparty, conclude::Output, error::Error, prelude::*}; /// This command does the following: /// 1. queries the chain to get its counterparty chain, channel and port identifiers (needed in 2) @@ -106,11 +90,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use super::QueryPendingSendsCmd; diff --git a/crates/relayer-cli/src/commands/query/packet/util.rs b/crates/relayer-cli/src/commands/query/packet/util.rs index e02ff177f3..b7068cf344 100644 --- a/crates/relayer-cli/src/commands/query/packet/util.rs +++ b/crates/relayer-cli/src/commands/query/packet/util.rs @@ -1,14 +1,8 @@ use core::fmt; pub use ibc_relayer::chain::counterparty::PendingPackets; -use ibc_relayer::util::collate::{ - Collated, - CollatedIterExt, -}; -use ibc_relayer_types::{ - core::ics04_channel::packet::Sequence, - Height, -}; +use ibc_relayer::util::collate::{Collated, CollatedIterExt}; +use ibc_relayer_types::{core::ics04_channel::packet::Sequence, Height}; use serde::Serialize; #[derive(Serialize)] diff --git a/crates/relayer-cli/src/commands/query/transfer.rs b/crates/relayer-cli/src/commands/query/transfer.rs index c08b89f935..d1ec140a61 100644 --- a/crates/relayer-cli/src/commands/query/transfer.rs +++ b/crates/relayer-cli/src/commands/query/transfer.rs @@ -1,10 +1,6 @@ //! `query transfer` subcommand -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; mod denom_trace; diff --git a/crates/relayer-cli/src/commands/query/transfer/denom_trace.rs b/crates/relayer-cli/src/commands/query/transfer/denom_trace.rs index 9df325dec9..dcffce2657 100644 --- a/crates/relayer-cli/src/commands/query/transfer/denom_trace.rs +++ b/crates/relayer-cli/src/commands/query/transfer/denom_trace.rs @@ -1,19 +1,11 @@ -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use crate::{ application::app_config, cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - json, - Output, - }, + conclude::{exit_with_unrecoverable_error, json, Output}, }; /// The data structure that represents the arguments when invoking the `query transfer denom-trace` CLI command. diff --git a/crates/relayer-cli/src/commands/query/tx.rs b/crates/relayer-cli/src/commands/query/tx.rs index 311a996119..4d06b38256 100644 --- a/crates/relayer-cli/src/commands/query/tx.rs +++ b/crates/relayer-cli/src/commands/query/tx.rs @@ -1,10 +1,6 @@ //! `query tx` subcommand -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; mod events; diff --git a/crates/relayer-cli/src/commands/query/tx/events.rs b/crates/relayer-cli/src/commands/query/tx/events.rs index d4bcd51287..cd77ab0d04 100644 --- a/crates/relayer-cli/src/commands/query/tx/events.rs +++ b/crates/relayer-cli/src/commands/query/tx/events.rs @@ -1,26 +1,16 @@ use core::str::FromStr; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::chain::{ handle::ChainHandle, - requests::{ - QueryTxHash, - QueryTxRequest, - }, + requests::{QueryTxHash, QueryTxRequest}, }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use tendermint::Hash; use crate::{ cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, error::Error, prelude::app_config, }; diff --git a/crates/relayer-cli/src/commands/start.rs b/crates/relayer-cli/src/commands/start.rs index a0a17cea19..6ca38f9df7 100644 --- a/crates/relayer-cli/src/commands/start.rs +++ b/crates/relayer-cli/src/commands/start.rs @@ -1,36 +1,18 @@ -use std::{ - error::Error, - io, -}; +use std::{error::Error, io}; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use crossbeam_channel::Sender; use ibc_relayer::{ - chain::handle::{ - CachingChainHandle, - ChainHandle, - }, + chain::handle::{CachingChainHandle, ChainHandle}, config::Config, registry::SharedRegistry, rest, - supervisor::{ - cmd::SupervisorCmd, - spawn_supervisor, - SupervisorHandle, - SupervisorOptions, - }, + supervisor::{cmd::SupervisorCmd, spawn_supervisor, SupervisorHandle, SupervisorOptions}, util::debug_section::DebugSection, }; use crate::{ - conclude::{ - json, - Output, - }, + conclude::{json, Output}, prelude::*, }; @@ -48,10 +30,7 @@ impl Runnable for StartCmd { let app = app_reader(); if app.debug_enabled(DebugSection::ProfilingJson) { - use std::{ - env, - path::Path, - }; + use std::{env, path::Path}; use ibc_relayer::util::profiling::open_or_create_profile_file; @@ -105,10 +84,7 @@ impl Runnable for StartCmd { /// - [DEPRECATED] SIGHUP: Trigger a reload of the configuration. /// - SIGUSR1: Ask the supervisor to dump its state and print it to the console. fn register_signals(tx_cmd: Sender) -> Result<(), io::Error> { - use signal_hook::{ - consts::signal::*, - iterator::Signals, - }; + use signal_hook::{consts::signal::*, iterator::Signals}; let sigs = vec![ SIGHUP, // Reload of configuration (disabled) diff --git a/crates/relayer-cli/src/commands/tx.rs b/crates/relayer-cli/src/commands/tx.rs index 8bca5448bd..0908cfb837 100644 --- a/crates/relayer-cli/src/commands/tx.rs +++ b/crates/relayer-cli/src/commands/tx.rs @@ -1,10 +1,5 @@ //! `tx` subcommand -use abscissa_core::{ - clap::Parser, - config::Override, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, config::Override, Command, Runnable}; use ibc_relayer::config::Config; mod channel; diff --git a/crates/relayer-cli/src/commands/tx/channel.rs b/crates/relayer-cli/src/commands/tx/channel.rs index 73813b95ef..2d7f625e3c 100644 --- a/crates/relayer-cli/src/commands/tx/channel.rs +++ b/crates/relayer-cli/src/commands/tx/channel.rs @@ -1,45 +1,23 @@ #![allow(clippy::redundant_closure_call)] -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::{ chain::{ handle::ChainHandle, - requests::{ - IncludeProof, - QueryConnectionRequest, - QueryHeight, - }, - }, - channel::{ - Channel, - ChannelSide, + requests::{IncludeProof, QueryConnectionRequest, QueryHeight}, }, + channel::{Channel, ChannelSide}, }; use ibc_relayer_types::{ core::{ ics03_connection::connection::ConnectionEnd, ics04_channel::channel::Ordering, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, events::IbcEvent, }; -use crate::{ - cli_utils::ChainHandlePair, - conclude::Output, - error::Error, - prelude::*, -}; +use crate::{cli_utils::ChainHandlePair, conclude::Output, error::Error, prelude::*}; macro_rules! tx_chan_cmd { ($dbg_string:literal, $func:ident, $self:expr, $chan:expr) => { @@ -699,21 +677,12 @@ mod tests { use abscissa_core::clap::Parser; use ibc_relayer_types::core::{ ics04_channel::channel::Ordering, - ics24_host::identifier::{ - ChainId, - ChannelId, - ConnectionId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, ConnectionId, PortId}, }; use super::{ - TxChanCloseConfirmCmd, - TxChanCloseInitCmd, - TxChanOpenAckCmd, - TxChanOpenConfirmCmd, - TxChanOpenInitCmd, - TxChanOpenTryCmd, + TxChanCloseConfirmCmd, TxChanCloseInitCmd, TxChanOpenAckCmd, TxChanOpenConfirmCmd, + TxChanOpenInitCmd, TxChanOpenTryCmd, }; #[test] diff --git a/crates/relayer-cli/src/commands/tx/client.rs b/crates/relayer-cli/src/commands/tx/client.rs index 5f129e2733..f96871b11a 100644 --- a/crates/relayer-cli/src/commands/tx/client.rs +++ b/crates/relayer-cli/src/commands/tx/client.rs @@ -1,45 +1,24 @@ use core::{ - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, time::Duration, }; use std::thread; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::{ chain::{ handle::ChainHandle, requests::{ - IncludeProof, - PageRequest, - QueryClientStateRequest, - QueryClientStatesRequest, + IncludeProof, PageRequest, QueryClientStateRequest, QueryClientStatesRequest, QueryHeight, }, }, - config::{ - ChainConfig, - Config, - GenesisRestart, - }, + config::{ChainConfig, Config, GenesisRestart}, event::IbcEventWithHeight, - foreign_client::{ - CreateOptions, - ForeignClient, - }, + foreign_client::{CreateOptions, ForeignClient}, }; use ibc_relayer_types::{ - core::ics24_host::identifier::{ - ChainId, - ClientId, - }, + core::ics24_host::identifier::{ChainId, ClientId}, events::IbcEvent, Height, }; @@ -50,15 +29,8 @@ use tracing::debug; use crate::{ application::app_config, - cli_utils::{ - spawn_chain_runtime, - spawn_chain_runtime_generic, - ChainHandlePair, - }, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + cli_utils::{spawn_chain_runtime, spawn_chain_runtime_generic, ChainHandlePair}, + conclude::{exit_with_unrecoverable_error, Output}, error::Error, }; @@ -644,17 +616,11 @@ mod tests { use abscissa_core::clap::Parser; use humantime::Duration; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ClientId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use tendermint_light_client_verifier::types::TrustThreshold; use super::{ - parse_trust_threshold, - TxCreateClientCmd, - TxUpdateClientCmd, - TxUpgradeClientCmd, + parse_trust_threshold, TxCreateClientCmd, TxUpdateClientCmd, TxUpgradeClientCmd, TxUpgradeClientsCmd, }; diff --git a/crates/relayer-cli/src/commands/tx/connection.rs b/crates/relayer-cli/src/commands/tx/connection.rs index a264e22185..89803dc16e 100644 --- a/crates/relayer-cli/src/commands/tx/connection.rs +++ b/crates/relayer-cli/src/commands/tx/connection.rs @@ -1,30 +1,14 @@ #![allow(clippy::redundant_closure_call)] -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; -use ibc_relayer::connection::{ - Connection, - ConnectionSide, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; +use ibc_relayer::connection::{Connection, ConnectionSide}; use ibc_relayer_types::{ - core::ics24_host::identifier::{ - ChainId, - ClientId, - ConnectionId, - }, + core::ics24_host::identifier::{ChainId, ClientId, ConnectionId}, events::IbcEvent, timestamp::ZERO_DURATION, }; -use crate::{ - cli_utils::ChainHandlePair, - conclude::Output, - error::Error, - prelude::*, -}; +use crate::{cli_utils::ChainHandlePair, conclude::Output, error::Error, prelude::*}; macro_rules! conn_open_cmd { ($dbg_string:literal, $func:ident, $self:expr, $conn:expr) => { @@ -361,18 +345,9 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ClientId, - ConnectionId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId, ConnectionId}; - use super::{ - TxConnAckCmd, - TxConnConfirmCmd, - TxConnInitCmd, - TxConnTryCmd, - }; + use super::{TxConnAckCmd, TxConnConfirmCmd, TxConnInitCmd, TxConnTryCmd}; #[test] fn test_conn_init() { diff --git a/crates/relayer-cli/src/commands/tx/packet.rs b/crates/relayer-cli/src/commands/tx/packet.rs index 302a609e1d..bc63a045cd 100644 --- a/crates/relayer-cli/src/commands/tx/packet.rs +++ b/crates/relayer-cli/src/commands/tx/packet.rs @@ -1,37 +1,21 @@ use std::ops::RangeInclusive; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::{ chain::handle::ChainHandle, - link::{ - Link, - LinkParameters, - }, + link::{Link, LinkParameters}, util::seq_range::parse_seq_range, }; use ibc_relayer_types::{ core::{ ics02_client::height::Height, ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }, events::IbcEvent, }; -use crate::{ - cli_utils::ChainHandlePair, - conclude::Output, - error::Error, - prelude::*, -}; +use crate::{cli_utils::ChainHandlePair, conclude::Output, error::Error, prelude::*}; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct TxPacketRecvCmd { @@ -232,16 +216,9 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }; - - use super::{ - TxPacketAckCmd, - TxPacketRecvCmd, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; + + use super::{TxPacketAckCmd, TxPacketRecvCmd}; #[test] fn test_packet_recv_required_only() { diff --git a/crates/relayer-cli/src/commands/tx/transfer.rs b/crates/relayer-cli/src/commands/tx/transfer.rs index 60d56a1f12..5f2933718a 100644 --- a/crates/relayer-cli/src/commands/tx/transfer.rs +++ b/crates/relayer-cli/src/commands/tx/transfer.rs @@ -1,40 +1,21 @@ use core::time::Duration; -use abscissa_core::{ - clap::Parser, - config::Override, - Command, - FrameworkErrorKind, - Runnable, -}; +use abscissa_core::{clap::Parser, config::Override, Command, FrameworkErrorKind, Runnable}; use eyre::eyre; use ibc_relayer::{ chain::handle::ChainHandle, config::Config, event::IbcEventWithHeight, - transfer::{ - build_and_send_transfer_messages, - TransferOptions, - }, + transfer::{build_and_send_transfer_messages, TransferOptions}, }; use ibc_relayer_types::{ applications::transfer::Amount, - core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChainId, ChannelId, PortId}, }; use crate::{ - cli_utils::{ - check_can_send_on_channel, - ChainHandlePair, - }, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + cli_utils::{check_can_send_on_channel, ChainHandlePair}, + conclude::{exit_with_unrecoverable_error, Output}, error::Error, prelude::*, }; @@ -235,11 +216,7 @@ mod tests { use abscissa_core::clap::Parser; use ibc_relayer_types::{ applications::transfer::Amount, - core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChainId, ChannelId, PortId}, }; use super::TxIcs20MsgTransferCmd; diff --git a/crates/relayer-cli/src/commands/tx/upgrade.rs b/crates/relayer-cli/src/commands/tx/upgrade.rs index 4249f98715..a8931c6cad 100644 --- a/crates/relayer-cli/src/commands/tx/upgrade.rs +++ b/crates/relayer-cli/src/commands/tx/upgrade.rs @@ -1,26 +1,14 @@ use core::time::Duration; -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::upgrade_chain::{ - build_and_send_ibc_upgrade_proposal, - requires_legacy_upgrade_proposal, - UpgradePlanOptions, -}; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ClientId, + build_and_send_ibc_upgrade_proposal, requires_legacy_upgrade_proposal, UpgradePlanOptions, }; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use crate::{ cli_utils::spawn_chain_runtime, - conclude::{ - exit_with_unrecoverable_error, - Output, - }, + conclude::{exit_with_unrecoverable_error, Output}, error::Error, prelude::*, }; @@ -169,10 +157,7 @@ mod tests { use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChainId, - ClientId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use super::TxIbcUpgradeChainCmd; diff --git a/crates/relayer-cli/src/commands/update.rs b/crates/relayer-cli/src/commands/update.rs index 8d3e7cf80a..29967578ed 100644 --- a/crates/relayer-cli/src/commands/update.rs +++ b/crates/relayer-cli/src/commands/update.rs @@ -1,10 +1,6 @@ //! `update` subcommand -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use crate::commands::tx::client::TxUpdateClientCmd; diff --git a/crates/relayer-cli/src/commands/upgrade.rs b/crates/relayer-cli/src/commands/upgrade.rs index 66c75bdf95..e0fa869d53 100644 --- a/crates/relayer-cli/src/commands/upgrade.rs +++ b/crates/relayer-cli/src/commands/upgrade.rs @@ -1,15 +1,8 @@ //! `upgrade` subcommand -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; -use crate::commands::tx::client::{ - TxUpgradeClientCmd, - TxUpgradeClientsCmd, -}; +use crate::commands::tx::client::{TxUpgradeClientCmd, TxUpgradeClientsCmd}; #[derive(Command, Debug, Parser, Runnable)] pub enum UpgradeCmds { diff --git a/crates/relayer-cli/src/commands/version.rs b/crates/relayer-cli/src/commands/version.rs index d3d209e92f..270b2b0a26 100644 --- a/crates/relayer-cli/src/commands/version.rs +++ b/crates/relayer-cli/src/commands/version.rs @@ -1,10 +1,6 @@ //! `version` subcommand -use abscissa_core::{ - clap::Parser, - Command, - Runnable, -}; +use abscissa_core::{clap::Parser, Command, Runnable}; use super::CliCmd; diff --git a/crates/relayer-cli/src/components.rs b/crates/relayer-cli/src/components.rs index 205609be8c..91c76b216e 100644 --- a/crates/relayer-cli/src/components.rs +++ b/crates/relayer-cli/src/components.rs @@ -1,23 +1,11 @@ //! Various components for internal use by the Abscissa subsystem. -use abscissa_core::{ - Component, - FrameworkError, - FrameworkErrorKind, -}; +use abscissa_core::{Component, FrameworkError, FrameworkErrorKind}; use ibc_relayer::{ - config::{ - Error, - GlobalConfig, - LogLevel, - }, + config::{Error, GlobalConfig, LogLevel}, util::debug_section::DebugSection, }; -use tracing_subscriber::{ - filter::EnvFilter, - util::SubscriberInitExt, - FmtSubscriber, -}; +use tracing_subscriber::{filter::EnvFilter, util::SubscriberInitExt, FmtSubscriber}; use crate::tracing_handle::ReloadHandle; diff --git a/crates/relayer-cli/src/entry.rs b/crates/relayer-cli/src/entry.rs index 55e825c3f9..cdcbc41551 100644 --- a/crates/relayer-cli/src/entry.rs +++ b/crates/relayer-cli/src/entry.rs @@ -2,26 +2,11 @@ //! Definition of the entrypoint for the Hermes CLI. -use std::{ - path::PathBuf, - process, -}; +use std::{path::PathBuf, process}; -use abscissa_core::{ - clap::Parser, - Command, - Configurable, - FrameworkError, - Runnable, -}; -use clap::{ - IntoApp, - ValueEnum, -}; -use ibc_relayer::{ - config::Config, - util::debug_section::DebugSection, -}; +use abscissa_core::{clap::Parser, Command, Configurable, FrameworkError, Runnable}; +use clap::{IntoApp, ValueEnum}; +use ibc_relayer::{config::Config, util::debug_section::DebugSection}; use crate::commands::CliCmd; diff --git a/crates/relayer-cli/src/error.rs b/crates/relayer-cli/src/error.rs index e891e05942..b989ccbb7b 100644 --- a/crates/relayer-cli/src/error.rs +++ b/crates/relayer-cli/src/error.rs @@ -2,28 +2,16 @@ use std::io::Error as IoError; -use flex_error::{ - define_error, - DisplayError, -}; +use flex_error::{define_error, DisplayError}; use ibc_relayer::{ - channel::ChannelError, - connection::ConnectionError, - error::Error as RelayerError, - foreign_client::ForeignClientError, - keyring::errors::Error as KeyRingError, - link::error::LinkError, - spawn::SpawnError, - supervisor::Error as SupervisorError, - transfer::TransferError, - upgrade_chain::UpgradeChainError, + channel::ChannelError, connection::ConnectionError, error::Error as RelayerError, + foreign_client::ForeignClientError, keyring::errors::Error as KeyRingError, + link::error::LinkError, spawn::SpawnError, supervisor::Error as SupervisorError, + transfer::TransferError, upgrade_chain::UpgradeChainError, }; use ibc_relayer_types::{ applications::ics29_fee::error::Error as FeeError, - core::{ - ics04_channel::channel::IdentifiedChannelEnd, - ics24_host::identifier::ChainId, - }, + core::{ics04_channel::channel::IdentifiedChannelEnd, ics24_host::identifier::ChainId}, signer::SignerError, }; use tendermint::Error as TendermintError; diff --git a/crates/relayer-cli/src/prelude.rs b/crates/relayer-cli/src/prelude.rs index 7c2a22d333..fac61533bc 100644 --- a/crates/relayer-cli/src/prelude.rs +++ b/crates/relayer-cli/src/prelude.rs @@ -8,7 +8,4 @@ pub use abscissa_core::prelude::*; /// Application state accessors -pub use crate::application::{ - app_config, - app_reader, -}; +pub use crate::application::{app_config, app_reader}; diff --git a/crates/relayer-cli/src/tracing_handle.rs b/crates/relayer-cli/src/tracing_handle.rs index d77205f271..6f7ca2c8e5 100644 --- a/crates/relayer-cli/src/tracing_handle.rs +++ b/crates/relayer-cli/src/tracing_handle.rs @@ -2,21 +2,10 @@ use std::io; use ibc_relayer::config::TracingServerConfig; use tokio::{ - io::{ - AsyncBufReadExt, - AsyncReadExt, - AsyncWriteExt, - BufReader, - }, - net::{ - TcpListener, - TcpStream, - }, -}; -use tracing_subscriber::{ - filter, - reload::Handle, + io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, BufReader}, + net::{TcpListener, TcpStream}, }; +use tracing_subscriber::{filter, reload::Handle}; pub type ReloadHandle = Handle; diff --git a/crates/relayer-rest/src/handle.rs b/crates/relayer-rest/src/handle.rs index 4e70afa0e9..0f9f9f1f74 100644 --- a/crates/relayer-rest/src/handle.rs +++ b/crates/relayer-rest/src/handle.rs @@ -4,12 +4,7 @@ use crossbeam_channel as channel; use ibc_relayer::{ config::ChainConfig, rest::{ - request::{ - reply_channel, - ReplySender, - Request, - VersionInfo, - }, + request::{reply_channel, ReplySender, Request, VersionInfo}, RestApiError, }, supervisor::dump_state::SupervisorState, diff --git a/crates/relayer-rest/src/server.rs b/crates/relayer-rest/src/server.rs index c21f5b321c..53b1bfbbaa 100644 --- a/crates/relayer-rest/src/server.rs +++ b/crates/relayer-rest/src/server.rs @@ -1,44 +1,22 @@ use std::{ error::Error, - net::{ - SocketAddr, - ToSocketAddrs, - }, + net::{SocketAddr, ToSocketAddrs}, }; use axum::{ - extract::{ - Path, - Query, - }, + extract::{Path, Query}, response::IntoResponse, - routing::{ - get, - post, - }, - Extension, - Json, - Router, - Server, + routing::{get, post}, + Extension, Json, Router, Server, }; use crossbeam_channel as channel; -use ibc_relayer::rest::{ - request::Request, - RestApiError, -}; +use ibc_relayer::rest::{request::Request, RestApiError}; use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use tokio::task::JoinHandle; use crate::handle::{ - all_chain_ids, - assemble_version_info, - chain_config, - supervisor_state, - trigger_clear_packets, + all_chain_ids, assemble_version_info, chain_config, supervisor_state, trigger_clear_packets, }; pub type BoxError = Box; diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index 38ef39e7fe..fa33d59d31 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -1,24 +1,13 @@ -use std::{ - fmt::Debug, - str::FromStr, - time::Duration, -}; +use std::{fmt::Debug, str::FromStr, time::Duration}; use ibc_relayer::{ config::ChainConfig, - rest::request::{ - Request, - VersionInfo, - }, + rest::request::{Request, VersionInfo}, supervisor::dump_state::SupervisorState, }; use ibc_relayer_rest::spawn; use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use serde::{ - de::DeserializeOwned, - Deserialize, - Serialize, -}; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; enum TestResult { Success, diff --git a/crates/relayer-types/src/applications/ics27_ica/cosmos_tx.rs b/crates/relayer-types/src/applications/ics27_ica/cosmos_tx.rs index af7cee9daf..4c08c6b617 100644 --- a/crates/relayer-types/src/applications/ics27_ica/cosmos_tx.rs +++ b/crates/relayer-types/src/applications/ics27_ica/cosmos_tx.rs @@ -1,17 +1,11 @@ use ibc_proto::{ - google::protobuf::Any, - ibc::applications::interchain_accounts::v1::CosmosTx as RawCosmosTx, + google::protobuf::Any, ibc::applications::interchain_accounts::v1::CosmosTx as RawCosmosTx, Protobuf, }; -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; use crate::{ - applications::ics27_ica::error::Error, - core::ics24_host::error::ValidationError, - tx_msg::Msg, + applications::ics27_ica::error::Error, core::ics24_host::error::ValidationError, tx_msg::Msg, }; pub const TYPE_URL: &str = "/ibc.applications.interchain_accounts.v1.CosmosTx"; diff --git a/crates/relayer-types/src/applications/ics27_ica/error.rs b/crates/relayer-types/src/applications/ics27_ica/error.rs index f652b99bb2..5a2054421e 100644 --- a/crates/relayer-types/src/applications/ics27_ica/error.rs +++ b/crates/relayer-types/src/applications/ics27_ica/error.rs @@ -1,9 +1,6 @@ use flex_error::define_error; -use crate::{ - core::ics24_host::error::ValidationError, - signer::SignerError, -}; +use crate::{core::ics24_host::error::ValidationError, signer::SignerError}; define_error! { #[derive(Debug, PartialEq, Eq)] diff --git a/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs b/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs index 1301de19cd..7847e28c0c 100644 --- a/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs +++ b/crates/relayer-types/src/applications/ics27_ica/msgs/register.rs @@ -2,19 +2,13 @@ use ibc_proto::{ ibc::applications::interchain_accounts::controller::v1::MsgRegisterInterchainAccount as RawMsgRegisterInterchainAccount, Protobuf, }; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use crate::{ applications::ics27_ica::error::Error, core::{ ics04_channel::version::Version, - ics24_host::{ - error::ValidationError, - identifier::ConnectionId, - }, + ics24_host::{error::ValidationError, identifier::ConnectionId}, }, signer::Signer, tx_msg::Msg, diff --git a/crates/relayer-types/src/applications/ics27_ica/msgs/send_tx.rs b/crates/relayer-types/src/applications/ics27_ica/msgs/send_tx.rs index 7fb8e2e218..939ab6072a 100644 --- a/crates/relayer-types/src/applications/ics27_ica/msgs/send_tx.rs +++ b/crates/relayer-types/src/applications/ics27_ica/msgs/send_tx.rs @@ -1,21 +1,11 @@ use ibc_proto::{ - ibc::applications::interchain_accounts::controller::v1::MsgSendTx as RawMsgSendTx, - Protobuf, -}; -use serde_derive::{ - Deserialize, - Serialize, + ibc::applications::interchain_accounts::controller::v1::MsgSendTx as RawMsgSendTx, Protobuf, }; +use serde_derive::{Deserialize, Serialize}; use crate::{ - applications::ics27_ica::{ - error::Error, - packet_data::InterchainAccountPacketData, - }, - core::ics24_host::{ - error::ValidationError, - identifier::ConnectionId, - }, + applications::ics27_ica::{error::Error, packet_data::InterchainAccountPacketData}, + core::ics24_host::{error::ValidationError, identifier::ConnectionId}, signer::Signer, timestamp::Timestamp, tx_msg::Msg, diff --git a/crates/relayer-types/src/applications/ics27_ica/packet_data.rs b/crates/relayer-types/src/applications/ics27_ica/packet_data.rs index a7fa7c585f..fc5e9b260d 100644 --- a/crates/relayer-types/src/applications/ics27_ica/packet_data.rs +++ b/crates/relayer-types/src/applications/ics27_ica/packet_data.rs @@ -2,10 +2,7 @@ use ibc_proto::ibc::{ applications::interchain_accounts::v1::InterchainAccountPacketData as RawInterchainAccountPacketData, apps::interchain_accounts::v1::Type, }; -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; use crate::applications::ics27_ica::error::Error; diff --git a/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_double_voting.rs b/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_double_voting.rs index 405ffe9755..2f058cc01b 100644 --- a/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_double_voting.rs +++ b/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_double_voting.rs @@ -7,11 +7,7 @@ use ibc_proto::{ use tendermint::evidence::DuplicateVoteEvidence; use super::error::Error; -use crate::{ - clients::ics07_tendermint::header::Header, - signer::Signer, - tx_msg::Msg, -}; +use crate::{clients::ics07_tendermint::header::Header, signer::Signer, tx_msg::Msg}; pub const ICS_DOUBLE_VOTING_TYPE_URL: &str = "/interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVoting"; diff --git a/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_misbehaviour.rs b/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_misbehaviour.rs index 0ce25b9147..a46bfc26ce 100644 --- a/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_misbehaviour.rs +++ b/crates/relayer-types/src/applications/ics28_ccv/msgs/ccv_misbehaviour.rs @@ -4,17 +4,10 @@ use ibc_proto::{ interchain_security::ccv::provider::v1::MsgSubmitConsumerMisbehaviour as RawIcsMisbehaviour, Protobuf, }; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use super::error::Error; -use crate::{ - clients::ics07_tendermint::misbehaviour::Misbehaviour, - signer::Signer, - tx_msg::Msg, -}; +use crate::{clients::ics07_tendermint::misbehaviour::Misbehaviour, signer::Signer, tx_msg::Msg}; pub const ICS_MISBEHAVIOR_TYPE_URL: &str = "/interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviour"; diff --git a/crates/relayer-types/src/applications/ics29_fee/error.rs b/crates/relayer-types/src/applications/ics29_fee/error.rs index 27265db13f..2b623c61ca 100644 --- a/crates/relayer-types/src/applications/ics29_fee/error.rs +++ b/crates/relayer-types/src/applications/ics29_fee/error.rs @@ -1,15 +1,9 @@ -use flex_error::{ - define_error, - TraceError, -}; +use flex_error::{define_error, TraceError}; use prost::EncodeError; use crate::{ applications::transfer::error::Error as TransferError, - core::{ - ics04_channel::error::Error as ChannelError, - ics24_host::error::ValidationError, - }, + core::{ics04_channel::error::Error as ChannelError, ics24_host::error::ValidationError}, signer::SignerError, }; diff --git a/crates/relayer-types/src/applications/ics29_fee/events.rs b/crates/relayer-types/src/applications/ics29_fee/events.rs index 87a2f78a78..4e34b32e1b 100644 --- a/crates/relayer-types/src/applications/ics29_fee/events.rs +++ b/crates/relayer-types/src/applications/ics29_fee/events.rs @@ -1,13 +1,7 @@ -use std::{ - fmt::Display, - str::FromStr, -}; +use std::{fmt::Display, str::FromStr}; use itertools::Itertools; -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; use tendermint::abci; use super::error::Error; @@ -15,10 +9,7 @@ use crate::{ applications::transfer::coin::RawCoin, core::{ ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChannelId, - PortId, - }, + ics24_host::identifier::{ChannelId, PortId}, }, events::IbcEventType, signer::Signer, diff --git a/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet.rs b/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet.rs index b4ac413cf4..8fcda126a0 100644 --- a/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet.rs +++ b/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet.rs @@ -1,20 +1,11 @@ use ibc_proto::{ google::protobuf::Any, - ibc::applications::fee::v1::{ - Fee as ProtoFee, - MsgPayPacketFee, - }, + ibc::applications::fee::v1::{Fee as ProtoFee, MsgPayPacketFee}, }; use crate::{ - applications::{ - ics29_fee::error::Error, - transfer::coin::RawCoin, - }, - core::ics24_host::identifier::{ - ChannelId, - PortId, - }, + applications::{ics29_fee::error::Error, transfer::coin::RawCoin}, + core::ics24_host::identifier::{ChannelId, PortId}, signer::Signer, tx_msg::encode_message, }; diff --git a/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet_async.rs b/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet_async.rs index 14090636f7..4382321734 100644 --- a/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet_async.rs +++ b/crates/relayer-types/src/applications/ics29_fee/msgs/pay_packet_async.rs @@ -2,25 +2,17 @@ use ibc_proto::{ google::protobuf::Any, ibc::{ applications::fee::v1::{ - Fee as ProtoFee, - MsgPayPacketFeeAsync, - PacketFee as ProtoPacketFee, + Fee as ProtoFee, MsgPayPacketFeeAsync, PacketFee as ProtoPacketFee, }, core::channel::v1::PacketId as ProtoPacketId, }, }; use crate::{ - applications::{ - ics29_fee::error::Error, - transfer::coin::RawCoin, - }, + applications::{ics29_fee::error::Error, transfer::coin::RawCoin}, core::{ ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChannelId, - PortId, - }, + ics24_host::identifier::{ChannelId, PortId}, }, signer::Signer, tx_msg::encode_message, diff --git a/crates/relayer-types/src/applications/ics29_fee/msgs/register_payee.rs b/crates/relayer-types/src/applications/ics29_fee/msgs/register_payee.rs index c6464f9db7..2c70d036b9 100644 --- a/crates/relayer-types/src/applications/ics29_fee/msgs/register_payee.rs +++ b/crates/relayer-types/src/applications/ics29_fee/msgs/register_payee.rs @@ -1,17 +1,11 @@ use ibc_proto::{ google::protobuf::Any, - ibc::applications::fee::v1::{ - MsgRegisterCounterpartyPayee, - MsgRegisterPayee, - }, + ibc::applications::fee::v1::{MsgRegisterCounterpartyPayee, MsgRegisterPayee}, }; use crate::{ applications::ics29_fee::error::Error, - core::ics24_host::identifier::{ - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChannelId, PortId}, signer::Signer, tx_msg::encode_message, }; diff --git a/crates/relayer-types/src/applications/ics29_fee/packet_fee.rs b/crates/relayer-types/src/applications/ics29_fee/packet_fee.rs index 411d13a94f..d27ede7931 100644 --- a/crates/relayer-types/src/applications/ics29_fee/packet_fee.rs +++ b/crates/relayer-types/src/applications/ics29_fee/packet_fee.rs @@ -3,18 +3,14 @@ use std::str::FromStr; use ibc_proto::{ cosmos::base::v1beta1::Coin as ProtoCoin, ibc::applications::fee::v1::{ - Fee as ProtoFee, - IdentifiedPacketFees as ProtoIdentifiedPacketFees, + Fee as ProtoFee, IdentifiedPacketFees as ProtoIdentifiedPacketFees, PacketFee as ProtoPacketFee, }, }; use super::error::Error; use crate::{ - applications::transfer::{ - amount::Amount, - coin::RawCoin, - }, + applications::transfer::{amount::Amount, coin::RawCoin}, core::ics04_channel::packet_id::PacketId, signer::Signer, }; diff --git a/crates/relayer-types/src/applications/ics31_icq/events.rs b/crates/relayer-types/src/applications/ics31_icq/events.rs index b02b9fb272..07c0f8ba94 100644 --- a/crates/relayer-types/src/applications/ics31_icq/events.rs +++ b/crates/relayer-types/src/applications/ics31_icq/events.rs @@ -1,23 +1,11 @@ -use std::{ - collections::BTreeMap, - str::FromStr, -}; +use std::{collections::BTreeMap, str::FromStr}; -use serde::{ - Deserialize, - Serialize, -}; -use tendermint::{ - abci, - block::Height, -}; +use serde::{Deserialize, Serialize}; +use tendermint::{abci, block::Height}; use super::error::Error; use crate::{ - core::ics24_host::identifier::{ - ChainId, - ConnectionId, - }, + core::ics24_host::identifier::{ChainId, ConnectionId}, events::IbcEvent, }; diff --git a/crates/relayer-types/src/applications/ics31_icq/response.rs b/crates/relayer-types/src/applications/ics31_icq/response.rs index f81ad76e1f..6abdaeb18a 100644 --- a/crates/relayer-types/src/applications/ics31_icq/response.rs +++ b/crates/relayer-types/src/applications/ics31_icq/response.rs @@ -1,18 +1,9 @@ -use ibc_proto::{ - google::protobuf::Any, - stride::interchainquery::v1::MsgSubmitQueryResponse, -}; +use ibc_proto::{google::protobuf::Any, stride::interchainquery::v1::MsgSubmitQueryResponse}; use prost::Message; use tendermint::merkle::proof::ProofOps as TendermintProofOps; -use tendermint_proto::crypto::{ - ProofOp, - ProofOps, -}; +use tendermint_proto::crypto::{ProofOp, ProofOps}; -use crate::{ - applications::ics31_icq::error::Error, - signer::Signer, -}; +use crate::{applications::ics31_icq::error::Error, signer::Signer}; pub const TYPE_URL: &str = "/stride.interchainquery.v1.MsgSubmitQueryResponse"; diff --git a/crates/relayer-types/src/applications/transfer/acknowledgement.rs b/crates/relayer-types/src/applications/transfer/acknowledgement.rs index 047b0404a4..2277baebd6 100644 --- a/crates/relayer-types/src/applications/transfer/acknowledgement.rs +++ b/crates/relayer-types/src/applications/transfer/acknowledgement.rs @@ -1,13 +1,6 @@ -use std::fmt::{ - Display, - Error as FmtError, - Formatter, -}; - -use serde::{ - Deserialize, - Serialize, -}; +use std::fmt::{Display, Error as FmtError, Formatter}; + +use serde::{Deserialize, Serialize}; use super::error::Error; diff --git a/crates/relayer-types/src/applications/transfer/amount.rs b/crates/relayer-types/src/applications/transfer/amount.rs index cf0fd48a08..ce9446c511 100644 --- a/crates/relayer-types/src/applications/transfer/amount.rs +++ b/crates/relayer-types/src/applications/transfer/amount.rs @@ -1,18 +1,7 @@ -use std::{ - iter::Sum, - ops::Add, - str::FromStr, -}; +use std::{iter::Sum, ops::Add, str::FromStr}; -use derive_more::{ - Display, - From, - Into, -}; -use serde::{ - Deserialize, - Serialize, -}; +use derive_more::{Display, From, Into}; +use serde::{Deserialize, Serialize}; use super::error::Error; use crate::bigint::U256; diff --git a/crates/relayer-types/src/applications/transfer/coin.rs b/crates/relayer-types/src/applications/transfer/coin.rs index 207f4a3bff..90ef36df93 100644 --- a/crates/relayer-types/src/applications/transfer/coin.rs +++ b/crates/relayer-types/src/applications/transfer/coin.rs @@ -1,25 +1,15 @@ use std::{ - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, str::FromStr, }; use ibc_proto::cosmos::base::v1beta1::Coin as ProtoCoin; use regex::Regex; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use super::{ amount::Amount, - denom::{ - BaseDenom, - PrefixedDenom, - }, + denom::{BaseDenom, PrefixedDenom}, error::Error, }; use crate::serializers::serde_string; diff --git a/crates/relayer-types/src/applications/transfer/denom.rs b/crates/relayer-types/src/applications/transfer/denom.rs index 4ceb009d4b..d74701c048 100644 --- a/crates/relayer-types/src/applications/transfer/denom.rs +++ b/crates/relayer-types/src/applications/transfer/denom.rs @@ -1,28 +1,15 @@ use std::{ - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, str::FromStr, }; -use derive_more::{ - Display, - From, -}; +use derive_more::{Display, From}; use ibc_proto::ibc::applications::transfer::v1::DenomTrace as RawDenomTrace; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use super::error::Error; use crate::{ - core::ics24_host::identifier::{ - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChannelId, PortId}, serializers::serde_string, }; diff --git a/crates/relayer-types/src/applications/transfer/error.rs b/crates/relayer-types/src/applications/transfer/error.rs index f7c6c7d8f0..4e9fc8577e 100644 --- a/crates/relayer-types/src/applications/transfer/error.rs +++ b/crates/relayer-types/src/applications/transfer/error.rs @@ -1,31 +1,16 @@ -use std::{ - convert::Infallible, - str::Utf8Error, - string::FromUtf8Error, -}; +use std::{convert::Infallible, str::Utf8Error, string::FromUtf8Error}; -use flex_error::{ - define_error, - DisplayOnly, - TraceError, -}; +use flex_error::{define_error, DisplayOnly, TraceError}; use subtle_encoding::Error as EncodingError; use tendermint_proto::Error as TendermintProtoError; use uint::FromDecStrErr; use crate::{ core::{ - ics04_channel::{ - channel::Ordering, - error as channel_error, - version::Version, - }, + ics04_channel::{channel::Ordering, error as channel_error, version::Version}, ics24_host::{ error::ValidationError, - identifier::{ - ChannelId, - PortId, - }, + identifier::{ChannelId, PortId}, }, }, signer::SignerError, diff --git a/crates/relayer-types/src/applications/transfer/events.rs b/crates/relayer-types/src/applications/transfer/events.rs index 297283c746..51a83a44b7 100644 --- a/crates/relayer-types/src/applications/transfer/events.rs +++ b/crates/relayer-types/src/applications/transfer/events.rs @@ -1,9 +1,6 @@ use crate::{ applications::transfer::{ - acknowledgement::Acknowledgement, - Amount, - PrefixedDenom, - MODULE_ID_STR, + acknowledgement::Acknowledgement, Amount, PrefixedDenom, MODULE_ID_STR, }, events::ModuleEvent, signer::Signer, diff --git a/crates/relayer-types/src/applications/transfer/msgs/send.rs b/crates/relayer-types/src/applications/transfer/msgs/send.rs index 1a1a07f15a..599e228aa1 100644 --- a/crates/relayer-types/src/applications/transfer/msgs/send.rs +++ b/crates/relayer-types/src/applications/transfer/msgs/send.rs @@ -1,22 +1,10 @@ -use std::{ - fmt::Display, - str::FromStr, -}; +use std::{fmt::Display, str::FromStr}; -use ibc_proto::{ - cosmos::bank::v1beta1::MsgSend as RawMsgSend, - Protobuf, -}; -use serde_derive::{ - Deserialize, - Serialize, -}; +use ibc_proto::{cosmos::bank::v1beta1::MsgSend as RawMsgSend, Protobuf}; +use serde_derive::{Deserialize, Serialize}; use crate::{ - applications::transfer::{ - error::Error, - Coin, - }, + applications::transfer::{error::Error, Coin}, core::ics24_host::error::ValidationError, tx_msg::Msg, }; diff --git a/crates/relayer-types/src/applications/transfer/msgs/transfer.rs b/crates/relayer-types/src/applications/transfer/msgs/transfer.rs index 27b71b1bcd..63ee23ad08 100644 --- a/crates/relayer-types/src/applications/transfer/msgs/transfer.rs +++ b/crates/relayer-types/src/applications/transfer/msgs/transfer.rs @@ -1,20 +1,15 @@ //! This is the definition of a transfer messages that an application submits to a chain. use ibc_proto::{ - cosmos::base::v1beta1::Coin, - google::protobuf::Any, - ibc::applications::transfer::v1::MsgTransfer as RawMsgTransfer, - Protobuf, + cosmos::base::v1beta1::Coin, google::protobuf::Any, + ibc::applications::transfer::v1::MsgTransfer as RawMsgTransfer, Protobuf, }; use crate::{ applications::transfer::error::Error, core::{ ics04_channel::timeout::TimeoutHeight, - ics24_host::identifier::{ - ChannelId, - PortId, - }, + ics24_host::identifier::{ChannelId, PortId}, }, signer::Signer, timestamp::Timestamp, @@ -138,32 +133,18 @@ impl From for Any { #[cfg(test)] pub mod test_util { - use core::{ - ops::Add, - time::Duration, - }; + use core::{ops::Add, time::Duration}; use super::MsgTransfer; use crate::{ - applications::transfer::{ - packet::PacketData, - BaseCoin, - Coin, - PrefixedCoin, - }, + applications::transfer::{packet::PacketData, BaseCoin, Coin, PrefixedCoin}, bigint::U256, core::{ ics04_channel::{ - packet::{ - Packet, - Sequence, - }, + packet::{Packet, Sequence}, timeout::TimeoutHeight, }, - ics24_host::identifier::{ - ChannelId, - PortId, - }, + ics24_host::identifier::{ChannelId, PortId}, }, signer::Signer, test_utils::get_dummy_bech32_account, diff --git a/crates/relayer-types/src/applications/transfer/packet.rs b/crates/relayer-types/src/applications/transfer/packet.rs index d11157d993..ff93868dff 100644 --- a/crates/relayer-types/src/applications/transfer/packet.rs +++ b/crates/relayer-types/src/applications/transfer/packet.rs @@ -1,24 +1,13 @@ use std::{ convert::TryFrom, str::FromStr, - string::{ - String, - ToString, - }, + string::{String, ToString}, }; use ibc_proto::ibc::applications::transfer::v2::FungibleTokenPacketData as RawPacketData; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; -use super::{ - error::Error, - Amount, - PrefixedCoin, - PrefixedDenom, -}; +use super::{error::Error, Amount, PrefixedCoin, PrefixedDenom}; use crate::signer::Signer; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] diff --git a/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs b/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs index bf544dd6b8..2eeb46fadb 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs @@ -1,8 +1,5 @@ use std::{ - convert::{ - TryFrom, - TryInto, - }, + convert::{TryFrom, TryInto}, time::Duration, }; @@ -15,31 +12,20 @@ use ibc_proto::{ Protobuf, }; use prost::Message; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use tendermint_light_client_verifier::options::Options; use crate::{ - clients::ics07_tendermint::{ - error::Error, - header::Header as TmHeader, - }, + clients::ics07_tendermint::{error::Error, header::Header as TmHeader}, core::{ ics02_client::{ - client_state::ClientState as Ics2ClientState, - client_type::ClientType, - error::Error as Ics02Error, - trust_threshold::TrustThreshold, + client_state::ClientState as Ics2ClientState, client_type::ClientType, + error::Error as Ics02Error, trust_threshold::TrustThreshold, }, ics23_commitment::specs::ProofSpecs, ics24_host::identifier::ChainId, }, - timestamp::{ - Timestamp, - ZERO_DURATION, - }, + timestamp::{Timestamp, ZERO_DURATION}, Height, }; @@ -388,20 +374,13 @@ mod tests { use test_log::test; use crate::{ - clients::ics07_tendermint::client_state::{ - AllowUpdate, - ClientState, - }, + clients::ics07_tendermint::client_state::{AllowUpdate, ClientState}, core::{ - ics02_client::trust_threshold::TrustThreshold, - ics23_commitment::specs::ProofSpecs, + ics02_client::trust_threshold::TrustThreshold, ics23_commitment::specs::ProofSpecs, ics24_host::identifier::ChainId, }, test::test_serialization_roundtrip, - timestamp::{ - Timestamp, - ZERO_DURATION, - }, + timestamp::{Timestamp, ZERO_DURATION}, Height, }; @@ -700,14 +679,8 @@ pub mod test_util { use tendermint::block::Header; use crate::{ - clients::ics07_tendermint::client_state::{ - AllowUpdate, - ClientState, - }, - core::{ - ics02_client::height::Height, - ics24_host::identifier::ChainId, - }, + clients::ics07_tendermint::client_state::{AllowUpdate, ClientState}, + core::{ics02_client::height::Height, ics24_host::identifier::ChainId}, }; pub fn get_dummy_tendermint_client_state(tm_header: Header) -> ClientState { diff --git a/crates/relayer-types/src/clients/ics07_tendermint/consensus_state.rs b/crates/relayer-types/src/clients/ics07_tendermint/consensus_state.rs index 34fce2a9d4..67087c5910 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/consensus_state.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/consensus_state.rs @@ -1,29 +1,15 @@ use ibc_proto::{ - google::protobuf::Any, - ibc::lightclients::tendermint::v1::ConsensusState as RawConsensusState, + google::protobuf::Any, ibc::lightclients::tendermint::v1::ConsensusState as RawConsensusState, Protobuf, }; -use serde::{ - Deserialize, - Serialize, -}; -use tendermint::{ - hash::Algorithm, - time::Time, - Hash, -}; +use serde::{Deserialize, Serialize}; +use tendermint::{hash::Algorithm, time::Time, Hash}; use tendermint_proto::google::protobuf as tpb; use crate::{ - clients::ics07_tendermint::{ - error::Error, - header::Header, - }, + clients::ics07_tendermint::{error::Error, header::Header}, core::{ - ics02_client::{ - client_type::ClientType, - error::Error as Ics02Error, - }, + ics02_client::{client_type::ClientType, error::Error as Ics02Error}, ics23_commitment::commitment::CommitmentRoot, }, timestamp::Timestamp, diff --git a/crates/relayer-types/src/clients/ics07_tendermint/error.rs b/crates/relayer-types/src/clients/ics07_tendermint/error.rs index 7a5ebb69c6..6cfb85a1bc 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/error.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/error.rs @@ -1,26 +1,13 @@ -use flex_error::{ - define_error, - TraceError, -}; -use tendermint::{ - account::Id, - hash::Hash, - Error as TendermintError, -}; +use flex_error::{define_error, TraceError}; +use tendermint::{account::Id, hash::Hash, Error as TendermintError}; use tendermint_light_client_verifier::errors::VerificationErrorDetail as LightClientErrorDetail; use crate::{ core::{ ics02_client::error::Error as Ics02Error, - ics24_host::{ - error::ValidationError, - identifier::ClientId, - }, - }, - timestamp::{ - Timestamp, - TimestampOverflowError, + ics24_host::{error::ValidationError, identifier::ClientId}, }, + timestamp::{Timestamp, TimestampOverflowError}, Height, }; diff --git a/crates/relayer-types/src/clients/ics07_tendermint/header.rs b/crates/relayer-types/src/clients/ics07_tendermint/header.rs index fc3693fba9..1734e7d56e 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/header.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/header.rs @@ -1,39 +1,21 @@ -use std::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use std::fmt::{Display, Error as FmtError, Formatter}; use bytes::Buf; use ibc_proto::{ - google::protobuf::Any, - ibc::lightclients::tendermint::v1::Header as RawHeader, - Protobuf, + google::protobuf::Any, ibc::lightclients::tendermint::v1::Header as RawHeader, Protobuf, }; use prost::Message; -use serde_derive::{ - Deserialize, - Serialize, -}; -use tendermint::{ - block::signed_header::SignedHeader, - validator::Set as ValidatorSet, -}; +use serde_derive::{Deserialize, Serialize}; +use tendermint::{block::signed_header::SignedHeader, validator::Set as ValidatorSet}; use crate::{ clients::ics07_tendermint::error::Error, core::{ - ics02_client::{ - client_type::ClientType, - error::Error as Ics02Error, - }, + ics02_client::{client_type::ClientType, error::Error as Ics02Error}, ics24_host::identifier::ChainId, }, timestamp::Timestamp, - utils::pretty::{ - PrettySignedHeader, - PrettyValidatorSet, - }, + utils::pretty::{PrettySignedHeader, PrettyValidatorSet}, Height, }; @@ -173,17 +155,11 @@ pub mod test_util { use subtle_encoding::hex; use tendermint::{ block::signed_header::SignedHeader, - validator::{ - Info as ValidatorInfo, - Set as ValidatorSet, - }, + validator::{Info as ValidatorInfo, Set as ValidatorSet}, PublicKey, }; - use crate::{ - clients::ics07_tendermint::header::Header, - Height, - }; + use crate::{clients::ics07_tendermint::header::Header, Height}; pub fn get_dummy_tendermint_header() -> tendermint::block::Header { serde_json::from_str::(include_str!( diff --git a/crates/relayer-types/src/clients/ics07_tendermint/misbehaviour.rs b/crates/relayer-types/src/clients/ics07_tendermint/misbehaviour.rs index eaedc9be28..d01f3f33cc 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/misbehaviour.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/misbehaviour.rs @@ -1,17 +1,8 @@ -use ibc_proto::{ - ibc::lightclients::tendermint::v1::Misbehaviour as RawMisbehaviour, - Protobuf, -}; -use serde::{ - Deserialize, - Serialize, -}; +use ibc_proto::{ibc::lightclients::tendermint::v1::Misbehaviour as RawMisbehaviour, Protobuf}; +use serde::{Deserialize, Serialize}; use crate::{ - clients::ics07_tendermint::{ - error::Error, - header::Header, - }, + clients::ics07_tendermint::{error::Error, header::Header}, core::ics24_host::identifier::ClientId, tx_msg::Msg, Height, diff --git a/crates/relayer-types/src/core/ics02_client/client_state.rs b/crates/relayer-types/src/core/ics02_client/client_state.rs index 15a9af6b61..814922861b 100644 --- a/crates/relayer-types/src/core/ics02_client/client_state.rs +++ b/crates/relayer-types/src/core/ics02_client/client_state.rs @@ -1,17 +1,11 @@ use core::fmt::Debug; use std::{ - marker::{ - Send, - Sync, - }, + marker::{Send, Sync}, time::Duration, }; use crate::{ - core::{ - ics02_client::client_type::ClientType, - ics24_host::identifier::ChainId, - }, + core::{ics02_client::client_type::ClientType, ics24_host::identifier::ChainId}, Height, }; diff --git a/crates/relayer-types/src/core/ics02_client/client_type.rs b/crates/relayer-types/src/core/ics02_client/client_type.rs index 7419b1efa4..67054ef349 100644 --- a/crates/relayer-types/src/core/ics02_client/client_type.rs +++ b/crates/relayer-types/src/core/ics02_client/client_type.rs @@ -1,13 +1,6 @@ -use std::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use std::fmt::{Display, Error as FmtError, Formatter}; -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; use super::error::Error; @@ -65,10 +58,7 @@ mod tests { use test_log::test; use super::ClientType; - use crate::core::ics02_client::error::{ - Error, - ErrorDetail, - }; + use crate::core::ics02_client::error::{Error, ErrorDetail}; #[test] fn parse_tendermint_client_type() { diff --git a/crates/relayer-types/src/core/ics02_client/consensus_state.rs b/crates/relayer-types/src/core/ics02_client/consensus_state.rs index 7d6ef73467..6211e442f9 100644 --- a/crates/relayer-types/src/core/ics02_client/consensus_state.rs +++ b/crates/relayer-types/src/core/ics02_client/consensus_state.rs @@ -1,16 +1,10 @@ use core::{ fmt::Debug, - marker::{ - Send, - Sync, - }, + marker::{Send, Sync}, }; use crate::{ - core::{ - ics02_client::client_type::ClientType, - ics23_commitment::commitment::CommitmentRoot, - }, + core::{ics02_client::client_type::ClientType, ics23_commitment::commitment::CommitmentRoot}, timestamp::Timestamp, }; diff --git a/crates/relayer-types/src/core/ics02_client/error.rs b/crates/relayer-types/src/core/ics02_client/error.rs index 16c76f80c1..43fcc611ef 100644 --- a/crates/relayer-types/src/core/ics02_client/error.rs +++ b/crates/relayer-types/src/core/ics02_client/error.rs @@ -1,20 +1,11 @@ -use flex_error::{ - define_error, - TraceError, -}; +use flex_error::{define_error, TraceError}; use tendermint_proto::Error as TendermintProtoError; use crate::{ core::{ - ics02_client::{ - client_type::ClientType, - height::HeightError, - }, + ics02_client::{client_type::ClientType, height::HeightError}, ics23_commitment::error::Error as Ics23Error, - ics24_host::{ - error::ValidationError, - identifier::ClientId, - }, + ics24_host::{error::ValidationError, identifier::ClientId}, }, signer::SignerError, timestamp::Timestamp, diff --git a/crates/relayer-types/src/core/ics02_client/events.rs b/crates/relayer-types/src/core/ics02_client/events.rs index 1ede4ad438..6605b2534a 100644 --- a/crates/relayer-types/src/core/ics02_client/events.rs +++ b/crates/relayer-types/src/core/ics02_client/events.rs @@ -1,31 +1,18 @@ //! Types for the IBC events emitted from Tendermint Websocket by the client module. -use std::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use std::fmt::{Display, Error as FmtError, Formatter}; -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; use tendermint::abci; use tendermint_proto::Protobuf; use super::header::AnyHeader; use crate::{ core::{ - ics02_client::{ - client_type::ClientType, - height::Height, - }, + ics02_client::{client_type::ClientType, height::Height}, ics24_host::identifier::ClientId, }, - events::{ - IbcEvent, - IbcEventType, - }, + events::{IbcEvent, IbcEventType}, }; /// The content of the `key` field for the attribute containing the client identifier. diff --git a/crates/relayer-types/src/core/ics02_client/header.rs b/crates/relayer-types/src/core/ics02_client/header.rs index 55b4599c12..9692a5f8f4 100644 --- a/crates/relayer-types/src/core/ics02_client/header.rs +++ b/crates/relayer-types/src/core/ics02_client/header.rs @@ -1,24 +1,13 @@ use core::fmt::Debug; -use ibc_proto::{ - google::protobuf::Any, - Protobuf, -}; -use serde::{ - Deserialize, - Serialize, -}; +use ibc_proto::{google::protobuf::Any, Protobuf}; +use serde::{Deserialize, Serialize}; use crate::{ clients::ics07_tendermint::header::{ - decode_header as tm_decode_header, - Header as TendermintHeader, - TENDERMINT_HEADER_TYPE_URL, - }, - core::ics02_client::{ - client_type::ClientType, - error::Error, + decode_header as tm_decode_header, Header as TendermintHeader, TENDERMINT_HEADER_TYPE_URL, }, + core::ics02_client::{client_type::ClientType, error::Error}, timestamp::Timestamp, Height, }; diff --git a/crates/relayer-types/src/core/ics02_client/height.rs b/crates/relayer-types/src/core/ics02_client/height.rs index 064419f70b..6fb3de355b 100644 --- a/crates/relayer-types/src/core/ics02_client/height.rs +++ b/crates/relayer-types/src/core/ics02_client/height.rs @@ -1,26 +1,10 @@ -use std::{ - cmp::Ordering, - num::ParseIntError, - str::FromStr, -}; - -use flex_error::{ - define_error, - TraceError, -}; -use ibc_proto::{ - ibc::core::client::v1::Height as RawHeight, - Protobuf, -}; -use serde_derive::{ - Deserialize, - Serialize, -}; - -use crate::core::{ - ics02_client::error::Error, - ics24_host::identifier::ChainId, -}; +use std::{cmp::Ordering, num::ParseIntError, str::FromStr}; + +use flex_error::{define_error, TraceError}; +use ibc_proto::{ibc::core::client::v1::Height as RawHeight, Protobuf}; +use serde_derive::{Deserialize, Serialize}; + +use crate::core::{ics02_client::error::Error, ics24_host::identifier::ChainId}; #[derive(Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Height { diff --git a/crates/relayer-types/src/core/ics02_client/misbehaviour.rs b/crates/relayer-types/src/core/ics02_client/misbehaviour.rs index b700eba87e..ca1d30711a 100644 --- a/crates/relayer-types/src/core/ics02_client/misbehaviour.rs +++ b/crates/relayer-types/src/core/ics02_client/misbehaviour.rs @@ -1,9 +1,6 @@ use core::fmt::Debug; -use crate::{ - core::ics24_host::identifier::ClientId, - Height, -}; +use crate::{core::ics24_host::identifier::ClientId, Height}; pub trait Misbehaviour: Clone + Debug + Send + Sync { /// The type of client (eg. Tendermint) diff --git a/crates/relayer-types/src/core/ics02_client/msgs.rs b/crates/relayer-types/src/core/ics02_client/msgs.rs index cb9aaaaabd..fc13f07445 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs.rs @@ -5,10 +5,8 @@ //! . use crate::core::ics02_client::msgs::{ - create_client::MsgCreateClient, - misbehaviour::MsgSubmitMisbehaviour, - update_client::MsgUpdateClient, - upgrade_client::MsgUpgradeClient, + create_client::MsgCreateClient, misbehaviour::MsgSubmitMisbehaviour, + update_client::MsgUpdateClient, upgrade_client::MsgUpgradeClient, }; pub mod create_client; diff --git a/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs b/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs index 1c3e4b8b21..208ba6a7d2 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs/create_client.rs @@ -1,16 +1,10 @@ //! Definition of domain type message `MsgCreateClient`. use ibc_proto::{ - google::protobuf::Any, - ibc::core::client::v1::MsgCreateClient as RawMsgCreateClient, - Protobuf, + google::protobuf::Any, ibc::core::client::v1::MsgCreateClient as RawMsgCreateClient, Protobuf, }; -use crate::{ - core::ics02_client::error::Error, - signer::Signer, - tx_msg::Msg, -}; +use crate::{core::ics02_client::error::Error, signer::Signer, tx_msg::Msg}; pub const TYPE_URL: &str = "/ibc.core.client.v1.MsgCreateClient"; diff --git a/crates/relayer-types/src/core/ics02_client/msgs/misbehaviour.rs b/crates/relayer-types/src/core/ics02_client/msgs/misbehaviour.rs index 2ac292af2d..bd09549019 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs/misbehaviour.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs/misbehaviour.rs @@ -1,14 +1,10 @@ use ibc_proto::{ google::protobuf::Any as ProtoAny, - ibc::core::client::v1::MsgSubmitMisbehaviour as RawMsgSubmitMisbehaviour, - Protobuf, + ibc::core::client::v1::MsgSubmitMisbehaviour as RawMsgSubmitMisbehaviour, Protobuf, }; use crate::{ - core::{ - ics02_client::error::Error, - ics24_host::identifier::ClientId, - }, + core::{ics02_client::error::Error, ics24_host::identifier::ClientId}, signer::Signer, tx_msg::Msg, }; diff --git a/crates/relayer-types/src/core/ics02_client/msgs/update_client.rs b/crates/relayer-types/src/core/ics02_client/msgs/update_client.rs index b1d260726c..e8ad51e1ef 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs/update_client.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs/update_client.rs @@ -1,18 +1,13 @@ //! Definition of domain type message `MsgUpdateAnyClient`. use ibc_proto::{ - google::protobuf::Any, - ibc::core::client::v1::MsgUpdateClient as RawMsgUpdateClient, - Protobuf, + google::protobuf::Any, ibc::core::client::v1::MsgUpdateClient as RawMsgUpdateClient, Protobuf, }; use crate::{ core::{ ics02_client::error::Error, - ics24_host::{ - error::ValidationError, - identifier::ClientId, - }, + ics24_host::{error::ValidationError, identifier::ClientId}, }, signer::Signer, tx_msg::Msg, @@ -86,10 +81,7 @@ mod tests { use crate::{ clients::ics07_tendermint::header::test_util::get_dummy_ics07_header, - core::{ - ics02_client::msgs::MsgUpdateClient, - ics24_host::identifier::ClientId, - }, + core::{ics02_client::msgs::MsgUpdateClient, ics24_host::identifier::ClientId}, test_utils::get_dummy_account_id, }; diff --git a/crates/relayer-types/src/core/ics02_client/msgs/upgrade_client.rs b/crates/relayer-types/src/core/ics02_client/msgs/upgrade_client.rs index 3882ace9e5..b0b50a0f0f 100644 --- a/crates/relayer-types/src/core/ics02_client/msgs/upgrade_client.rs +++ b/crates/relayer-types/src/core/ics02_client/msgs/upgrade_client.rs @@ -14,10 +14,7 @@ use ibc_proto::{ use crate::{ core::{ ics02_client::error::Error, - ics23_commitment::{ - commitment::CommitmentProofBytes, - error::Error as Ics23Error, - }, + ics23_commitment::{commitment::CommitmentProofBytes, error::Error as Ics23Error}, ics24_host::identifier::ClientId, }, signer::Signer, @@ -129,19 +126,11 @@ pub mod test_util { use super::MsgUpgradeClient; use crate::{ - core::{ - ics02_client::height::Height, - ics24_host::identifier::ClientId, - }, + core::{ics02_client::height::Height, ics24_host::identifier::ClientId}, mock::{ - client_state::MockClientState, - consensus_state::MockConsensusState, - header::MockHeader, - }, - test_utils::{ - get_dummy_bech32_account, - get_dummy_proof, + client_state::MockClientState, consensus_state::MockConsensusState, header::MockHeader, }, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, }; /// Extends the implementation with additional helper methods. @@ -172,17 +161,12 @@ mod tests { use crate::{ core::{ - ics02_client::{ - height::Height, - msgs::upgrade_client::MsgUpgradeClient, - }, + ics02_client::{height::Height, msgs::upgrade_client::MsgUpgradeClient}, ics23_commitment::commitment::test_util::get_dummy_merkle_proof, ics24_host::identifier::ClientId, }, mock::{ - client_state::MockClientState, - consensus_state::MockConsensusState, - header::MockHeader, + client_state::MockClientState, consensus_state::MockConsensusState, header::MockHeader, }, test_utils::get_dummy_account_id, }; diff --git a/crates/relayer-types/src/core/ics02_client/trust_threshold.rs b/crates/relayer-types/src/core/ics02_client/trust_threshold.rs index ceabf7cc3e..682c8669a7 100644 --- a/crates/relayer-types/src/core/ics02_client/trust_threshold.rs +++ b/crates/relayer-types/src/core/ics02_client/trust_threshold.rs @@ -4,23 +4,13 @@ use std::{ convert::TryFrom, - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, str::FromStr, }; -use ibc_proto::{ - ibc::lightclients::tendermint::v1::Fraction, - Protobuf, -}; +use ibc_proto::{ibc::lightclients::tendermint::v1::Fraction, Protobuf}; use num_rational::Ratio; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use tendermint::trust_threshold::TrustThresholdFraction; use crate::core::ics02_client::error::Error; @@ -173,10 +163,7 @@ impl<'de> Deserialize<'de> for TrustThreshold { { use std::fmt; - use serde::de::{ - self, - Visitor, - }; + use serde::de::{self, Visitor}; // This is a Visitor that forwards string types to T's `FromStr` impl and // forwards map types to T's `Deserialize` impl. The `PhantomData` is to @@ -229,10 +216,7 @@ where { use std::fmt; - use serde::de::{ - self, - Visitor, - }; + use serde::de::{self, Visitor}; struct StringOrInt; diff --git a/crates/relayer-types/src/core/ics03_connection/connection.rs b/crates/relayer-types/src/core/ics03_connection/connection.rs index d7d687d8b1..e6856efadc 100644 --- a/crates/relayer-types/src/core/ics03_connection/connection.rs +++ b/crates/relayer-types/src/core/ics03_connection/connection.rs @@ -1,9 +1,5 @@ use std::{ - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, str::FromStr, time::Duration, u64, @@ -11,31 +7,21 @@ use std::{ use ibc_proto::{ ibc::core::connection::v1::{ - ConnectionEnd as RawConnectionEnd, - Counterparty as RawCounterparty, + ConnectionEnd as RawConnectionEnd, Counterparty as RawCounterparty, IdentifiedConnection as RawIdentifiedConnection, }, Protobuf, }; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use crate::{ core::{ ics02_client::error::Error as ClientError, - ics03_connection::{ - error::Error, - version::Version, - }, + ics03_connection::{error::Error, version::Version}, ics23_commitment::commitment::CommitmentPrefix, ics24_host::{ error::ValidationError, - identifier::{ - ClientId, - ConnectionId, - }, + identifier::{ClientId, ConnectionId}, }, }, timestamp::ZERO_DURATION, diff --git a/crates/relayer-types/src/core/ics03_connection/error.rs b/crates/relayer-types/src/core/ics03_connection/error.rs index c2106a7179..f5bb0590a5 100644 --- a/crates/relayer-types/src/core/ics03_connection/error.rs +++ b/crates/relayer-types/src/core/ics03_connection/error.rs @@ -6,10 +6,7 @@ use crate::{ ics03_connection::version::Version, ics24_host::{ error::ValidationError, - identifier::{ - ClientId, - ConnectionId, - }, + identifier::{ClientId, ConnectionId}, }, }, proofs::ProofError, diff --git a/crates/relayer-types/src/core/ics03_connection/events.rs b/crates/relayer-types/src/core/ics03_connection/events.rs index 5f814bad70..06d5e21910 100644 --- a/crates/relayer-types/src/core/ics03_connection/events.rs +++ b/crates/relayer-types/src/core/ics03_connection/events.rs @@ -1,26 +1,13 @@ //! Types for the IBC events emitted from Tendermint Websocket by the connection module. -use std::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use std::fmt::{Display, Error as FmtError, Formatter}; -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; use tendermint::abci; use crate::{ - core::ics24_host::identifier::{ - ClientId, - ConnectionId, - }, - events::{ - IbcEvent, - IbcEventType, - }, + core::ics24_host::identifier::{ClientId, ConnectionId}, + events::{IbcEvent, IbcEventType}, }; /// The content of the `key` field for the attribute containing the connection identifier. diff --git a/crates/relayer-types/src/core/ics03_connection/msgs.rs b/crates/relayer-types/src/core/ics03_connection/msgs.rs index 84bb733584..c811278091 100644 --- a/crates/relayer-types/src/core/ics03_connection/msgs.rs +++ b/crates/relayer-types/src/core/ics03_connection/msgs.rs @@ -13,10 +13,8 @@ //! `signer` which is specific to Cosmos-SDK. use crate::core::ics03_connection::msgs::{ - conn_open_ack::MsgConnectionOpenAck, - conn_open_confirm::MsgConnectionOpenConfirm, - conn_open_init::MsgConnectionOpenInit, - conn_open_try::MsgConnectionOpenTry, + conn_open_ack::MsgConnectionOpenAck, conn_open_confirm::MsgConnectionOpenConfirm, + conn_open_init::MsgConnectionOpenInit, conn_open_try::MsgConnectionOpenTry, }; pub mod conn_open_ack; @@ -37,14 +35,10 @@ pub enum ConnectionMsg { pub mod test_util { use ibc_proto::ibc::core::{ - commitment::v1::MerklePrefix, - connection::v1::Counterparty as RawCounterparty, + commitment::v1::MerklePrefix, connection::v1::Counterparty as RawCounterparty, }; - use crate::core::ics24_host::identifier::{ - ClientId, - ConnectionId, - }; + use crate::core::ics24_host::identifier::{ClientId, ConnectionId}; pub fn get_dummy_raw_counterparty() -> RawCounterparty { RawCounterparty { diff --git a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_ack.rs b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_ack.rs index fec58fe4c4..2d602a7375 100644 --- a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_ack.rs +++ b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_ack.rs @@ -1,22 +1,15 @@ use ibc_proto::{ google::protobuf::Any, - ibc::core::connection::v1::MsgConnectionOpenAck as RawMsgConnectionOpenAck, - Protobuf, + ibc::core::connection::v1::MsgConnectionOpenAck as RawMsgConnectionOpenAck, Protobuf, }; use crate::{ core::{ - ics03_connection::{ - error::Error, - version::Version, - }, + ics03_connection::{error::Error, version::Version}, ics23_commitment::commitment::CommitmentProofBytes, ics24_host::identifier::ConnectionId, }, - proofs::{ - ConsensusProof, - Proofs, - }, + proofs::{ConsensusProof, Proofs}, signer::Signer, tx_msg::Msg, Height, @@ -146,19 +139,12 @@ impl From for RawMsgConnectionOpenAck { pub mod test_util { use ibc_proto::ibc::core::{ - client::v1::Height, - connection::v1::MsgConnectionOpenAck as RawMsgConnectionOpenAck, + client::v1::Height, connection::v1::MsgConnectionOpenAck as RawMsgConnectionOpenAck, }; use crate::{ - core::{ - ics03_connection::version::Version, - ics24_host::identifier::ConnectionId, - }, - test_utils::{ - get_dummy_bech32_account, - get_dummy_proof, - }, + core::{ics03_connection::version::Version, ics24_host::identifier::ConnectionId}, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, }; pub fn get_dummy_raw_msg_conn_open_ack( @@ -191,14 +177,12 @@ pub mod test_util { mod tests { use ibc_proto::ibc::core::{ - client::v1::Height, - connection::v1::MsgConnectionOpenAck as RawMsgConnectionOpenAck, + client::v1::Height, connection::v1::MsgConnectionOpenAck as RawMsgConnectionOpenAck, }; use test_log::test; use crate::core::ics03_connection::msgs::conn_open_ack::{ - test_util::get_dummy_raw_msg_conn_open_ack, - MsgConnectionOpenAck, + test_util::get_dummy_raw_msg_conn_open_ack, MsgConnectionOpenAck, }; #[test] diff --git a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_confirm.rs b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_confirm.rs index d12e00b69b..f6f98b2d18 100644 --- a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_confirm.rs +++ b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_confirm.rs @@ -1,13 +1,9 @@ use ibc_proto::{ - ibc::core::connection::v1::MsgConnectionOpenConfirm as RawMsgConnectionOpenConfirm, - Protobuf, + ibc::core::connection::v1::MsgConnectionOpenConfirm as RawMsgConnectionOpenConfirm, Protobuf, }; use crate::{ - core::{ - ics03_connection::error::Error, - ics24_host::identifier::ConnectionId, - }, + core::{ics03_connection::error::Error, ics24_host::identifier::ConnectionId}, proofs::Proofs, signer::Signer, tx_msg::Msg, @@ -83,14 +79,10 @@ impl From for RawMsgConnectionOpenConfirm { pub mod test_util { use ibc_proto::ibc::core::{ - client::v1::Height, - connection::v1::MsgConnectionOpenConfirm as RawMsgConnectionOpenConfirm, + client::v1::Height, connection::v1::MsgConnectionOpenConfirm as RawMsgConnectionOpenConfirm, }; - use crate::test_utils::{ - get_dummy_bech32_account, - get_dummy_proof, - }; + use crate::test_utils::{get_dummy_bech32_account, get_dummy_proof}; pub fn get_dummy_raw_msg_conn_open_confirm() -> RawMsgConnectionOpenConfirm { RawMsgConnectionOpenConfirm { @@ -109,14 +101,12 @@ pub mod test_util { mod tests { use ibc_proto::ibc::core::{ - client::v1::Height, - connection::v1::MsgConnectionOpenConfirm as RawMsgConnectionOpenConfirm, + client::v1::Height, connection::v1::MsgConnectionOpenConfirm as RawMsgConnectionOpenConfirm, }; use test_log::test; use crate::core::ics03_connection::msgs::conn_open_confirm::{ - test_util::get_dummy_raw_msg_conn_open_confirm, - MsgConnectionOpenConfirm, + test_util::get_dummy_raw_msg_conn_open_confirm, MsgConnectionOpenConfirm, }; #[test] diff --git a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_init.rs b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_init.rs index 4716327a94..6e069f4c0e 100644 --- a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_init.rs +++ b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_init.rs @@ -1,17 +1,12 @@ use std::time::Duration; use ibc_proto::{ - ibc::core::connection::v1::MsgConnectionOpenInit as RawMsgConnectionOpenInit, - Protobuf, + ibc::core::connection::v1::MsgConnectionOpenInit as RawMsgConnectionOpenInit, Protobuf, }; use crate::{ core::{ - ics03_connection::{ - connection::Counterparty, - error::Error, - version::Version, - }, + ics03_connection::{connection::Counterparty, error::Error, version::Version}, ics24_host::identifier::ClientId, }, signer::Signer, @@ -85,8 +80,7 @@ pub mod test_util { core::{ ics03_connection::{ msgs::{ - conn_open_init::MsgConnectionOpenInit, - test_util::get_dummy_raw_counterparty, + conn_open_init::MsgConnectionOpenInit, test_util::get_dummy_raw_counterparty, }, version::Version, }, @@ -120,8 +114,7 @@ pub mod test_util { mod tests { use ibc_proto::ibc::core::connection::v1::{ - Counterparty as RawCounterparty, - MsgConnectionOpenInit as RawMsgConnectionOpenInit, + Counterparty as RawCounterparty, MsgConnectionOpenInit as RawMsgConnectionOpenInit, }; use test_log::test; diff --git a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_try.rs b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_try.rs index 21f57fe530..bc9bc3a3e4 100644 --- a/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_try.rs +++ b/crates/relayer-types/src/core/ics03_connection/msgs/conn_open_try.rs @@ -1,35 +1,21 @@ use std::{ - convert::{ - TryFrom, - TryInto, - }, + convert::{TryFrom, TryInto}, str::FromStr, time::Duration, }; use ibc_proto::{ google::protobuf::Any, - ibc::core::connection::v1::MsgConnectionOpenTry as RawMsgConnectionOpenTry, - Protobuf, + ibc::core::connection::v1::MsgConnectionOpenTry as RawMsgConnectionOpenTry, Protobuf, }; use crate::{ core::{ - ics03_connection::{ - connection::Counterparty, - error::Error, - version::Version, - }, + ics03_connection::{connection::Counterparty, error::Error, version::Version}, ics23_commitment::commitment::CommitmentProofBytes, - ics24_host::identifier::{ - ClientId, - ConnectionId, - }, - }, - proofs::{ - ConsensusProof, - Proofs, + ics24_host::identifier::{ClientId, ConnectionId}, }, + proofs::{ConsensusProof, Proofs}, signer::Signer, tx_msg::Msg, Height, @@ -188,28 +174,20 @@ impl From for RawMsgConnectionOpenTry { pub mod test_util { use ibc_proto::ibc::core::{ - client::v1::Height, - connection::v1::MsgConnectionOpenTry as RawMsgConnectionOpenTry, + client::v1::Height, connection::v1::MsgConnectionOpenTry as RawMsgConnectionOpenTry, }; use crate::{ core::{ ics03_connection::{ msgs::{ - conn_open_try::MsgConnectionOpenTry, - test_util::get_dummy_raw_counterparty, + conn_open_try::MsgConnectionOpenTry, test_util::get_dummy_raw_counterparty, }, version::get_compatible_versions, }, - ics24_host::identifier::{ - ClientId, - ConnectionId, - }, - }, - test_utils::{ - get_dummy_bech32_account, - get_dummy_proof, + ics24_host::identifier::{ClientId, ConnectionId}, }, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, }; /// Testing-specific helper methods. @@ -273,17 +251,13 @@ mod tests { use ibc_proto::ibc::core::{ client::v1::Height, connection::v1::{ - Counterparty as RawCounterparty, - MsgConnectionOpenTry as RawMsgConnectionOpenTry, + Counterparty as RawCounterparty, MsgConnectionOpenTry as RawMsgConnectionOpenTry, }, }; use test_log::test; use crate::core::ics03_connection::msgs::{ - conn_open_try::{ - test_util::get_dummy_raw_msg_conn_open_try, - MsgConnectionOpenTry, - }, + conn_open_try::{test_util::get_dummy_raw_msg_conn_open_try, MsgConnectionOpenTry}, test_util::get_dummy_raw_counterparty, }; diff --git a/crates/relayer-types/src/core/ics03_connection/version.rs b/crates/relayer-types/src/core/ics03_connection/version.rs index d6f33bb8ce..c1bed7e360 100644 --- a/crates/relayer-types/src/core/ics03_connection/version.rs +++ b/crates/relayer-types/src/core/ics03_connection/version.rs @@ -1,19 +1,10 @@ use std::fmt::Display; -use ibc_proto::{ - ibc::core::connection::v1::Version as RawVersion, - Protobuf, -}; -use serde::{ - Deserialize, - Serialize, -}; +use ibc_proto::{ibc::core::connection::v1::Version as RawVersion, Protobuf}; +use serde::{Deserialize, Serialize}; use crate::{ - core::{ - ics03_connection::error::Error, - ics04_channel::channel::Ordering, - }, + core::{ics03_connection::error::Error, ics04_channel::channel::Ordering}, utils::pretty::PrettySlice, }; @@ -124,11 +115,7 @@ mod tests { use crate::core::ics03_connection::{ error::Error, - version::{ - get_compatible_versions, - pick_version, - Version, - }, + version::{get_compatible_versions, pick_version, Version}, }; fn good_versions() -> Vec { diff --git a/crates/relayer-types/src/core/ics04_channel/channel.rs b/crates/relayer-types/src/core/ics04_channel/channel.rs index 60998e4351..e0a46ccaf9 100644 --- a/crates/relayer-types/src/core/ics04_channel/channel.rs +++ b/crates/relayer-types/src/core/ics04_channel/channel.rs @@ -1,36 +1,21 @@ use std::{ - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, str::FromStr, }; use ibc_proto::{ ibc::core::channel::v1::{ - Channel as RawChannel, - Counterparty as RawCounterparty, + Channel as RawChannel, Counterparty as RawCounterparty, IdentifiedChannel as RawIdentifiedChannel, }, Protobuf, }; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use crate::{ core::{ - ics04_channel::{ - error::Error, - version::Version, - }, - ics24_host::identifier::{ - ChannelId, - ConnectionId, - PortId, - }, + ics04_channel::{error::Error, version::Version}, + ics24_host::identifier::{ChannelId, ConnectionId, PortId}, }, utils::pretty::PrettySlice, }; @@ -459,15 +444,10 @@ impl Display for State { #[cfg(test)] pub mod test_util { use ibc_proto::ibc::core::channel::v1::{ - Channel as RawChannel, - Counterparty as RawCounterparty, + Channel as RawChannel, Counterparty as RawCounterparty, }; - use crate::core::ics24_host::identifier::{ - ChannelId, - ConnectionId, - PortId, - }; + use crate::core::ics24_host::identifier::{ChannelId, ConnectionId, PortId}; /// Returns a dummy `RawCounterparty`, for testing only! /// Can be optionally parametrized with a specific channel identifier. @@ -498,10 +478,7 @@ mod tests { use ibc_proto::ibc::core::channel::v1::Channel as RawChannel; use test_log::test; - use crate::core::ics04_channel::channel::{ - test_util::get_dummy_raw_channel_end, - ChannelEnd, - }; + use crate::core::ics04_channel::channel::{test_util::get_dummy_raw_channel_end, ChannelEnd}; #[test] fn channel_end_try_from_raw() { diff --git a/crates/relayer-types/src/core/ics04_channel/commitment.rs b/crates/relayer-types/src/core/ics04_channel/commitment.rs index 3ab3787d25..f3e3815240 100644 --- a/crates/relayer-types/src/core/ics04_channel/commitment.rs +++ b/crates/relayer-types/src/core/ics04_channel/commitment.rs @@ -1,7 +1,4 @@ -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; /// Packet commitment #[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)] diff --git a/crates/relayer-types/src/core/ics04_channel/error.rs b/crates/relayer-types/src/core/ics04_channel/error.rs index 3f80270d03..961131302a 100644 --- a/crates/relayer-types/src/core/ics04_channel/error.rs +++ b/crates/relayer-types/src/core/ics04_channel/error.rs @@ -1,13 +1,7 @@ -use flex_error::{ - define_error, - TraceError, -}; +use flex_error::{define_error, TraceError}; use tendermint_proto::Error as TendermintError; -use super::{ - packet::Sequence, - timeout::TimeoutHeight, -}; +use super::{packet::Sequence, timeout::TimeoutHeight}; use crate::{ core::{ ics02_client::error as client_error, @@ -15,12 +9,7 @@ use crate::{ ics04_channel::channel::State, ics24_host::{ error::ValidationError, - identifier::{ - ChannelId, - ClientId, - ConnectionId, - PortId, - }, + identifier::{ChannelId, ClientId, ConnectionId, PortId}, }, }, proofs::ProofError, diff --git a/crates/relayer-types/src/core/ics04_channel/events.rs b/crates/relayer-types/src/core/ics04_channel/events.rs index 2a4be81fd6..d67ae0c51f 100644 --- a/crates/relayer-types/src/core/ics04_channel/events.rs +++ b/crates/relayer-types/src/core/ics04_channel/events.rs @@ -1,37 +1,19 @@ //! Types for the IBC events emitted from Tendermint Websocket by the channels module. use std::{ - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, str, }; -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; use tendermint::abci; use crate::{ core::{ - ics04_channel::{ - error::Error, - packet::Packet, - }, - ics24_host::identifier::{ - ChannelId, - ConnectionId, - PortId, - }, - }, - events::{ - Error as EventError, - IbcEvent, - IbcEventType, + ics04_channel::{error::Error, packet::Packet}, + ics24_host::identifier::{ChannelId, ConnectionId, PortId}, }, + events::{Error as EventError, IbcEvent, IbcEventType}, utils::pretty::PrettySlice, }; diff --git a/crates/relayer-types/src/core/ics04_channel/msgs.rs b/crates/relayer-types/src/core/ics04_channel/msgs.rs index ac1c8329c1..a4d0b97222 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs.rs @@ -2,15 +2,10 @@ //! as packets. use crate::core::ics04_channel::msgs::{ - acknowledgement::MsgAcknowledgement, - chan_close_confirm::MsgChannelCloseConfirm, - chan_close_init::MsgChannelCloseInit, - chan_open_ack::MsgChannelOpenAck, - chan_open_confirm::MsgChannelOpenConfirm, - chan_open_init::MsgChannelOpenInit, - chan_open_try::MsgChannelOpenTry, - recv_packet::MsgRecvPacket, - timeout::MsgTimeout, + acknowledgement::MsgAcknowledgement, chan_close_confirm::MsgChannelCloseConfirm, + chan_close_init::MsgChannelCloseInit, chan_open_ack::MsgChannelOpenAck, + chan_open_confirm::MsgChannelOpenConfirm, chan_open_init::MsgChannelOpenInit, + chan_open_try::MsgChannelOpenTry, recv_packet::MsgRecvPacket, timeout::MsgTimeout, timeout_on_close::MsgTimeoutOnClose, }; diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/acknowledgement.rs b/crates/relayer-types/src/core/ics04_channel/msgs/acknowledgement.rs index 5bf862b732..7d81455c33 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/acknowledgement.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/acknowledgement.rs @@ -1,17 +1,8 @@ -use derive_more::{ - From, - Into, -}; -use ibc_proto::{ - ibc::core::channel::v1::MsgAcknowledgement as RawMsgAcknowledgement, - Protobuf, -}; +use derive_more::{From, Into}; +use ibc_proto::{ibc::core::channel::v1::MsgAcknowledgement as RawMsgAcknowledgement, Protobuf}; use crate::{ - core::ics04_channel::{ - error::Error, - packet::Packet, - }, + core::ics04_channel::{error::Error, packet::Packet}, proofs::Proofs, signer::Signer, tx_msg::Msg, @@ -132,19 +123,13 @@ impl From for RawMsgAcknowledgement { #[cfg(test)] pub mod test_util { use ibc_proto::ibc::core::{ - channel::v1::{ - MsgAcknowledgement as RawMsgAcknowledgement, - Packet as RawPacket, - }, + channel::v1::{MsgAcknowledgement as RawMsgAcknowledgement, Packet as RawPacket}, client::v1::Height as RawHeight, }; use crate::{ core::ics04_channel::packet::test_utils::get_dummy_raw_packet, - test_utils::{ - get_dummy_bech32_account, - get_dummy_proof, - }, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, }; /// Returns a dummy `RawMsgAcknowledgement`, for testing only! @@ -180,8 +165,7 @@ mod test { core::ics04_channel::{ error::Error, msgs::acknowledgement::{ - test_util::get_dummy_raw_msg_acknowledgement, - MsgAcknowledgement, + test_util::get_dummy_raw_msg_acknowledgement, MsgAcknowledgement, }, }, test_utils::get_dummy_bech32_account, diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs index 0ffc52eb1e..ee7c52ec7b 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_confirm.rs @@ -1,15 +1,11 @@ use ibc_proto::{ - ibc::core::channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm, - Protobuf, + ibc::core::channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm, Protobuf, }; use crate::{ core::{ ics04_channel::error::Error, - ics24_host::identifier::{ - ChannelId, - PortId, - }, + ics24_host::identifier::{ChannelId, PortId}, }, proofs::Proofs, signer::Signer, @@ -101,19 +97,12 @@ impl From for RawMsgChannelCloseConfirm { pub mod test_util { use ibc_proto::ibc::core::{ - channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm, - client::v1::Height, + channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm, client::v1::Height, }; use crate::{ - core::ics24_host::identifier::{ - ChannelId, - PortId, - }, - test_utils::{ - get_dummy_bech32_account, - get_dummy_proof, - }, + core::ics24_host::identifier::{ChannelId, PortId}, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, }; /// Returns a dummy `RawMsgChannelCloseConfirm`, for testing only! @@ -135,13 +124,11 @@ pub mod test_util { mod tests { use ibc_proto::ibc::core::{ - channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm, - client::v1::Height, + channel::v1::MsgChannelCloseConfirm as RawMsgChannelCloseConfirm, client::v1::Height, }; use crate::core::ics04_channel::msgs::chan_close_confirm::{ - test_util::get_dummy_raw_msg_chan_close_confirm, - MsgChannelCloseConfirm, + test_util::get_dummy_raw_msg_chan_close_confirm, MsgChannelCloseConfirm, }; #[test] diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_init.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_init.rs index 6c466af635..f432e5d8fc 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_init.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_close_init.rs @@ -1,15 +1,9 @@ -use ibc_proto::{ - ibc::core::channel::v1::MsgChannelCloseInit as RawMsgChannelCloseInit, - Protobuf, -}; +use ibc_proto::{ibc::core::channel::v1::MsgChannelCloseInit as RawMsgChannelCloseInit, Protobuf}; use crate::{ core::{ ics04_channel::error::Error, - ics24_host::identifier::{ - ChannelId, - PortId, - }, + ics24_host::identifier::{ChannelId, PortId}, }, signer::Signer, tx_msg::Msg, @@ -80,10 +74,7 @@ pub mod test_util { use ibc_proto::ibc::core::channel::v1::MsgChannelCloseInit as RawMsgChannelCloseInit; use crate::{ - core::ics24_host::identifier::{ - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChannelId, PortId}, test_utils::get_dummy_bech32_account, }; @@ -104,8 +95,7 @@ mod tests { use test_log::test; use crate::core::ics04_channel::msgs::chan_close_init::{ - test_util::get_dummy_raw_msg_chan_close_init, - MsgChannelCloseInit, + test_util::get_dummy_raw_msg_chan_close_init, MsgChannelCloseInit, }; #[test] diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_ack.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_ack.rs index 506202a8ee..e160657bd1 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_ack.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_ack.rs @@ -1,18 +1,9 @@ -use ibc_proto::{ - ibc::core::channel::v1::MsgChannelOpenAck as RawMsgChannelOpenAck, - Protobuf, -}; +use ibc_proto::{ibc::core::channel::v1::MsgChannelOpenAck as RawMsgChannelOpenAck, Protobuf}; use crate::{ core::{ - ics04_channel::{ - error::Error, - version::Version, - }, - ics24_host::identifier::{ - ChannelId, - PortId, - }, + ics04_channel::{error::Error, version::Version}, + ics24_host::identifier::{ChannelId, PortId}, }, proofs::Proofs, signer::Signer, @@ -118,19 +109,12 @@ impl From for RawMsgChannelOpenAck { pub mod test_util { use ibc_proto::ibc::core::{ - channel::v1::MsgChannelOpenAck as RawMsgChannelOpenAck, - client::v1::Height, + channel::v1::MsgChannelOpenAck as RawMsgChannelOpenAck, client::v1::Height, }; use crate::{ - core::ics24_host::identifier::{ - ChannelId, - PortId, - }, - test_utils::{ - get_dummy_bech32_account, - get_dummy_proof, - }, + core::ics24_host::identifier::{ChannelId, PortId}, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, }; /// Returns a dummy `RawMsgChannelOpenAck`, for testing only! @@ -154,14 +138,12 @@ pub mod test_util { mod tests { use ibc_proto::ibc::core::{ - channel::v1::MsgChannelOpenAck as RawMsgChannelOpenAck, - client::v1::Height, + channel::v1::MsgChannelOpenAck as RawMsgChannelOpenAck, client::v1::Height, }; use test_log::test; use crate::core::ics04_channel::msgs::chan_open_ack::{ - test_util::get_dummy_raw_msg_chan_open_ack, - MsgChannelOpenAck, + test_util::get_dummy_raw_msg_chan_open_ack, MsgChannelOpenAck, }; #[test] diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_confirm.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_confirm.rs index aa55544123..733a50808f 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_confirm.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_confirm.rs @@ -1,15 +1,11 @@ use ibc_proto::{ - ibc::core::channel::v1::MsgChannelOpenConfirm as RawMsgChannelOpenConfirm, - Protobuf, + ibc::core::channel::v1::MsgChannelOpenConfirm as RawMsgChannelOpenConfirm, Protobuf, }; use crate::{ core::{ ics04_channel::error::Error, - ics24_host::identifier::{ - ChannelId, - PortId, - }, + ics24_host::identifier::{ChannelId, PortId}, }, proofs::Proofs, signer::Signer, @@ -98,19 +94,12 @@ impl From for RawMsgChannelOpenConfirm { pub mod test_util { use ibc_proto::ibc::core::{ - channel::v1::MsgChannelOpenConfirm as RawMsgChannelOpenConfirm, - client::v1::Height, + channel::v1::MsgChannelOpenConfirm as RawMsgChannelOpenConfirm, client::v1::Height, }; use crate::{ - core::ics24_host::identifier::{ - ChannelId, - PortId, - }, - test_utils::{ - get_dummy_bech32_account, - get_dummy_proof, - }, + core::ics24_host::identifier::{ChannelId, PortId}, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, }; /// Returns a dummy `RawMsgChannelOpenConfirm`, for testing only! @@ -132,14 +121,12 @@ pub mod test_util { mod tests { use ibc_proto::ibc::core::{ - channel::v1::MsgChannelOpenConfirm as RawMsgChannelOpenConfirm, - client::v1::Height, + channel::v1::MsgChannelOpenConfirm as RawMsgChannelOpenConfirm, client::v1::Height, }; use test_log::test; use crate::core::ics04_channel::msgs::chan_open_confirm::{ - test_util::get_dummy_raw_msg_chan_open_confirm, - MsgChannelOpenConfirm, + test_util::get_dummy_raw_msg_chan_open_confirm, MsgChannelOpenConfirm, }; #[test] diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_init.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_init.rs index 0cf1ffe4a3..479152bba2 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_init.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_init.rs @@ -1,14 +1,8 @@ -use ibc_proto::{ - ibc::core::channel::v1::MsgChannelOpenInit as RawMsgChannelOpenInit, - Protobuf, -}; +use ibc_proto::{ibc::core::channel::v1::MsgChannelOpenInit as RawMsgChannelOpenInit, Protobuf}; use crate::{ core::{ - ics04_channel::{ - channel::ChannelEnd, - error::Error, - }, + ics04_channel::{channel::ChannelEnd, error::Error}, ics24_host::identifier::PortId, }, signer::Signer, @@ -106,8 +100,7 @@ mod tests { use test_log::test; use crate::core::ics04_channel::msgs::chan_open_init::{ - test_util::get_dummy_raw_msg_chan_open_init, - MsgChannelOpenInit, + test_util::get_dummy_raw_msg_chan_open_init, MsgChannelOpenInit, }; #[test] diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_try.rs b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_try.rs index 3be9608b72..db1d394a28 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_try.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/chan_open_try.rs @@ -1,23 +1,13 @@ use core::str::FromStr; -use ibc_proto::{ - ibc::core::channel::v1::MsgChannelOpenTry as RawMsgChannelOpenTry, - Protobuf, -}; +use ibc_proto::{ibc::core::channel::v1::MsgChannelOpenTry as RawMsgChannelOpenTry, Protobuf}; use crate::{ core::{ - ics04_channel::{ - channel::ChannelEnd, - error::Error as ChannelError, - version::Version, - }, + ics04_channel::{channel::ChannelEnd, error::Error as ChannelError, version::Version}, ics24_host::{ error::ValidationError, - identifier::{ - ChannelId, - PortId, - }, + identifier::{ChannelId, PortId}, }, }, proofs::Proofs, @@ -149,22 +139,15 @@ impl From for RawMsgChannelOpenTry { pub mod test_util { use ibc_proto::ibc::core::{ - channel::v1::MsgChannelOpenTry as RawMsgChannelOpenTry, - client::v1::Height, + channel::v1::MsgChannelOpenTry as RawMsgChannelOpenTry, client::v1::Height, }; use crate::{ core::{ ics04_channel::channel::test_util::get_dummy_raw_channel_end, - ics24_host::identifier::{ - ChannelId, - PortId, - }, - }, - test_utils::{ - get_dummy_bech32_account, - get_dummy_proof, + ics24_host::identifier::{ChannelId, PortId}, }, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, }; /// Returns a dummy `RawMsgChannelOpenTry`, for testing only! @@ -188,14 +171,12 @@ pub mod test_util { #[cfg(test)] mod tests { use ibc_proto::ibc::core::{ - channel::v1::MsgChannelOpenTry as RawMsgChannelOpenTry, - client::v1::Height, + channel::v1::MsgChannelOpenTry as RawMsgChannelOpenTry, client::v1::Height, }; use test_log::test; use crate::core::ics04_channel::msgs::chan_open_try::{ - test_util::get_dummy_raw_msg_chan_open_try, - MsgChannelOpenTry, + test_util::get_dummy_raw_msg_chan_open_try, MsgChannelOpenTry, }; #[test] diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/recv_packet.rs b/crates/relayer-types/src/core/ics04_channel/msgs/recv_packet.rs index 84a8f6a0d6..e3b595cf76 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/recv_packet.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/recv_packet.rs @@ -1,13 +1,7 @@ -use ibc_proto::{ - ibc::core::channel::v1::MsgRecvPacket as RawMsgRecvPacket, - Protobuf, -}; +use ibc_proto::{ibc::core::channel::v1::MsgRecvPacket as RawMsgRecvPacket, Protobuf}; use crate::{ - core::ics04_channel::{ - error::Error, - packet::Packet, - }, + core::ics04_channel::{error::Error, packet::Packet}, proofs::Proofs, signer::Signer, tx_msg::Msg, @@ -94,22 +88,15 @@ impl From for RawMsgRecvPacket { #[cfg(test)] pub mod test_util { - use core::{ - ops::Add, - time::Duration, - }; + use core::{ops::Add, time::Duration}; use ibc_proto::ibc::core::{ - channel::v1::MsgRecvPacket as RawMsgRecvPacket, - client::v1::Height as RawHeight, + channel::v1::MsgRecvPacket as RawMsgRecvPacket, client::v1::Height as RawHeight, }; use crate::{ core::ics04_channel::packet::test_utils::get_dummy_raw_packet, - test_utils::{ - get_dummy_bech32_account, - get_dummy_proof, - }, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, timestamp::Timestamp, }; @@ -141,10 +128,7 @@ mod test { use crate::{ core::ics04_channel::{ error::Error, - msgs::recv_packet::{ - test_util::get_dummy_raw_msg_recv_packet, - MsgRecvPacket, - }, + msgs::recv_packet::{test_util::get_dummy_raw_msg_recv_packet, MsgRecvPacket}, }, test_utils::get_dummy_bech32_account, }; diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/timeout.rs b/crates/relayer-types/src/core/ics04_channel/msgs/timeout.rs index 5233f6d2cf..56348b1f23 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/timeout.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/timeout.rs @@ -1,15 +1,9 @@ -use ibc_proto::{ - ibc::core::channel::v1::MsgTimeout as RawMsgTimeout, - Protobuf, -}; +use ibc_proto::{ibc::core::channel::v1::MsgTimeout as RawMsgTimeout, Protobuf}; use crate::{ core::ics04_channel::{ error::Error, - packet::{ - Packet, - Sequence, - }, + packet::{Packet, Sequence}, }, proofs::Proofs, signer::Signer, @@ -109,16 +103,12 @@ impl From for RawMsgTimeout { #[cfg(test)] pub mod test_util { use ibc_proto::ibc::core::{ - channel::v1::MsgTimeout as RawMsgTimeout, - client::v1::Height as RawHeight, + channel::v1::MsgTimeout as RawMsgTimeout, client::v1::Height as RawHeight, }; use crate::{ core::ics04_channel::packet::test_utils::get_dummy_raw_packet, - test_utils::{ - get_dummy_bech32_account, - get_dummy_proof, - }, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, }; /// Returns a dummy `RawMsgTimeout`, for testing only! @@ -150,10 +140,7 @@ mod test { use crate::{ core::ics04_channel::{ error::Error, - msgs::timeout::{ - test_util::get_dummy_raw_msg_timeout, - MsgTimeout, - }, + msgs::timeout::{test_util::get_dummy_raw_msg_timeout, MsgTimeout}, }, test_utils::get_dummy_bech32_account, }; diff --git a/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs b/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs index 6f74287fe4..ccc0ce13a0 100644 --- a/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs +++ b/crates/relayer-types/src/core/ics04_channel/msgs/timeout_on_close.rs @@ -1,15 +1,9 @@ -use ibc_proto::{ - ibc::core::channel::v1::MsgTimeoutOnClose as RawMsgTimeoutOnClose, - Protobuf, -}; +use ibc_proto::{ibc::core::channel::v1::MsgTimeoutOnClose as RawMsgTimeoutOnClose, Protobuf}; use crate::{ core::ics04_channel::{ error::Error, - packet::{ - Packet, - Sequence, - }, + packet::{Packet, Sequence}, }, proofs::Proofs, signer::Signer, @@ -122,8 +116,7 @@ mod tests { use test_log::test; use crate::core::ics04_channel::msgs::timeout_on_close::{ - test_util::get_dummy_raw_msg_timeout_on_close, - MsgTimeoutOnClose, + test_util::get_dummy_raw_msg_timeout_on_close, MsgTimeoutOnClose, }; #[test] @@ -207,16 +200,12 @@ mod tests { #[cfg(test)] pub mod test_util { use ibc_proto::ibc::core::{ - channel::v1::MsgTimeoutOnClose as RawMsgTimeoutOnClose, - client::v1::Height as RawHeight, + channel::v1::MsgTimeoutOnClose as RawMsgTimeoutOnClose, client::v1::Height as RawHeight, }; use crate::{ core::ics04_channel::packet::test_utils::get_dummy_raw_packet, - test_utils::{ - get_dummy_bech32_account, - get_dummy_proof, - }, + test_utils::{get_dummy_bech32_account, get_dummy_proof}, }; /// Returns a dummy `RawMsgTimeoutOnClose`, for testing only! diff --git a/crates/relayer-types/src/core/ics04_channel/packet.rs b/crates/relayer-types/src/core/ics04_channel/packet.rs index 413f2ade2d..bb3fad0869 100644 --- a/crates/relayer-types/src/core/ics04_channel/packet.rs +++ b/crates/relayer-types/src/core/ics04_channel/packet.rs @@ -1,24 +1,15 @@ use std::str::FromStr; use ibc_proto::ibc::core::channel::v1::Packet as RawPacket; -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; use super::timeout::TimeoutHeight; use crate::{ core::{ ics04_channel::error::Error, - ics24_host::identifier::{ - ChannelId, - PortId, - }, - }, - timestamp::{ - Expiry::Expired, - Timestamp, + ics24_host::identifier::{ChannelId, PortId}, }, + timestamp::{Expiry::Expired, Timestamp}, Height, }; @@ -285,15 +276,9 @@ impl From for RawPacket { #[cfg(test)] pub mod test_utils { - use ibc_proto::ibc::core::{ - channel::v1::Packet as RawPacket, - client::v1::Height as RawHeight, - }; + use ibc_proto::ibc::core::{channel::v1::Packet as RawPacket, client::v1::Height as RawHeight}; - use crate::core::ics24_host::identifier::{ - ChannelId, - PortId, - }; + use crate::core::ics24_host::identifier::{ChannelId, PortId}; /// Returns a dummy `RawPacket`, for testing only! pub fn get_dummy_raw_packet(timeout_height: u64, timeout_timestamp: u64) -> RawPacket { @@ -316,16 +301,10 @@ pub mod test_utils { #[cfg(test)] mod tests { - use ibc_proto::ibc::core::{ - channel::v1::Packet as RawPacket, - client::v1::Height as RawHeight, - }; + use ibc_proto::ibc::core::{channel::v1::Packet as RawPacket, client::v1::Height as RawHeight}; use test_log::test; - use crate::core::ics04_channel::packet::{ - test_utils::get_dummy_raw_packet, - Packet, - }; + use crate::core::ics04_channel::packet::{test_utils::get_dummy_raw_packet, Packet}; #[test] fn packet_try_from_raw() { diff --git a/crates/relayer-types/src/core/ics04_channel/packet_id.rs b/crates/relayer-types/src/core/ics04_channel/packet_id.rs index 6abb853e64..e998811cdf 100644 --- a/crates/relayer-types/src/core/ics04_channel/packet_id.rs +++ b/crates/relayer-types/src/core/ics04_channel/packet_id.rs @@ -1,19 +1,10 @@ -use std::{ - convert::TryFrom, - str::FromStr, -}; +use std::{convert::TryFrom, str::FromStr}; use ibc_proto::ibc::core::channel::v1::PacketId as ProtoPacketId; use crate::core::{ - ics04_channel::{ - error::Error, - packet::Sequence, - }, - ics24_host::identifier::{ - ChannelId, - PortId, - }, + ics04_channel::{error::Error, packet::Sequence}, + ics24_host::identifier::{ChannelId, PortId}, }; #[derive(Debug, Clone)] diff --git a/crates/relayer-types/src/core/ics04_channel/timeout.rs b/crates/relayer-types/src/core/ics04_channel/timeout.rs index d2ed737b02..d1579ca828 100644 --- a/crates/relayer-types/src/core/ics04_channel/timeout.rs +++ b/crates/relayer-types/src/core/ics04_channel/timeout.rs @@ -1,19 +1,9 @@ -use std::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use std::fmt::{Display, Error as FmtError, Formatter}; use ibc_proto::ibc::core::client::v1::Height as RawHeight; -use serde::{ - Deserialize, - Serialize, -}; - -use crate::core::ics02_client::{ - error::Error as ICS2Error, - height::Height, -}; +use serde::{Deserialize, Serialize}; + +use crate::core::ics02_client::{error::Error as ICS2Error, height::Height}; /// Indicates a consensus height on the destination chain after which the packet /// will no longer be processed, and will instead count as having timed-out. diff --git a/crates/relayer-types/src/core/ics04_channel/version.rs b/crates/relayer-types/src/core/ics04_channel/version.rs index 0b60ecf3b1..e584f2bec9 100644 --- a/crates/relayer-types/src/core/ics04_channel/version.rs +++ b/crates/relayer-types/src/core/ics04_channel/version.rs @@ -4,18 +4,11 @@ use std::{ convert::Infallible, - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, str::FromStr, }; -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; use serde_json as json; use crate::applications::transfer; diff --git a/crates/relayer-types/src/core/ics23_commitment/commitment.rs b/crates/relayer-types/src/core/ics23_commitment/commitment.rs index dbc6e6c1e6..9fe5d555e2 100644 --- a/crates/relayer-types/src/core/ics23_commitment/commitment.rs +++ b/crates/relayer-types/src/core/ics23_commitment/commitment.rs @@ -1,26 +1,11 @@ -use std::{ - convert::TryFrom, - fmt, -}; +use std::{convert::TryFrom, fmt}; use ibc_proto::ibc::core::commitment::v1::MerkleProof as RawMerkleProof; -use serde::{ - Deserialize, - Serialize, -}; -use subtle_encoding::{ - Encoding, - Hex, -}; - -use super::{ - error::Error, - merkle::MerkleProof, -}; -use crate::{ - proofs::ProofError, - tx_msg::encode_message, -}; +use serde::{Deserialize, Serialize}; +use subtle_encoding::{Encoding, Hex}; + +use super::{error::Error, merkle::MerkleProof}; +use crate::{proofs::ProofError, tx_msg::encode_message}; #[derive(Clone, PartialEq, Eq, Serialize, Deserialize)] #[serde(transparent)] @@ -186,8 +171,7 @@ impl Serialize for CommitmentPrefix { pub mod test_util { use ibc_proto::{ - ibc::core::commitment::v1::MerkleProof as RawMerkleProof, - ics23::CommitmentProof, + ibc::core::commitment::v1::MerkleProof as RawMerkleProof, ics23::CommitmentProof, }; /// Returns a dummy `RawMerkleProof`, for testing only! diff --git a/crates/relayer-types/src/core/ics23_commitment/error.rs b/crates/relayer-types/src/core/ics23_commitment/error.rs index f4a22487f5..260c9557b4 100644 --- a/crates/relayer-types/src/core/ics23_commitment/error.rs +++ b/crates/relayer-types/src/core/ics23_commitment/error.rs @@ -1,7 +1,4 @@ -use flex_error::{ - define_error, - TraceError, -}; +use flex_error::{define_error, TraceError}; use prost::DecodeError; define_error! { diff --git a/crates/relayer-types/src/core/ics23_commitment/merkle.rs b/crates/relayer-types/src/core/ics23_commitment/merkle.rs index 881ab121d8..5fdafa12c4 100644 --- a/crates/relayer-types/src/core/ics23_commitment/merkle.rs +++ b/crates/relayer-types/src/core/ics23_commitment/merkle.rs @@ -1,23 +1,12 @@ -use ibc_proto::ibc::core::commitment::v1::{ - MerklePath, - MerkleProof as RawMerkleProof, - MerkleRoot, -}; +use ibc_proto::ibc::core::commitment::v1::{MerklePath, MerkleProof as RawMerkleProof, MerkleRoot}; use ics23::{ - calculate_existence_root, - commitment_proof::Proof, - verify_membership, - verify_non_membership, - CommitmentProof, - NonExistenceProof, + calculate_existence_root, commitment_proof::Proof, verify_membership, verify_non_membership, + CommitmentProof, NonExistenceProof, }; use tendermint::merkle::proof::ProofOps as TendermintProof; use crate::core::ics23_commitment::{ - commitment::{ - CommitmentPrefix, - CommitmentRoot, - }, + commitment::{CommitmentPrefix, CommitmentRoot}, error::Error, specs::ProofSpecs, }; diff --git a/crates/relayer-types/src/core/ics23_commitment/specs.rs b/crates/relayer-types/src/core/ics23_commitment/specs.rs index 9c7f942922..75486c955e 100644 --- a/crates/relayer-types/src/core/ics23_commitment/specs.rs +++ b/crates/relayer-types/src/core/ics23_commitment/specs.rs @@ -1,8 +1,5 @@ use ics23::ProofSpec; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; /// An array of proof specifications. /// diff --git a/crates/relayer-types/src/core/ics24_host/identifier.rs b/crates/relayer-types/src/core/ics24_host/identifier.rs index 66ccae442c..e1ab7113d3 100644 --- a/crates/relayer-types/src/core/ics24_host/identifier.rs +++ b/crates/relayer-types/src/core/ics24_host/identifier.rs @@ -1,28 +1,14 @@ use std::{ - convert::{ - From, - Infallible, - }, - fmt::{ - Debug, - Display, - Error as FmtError, - Formatter, - }, + convert::{From, Infallible}, + fmt::{Debug, Display, Error as FmtError, Formatter}, str::FromStr, }; use regex::Regex; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use super::validate::*; -use crate::core::{ - ics02_client::client_type::ClientType, - ics24_host::error::ValidationError, -}; +use crate::core::{ics02_client::client_type::ClientType, ics24_host::error::ValidationError}; /// This type is subject to future changes. /// diff --git a/crates/relayer-types/src/core/ics24_host/mod.rs b/crates/relayer-types/src/core/ics24_host/mod.rs index 40eb80d8ab..23be43fb73 100644 --- a/crates/relayer-types/src/core/ics24_host/mod.rs +++ b/crates/relayer-types/src/core/ics24_host/mod.rs @@ -1,12 +1,7 @@ //! ICS 24: Host defines the minimal set of interfaces that a //! state machine hosting an IBC-enabled chain must implement. -pub use path::{ - ClientUpgradePath, - Path, - IBC_QUERY_PATH, - SDK_UPGRADE_QUERY_PATH, -}; +pub use path::{ClientUpgradePath, Path, IBC_QUERY_PATH, SDK_UPGRADE_QUERY_PATH}; pub mod error; pub mod identifier; diff --git a/crates/relayer-types/src/core/ics24_host/path.rs b/crates/relayer-types/src/core/ics24_host/path.rs index 3fde102b1b..492f9cd8d1 100644 --- a/crates/relayer-types/src/core/ics24_host/path.rs +++ b/crates/relayer-types/src/core/ics24_host/path.rs @@ -4,20 +4,12 @@ /// use std::str::FromStr; -use derive_more::{ - Display, - From, -}; +use derive_more::{Display, From}; use flex_error::define_error; use crate::core::{ ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChannelId, - ClientId, - ConnectionId, - PortId, - }, + ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}, }; /// ABCI Query path for the IBC sub-store diff --git a/crates/relayer-types/src/core/ics24_host/validate.rs b/crates/relayer-types/src/core/ics24_host/validate.rs index bbe6187f87..8c8fc446ae 100644 --- a/crates/relayer-types/src/core/ics24_host/validate.rs +++ b/crates/relayer-types/src/core/ics24_host/validate.rs @@ -78,11 +78,8 @@ mod tests { use test_log::test; use crate::core::ics24_host::validate::{ - validate_channel_identifier, - validate_client_identifier, - validate_connection_identifier, - validate_identifier, - validate_port_identifier, + validate_channel_identifier, validate_client_identifier, validate_connection_identifier, + validate_identifier, validate_port_identifier, }; #[test] diff --git a/crates/relayer-types/src/core/ics26_routing/error.rs b/crates/relayer-types/src/core/ics26_routing/error.rs index b0112be80c..12020f405c 100644 --- a/crates/relayer-types/src/core/ics26_routing/error.rs +++ b/crates/relayer-types/src/core/ics26_routing/error.rs @@ -1,15 +1,8 @@ -use flex_error::{ - define_error, - TraceError, -}; +use flex_error::{define_error, TraceError}; use crate::{ applications::transfer, - core::{ - ics02_client, - ics03_connection, - ics04_channel, - }, + core::{ics02_client, ics03_connection, ics04_channel}, }; define_error! { diff --git a/crates/relayer-types/src/core/ics26_routing/msgs.rs b/crates/relayer-types/src/core/ics26_routing/msgs.rs index c95b0dc813..71d7536c4a 100644 --- a/crates/relayer-types/src/core/ics26_routing/msgs.rs +++ b/crates/relayer-types/src/core/ics26_routing/msgs.rs @@ -1,34 +1,13 @@ -use ibc_proto::{ - google::protobuf::Any, - Protobuf, -}; +use ibc_proto::{google::protobuf::Any, Protobuf}; use crate::core::{ - ics02_client::msgs::{ - create_client, - update_client, - upgrade_client, - ClientMsg, - }, + ics02_client::msgs::{create_client, update_client, upgrade_client, ClientMsg}, ics03_connection::msgs::{ - conn_open_ack, - conn_open_confirm, - conn_open_init, - conn_open_try, - ConnectionMsg, + conn_open_ack, conn_open_confirm, conn_open_init, conn_open_try, ConnectionMsg, }, ics04_channel::msgs::{ - acknowledgement, - chan_close_confirm, - chan_close_init, - chan_open_ack, - chan_open_confirm, - chan_open_init, - chan_open_try, - recv_packet, - timeout, - timeout_on_close, - ChannelMsg, + acknowledgement, chan_close_confirm, chan_close_init, chan_open_ack, chan_open_confirm, + chan_open_init, chan_open_try, recv_packet, timeout, timeout_on_close, ChannelMsg, PacketMsg, }, ics26_routing::error::Error, diff --git a/crates/relayer-types/src/events.rs b/crates/relayer-types/src/events.rs index 8bf42e8b65..dd7ec33dd2 100644 --- a/crates/relayer-types/src/events.rs +++ b/crates/relayer-types/src/events.rs @@ -1,54 +1,31 @@ use std::{ borrow::Cow, convert::TryFrom, - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, str::FromStr, }; -use flex_error::{ - define_error, - TraceError, -}; -use serde_derive::{ - Deserialize, - Serialize, -}; +use flex_error::{define_error, TraceError}; +use serde_derive::{Deserialize, Serialize}; use tendermint::abci; use crate::{ applications::{ ics29_fee::{ error::Error as FeeError, - events::{ - DistributeFeePacket, - IncentivizedPacket, - }, - }, - ics31_icq::{ - error::Error as QueryPacketError, - events::CrossChainQueryPacket, + events::{DistributeFeePacket, IncentivizedPacket}, }, + ics31_icq::{error::Error as QueryPacketError, events::CrossChainQueryPacket}, }, core::{ - ics02_client::{ - error as client_error, - events as ClientEvents, - events::NewBlock, - }, + ics02_client::{error as client_error, events as ClientEvents, events::NewBlock}, ics03_connection::{ - error as connection_error, - events as ConnectionEvents, + error as connection_error, events as ConnectionEvents, events::Attributes as ConnectionAttributes, }, ics04_channel::{ - error as channel_error, - events as ChannelEvents, - events::Attributes as ChannelAttributes, - packet::Packet, + error as channel_error, events as ChannelEvents, + events::Attributes as ChannelAttributes, packet::Packet, }, ics24_host::error::ValidationError, }, diff --git a/crates/relayer-types/src/mock/client_state.rs b/crates/relayer-types/src/mock/client_state.rs index 3d7c30c37a..ab36271537 100644 --- a/crates/relayer-types/src/mock/client_state.rs +++ b/crates/relayer-types/src/mock/client_state.rs @@ -1,28 +1,14 @@ use std::time::Duration; -use ibc_proto::{ - google::protobuf::Any, - ibc::mock::ClientState as RawMockClientState, - Protobuf, -}; -use serde::{ - Deserialize, - Serialize, -}; +use ibc_proto::{google::protobuf::Any, ibc::mock::ClientState as RawMockClientState, Protobuf}; +use serde::{Deserialize, Serialize}; use crate::{ core::{ - ics02_client::{ - client_state::ClientState, - client_type::ClientType, - error::Error, - }, + ics02_client::{client_state::ClientState, client_type::ClientType, error::Error}, ics24_host::identifier::ChainId, }, - mock::{ - consensus_state::MockConsensusState, - header::MockHeader, - }, + mock::{consensus_state::MockConsensusState, header::MockHeader}, Height, }; diff --git a/crates/relayer-types/src/mock/consensus_state.rs b/crates/relayer-types/src/mock/consensus_state.rs index 60558d00c4..cf3347338c 100644 --- a/crates/relayer-types/src/mock/consensus_state.rs +++ b/crates/relayer-types/src/mock/consensus_state.rs @@ -1,20 +1,11 @@ use ibc_proto::{ - google::protobuf::Any, - ibc::mock::ConsensusState as RawMockConsensusState, - Protobuf, -}; -use serde::{ - Deserialize, - Serialize, + google::protobuf::Any, ibc::mock::ConsensusState as RawMockConsensusState, Protobuf, }; +use serde::{Deserialize, Serialize}; use crate::{ core::{ - ics02_client::{ - client_type::ClientType, - consensus_state::ConsensusState, - error::Error, - }, + ics02_client::{client_type::ClientType, consensus_state::ConsensusState, error::Error}, ics23_commitment::commitment::CommitmentRoot, }, mock::header::MockHeader, diff --git a/crates/relayer-types/src/mock/header.rs b/crates/relayer-types/src/mock/header.rs index b202c7ca44..700fb168f7 100644 --- a/crates/relayer-types/src/mock/header.rs +++ b/crates/relayer-types/src/mock/header.rs @@ -1,25 +1,10 @@ -use std::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use std::fmt::{Display, Error as FmtError, Formatter}; -use ibc_proto::{ - google::protobuf::Any, - ibc::mock::Header as RawMockHeader, - Protobuf, -}; -use serde_derive::{ - Deserialize, - Serialize, -}; +use ibc_proto::{google::protobuf::Any, ibc::mock::Header as RawMockHeader, Protobuf}; +use serde_derive::{Deserialize, Serialize}; use crate::{ - core::ics02_client::{ - client_type::ClientType, - error::Error, - header::Header, - }, + core::ics02_client::{client_type::ClientType, error::Error, header::Header}, timestamp::Timestamp, Height, }; diff --git a/crates/relayer-types/src/mock/misbehaviour.rs b/crates/relayer-types/src/mock/misbehaviour.rs index bc33816f01..b53cfd667d 100644 --- a/crates/relayer-types/src/mock/misbehaviour.rs +++ b/crates/relayer-types/src/mock/misbehaviour.rs @@ -1,17 +1,8 @@ -use ibc_proto::{ - ibc::mock::Misbehaviour as RawMisbehaviour, - Protobuf, -}; -use serde::{ - Deserialize, - Serialize, -}; +use ibc_proto::{ibc::mock::Misbehaviour as RawMisbehaviour, Protobuf}; +use serde::{Deserialize, Serialize}; use crate::{ - core::{ - ics02_client::error::Error, - ics24_host::identifier::ClientId, - }, + core::{ics02_client::error::Error, ics24_host::identifier::ClientId}, mock::header::MockHeader, Height, }; diff --git a/crates/relayer-types/src/proofs.rs b/crates/relayer-types/src/proofs.rs index 30477d63d2..97a8795771 100644 --- a/crates/relayer-types/src/proofs.rs +++ b/crates/relayer-types/src/proofs.rs @@ -1,14 +1,8 @@ -use flex_error::{ - define_error, - TraceError, -}; +use flex_error::{define_error, TraceError}; use prost::EncodeError; use serde::Serialize; -use crate::{ - core::ics23_commitment::commitment::CommitmentProofBytes, - Height, -}; +use crate::{core::ics23_commitment::commitment::CommitmentProofBytes, Height}; define_error! { #[derive(Debug, PartialEq, Eq)] diff --git a/crates/relayer-types/src/serializers.rs b/crates/relayer-types/src/serializers.rs index f28d8456b2..e1eaea366c 100644 --- a/crates/relayer-types/src/serializers.rs +++ b/crates/relayer-types/src/serializers.rs @@ -1,11 +1,5 @@ -use serde::ser::{ - Serialize, - Serializer, -}; -use subtle_encoding::{ - Encoding, - Hex, -}; +use serde::ser::{Serialize, Serializer}; +use subtle_encoding::{Encoding, Hex}; pub fn ser_hex_upper(data: T, serializer: S) -> Result where @@ -18,17 +12,9 @@ where pub mod serde_string { - use core::{ - fmt::Display, - str::FromStr, - }; + use core::{fmt::Display, str::FromStr}; - use serde::{ - de, - Deserialize, - Deserializer, - Serializer, - }; + use serde::{de, Deserialize, Deserializer, Serializer}; pub fn serialize(value: &T, serializer: S) -> Result where diff --git a/crates/relayer-types/src/signer.rs b/crates/relayer-types/src/signer.rs index b0b6203812..e016850c7d 100644 --- a/crates/relayer-types/src/signer.rs +++ b/crates/relayer-types/src/signer.rs @@ -2,10 +2,7 @@ use std::str::FromStr; use derive_more::Display; use flex_error::define_error; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; define_error! { #[derive(Debug, PartialEq, Eq)] diff --git a/crates/relayer-types/src/test.rs b/crates/relayer-types/src/test.rs index f6ccd35d08..373a052929 100644 --- a/crates/relayer-types/src/test.rs +++ b/crates/relayer-types/src/test.rs @@ -1,9 +1,6 @@ use core::fmt::Debug; -use serde::{ - de::DeserializeOwned, - Serialize, -}; +use serde::{de::DeserializeOwned, Serialize}; /// Test that a struct `T` can be: /// diff --git a/crates/relayer-types/src/test_utils.rs b/crates/relayer-types/src/test_utils.rs index 733c479c5d..ea52217f22 100644 --- a/crates/relayer-types/src/test_utils.rs +++ b/crates/relayer-types/src/test_utils.rs @@ -1,9 +1,4 @@ -use tendermint::{ - block, - consensus, - evidence, - public_key::Algorithm, -}; +use tendermint::{block, consensus, evidence, public_key::Algorithm}; use crate::signer::Signer; diff --git a/crates/relayer-types/src/timestamp.rs b/crates/relayer-types/src/timestamp.rs index 767992abc4..a3f2950167 100644 --- a/crates/relayer-types/src/timestamp.rs +++ b/crates/relayer-types/src/timestamp.rs @@ -1,27 +1,14 @@ use std::{ - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, hash::Hash, num::ParseIntError, - ops::{ - Add, - Sub, - }, + ops::{Add, Sub}, str::FromStr, time::Duration, }; -use flex_error::{ - define_error, - TraceError, -}; -use serde_derive::{ - Deserialize, - Serialize, -}; +use flex_error::{define_error, TraceError}; +use serde_derive::{Deserialize, Serialize}; use tendermint::Time; use time::OffsetDateTime; @@ -254,11 +241,7 @@ mod tests { use test_log::test; use time::OffsetDateTime; - use super::{ - Expiry, - Timestamp, - ZERO_DURATION, - }; + use super::{Expiry, Timestamp, ZERO_DURATION}; #[test] fn test_timestamp_comparisons() { diff --git a/crates/relayer-types/src/tx_msg.rs b/crates/relayer-types/src/tx_msg.rs index 9e152f13f7..2608fe57c8 100644 --- a/crates/relayer-types/src/tx_msg.rs +++ b/crates/relayer-types/src/tx_msg.rs @@ -1,8 +1,5 @@ use ibc_proto::google::protobuf::Any; -use prost::{ - EncodeError, - Message, -}; +use prost::{EncodeError, Message}; use crate::core::ics24_host::error::ValidationError; diff --git a/crates/relayer-types/src/utils/pretty.rs b/crates/relayer-types/src/utils/pretty.rs index 975bec308d..b4b79a5dc1 100644 --- a/crates/relayer-types/src/utils/pretty.rs +++ b/crates/relayer-types/src/utils/pretty.rs @@ -1,17 +1,9 @@ use std::{ - fmt::{ - Debug, - Display, - Error as FmtError, - Formatter, - }, + fmt::{Debug, Display, Error as FmtError, Formatter}, time::Duration, }; -use tendermint::{ - block::signed_header::SignedHeader, - validator::Set as ValidatorSet, -}; +use tendermint::{block::signed_header::SignedHeader, validator::Set as ValidatorSet}; pub struct PrettyDuration<'a>(pub &'a Duration); @@ -89,10 +81,7 @@ impl<'a, T: Display> Display for PrettySlice<'a, T> { #[cfg(test)] mod tests { - use std::{ - string::String, - vec, - }; + use std::{string::String, vec}; use super::*; diff --git a/crates/relayer/src/account.rs b/crates/relayer/src/account.rs index 1e993fd8d1..8ee076ab6e 100644 --- a/crates/relayer/src/account.rs +++ b/crates/relayer/src/account.rs @@ -1,9 +1,6 @@ //! Data structures related to the accounts used by the relayer. -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; /// The balance for a specific denom #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/crates/relayer/src/cache.rs b/crates/relayer/src/cache.rs index b8021e197c..b31dc139c5 100644 --- a/crates/relayer/src/cache.rs +++ b/crates/relayer/src/cache.rs @@ -3,20 +3,13 @@ //! Utilizes the [`moka`](https://docs.rs/moka) crate, which provides full //! concurrency of retrievals and a high expected concurrency for updates. use core::fmt::Formatter; -use std::{ - fmt, - time::Duration, -}; +use std::{fmt, time::Duration}; use ibc_relayer_types::core::{ ics02_client::height::Height, ics03_connection::connection::ConnectionEnd, ics04_channel::channel::ChannelEnd, - ics24_host::identifier::{ - ClientId, - ConnectionId, - PortChannelId, - }, + ics24_host::identifier::{ClientId, ConnectionId, PortChannelId}, }; use moka::sync::Cache as MokaCache; diff --git a/crates/relayer/src/chain/astria/endpoint.rs b/crates/relayer/src/chain/astria/endpoint.rs index e4bebbde63..b2daed7b47 100644 --- a/crates/relayer/src/chain/astria/endpoint.rs +++ b/crates/relayer/src/chain/astria/endpoint.rs @@ -1,14 +1,8 @@ use alloc::sync::Arc; -use std::{ - str::FromStr as _, - time::Duration, -}; +use std::{str::FromStr as _, time::Duration}; use ibc_proto::ibc::{ - apps::fee::v1::{ - QueryIncentivizedPacketRequest, - QueryIncentivizedPacketResponse, - }, + apps::fee::v1::{QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse}, core::{ channel::v1::query_client::QueryClient as IbcChannelQueryClient, client::v1::query_client::QueryClient as IbcClientQueryClient, @@ -19,36 +13,17 @@ use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, clients::ics07_tendermint::{ client_state::ClientState as TendermintClientState, - consensus_state::ConsensusState as TendermintConsensusState, - header::Header, + consensus_state::ConsensusState as TendermintConsensusState, header::Header, }, core::{ - ics02_client::{ - client_type::ClientType, - events::UpdateClient, - }, - ics03_connection::connection::{ - ConnectionEnd, - IdentifiedConnectionEnd, - }, + ics02_client::{client_type::ClientType, events::UpdateClient}, + ics03_connection::connection::{ConnectionEnd, IdentifiedConnectionEnd}, ics04_channel::{ - channel::{ - ChannelEnd, - IdentifiedChannelEnd, - }, + channel::{ChannelEnd, IdentifiedChannelEnd}, packet::Sequence, }, - ics23_commitment::{ - commitment::CommitmentPrefix, - merkle::MerkleProof, - }, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, - }, + ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, signer::Signer, Height as ICSHeight, @@ -58,12 +33,8 @@ use tendermint::time::Time as TmTime; use tendermint_light_client::verifier::types::LightBlock; use tendermint_rpc::{ client::CompatMode, - endpoint::{ - broadcast::tx_sync::Response as TxResponse, - status, - }, - Client as _, - HttpClient, + endpoint::{broadcast::tx_sync::Response as TxResponse, status}, + Client as _, HttpClient, }; use tokio::runtime::Runtime as TokioRuntime; use tonic::IntoRequest; @@ -72,47 +43,25 @@ use tracing::warn; use crate::{ account::Balance, chain::{ - astria::utils::{ - decode_merkle_proof, - response_to_tx_sync_result, - }, + astria::utils::{decode_merkle_proof, response_to_tx_sync_result}, client::ClientSettings, - cosmos::{ - version::Specs, - wait::wait_for_block_commits, - }, - endpoint::{ - ChainEndpoint, - ChainStatus, - HealthCheck, - }, + cosmos::{version::Specs, wait::wait_for_block_commits}, + endpoint::{ChainEndpoint, ChainStatus, HealthCheck}, handle::Subscription, requests::*, tracking::TrackedMsgs, }, - client_state::{ - AnyClientState, - IdentifiedAnyClientState, - }, + client_state::{AnyClientState, IdentifiedAnyClientState}, config::ChainConfig, consensus_state::AnyConsensusState, denom::DenomTrace, error::Error, event::{ - source::{ - EventSource, - TxEventSourceCmd, - }, + source::{EventSource, TxEventSourceCmd}, IbcEventWithHeight, }, - keyring::{ - Ed25519KeyPair, - KeyRing, - }, - light_client::{ - tendermint::LightClient, - LightClient as _, - }, + keyring::{Ed25519KeyPair, KeyRing}, + light_client::{tendermint::LightClient, LightClient as _}, misbehaviour::MisbehaviourEvidence, }; @@ -231,17 +180,11 @@ impl AstriaEndpoint { async fn broadcast_messages(&mut self, tracked_msgs: TrackedMsgs) -> Result { use astria_core::{ - crypto::{ - SigningKey, - VerificationKey, - }, + crypto::{SigningKey, VerificationKey}, generated::protocol::transactions::v1alpha1::Ics20Withdrawal as RawIcs20Withdrawal, primitive::v1::Address, protocol::transaction::v1alpha1::{ - action::Ics20Withdrawal, - Action, - TransactionParams, - UnsignedTransaction, + action::Ics20Withdrawal, Action, TransactionParams, UnsignedTransaction, }, Protobuf as _, }; @@ -599,14 +542,8 @@ impl ChainEndpoint for AstriaEndpoint { _key_name: Option<&str>, denom: Option<&str>, ) -> Result { - use astria_core::{ - crypto::VerificationKey, - protocol::account::v1alpha1::AssetBalance, - }; - use astria_sequencer_client::{ - Address, - SequencerClientExt as _, - }; + use astria_core::{crypto::VerificationKey, protocol::account::v1alpha1::AssetBalance}; + use astria_sequencer_client::{Address, SequencerClientExt as _}; let signing_key: ed25519_consensus::SigningKey = (*self.get_key()?.signing_key().as_bytes()).into(); // TODO cache this @@ -680,10 +617,7 @@ impl ChainEndpoint for AstriaEndpoint { &self, request: QueryClientStatesRequest, ) -> Result, Error> { - use crate::{ - chain::cosmos::client_id_suffix, - util::pretty::PrettyIdentifiedClientState, - }; + use crate::{chain::cosmos::client_id_suffix, util::pretty::PrettyIdentifiedClientState}; let mut client = self.ibc_client_grpc_client.clone(); @@ -1379,10 +1313,7 @@ impl ChainEndpoint for AstriaEndpoint { mut request: QueryPacketEventDataRequest, ) -> Result, Error> { use crate::chain::cosmos::{ - query::tx::{ - query_packets_from_block, - query_packets_from_txs, - }, + query::tx::{query_packets_from_block, query_packets_from_txs}, sort_events_by_sequence, }; diff --git a/crates/relayer/src/chain/astria/utils.rs b/crates/relayer/src/chain/astria/utils.rs index c3696eee9e..abcb37d445 100644 --- a/crates/relayer/src/chain/astria/utils.rs +++ b/crates/relayer/src/chain/astria/utils.rs @@ -1,15 +1,11 @@ use ibc_relayer_types::core::{ - ics23_commitment::merkle::MerkleProof, - ics24_host::identifier::ChainId, + ics23_commitment::merkle::MerkleProof, ics24_host::identifier::ChainId, }; use ibc_types::DomainType as _; use tendermint_rpc::endpoint::broadcast::tx_sync::Response; use crate::{ - chain::cosmos::types::tx::{ - TxStatus, - TxSyncResult, - }, + chain::cosmos::types::tx::{TxStatus, TxSyncResult}, error::Error, event::IbcEventWithHeight, }; diff --git a/crates/relayer/src/chain/client.rs b/crates/relayer/src/chain/client.rs index 8b6df2ea71..18cb000139 100644 --- a/crates/relayer/src/chain/client.rs +++ b/crates/relayer/src/chain/client.rs @@ -1,10 +1,6 @@ //! Data structures and logic to set up IBC client's parameters. -use crate::{ - chain::cosmos, - config::ChainConfig, - foreign_client::CreateOptions, -}; +use crate::{chain::cosmos, config::ChainConfig, foreign_client::CreateOptions}; /// Client parameters for the `build_create_client` operation. /// diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index e89224f7b5..458767c929 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -1,88 +1,44 @@ use alloc::sync::Arc; use core::{ - convert::{ - TryFrom, - TryInto, - }, + convert::{TryFrom, TryInto}, future::Future, str::FromStr, time::Duration, }; -use std::{ - cmp::Ordering, - thread, -}; +use std::{cmp::Ordering, thread}; -use bytes::{ - Buf, - Bytes, -}; +use bytes::{Buf, Bytes}; use futures::future::join_all; use ibc_proto::{ - cosmos::{ - base::node::v1beta1::ConfigResponse, - staking::v1beta1::Params as StakingParams, - }, - ibc::apps::fee::v1::{ - QueryIncentivizedPacketRequest, - QueryIncentivizedPacketResponse, - }, + cosmos::{base::node::v1beta1::ConfigResponse, staking::v1beta1::Params as StakingParams}, + ibc::apps::fee::v1::{QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse}, interchain_security::ccv::v1::ConsumerParams as CcvConsumerParams, Protobuf, }; use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, clients::ics07_tendermint::{ - client_state::{ - AllowUpdate, - ClientState as TmClientState, - }, + client_state::{AllowUpdate, ClientState as TmClientState}, consensus_state::ConsensusState as TmConsensusState, header::Header as TmHeader, }, core::{ ics02_client::{ - client_type::ClientType, - error::Error as ClientError, - events::UpdateClient, - }, - ics03_connection::connection::{ - ConnectionEnd, - IdentifiedConnectionEnd, + client_type::ClientType, error::Error as ClientError, events::UpdateClient, }, + ics03_connection::connection::{ConnectionEnd, IdentifiedConnectionEnd}, ics04_channel::{ - channel::{ - ChannelEnd, - IdentifiedChannelEnd, - }, + channel::{ChannelEnd, IdentifiedChannelEnd}, packet::Sequence, }, - ics23_commitment::{ - commitment::CommitmentPrefix, - merkle::MerkleProof, - }, + ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, ics24_host::{ - identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, - }, + identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, path::{ - AcksPath, - ChannelEndsPath, - ClientConsensusStatePath, - ClientStatePath, - CommitmentsPath, - ConnectionsPath, - ReceiptsPath, - SeqRecvsPath, + AcksPath, ChannelEndsPath, ClientConsensusStatePath, ClientStatePath, + CommitmentsPath, ConnectionsPath, ReceiptsPath, SeqRecvsPath, }, - ClientUpgradePath, - Path, - IBC_QUERY_PATH, - SDK_UPGRADE_QUERY_PATH, + ClientUpgradePath, Path, IBC_QUERY_PATH, SDK_UPGRADE_QUERY_PATH, }, }, signer::Signer, @@ -91,75 +47,44 @@ use ibc_relayer_types::{ use num_bigint::BigInt; use tendermint::{ block::Height as TmHeight, - node::{ - self, - info::TxIndexStatus, - }, + node::{self, info::TxIndexStatus}, time::Time as TmTime, }; use tendermint_light_client::verifier::types::LightBlock as TmLightBlock; use tendermint_rpc::{ client::CompatMode, - endpoint::{ - broadcast::tx_sync::Response, - status, - }, - Client, - HttpClient, - Order, + endpoint::{broadcast::tx_sync::Response, status}, + Client, HttpClient, Order, }; use tokio::runtime::Runtime as TokioRuntime; -use tonic::{ - codegen::http::Uri, - metadata::AsciiMetadataValue, -}; -use tracing::{ - debug, - error, - info, - instrument, - trace, - warn, -}; +use tonic::{codegen::http::Uri, metadata::AsciiMetadataValue}; +use tracing::{debug, error, info, instrument, trace, warn}; -use self::{ - types::app_state::GenesisAppState, - version::Specs, -}; +use self::{types::app_state::GenesisAppState, version::Specs}; use crate::{ account::Balance, chain::{ client::ClientSettings, cosmos::{ batch::{ - send_batched_messages_and_wait_check_tx, - send_batched_messages_and_wait_commit, + send_batched_messages_and_wait_check_tx, send_batched_messages_and_wait_commit, sequential_send_batched_messages_and_wait_commit, }, encode::key_pair_to_signer, fee::maybe_register_counterparty_payee, - gas::{ - calculate_fee, - mul_ceil, - }, + gas::{calculate_fee, mul_ceil}, query::{ abci_query, account::get_or_fetch_account, - balance::{ - query_all_balances, - query_balance, - }, + balance::{query_all_balances, query_balance}, consensus_state::query_consensus_state_heights, custom::cross_chain_query_via_rpc, denom_trace::query_denom_trace, fee::query_incentivized_packet, - fetch_version_specs, - packet_query, + fetch_version_specs, packet_query, status::query_status, tx::{ - filter_matching_event, - query_packets_from_block, - query_packets_from_txs, + filter_matching_event, query_packets_from_block, query_packets_from_txs, query_txs, }, QueryResponse, @@ -167,59 +92,30 @@ use crate::{ types::{ account::Account, config::TxConfig, - gas::{ - default_gas_from_config, - gas_multiplier_from_config, - max_gas_from_config, - }, + gas::{default_gas_from_config, gas_multiplier_from_config, max_gas_from_config}, }, }, - endpoint::{ - ChainEndpoint, - ChainStatus, - HealthCheck, - }, + endpoint::{ChainEndpoint, ChainStatus, HealthCheck}, handle::Subscription, requests::*, tracking::TrackedMsgs, }, - client_state::{ - AnyClientState, - IdentifiedAnyClientState, - }, - config::{ - parse_gas_prices, - ChainConfig, - Error as ConfigError, - GasPrice, - }, + client_state::{AnyClientState, IdentifiedAnyClientState}, + config::{parse_gas_prices, ChainConfig, Error as ConfigError, GasPrice}, consensus_state::AnyConsensusState, denom::DenomTrace, error::Error, event::{ - source::{ - EventSource, - TxEventSourceCmd, - }, + source::{EventSource, TxEventSourceCmd}, IbcEventWithHeight, }, - keyring::{ - KeyRing, - Secp256k1KeyPair, - SigningKeyPair, - }, - light_client::{ - tendermint::LightClient as TmLightClient, - LightClient, - Verified, - }, + keyring::{KeyRing, Secp256k1KeyPair, SigningKeyPair}, + light_client::{tendermint::LightClient as TmLightClient, LightClient, Verified}, misbehaviour::MisbehaviourEvidence, util::{ compat_mode::compat_mode_from_version, pretty::{ - PrettyIdentifiedChannel, - PrettyIdentifiedClientState, - PrettyIdentifiedConnection, + PrettyIdentifiedChannel, PrettyIdentifiedClientState, PrettyIdentifiedConnection, }, }, }; @@ -2540,24 +2436,15 @@ fn do_health_check(chain: &CosmosSdkChain) -> Result<(), Error> { #[cfg(test)] mod tests { use ibc_relayer_types::{ - core::{ - ics02_client::client_type::ClientType, - ics24_host::identifier::ClientId, - }, - mock::{ - client_state::MockClientState, - header::MockHeader, - }, + core::{ics02_client::client_type::ClientType, ics24_host::identifier::ClientId}, + mock::{client_state::MockClientState, header::MockHeader}, Height, }; use super::calculate_fee; use crate::{ chain::cosmos::client_id_suffix, - client_state::{ - AnyClientState, - IdentifiedAnyClientState, - }, + client_state::{AnyClientState, IdentifiedAnyClientState}, config::GasPrice, }; diff --git a/crates/relayer/src/chain/cosmos/batch.rs b/crates/relayer/src/chain/cosmos/batch.rs index 0b2c89fca1..6e8ce857bb 100644 --- a/crates/relayer/src/chain/cosmos/batch.rs +++ b/crates/relayer/src/chain/cosmos/batch.rs @@ -1,16 +1,9 @@ use core::mem; use ibc_proto::google::protobuf::Any; -use ibc_relayer_types::{ - core::ics24_host::identifier::ChainId, - events::IbcEvent, - Height, -}; +use ibc_relayer_types::{core::ics24_host::identifier::ChainId, events::IbcEvent, Height}; use prost::Message; -use tendermint_rpc::{ - endpoint::broadcast::tx_sync::Response, - HttpClient, -}; +use tendermint_rpc::{endpoint::broadcast::tx_sync::Response, HttpClient}; use tracing::debug; use crate::{ @@ -21,10 +14,7 @@ use crate::{ types::{ account::Account, config::TxConfig, - tx::{ - TxStatus, - TxSyncResult, - }, + tx::{TxStatus, TxSyncResult}, }, wait::wait_for_block_commits, }, @@ -333,27 +323,13 @@ mod tests { encode::sign_and_encode_tx, gas::gas_amount_to_fee, types::{ - account::{ - Account, - AccountAddress, - AccountNumber, - AccountSequence, - }, + account::{Account, AccountAddress, AccountNumber, AccountSequence}, config::TxConfig, }, }, config, - config::types::{ - MaxMsgNum, - MaxTxSize, - Memo, - }, - keyring::{ - self, - KeyRing, - Secp256k1KeyPair, - SigningKeyPair, - }, + config::types::{MaxMsgNum, MaxTxSize, Memo}, + keyring::{self, KeyRing, Secp256k1KeyPair, SigningKeyPair}, }; const COSMOS_HD_PATH: &str = "m/44'/118'/0'/0/0"; diff --git a/crates/relayer/src/chain/cosmos/client.rs b/crates/relayer/src/chain/cosmos/client.rs index dfae496fe0..4f9a35fcaf 100644 --- a/crates/relayer/src/chain/cosmos/client.rs +++ b/crates/relayer/src/chain/cosmos/client.rs @@ -6,8 +6,7 @@ use ibc_relayer_types::core::ics02_client::trust_threshold::TrustThreshold; use tracing::warn; use crate::{ - chain::cosmos::config::CosmosSdkConfig, - foreign_client::CreateOptions, + chain::cosmos::config::CosmosSdkConfig, foreign_client::CreateOptions, util::pretty::PrettyDuration, }; diff --git a/crates/relayer/src/chain/cosmos/config.rs b/crates/relayer/src/chain/cosmos/config.rs index c64e8e0503..61e7e934dc 100644 --- a/crates/relayer/src/chain/cosmos/config.rs +++ b/crates/relayer/src/chain/cosmos/config.rs @@ -3,13 +3,9 @@ use std::path::PathBuf; use byte_unit::Byte; use ibc_relayer_types::core::{ - ics23_commitment::specs::ProofSpecs, - ics24_host::identifier::ChainId, -}; -use serde_derive::{ - Deserialize, - Serialize, + ics23_commitment::specs::ProofSpecs, ics24_host::identifier::ChainId, }; +use serde_derive::{Deserialize, Serialize}; use tendermint_rpc::Url; use crate::{ @@ -19,18 +15,8 @@ use crate::{ compat_mode::CompatMode, default, gas_multiplier::GasMultiplier, - types::{ - MaxMsgNum, - MaxTxSize, - Memo, - TrustThreshold, - }, - AddressType, - EventSourceMode, - ExtensionOption, - GasPrice, - GenesisRestart, - PacketFilter, + types::{MaxMsgNum, MaxTxSize, Memo, TrustThreshold}, + AddressType, EventSourceMode, ExtensionOption, GasPrice, GenesisRestart, PacketFilter, RefreshRate, }, keyring::Store, diff --git a/crates/relayer/src/chain/cosmos/config/error.rs b/crates/relayer/src/chain/cosmos/config/error.rs index 9500fce21b..efcf9e55cb 100644 --- a/crates/relayer/src/chain/cosmos/config/error.rs +++ b/crates/relayer/src/chain/cosmos/config/error.rs @@ -1,7 +1,6 @@ use flex_error::define_error; use ibc_relayer_types::core::{ - ics02_client::trust_threshold::TrustThreshold, - ics24_host::identifier::ChainId, + ics02_client::trust_threshold::TrustThreshold, ics24_host::identifier::ChainId, }; define_error! { diff --git a/crates/relayer/src/chain/cosmos/encode.rs b/crates/relayer/src/chain/cosmos/encode.rs index 615a0e2121..e77651de6b 100644 --- a/crates/relayer/src/chain/cosmos/encode.rs +++ b/crates/relayer/src/chain/cosmos/encode.rs @@ -1,30 +1,15 @@ use core::str::FromStr; -use bech32::{ - ToBase32, - Variant, -}; +use bech32::{ToBase32, Variant}; use ibc_proto::{ cosmos::tx::v1beta1::{ - mode_info::{ - Single, - Sum, - }, - AuthInfo, - Fee, - ModeInfo, - SignDoc, - SignerInfo, - TxBody, - TxRaw, + mode_info::{Single, Sum}, + AuthInfo, Fee, ModeInfo, SignDoc, SignerInfo, TxBody, TxRaw, }, google::protobuf::Any, }; use ibc_relayer_types::{ - core::{ - ics02_client::error::Error as ClientError, - ics24_host::identifier::ChainId, - }, + core::{ics02_client::error::Error as ClientError, ics24_host::identifier::ChainId}, signer::Signer, }; use prost::Message; @@ -32,23 +17,13 @@ use tendermint::account::Id as AccountId; use crate::{ chain::cosmos::types::{ - account::{ - Account, - AccountNumber, - AccountSequence, - }, + account::{Account, AccountNumber, AccountSequence}, config::TxConfig, tx::SignedTx, }, - config::{ - types::Memo, - AddressType, - }, + config::{types::Memo, AddressType}, error::Error, - keyring::{ - Secp256k1KeyPair, - SigningKeyPair, - }, + keyring::{Secp256k1KeyPair, SigningKeyPair}, }; pub fn sign_and_encode_tx( diff --git a/crates/relayer/src/chain/cosmos/estimate.rs b/crates/relayer/src/chain/cosmos/estimate.rs index 4ce084bda1..58d5f915bd 100644 --- a/crates/relayer/src/chain/cosmos/estimate.rs +++ b/crates/relayer/src/chain/cosmos/estimate.rs @@ -1,30 +1,17 @@ use ibc_proto::{ - cosmos::tx::v1beta1::{ - Fee, - Tx, - }, + cosmos::tx::v1beta1::{Fee, Tx}, google::protobuf::Any, }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use tonic::codegen::http::Uri; -use tracing::{ - debug, - error, - span, - warn, - Level, -}; +use tracing::{debug, error, span, warn, Level}; use crate::{ chain::cosmos::{ encode::sign_tx, gas::gas_amount_to_fee, simulate::send_tx_simulate, - types::{ - account::Account, - config::TxConfig, - gas::GasConfig, - }, + types::{account::Account, config::TxConfig, gas::GasConfig}, }, config::types::Memo, error::Error, diff --git a/crates/relayer/src/chain/cosmos/fee.rs b/crates/relayer/src/chain/cosmos/fee.rs index 9f6e635b7b..d9ad1c72ac 100644 --- a/crates/relayer/src/chain/cosmos/fee.rs +++ b/crates/relayer/src/chain/cosmos/fee.rs @@ -1,32 +1,20 @@ use ibc_relayer_types::{ applications::ics29_fee::msgs::register_payee::build_register_counterparty_payee_message, - core::ics24_host::identifier::{ - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChannelId, PortId}, signer::Signer, }; use tendermint_rpc::HttpClient; use crate::{ chain::cosmos::{ - query::{ - account::get_or_fetch_account, - fee::query_counterparty_payee, - }, + query::{account::get_or_fetch_account, fee::query_counterparty_payee}, retry::send_tx_with_account_sequence_retry, - types::{ - account::Account, - config::TxConfig, - }, + types::{account::Account, config::TxConfig}, wait::wait_tx_succeed, }, config::types::Memo, error::Error, - keyring::{ - Secp256k1KeyPair, - SigningKeyPair, - }, + keyring::{Secp256k1KeyPair, SigningKeyPair}, }; // FIXME: monster function, refactor diff --git a/crates/relayer/src/chain/cosmos/gas.rs b/crates/relayer/src/chain/cosmos/gas.rs index 78341cd075..8e5a36421f 100644 --- a/crates/relayer/src/chain/cosmos/gas.rs +++ b/crates/relayer/src/chain/cosmos/gas.rs @@ -1,16 +1,10 @@ use core::cmp::min; -use ibc_proto::cosmos::{ - base::v1beta1::Coin, - tx::v1beta1::Fee, -}; +use ibc_proto::cosmos::{base::v1beta1::Coin, tx::v1beta1::Fee}; use num_bigint::BigInt; use num_rational::BigRational; -use crate::{ - chain::cosmos::types::gas::GasConfig, - config::GasPrice, -}; +use crate::{chain::cosmos::types::gas::GasConfig, config::GasPrice}; pub fn gas_amount_to_fee(config: &GasConfig, gas_amount: u64) -> Fee { let adjusted_gas_limit = adjust_estimated_gas(AdjustGas { @@ -103,10 +97,7 @@ fn adjust_estimated_gas( #[cfg(test)] mod tests { - use super::{ - adjust_estimated_gas, - AdjustGas, - }; + use super::{adjust_estimated_gas, AdjustGas}; #[test] fn adjust_zero_gas() { diff --git a/crates/relayer/src/chain/cosmos/query.rs b/crates/relayer/src/chain/cosmos/query.rs index 48d3137a71..d9187cb4bd 100644 --- a/crates/relayer/src/chain/cosmos/query.rs +++ b/crates/relayer/src/chain/cosmos/query.rs @@ -1,32 +1,19 @@ use http::uri::Uri; use ibc_proto::cosmos::base::tendermint::v1beta1::{ - service_client::ServiceClient, - GetNodeInfoRequest, + service_client::ServiceClient, GetNodeInfoRequest, }; use ibc_relayer_types::core::{ ics04_channel::packet::Sequence, - ics23_commitment::merkle::{ - convert_tm_to_ics_merkle_proof, - MerkleProof, - }, + ics23_commitment::merkle::{convert_tm_to_ics_merkle_proof, MerkleProof}, ics24_host::identifier::ChainId, }; use tendermint::block::Height; -use tendermint_rpc::{ - query::Query, - Client, - HttpClient, - Url, -}; +use tendermint_rpc::{query::Query, Client, HttpClient, Url}; use crate::{ chain::{ cosmos::version::Specs, - requests::{ - QueryClientEventRequest, - QueryPacketEventDataRequest, - QueryTxHash, - }, + requests::{QueryClientEventRequest, QueryPacketEventDataRequest, QueryTxHash}, }, error::Error, }; diff --git a/crates/relayer/src/chain/cosmos/query/account.rs b/crates/relayer/src/chain/cosmos/query/account.rs index 5a72a77bd6..8cdece29c7 100644 --- a/crates/relayer/src/chain/cosmos/query/account.rs +++ b/crates/relayer/src/chain/cosmos/query/account.rs @@ -1,17 +1,12 @@ use http::uri::Uri; use ibc_proto::cosmos::auth::v1beta1::{ - query_client::QueryClient, - BaseAccount, - EthAccount, - QueryAccountRequest, + query_client::QueryClient, BaseAccount, EthAccount, QueryAccountRequest, }; use prost::Message; use tracing::info; use crate::{ - chain::cosmos::types::account::Account, - config::default::max_grpc_decoding_size, - error::Error, + chain::cosmos::types::account::Account, config::default::max_grpc_decoding_size, error::Error, }; /// Get a `&mut Account` from an `&mut Option` if it is `Some(Account)`. diff --git a/crates/relayer/src/chain/cosmos/query/balance.rs b/crates/relayer/src/chain/cosmos/query/balance.rs index 265fde4350..7a2d559e97 100644 --- a/crates/relayer/src/chain/cosmos/query/balance.rs +++ b/crates/relayer/src/chain/cosmos/query/balance.rs @@ -1,15 +1,9 @@ use http::uri::Uri; use ibc_proto::cosmos::bank::v1beta1::{ - query_client::QueryClient, - QueryAllBalancesRequest, - QueryBalanceRequest, + query_client::QueryClient, QueryAllBalancesRequest, QueryBalanceRequest, }; -use crate::{ - account::Balance, - config::default::max_grpc_decoding_size, - error::Error, -}; +use crate::{account::Balance, config::default::max_grpc_decoding_size, error::Error}; /// Uses the GRPC client to retrieve the account balance for a specific denom pub async fn query_balance( diff --git a/crates/relayer/src/chain/cosmos/query/consensus_state.rs b/crates/relayer/src/chain/cosmos/query/consensus_state.rs index b586b83229..0975ea4a11 100644 --- a/crates/relayer/src/chain/cosmos/query/consensus_state.rs +++ b/crates/relayer/src/chain/cosmos/query/consensus_state.rs @@ -1,25 +1,13 @@ use http::Uri; -use ibc_relayer_types::{ - core::ics24_host::identifier::ChainId, - Height, -}; -use tracing::{ - debug, - warn, -}; +use ibc_relayer_types::{core::ics24_host::identifier::ChainId, Height}; +use tracing::{debug, warn}; use crate::{ - chain::requests::{ - QueryConsensusStateHeightsRequest, - QueryConsensusStatesRequest, - }, + chain::requests::{QueryConsensusStateHeightsRequest, QueryConsensusStatesRequest}, config::default::max_grpc_decoding_size, consensus_state::AnyConsensusStateWithHeight, error::Error, - util::pretty::{ - PrettyConsensusStateWithHeight, - PrettyHeight, - }, + util::pretty::{PrettyConsensusStateWithHeight, PrettyHeight}, }; /// Performs a `QueryConsensusStateHeightsRequest` gRPC query to fetch all the consensus state diff --git a/crates/relayer/src/chain/cosmos/query/custom.rs b/crates/relayer/src/chain/cosmos/query/custom.rs index 79557099c9..c1faa20395 100644 --- a/crates/relayer/src/chain/cosmos/query/custom.rs +++ b/crates/relayer/src/chain/cosmos/query/custom.rs @@ -1,17 +1,10 @@ use hex; use ibc_relayer_types::applications::ics31_icq::{ - error::Error as CrossChainQueryError, - response::CrossChainQueryResponse, -}; -use tendermint_rpc::{ - Client, - HttpClient, + error::Error as CrossChainQueryError, response::CrossChainQueryResponse, }; +use tendermint_rpc::{Client, HttpClient}; -use crate::{ - chain::requests::CrossChainQueryRequest, - error::Error, -}; +use crate::{chain::requests::CrossChainQueryRequest, error::Error}; pub async fn cross_chain_query_via_rpc( client: &HttpClient, diff --git a/crates/relayer/src/chain/cosmos/query/denom_trace.rs b/crates/relayer/src/chain/cosmos/query/denom_trace.rs index 1b3e1f85b6..259b65f4c3 100644 --- a/crates/relayer/src/chain/cosmos/query/denom_trace.rs +++ b/crates/relayer/src/chain/cosmos/query/denom_trace.rs @@ -1,14 +1,9 @@ use http::uri::Uri; use ibc_proto::ibc::applications::transfer::v1::{ - query_client::QueryClient, - QueryDenomTraceRequest, + query_client::QueryClient, QueryDenomTraceRequest, }; -use crate::{ - config::default::max_grpc_decoding_size, - denom::DenomTrace, - error::Error, -}; +use crate::{config::default::max_grpc_decoding_size, denom::DenomTrace, error::Error}; // Uses the GRPC client to retrieve the denom trace for a specific hash pub async fn query_denom_trace(grpc_address: &Uri, hash: &str) -> Result { diff --git a/crates/relayer/src/chain/cosmos/query/fee.rs b/crates/relayer/src/chain/cosmos/query/fee.rs index 317f5ba518..9be3798d57 100644 --- a/crates/relayer/src/chain/cosmos/query/fee.rs +++ b/crates/relayer/src/chain/cosmos/query/fee.rs @@ -1,29 +1,19 @@ use http::uri::Uri; use ibc_proto::ibc::{ applications::fee::v1::{ - query_client::QueryClient, - QueryCounterpartyPayeeRequest, + query_client::QueryClient, QueryCounterpartyPayeeRequest, QueryIncentivizedPacketsForChannelRequest, }, - apps::fee::v1::{ - QueryIncentivizedPacketRequest, - QueryIncentivizedPacketResponse, - }, + apps::fee::v1::{QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse}, }; use ibc_relayer_types::{ applications::ics29_fee::packet_fee::IdentifiedPacketFees, - core::ics24_host::identifier::{ - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChannelId, PortId}, signer::Signer, }; use tonic::Code; -use crate::{ - config::default::max_grpc_decoding_size, - error::Error, -}; +use crate::{config::default::max_grpc_decoding_size, error::Error}; pub async fn query_counterparty_payee( grpc_address: &Uri, diff --git a/crates/relayer/src/chain/cosmos/query/status.rs b/crates/relayer/src/chain/cosmos/query/status.rs index 532a170ef3..5da1a83bc1 100644 --- a/crates/relayer/src/chain/cosmos/query/status.rs +++ b/crates/relayer/src/chain/cosmos/query/status.rs @@ -1,17 +1,7 @@ -use ibc_relayer_types::{ - core::ics24_host::identifier::ChainId, - Height, -}; -use tendermint_rpc::{ - Client, - HttpClient, - Url, -}; +use ibc_relayer_types::{core::ics24_host::identifier::ChainId, Height}; +use tendermint_rpc::{Client, HttpClient, Url}; -use crate::{ - chain::endpoint::ChainStatus, - error::Error, -}; +use crate::{chain::endpoint::ChainStatus, error::Error}; /// Query the chain status via an RPC query. /// diff --git a/crates/relayer/src/chain/cosmos/query/tx.rs b/crates/relayer/src/chain/cosmos/query/tx.rs index 859f69f7f0..9a23cdbb88 100644 --- a/crates/relayer/src/chain/cosmos/query/tx.rs +++ b/crates/relayer/src/chain/cosmos/query/tx.rs @@ -1,51 +1,29 @@ use ibc_relayer_types::{ core::{ ics02_client::height::Height, - ics04_channel::packet::{ - Packet, - Sequence, - }, + ics04_channel::packet::{Packet, Sequence}, ics24_host::identifier::ChainId, }, events::IbcEvent, Height as ICSHeight, }; -use tendermint::{ - abci::Event, - Hash as TxHash, -}; -use tendermint_rpc::{ - endpoint::tx::Response as TxResponse, - Client, - HttpClient, - Order, - Url, -}; +use tendermint::{abci::Event, Hash as TxHash}; +use tendermint_rpc::{endpoint::tx::Response as TxResponse, Client, HttpClient, Order, Url}; use tracing::warn; use crate::{ chain::{ cosmos::{ - query::{ - header_query, - packet_query, - tx_hash_query, - }, + query::{header_query, packet_query, tx_hash_query}, types::events, }, requests::{ - QueryClientEventRequest, - QueryHeight, - QueryPacketEventDataRequest, - QueryTxHash, + QueryClientEventRequest, QueryHeight, QueryPacketEventDataRequest, QueryTxHash, QueryTxRequest, }, }, error::Error, - event::{ - ibc_event_try_from_abci_event, - IbcEventWithHeight, - }, + event::{ibc_event_try_from_abci_event, IbcEventWithHeight}, }; /// This function queries transactions for events matching certain criteria. diff --git a/crates/relayer/src/chain/cosmos/retry.rs b/crates/relayer/src/chain/cosmos/retry.rs index 7dfb3fac5b..aaf4753d56 100644 --- a/crates/relayer/src/chain/cosmos/retry.rs +++ b/crates/relayer/src/chain/cosmos/retry.rs @@ -3,35 +3,20 @@ use std::thread; use ibc_proto::google::protobuf::Any; use tendermint::abci::Code; -use tendermint_rpc::{ - endpoint::broadcast::tx_sync::Response, - HttpClient, -}; -use tracing::{ - debug, - error, - instrument, - warn, -}; +use tendermint_rpc::{endpoint::broadcast::tx_sync::Response, HttpClient}; +use tracing::{debug, error, instrument, warn}; use crate::{ chain::cosmos::{ query::account::refresh_account, tx::estimate_fee_and_send_tx, - types::{ - account::Account, - config::TxConfig, - }, + types::{account::Account, config::TxConfig}, }, config::types::Memo, error::Error, - keyring::{ - Secp256k1KeyPair, - SigningKeyPair, - }, + keyring::{Secp256k1KeyPair, SigningKeyPair}, sdk_error::sdk_error_from_tx_sync_error_code, - telemetry, - time, + telemetry, time, }; // Delay in milliseconds before retrying in the case of account sequence mismatch. diff --git a/crates/relayer/src/chain/cosmos/simulate.rs b/crates/relayer/src/chain/cosmos/simulate.rs index ec6abbceb7..24803fd3a3 100644 --- a/crates/relayer/src/chain/cosmos/simulate.rs +++ b/crates/relayer/src/chain/cosmos/simulate.rs @@ -1,15 +1,9 @@ use ibc_proto::cosmos::tx::v1beta1::{ - service_client::ServiceClient, - SimulateRequest, - SimulateResponse, - Tx, + service_client::ServiceClient, SimulateRequest, SimulateResponse, Tx, }; use tonic::codegen::http::Uri; -use crate::{ - config::default::max_grpc_decoding_size, - error::Error, -}; +use crate::{config::default::max_grpc_decoding_size, error::Error}; pub async fn send_tx_simulate(grpc_address: &Uri, tx: Tx) -> Result { let mut tx_bytes = vec![]; diff --git a/crates/relayer/src/chain/cosmos/tx.rs b/crates/relayer/src/chain/cosmos/tx.rs index ca11ac8469..1005b43dfe 100644 --- a/crates/relayer/src/chain/cosmos/tx.rs +++ b/crates/relayer/src/chain/cosmos/tx.rs @@ -1,37 +1,20 @@ -use ibc_proto::{ - cosmos::tx::v1beta1::Fee, - google::protobuf::Any, -}; +use ibc_proto::{cosmos::tx::v1beta1::Fee, google::protobuf::Any}; use ibc_relayer_types::events::IbcEvent; -use tendermint_rpc::{ - endpoint::broadcast::tx_sync::Response, - Client, - HttpClient, - Url, -}; +use tendermint_rpc::{endpoint::broadcast::tx_sync::Response, Client, HttpClient, Url}; use super::batch::send_batched_messages_and_wait_commit; use crate::{ chain::cosmos::{ encode::sign_and_encode_tx, estimate::estimate_tx_fees, - query::{ - account::query_account, - tx::all_ibc_events_from_tx_search_response, - }, - types::{ - account::Account, - config::TxConfig, - }, + query::{account::query_account, tx::all_ibc_events_from_tx_search_response}, + types::{account::Account, config::TxConfig}, wait::wait_tx_succeed, }, config::types::Memo, error::Error, event::IbcEventWithHeight, - keyring::{ - Secp256k1KeyPair, - SigningKeyPair, - }, + keyring::{Secp256k1KeyPair, SigningKeyPair}, }; pub async fn estimate_fee_and_send_tx( diff --git a/crates/relayer/src/chain/cosmos/types/account.rs b/crates/relayer/src/chain/cosmos/types/account.rs index bdb6b1a997..be1d5209f6 100644 --- a/crates/relayer/src/chain/cosmos/types/account.rs +++ b/crates/relayer/src/chain/cosmos/types/account.rs @@ -1,8 +1,4 @@ -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use ibc_proto::cosmos::auth::v1beta1::BaseAccount; diff --git a/crates/relayer/src/chain/cosmos/types/app_state.rs b/crates/relayer/src/chain/cosmos/types/app_state.rs index e4feec3f7b..6e69d0590c 100644 --- a/crates/relayer/src/chain/cosmos/types/app_state.rs +++ b/crates/relayer/src/chain/cosmos/types/app_state.rs @@ -2,10 +2,7 @@ //! /genesis RPC endpoint. use serde::Deserialize as SerdeDeserialize; -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; #[derive(Debug, Deserialize, Serialize)] pub struct GenesisAppState { diff --git a/crates/relayer/src/chain/cosmos/types/config.rs b/crates/relayer/src/chain/cosmos/types/config.rs index de93bc5e57..8034a6a374 100644 --- a/crates/relayer/src/chain/cosmos/types/config.rs +++ b/crates/relayer/src/chain/cosmos/types/config.rs @@ -1,7 +1,4 @@ -use core::{ - str::FromStr, - time::Duration, -}; +use core::{str::FromStr, time::Duration}; use http::Uri; use ibc_proto::google::protobuf::Any; @@ -9,15 +6,9 @@ use ibc_relayer_types::core::ics24_host::identifier::ChainId; use tendermint_rpc::Url; use crate::{ - chain::cosmos::{ - config::CosmosSdkConfig, - types::gas::GasConfig, - }, + chain::cosmos::{config::CosmosSdkConfig, types::gas::GasConfig}, config::{ - types::{ - MaxMsgNum, - MaxTxSize, - }, + types::{MaxMsgNum, MaxTxSize}, AddressType, }, error::Error, diff --git a/crates/relayer/src/chain/cosmos/types/events/channel.rs b/crates/relayer/src/chain/cosmos/types/events/channel.rs index fcb7b970eb..78f3310d1a 100644 --- a/crates/relayer/src/chain/cosmos/types/events/channel.rs +++ b/crates/relayer/src/chain/cosmos/types/events/channel.rs @@ -6,29 +6,12 @@ use ibc_relayer_types::{ ics04_channel::{ error::Error, events::{ - AcknowledgePacket, - Attributes, - CloseConfirm, - CloseInit, - EventType, - OpenAck, - OpenConfirm, - OpenInit, - OpenTry, - ReceivePacket, - SendPacket, - TimeoutOnClosePacket, - TimeoutPacket, - WriteAcknowledgement, - PKT_ACK_ATTRIBUTE_KEY, - PKT_DATA_ATTRIBUTE_KEY, - PKT_DST_CHANNEL_ATTRIBUTE_KEY, - PKT_DST_PORT_ATTRIBUTE_KEY, - PKT_SEQ_ATTRIBUTE_KEY, - PKT_SRC_CHANNEL_ATTRIBUTE_KEY, - PKT_SRC_PORT_ATTRIBUTE_KEY, - PKT_TIMEOUT_HEIGHT_ATTRIBUTE_KEY, - PKT_TIMEOUT_TIMESTAMP_ATTRIBUTE_KEY, + AcknowledgePacket, Attributes, CloseConfirm, CloseInit, EventType, OpenAck, + OpenConfirm, OpenInit, OpenTry, ReceivePacket, SendPacket, TimeoutOnClosePacket, + TimeoutPacket, WriteAcknowledgement, PKT_ACK_ATTRIBUTE_KEY, PKT_DATA_ATTRIBUTE_KEY, + PKT_DST_CHANNEL_ATTRIBUTE_KEY, PKT_DST_PORT_ATTRIBUTE_KEY, PKT_SEQ_ATTRIBUTE_KEY, + PKT_SRC_CHANNEL_ATTRIBUTE_KEY, PKT_SRC_PORT_ATTRIBUTE_KEY, + PKT_TIMEOUT_HEIGHT_ATTRIBUTE_KEY, PKT_TIMEOUT_TIMESTAMP_ATTRIBUTE_KEY, }, packet::Packet, timeout::TimeoutHeight, diff --git a/crates/relayer/src/chain/cosmos/types/events/fee.rs b/crates/relayer/src/chain/cosmos/types/events/fee.rs index c0050e05b3..678ecda3f8 100644 --- a/crates/relayer/src/chain/cosmos/types/events/fee.rs +++ b/crates/relayer/src/chain/cosmos/types/events/fee.rs @@ -1,9 +1,6 @@ use ibc_relayer_types::{ applications::ics29_fee::events::IncentivizedPacket, - events::{ - IbcEvent, - IbcEventType, - }, + events::{IbcEvent, IbcEventType}, }; use tendermint::abci::Event as AbciEvent; diff --git a/crates/relayer/src/chain/cosmos/types/events/mod.rs b/crates/relayer/src/chain/cosmos/types/events/mod.rs index 40c247c3c1..e96cafdfca 100644 --- a/crates/relayer/src/chain/cosmos/types/events/mod.rs +++ b/crates/relayer/src/chain/cosmos/types/events/mod.rs @@ -1,10 +1,7 @@ use ibc_relayer_types::Height; use tendermint::abci; -use crate::event::{ - ibc_event_try_from_abci_event, - IbcEventWithHeight, -}; +use crate::event::{ibc_event_try_from_abci_event, IbcEventWithHeight}; pub mod channel; pub mod fee; diff --git a/crates/relayer/src/chain/cosmos/types/gas.rs b/crates/relayer/src/chain/cosmos/types/gas.rs index 0198760167..e60f83b4e2 100644 --- a/crates/relayer/src/chain/cosmos/types/gas.rs +++ b/crates/relayer/src/chain/cosmos/types/gas.rs @@ -1,10 +1,7 @@ use ibc_proto::cosmos::tx::v1beta1::Fee; use crate::{ - chain::cosmos::{ - calculate_fee, - config::CosmosSdkConfig, - }, + chain::cosmos::{calculate_fee, config::CosmosSdkConfig}, config::GasPrice, }; diff --git a/crates/relayer/src/chain/cosmos/types/tx.rs b/crates/relayer/src/chain/cosmos/types/tx.rs index ab50109211..e51184baf0 100644 --- a/crates/relayer/src/chain/cosmos/types/tx.rs +++ b/crates/relayer/src/chain/cosmos/types/tx.rs @@ -1,7 +1,4 @@ -use ibc_proto::cosmos::tx::v1beta1::{ - AuthInfo, - TxBody, -}; +use ibc_proto::cosmos::tx::v1beta1::{AuthInfo, TxBody}; use tendermint_rpc::endpoint::broadcast::tx_sync::Response; use crate::event::IbcEventWithHeight; diff --git a/crates/relayer/src/chain/cosmos/version.rs b/crates/relayer/src/chain/cosmos/version.rs index ffd9b93fdd..fd2bba9280 100644 --- a/crates/relayer/src/chain/cosmos/version.rs +++ b/crates/relayer/src/chain/cosmos/version.rs @@ -2,11 +2,7 @@ //! of Cosmos-SDK networks. The extracted version specification //! is captured in a domain-type semver format in [`Specs`]. -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use flex_error::define_error; use ibc_proto::cosmos::base::tendermint::v1beta1::VersionInfo; diff --git a/crates/relayer/src/chain/cosmos/wait.rs b/crates/relayer/src/chain/cosmos/wait.rs index 61266bf009..43e897a026 100644 --- a/crates/relayer/src/chain/cosmos/wait.rs +++ b/crates/relayer/src/chain/cosmos/wait.rs @@ -1,37 +1,19 @@ use core::time::Duration; -use std::{ - thread, - time::Instant, -}; +use std::{thread, time::Instant}; -use ibc_relayer_types::{ - core::ics24_host::identifier::ChainId, - events::IbcEvent, - Height, -}; +use ibc_relayer_types::{core::ics24_host::identifier::ChainId, events::IbcEvent, Height}; use itertools::Itertools; use tendermint::Hash as TxHash; -use tendermint_rpc::{ - endpoint::tx::Response as TxResponse, - HttpClient, - Url, -}; +use tendermint_rpc::{endpoint::tx::Response as TxResponse, HttpClient, Url}; use tokio::time::sleep; -use tracing::{ - debug, - debug_span, - trace, -}; +use tracing::{debug, debug_span, trace}; use crate::{ chain::cosmos::{ query::tx::query_tx_response, types::{ events::from_tx_response_event, - tx::{ - TxStatus, - TxSyncResult, - }, + tx::{TxStatus, TxSyncResult}, }, }, error::Error, diff --git a/crates/relayer/src/chain/counterparty.rs b/crates/relayer/src/chain/counterparty.rs index d13e16be0d..6fe3911abf 100644 --- a/crates/relayer/src/chain/counterparty.rs +++ b/crates/relayer/src/chain/counterparty.rs @@ -3,60 +3,33 @@ use std::collections::HashSet; use ibc_relayer_types::{ core::{ ics03_connection::connection::{ - ConnectionEnd, - IdentifiedConnectionEnd, - State as ConnectionState, + ConnectionEnd, IdentifiedConnectionEnd, State as ConnectionState, }, ics04_channel::{ - channel::{ - IdentifiedChannelEnd, - State, - }, + channel::{IdentifiedChannelEnd, State}, packet::Sequence, }, ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortChannelId, - PortId, + ChainId, ChannelId, ClientId, ConnectionId, PortChannelId, PortId, }, }, Height, }; -use serde::{ - Deserialize, - Serialize, -}; -use tracing::{ - error, - trace, -}; +use serde::{Deserialize, Serialize}; +use tracing::{error, trace}; use super::{ handle::ChainHandle, requests::{ - IncludeProof, - PageRequest, - QueryChannelRequest, - QueryClientConnectionsRequest, - QueryClientStateRequest, - QueryConnectionChannelsRequest, - QueryConnectionRequest, - QueryPacketAcknowledgementsRequest, - QueryPacketCommitmentsRequest, - QueryUnreceivedAcksRequest, - QueryUnreceivedPacketsRequest, + IncludeProof, PageRequest, QueryChannelRequest, QueryClientConnectionsRequest, + QueryClientStateRequest, QueryConnectionChannelsRequest, QueryConnectionRequest, + QueryPacketAcknowledgementsRequest, QueryPacketCommitmentsRequest, + QueryUnreceivedAcksRequest, QueryUnreceivedPacketsRequest, }, }; use crate::{ - chain::requests::QueryHeight, - channel::ChannelError, - client_state::IdentifiedAnyClientState, - path::PathIdentifiers, - supervisor::Error, - telemetry, + chain::requests::QueryHeight, channel::ChannelError, client_state::IdentifiedAnyClientState, + path::PathIdentifiers, supervisor::Error, telemetry, }; pub fn counterparty_chain_from_connection( diff --git a/crates/relayer/src/chain/endpoint.rs b/crates/relayer/src/chain/endpoint.rs index 7a2a83498a..b9f5507c1b 100644 --- a/crates/relayer/src/chain/endpoint.rs +++ b/crates/relayer/src/chain/endpoint.rs @@ -2,8 +2,7 @@ use alloc::sync::Arc; use core::convert::TryFrom; use ibc_proto::ibc::apps::fee::v1::{ - QueryIncentivizedPacketRequest, - QueryIncentivizedPacketResponse, + QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, }; use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, @@ -12,51 +11,23 @@ use ibc_relayer_types::{ client_state::ClientState, consensus_state::ConsensusState, events::UpdateClient, - header::{ - AnyHeader, - Header, - }, + header::{AnyHeader, Header}, }, ics03_connection::{ - connection::{ - ConnectionEnd, - IdentifiedConnectionEnd, - State, - }, - version::{ - get_compatible_versions, - Version, - }, + connection::{ConnectionEnd, IdentifiedConnectionEnd, State}, + version::{get_compatible_versions, Version}, }, ics04_channel::{ - channel::{ - ChannelEnd, - IdentifiedChannelEnd, - }, - packet::{ - PacketMsgType, - Sequence, - }, + channel::{ChannelEnd, IdentifiedChannelEnd}, + packet::{PacketMsgType, Sequence}, }, ics23_commitment::{ - commitment::{ - CommitmentPrefix, - CommitmentProofBytes, - }, + commitment::{CommitmentPrefix, CommitmentProofBytes}, merkle::MerkleProof, }, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, - }, - }, - proofs::{ - ConsensusProof, - Proofs, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, + proofs::{ConsensusProof, Proofs}, signer::Signer, timestamp::Timestamp, Height as ICSHeight, @@ -67,27 +38,17 @@ use tokio::runtime::Runtime as TokioRuntime; use crate::{ account::Balance, chain::{ - client::ClientSettings, - cosmos::version::Specs, - handle::Subscription, - requests::*, + client::ClientSettings, cosmos::version::Specs, handle::Subscription, requests::*, tracking::TrackedMsgs, }, - client_state::{ - AnyClientState, - IdentifiedAnyClientState, - }, + client_state::{AnyClientState, IdentifiedAnyClientState}, config::ChainConfig, connection::ConnectionMsgType, consensus_state::AnyConsensusState, denom::DenomTrace, error::Error, event::IbcEventWithHeight, - keyring::{ - AnySigningKeyPair, - KeyRing, - SigningKeyPairSized, - }, + keyring::{AnySigningKeyPair, KeyRing, SigningKeyPairSized}, misbehaviour::MisbehaviourEvidence, }; diff --git a/crates/relayer/src/chain/handle.rs b/crates/relayer/src/chain/handle.rs index 5e4bf0946a..71091f3549 100644 --- a/crates/relayer/src/chain/handle.rs +++ b/crates/relayer/src/chain/handle.rs @@ -1,50 +1,24 @@ use alloc::sync::Arc; -use core::fmt::{ - self, - Debug, - Display, -}; +use core::fmt::{self, Debug, Display}; use crossbeam_channel as channel; use ibc_proto::ibc::apps::fee::v1::{ - QueryIncentivizedPacketRequest, - QueryIncentivizedPacketResponse, + QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, }; use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, core::{ - ics02_client::{ - events::UpdateClient, - header::AnyHeader, - }, + ics02_client::{events::UpdateClient, header::AnyHeader}, ics03_connection::{ - connection::{ - ConnectionEnd, - IdentifiedConnectionEnd, - }, + connection::{ConnectionEnd, IdentifiedConnectionEnd}, version::Version, }, ics04_channel::{ - channel::{ - ChannelEnd, - IdentifiedChannelEnd, - }, - packet::{ - PacketMsgType, - Sequence, - }, - }, - ics23_commitment::{ - commitment::CommitmentPrefix, - merkle::MerkleProof, - }, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, + channel::{ChannelEnd, IdentifiedChannelEnd}, + packet::{PacketMsgType, Sequence}, }, + ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, proofs::Proofs, signer::Signer, @@ -55,29 +29,20 @@ use tracing::Span; use super::{ client::ClientSettings, cosmos::version::Specs, - endpoint::{ - ChainStatus, - HealthCheck, - }, + endpoint::{ChainStatus, HealthCheck}, requests::*, tracking::TrackedMsgs, }; use crate::{ account::Balance, - client_state::{ - AnyClientState, - IdentifiedAnyClientState, - }, + client_state::{AnyClientState, IdentifiedAnyClientState}, config::ChainConfig, connection::ConnectionMsgType, consensus_state::AnyConsensusState, denom::DenomTrace, error::Error, event::{ - source::{ - EventBatch, - Result as MonitorResult, - }, + source::{EventBatch, Result as MonitorResult}, IbcEventWithHeight, }, keyring::AnySigningKeyPair, diff --git a/crates/relayer/src/chain/handle/base.rs b/crates/relayer/src/chain/handle/base.rs index ef9d171617..438155aeb7 100644 --- a/crates/relayer/src/chain/handle/base.rs +++ b/crates/relayer/src/chain/handle/base.rs @@ -1,50 +1,23 @@ -use core::fmt::{ - Debug, - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Debug, Display, Error as FmtError, Formatter}; use crossbeam_channel as channel; use ibc_proto::ibc::apps::fee::v1::{ - QueryIncentivizedPacketRequest, - QueryIncentivizedPacketResponse, + QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, }; use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, core::{ - ics02_client::{ - events::UpdateClient, - header::AnyHeader, - }, + ics02_client::{events::UpdateClient, header::AnyHeader}, ics03_connection::{ - connection::{ - ConnectionEnd, - IdentifiedConnectionEnd, - }, + connection::{ConnectionEnd, IdentifiedConnectionEnd}, version::Version, }, ics04_channel::{ - channel::{ - ChannelEnd, - IdentifiedChannelEnd, - }, - packet::{ - PacketMsgType, - Sequence, - }, - }, - ics23_commitment::{ - commitment::CommitmentPrefix, - merkle::MerkleProof, - }, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, + channel::{ChannelEnd, IdentifiedChannelEnd}, + packet::{PacketMsgType, Sequence}, }, + ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, proofs::Proofs, signer::Signer, @@ -52,27 +25,14 @@ use ibc_relayer_types::{ }; use tracing::Span; -use super::{ - reply_channel, - ChainHandle, - ChainRequest, - HealthCheck, - ReplyTo, - Subscription, -}; +use super::{reply_channel, ChainHandle, ChainRequest, HealthCheck, ReplyTo, Subscription}; use crate::{ account::Balance, chain::{ - client::ClientSettings, - cosmos::version::Specs, - endpoint::ChainStatus, - requests::*, + client::ClientSettings, cosmos::version::Specs, endpoint::ChainStatus, requests::*, tracking::TrackedMsgs, }, - client_state::{ - AnyClientState, - IdentifiedAnyClientState, - }, + client_state::{AnyClientState, IdentifiedAnyClientState}, config::ChainConfig, connection::ConnectionMsgType, consensus_state::AnyConsensusState, diff --git a/crates/relayer/src/chain/handle/cache.rs b/crates/relayer/src/chain/handle/cache.rs index e6002537bb..8b59532490 100644 --- a/crates/relayer/src/chain/handle/cache.rs +++ b/crates/relayer/src/chain/handle/cache.rs @@ -1,49 +1,24 @@ -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use crossbeam_channel as channel; use ibc_proto::ibc::apps::fee::v1::{ - QueryIncentivizedPacketRequest, - QueryIncentivizedPacketResponse, + QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, }; use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, core::{ - ics02_client::{ - events::UpdateClient, - header::AnyHeader, - }, + ics02_client::{events::UpdateClient, header::AnyHeader}, ics03_connection::{ - connection::{ - ConnectionEnd, - IdentifiedConnectionEnd, - }, + connection::{ConnectionEnd, IdentifiedConnectionEnd}, version::Version, }, ics04_channel::{ - channel::{ - ChannelEnd, - IdentifiedChannelEnd, - }, - packet::{ - PacketMsgType, - Sequence, - }, - }, - ics23_commitment::{ - commitment::CommitmentPrefix, - merkle::MerkleProof, + channel::{ChannelEnd, IdentifiedChannelEnd}, + packet::{PacketMsgType, Sequence}, }, + ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortChannelId, - PortId, + ChainId, ChannelId, ClientId, ConnectionId, PortChannelId, PortId, }, }, proofs::Proofs, @@ -54,29 +29,16 @@ use tracing::Span; use crate::{ account::Balance, - cache::{ - Cache, - CacheStatus, - }, + cache::{Cache, CacheStatus}, chain::{ client::ClientSettings, cosmos::version::Specs, - endpoint::{ - ChainStatus, - HealthCheck, - }, - handle::{ - ChainHandle, - ChainRequest, - Subscription, - }, + endpoint::{ChainStatus, HealthCheck}, + handle::{ChainHandle, ChainRequest, Subscription}, requests::*, tracking::TrackedMsgs, }, - client_state::{ - AnyClientState, - IdentifiedAnyClientState, - }, + client_state::{AnyClientState, IdentifiedAnyClientState}, config::ChainConfig, connection::ConnectionMsgType, consensus_state::AnyConsensusState, diff --git a/crates/relayer/src/chain/handle/counting.rs b/crates/relayer/src/chain/handle/counting.rs index 9b833eb4af..4cb9f15493 100644 --- a/crates/relayer/src/chain/handle/counting.rs +++ b/crates/relayer/src/chain/handle/counting.rs @@ -1,88 +1,45 @@ -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use std::{ collections::HashMap, - sync::{ - Arc, - RwLock, - RwLockReadGuard, - }, + sync::{Arc, RwLock, RwLockReadGuard}, }; use crossbeam_channel as channel; use ibc_proto::ibc::apps::fee::v1::{ - QueryIncentivizedPacketRequest, - QueryIncentivizedPacketResponse, + QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, }; use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, core::{ - ics02_client::{ - events::UpdateClient, - header::AnyHeader, - }, + ics02_client::{events::UpdateClient, header::AnyHeader}, ics03_connection::{ - connection::{ - ConnectionEnd, - IdentifiedConnectionEnd, - }, + connection::{ConnectionEnd, IdentifiedConnectionEnd}, version::Version, }, ics04_channel::{ - channel::{ - ChannelEnd, - IdentifiedChannelEnd, - }, - packet::{ - PacketMsgType, - Sequence, - }, - }, - ics23_commitment::{ - commitment::CommitmentPrefix, - merkle::MerkleProof, - }, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, + channel::{ChannelEnd, IdentifiedChannelEnd}, + packet::{PacketMsgType, Sequence}, }, + ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, proofs::Proofs, signer::Signer, Height, }; -use tracing::{ - debug, - Span, -}; +use tracing::{debug, Span}; use crate::{ account::Balance, chain::{ client::ClientSettings, cosmos::version::Specs, - endpoint::{ - ChainStatus, - HealthCheck, - }, - handle::{ - ChainHandle, - ChainRequest, - Subscription, - }, + endpoint::{ChainStatus, HealthCheck}, + handle::{ChainHandle, ChainRequest, Subscription}, requests::*, tracking::TrackedMsgs, }, - client_state::{ - AnyClientState, - IdentifiedAnyClientState, - }, + client_state::{AnyClientState, IdentifiedAnyClientState}, config::ChainConfig, connection::ConnectionMsgType, consensus_state::AnyConsensusState, diff --git a/crates/relayer/src/chain/requests.rs b/crates/relayer/src/chain/requests.rs index 29a6d6f186..9941f4c8f9 100644 --- a/crates/relayer/src/chain/requests.rs +++ b/crates/relayer/src/chain/requests.rs @@ -1,7 +1,4 @@ -use core::fmt::{ - self, - Display, -}; +use core::fmt::{self, Display}; use ibc_proto::{ cosmos::base::query::v1beta1::PageRequest as RawPageRequest, @@ -30,25 +27,13 @@ use ibc_proto::{ use ibc_relayer_types::{ core::{ ics04_channel::packet::Sequence, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, events::WithBlockDataType, Height, }; -use serde::{ - Deserialize, - Serialize, -}; -use tendermint::{ - block::Height as TMBlockHeight, - Hash as TxHash, -}; +use serde::{Deserialize, Serialize}; +use tendermint::{block::Height as TMBlockHeight, Hash as TxHash}; use tonic::metadata::AsciiMetadataValue; use crate::error::Error; diff --git a/crates/relayer/src/chain/runtime.rs b/crates/relayer/src/chain/runtime.rs index f59a2db3c4..6698f2816b 100644 --- a/crates/relayer/src/chain/runtime.rs +++ b/crates/relayer/src/chain/runtime.rs @@ -3,79 +3,42 @@ use std::thread; use crossbeam_channel as channel; use ibc_proto::ibc::apps::fee::v1::{ - QueryIncentivizedPacketRequest, - QueryIncentivizedPacketResponse, + QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, }; use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, core::{ - ics02_client::{ - events::UpdateClient, - header::AnyHeader, - }, + ics02_client::{events::UpdateClient, header::AnyHeader}, ics03_connection::{ - connection::{ - ConnectionEnd, - IdentifiedConnectionEnd, - }, + connection::{ConnectionEnd, IdentifiedConnectionEnd}, version::Version, }, ics04_channel::{ - channel::{ - ChannelEnd, - IdentifiedChannelEnd, - }, - packet::{ - PacketMsgType, - Sequence, - }, - }, - ics23_commitment::{ - commitment::CommitmentPrefix, - merkle::MerkleProof, - }, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, + channel::{ChannelEnd, IdentifiedChannelEnd}, + packet::{PacketMsgType, Sequence}, }, + ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, proofs::Proofs, signer::Signer, Height, }; use tokio::runtime::Runtime as TokioRuntime; -use tracing::{ - error, - Span, -}; +use tracing::{error, Span}; use super::{ client::ClientSettings, cosmos::version::Specs, - endpoint::{ - ChainEndpoint, - ChainStatus, - HealthCheck, - }, - handle::{ - ChainHandle, - ChainRequest, - ReplyTo, - Subscription, - }, + endpoint::{ChainEndpoint, ChainStatus, HealthCheck}, + handle::{ChainHandle, ChainRequest, ReplyTo, Subscription}, requests::*, tracking::TrackedMsgs, }; use crate::{ account::Balance, chain::requests::QueryPacketEventDataRequest, - client_state::{ - AnyClientState, - IdentifiedAnyClientState, - }, + client_state::{AnyClientState, IdentifiedAnyClientState}, config::ChainConfig, connection::ConnectionMsgType, consensus_state::AnyConsensusState, diff --git a/crates/relayer/src/chain/tracking.rs b/crates/relayer/src/chain/tracking.rs index 526bf02d43..62f89ca096 100644 --- a/crates/relayer/src/chain/tracking.rs +++ b/crates/relayer/src/chain/tracking.rs @@ -1,8 +1,4 @@ -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use ibc_proto::google::protobuf::Any; use uuid::Uuid; diff --git a/crates/relayer/src/channel.rs b/crates/relayer/src/channel.rs index a901aabfb2..885d3d3976 100644 --- a/crates/relayer/src/channel.rs +++ b/crates/relayer/src/channel.rs @@ -1,9 +1,5 @@ use core::{ - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, time::Duration, }; @@ -12,75 +8,39 @@ use ibc_proto::google::protobuf::Any; use ibc_relayer_types::{ core::{ ics04_channel::{ - channel::{ - ChannelEnd, - Counterparty, - IdentifiedChannelEnd, - Ordering, - State, - }, + channel::{ChannelEnd, Counterparty, IdentifiedChannelEnd, Ordering, State}, msgs::{ - chan_close_confirm::MsgChannelCloseConfirm, - chan_close_init::MsgChannelCloseInit, - chan_open_ack::MsgChannelOpenAck, - chan_open_confirm::MsgChannelOpenConfirm, - chan_open_init::MsgChannelOpenInit, - chan_open_try::MsgChannelOpenTry, + chan_close_confirm::MsgChannelCloseConfirm, chan_close_init::MsgChannelCloseInit, + chan_open_ack::MsgChannelOpenAck, chan_open_confirm::MsgChannelOpenConfirm, + chan_open_init::MsgChannelOpenInit, chan_open_try::MsgChannelOpenTry, }, }, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, events::IbcEvent, tx_msg::Msg, Height, }; use serde::Serialize; -use tracing::{ - debug, - error, - info, - warn, -}; +use tracing::{debug, error, info, warn}; use crate::{ chain::{ - counterparty::{ - channel_connection_client, - channel_state_on_destination, - }, + counterparty::{channel_connection_client, channel_state_on_destination}, handle::ChainHandle, requests::{ - IncludeProof, - PageRequest, - QueryChannelRequest, - QueryConnectionChannelsRequest, - QueryConnectionRequest, - QueryHeight, + IncludeProof, PageRequest, QueryChannelRequest, QueryConnectionChannelsRequest, + QueryConnectionRequest, QueryHeight, }, tracking::TrackedMsgs, }, connection::Connection, - foreign_client::{ - ForeignClient, - HasExpiredOrFrozenError, - }, + foreign_client::{ForeignClient, HasExpiredOrFrozenError}, object::Channel as WorkerChannelObject, supervisor::error::Error as SupervisorError, util::{ - pretty::{ - PrettyDuration, - PrettyOption, - }, - retry::{ - retry_with_index, - RetryResult, - }, + pretty::{PrettyDuration, PrettyOption}, + retry::{retry_with_index, RetryResult}, task::Next, }, }; @@ -97,10 +57,7 @@ pub mod channel_handshake_retry { use crate::{ channel::ChannelError, - util::retry::{ - clamp_total, - ConstantGrowth, - }, + util::retry::{clamp_total, ConstantGrowth}, }; /// Approximate number of retries per block. diff --git a/crates/relayer/src/channel/error.rs b/crates/relayer/src/channel/error.rs index a2bbd2baab..27162cd9fc 100644 --- a/crates/relayer/src/channel/error.rs +++ b/crates/relayer/src/channel/error.rs @@ -1,30 +1,18 @@ use core::time::Duration; -use flex_error::{ - define_error, - ErrorMessageTracer, -}; +use flex_error::{define_error, ErrorMessageTracer}; use ibc_relayer_types::{ core::{ ics02_client::error::Error as ClientError, ics04_channel::channel::State, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - PortChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, ClientId, PortChannelId, PortId}, }, events::IbcEvent, }; use crate::{ error::Error as RelayerError, - foreign_client::{ - ForeignClientError, - HasExpiredOrFrozenError, - }, + foreign_client::{ForeignClientError, HasExpiredOrFrozenError}, supervisor::Error as SupervisorError, }; diff --git a/crates/relayer/src/channel/version.rs b/crates/relayer/src/channel/version.rs index 9866779c05..4de5a1fcbe 100644 --- a/crates/relayer/src/channel/version.rs +++ b/crates/relayer/src/channel/version.rs @@ -5,10 +5,7 @@ //! handshake. pub use ibc_relayer_types::core::ics04_channel::version::Version; -use ibc_relayer_types::{ - applications::transfer, - core::ics24_host::identifier::PortId, -}; +use ibc_relayer_types::{applications::transfer, core::ics24_host::identifier::PortId}; /// Returns the default channel version, depending on the the given [`PortId`]. pub fn default_by_port(port_id: &PortId) -> Option { diff --git a/crates/relayer/src/client_state.rs b/crates/relayer/src/client_state.rs index 2178c3d006..6b1b09d110 100644 --- a/crates/relayer/src/client_state.rs +++ b/crates/relayer/src/client_state.rs @@ -16,31 +16,22 @@ use ibc_relayer_types::mock::client_state::MockClientState; use ibc_relayer_types::mock::client_state::MOCK_CLIENT_STATE_TYPE_URL; use ibc_relayer_types::{ clients::ics07_tendermint::client_state::{ - ClientState as TmClientState, - UpgradeOptions as TmUpgradeOptions, + ClientState as TmClientState, UpgradeOptions as TmUpgradeOptions, TENDERMINT_CLIENT_STATE_TYPE_URL, }, core::{ ics02_client::{ - client_state::ClientState, - client_type::ClientType, - error::Error, + client_state::ClientState, client_type::ClientType, error::Error, trust_threshold::TrustThreshold, }, ics24_host::{ error::ValidationError, - identifier::{ - ChainId, - ClientId, - }, + identifier::{ChainId, ClientId}, }, }, Height, }; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "type")] diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index aee6a3ca64..9a229f3360 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -11,21 +11,11 @@ pub mod types; use alloc::collections::BTreeMap; use core::{ cmp::Ordering, - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, str::FromStr, time::Duration, }; -use std::{ - fs, - fs::File, - io::Write, - ops::Range, - path::Path, -}; +use std::{fs, fs::File, io::Write, ops::Range, path::Path}; use byte_unit::Byte; pub use error::Error; @@ -34,40 +24,23 @@ use ibc_proto::google::protobuf::Any; use ibc_relayer_types::{ core::{ ics23_commitment::specs::ProofSpecs, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }, timestamp::ZERO_DURATION, }; pub use refresh_rate::RefreshRate; -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; use tendermint::block::Height as BlockHeight; -use tendermint_rpc::{ - Url, - WebSocketClientUrl, -}; +use tendermint_rpc::{Url, WebSocketClientUrl}; pub use crate::config::Error as ConfigError; use crate::{ chain::cosmos::config::CosmosSdkConfig, - config::types::{ - ics20_field_size_limit::Ics20FieldSizeLimit, - TrustThreshold, - }, + config::types::{ics20_field_size_limit::Ics20FieldSizeLimit, TrustThreshold}, error::Error as RelayerError, extension_options::ExtensionOptionDynamicFeeTx, keyring, - keyring::{ - AnySigningKeyPair, - KeyRing, - Store, - }, + keyring::{AnySigningKeyPair, KeyRing, Store}, }; #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -853,11 +826,7 @@ mod tests { use test_log::test; - use super::{ - load, - parse_gas_prices, - store_writer, - }; + use super::{load, parse_gas_prices, store_writer}; use crate::config::GasPrice; #[test] diff --git a/crates/relayer/src/config/compat_mode.rs b/crates/relayer/src/config/compat_mode.rs index 4fdff7552e..e939cec28b 100644 --- a/crates/relayer/src/config/compat_mode.rs +++ b/crates/relayer/src/config/compat_mode.rs @@ -1,18 +1,9 @@ use core::{ - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, str::FromStr, }; -use serde::{ - Deserialize, - Deserializer, - Serialize, - Serializer, -}; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; use tendermint_rpc::client::CompatMode as TmCompatMode; use crate::config::Error; diff --git a/crates/relayer/src/config/error.rs b/crates/relayer/src/config/error.rs index c93bce7ee7..1efd3a1fdb 100644 --- a/crates/relayer/src/config/error.rs +++ b/crates/relayer/src/config/error.rs @@ -1,7 +1,4 @@ -use flex_error::{ - define_error, - TraceError, -}; +use flex_error::{define_error, TraceError}; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use tracing_subscriber::filter::ParseError; diff --git a/crates/relayer/src/config/filter.rs b/crates/relayer/src/config/filter.rs index fb6c74324e..ef66a15dd4 100644 --- a/crates/relayer/src/config/filter.rs +++ b/crates/relayer/src/config/filter.rs @@ -1,31 +1,16 @@ //! Custom `serde` deserializer for `FilterMatch` -use core::{ - fmt, - str::FromStr, -}; -use std::{ - collections::HashMap, - hash::Hash, -}; +use core::{fmt, str::FromStr}; +use std::{collections::HashMap, hash::Hash}; use ibc_relayer_types::{ applications::transfer::RawCoin, bigint::U256, - core::ics24_host::identifier::{ - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChannelId, PortId}, events::IbcEventType, }; use itertools::Itertools; -use serde::{ - de, - Deserialize, - Deserializer, - Serialize, - Serializer, -}; +use serde::{de, Deserialize, Deserializer, Serialize, Serializer}; /// Represents all the filtering policies for packets. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] @@ -469,10 +454,7 @@ mod tests { fn serialize_packet_filter_policy() { use std::str::FromStr; - use ibc_relayer_types::core::ics24_host::identifier::{ - ChannelId, - PortId, - }; + use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId}; let filter_policy = ChannelFilters(vec![ ( diff --git a/crates/relayer/src/config/gas_multiplier.rs b/crates/relayer/src/config/gas_multiplier.rs index 7867f3f3fa..3917469b31 100644 --- a/crates/relayer/src/config/gas_multiplier.rs +++ b/crates/relayer/src/config/gas_multiplier.rs @@ -1,12 +1,6 @@ use serde::{ - de::{ - Error as _, - Unexpected, - }, - Deserialize, - Deserializer, - Serialize, - Serializer, + de::{Error as _, Unexpected}, + Deserialize, Deserializer, Serialize, Serializer, }; flex_error::define_error! { diff --git a/crates/relayer/src/config/proof_specs.rs b/crates/relayer/src/config/proof_specs.rs index ff278f65ee..e953b6e00a 100644 --- a/crates/relayer/src/config/proof_specs.rs +++ b/crates/relayer/src/config/proof_specs.rs @@ -3,12 +3,7 @@ use core::fmt; use ibc_relayer_types::core::ics23_commitment::specs::ProofSpecs; -use serde::{ - de, - ser, - Deserializer, - Serializer, -}; +use serde::{de, ser, Deserializer, Serializer}; pub fn serialize( proof_specs: &Option, diff --git a/crates/relayer/src/config/refresh_rate.rs b/crates/relayer/src/config/refresh_rate.rs index 0c14d6c84f..c3d359f830 100644 --- a/crates/relayer/src/config/refresh_rate.rs +++ b/crates/relayer/src/config/refresh_rate.rs @@ -1,11 +1,6 @@ use std::str::FromStr; -use serde::{ - Deserialize, - Deserializer, - Serialize, - Serializer, -}; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub struct RefreshRate { diff --git a/crates/relayer/src/config/types.rs b/crates/relayer/src/config/types.rs index 4eb5670bbb..fc2394be22 100644 --- a/crates/relayer/src/config/types.rs +++ b/crates/relayer/src/config/types.rs @@ -57,14 +57,8 @@ pub mod max_msg_num { } use serde::{ - de::{ - Error as _, - Unexpected, - }, - Deserialize, - Deserializer, - Serialize, - Serializer, + de::{Error as _, Unexpected}, + Deserialize, Deserializer, Serialize, Serializer, }; impl<'de> Deserialize<'de> for MaxMsgNum { @@ -152,14 +146,8 @@ pub mod max_tx_size { } use serde::{ - de::{ - Error as _, - Unexpected, - }, - Deserialize, - Deserializer, - Serialize, - Serializer, + de::{Error as _, Unexpected}, + Deserialize, Deserializer, Serialize, Serializer, }; impl<'de> Deserialize<'de> for MaxTxSize { @@ -244,13 +232,7 @@ pub mod memo { } } - use serde::{ - de::Error as _, - Deserialize, - Deserializer, - Serialize, - Serializer, - }; + use serde::{de::Error as _, Deserialize, Deserializer, Serialize, Serializer}; impl<'de> Deserialize<'de> for Memo { fn deserialize(deserializer: D) -> Result @@ -277,11 +259,7 @@ pub mod memo { } } - use core::fmt::{ - Display, - Error as FmtError, - Formatter, - }; + use core::fmt::{Display, Error as FmtError, Formatter}; impl Display for Memo { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { @@ -294,10 +272,7 @@ pub mod ics20_field_size_limit { use std::fmt::Display; use byte_unit::Byte; - use serde_derive::{ - Deserialize, - Serialize, - }; + use serde_derive::{Deserialize, Serialize}; pub enum ValidationResult { Valid, diff --git a/crates/relayer/src/connection.rs b/crates/relayer/src/connection.rs index 2babdbea3d..1bd190b5ed 100644 --- a/crates/relayer/src/connection.rs +++ b/crates/relayer/src/connection.rs @@ -1,9 +1,5 @@ use core::{ - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, time::Duration, }; use std::thread; @@ -13,63 +9,35 @@ use ibc_relayer_types::{ core::{ ics02_client::height::Height, ics03_connection::{ - connection::{ - ConnectionEnd, - Counterparty, - IdentifiedConnectionEnd, - State, - }, + connection::{ConnectionEnd, Counterparty, IdentifiedConnectionEnd, State}, msgs::{ - conn_open_ack::MsgConnectionOpenAck, - conn_open_confirm::MsgConnectionOpenConfirm, - conn_open_init::MsgConnectionOpenInit, - conn_open_try::MsgConnectionOpenTry, + conn_open_ack::MsgConnectionOpenAck, conn_open_confirm::MsgConnectionOpenConfirm, + conn_open_init::MsgConnectionOpenInit, conn_open_try::MsgConnectionOpenTry, }, }, - ics24_host::identifier::{ - ClientId, - ConnectionId, - }, + ics24_host::identifier::{ClientId, ConnectionId}, }, events::IbcEvent, timestamp::ZERO_DURATION, tx_msg::Msg, }; use serde::Serialize; -use tracing::{ - debug, - error, - info, - warn, -}; +use tracing::{debug, error, info, warn}; use crate::{ chain::{ counterparty::connection_state_on_destination, handle::ChainHandle, requests::{ - IncludeProof, - PageRequest, - QueryConnectionRequest, - QueryConnectionsRequest, - QueryHeight, + IncludeProof, PageRequest, QueryConnectionRequest, QueryConnectionsRequest, QueryHeight, }, tracking::TrackedMsgs, }, - foreign_client::{ - ForeignClient, - HasExpiredOrFrozenError, - }, + foreign_client::{ForeignClient, HasExpiredOrFrozenError}, object::Connection as WorkerConnectionObject, util::{ - pretty::{ - PrettyDuration, - PrettyOption, - }, - retry::{ - retry_with_index, - RetryResult, - }, + pretty::{PrettyDuration, PrettyOption}, + retry::{retry_with_index, RetryResult}, task::Next, }, }; @@ -88,10 +56,7 @@ mod handshake_retry { use crate::{ connection::ConnectionError, - util::retry::{ - clamp_total, - ConstantGrowth, - }, + util::retry::{clamp_total, ConstantGrowth}, }; /// Approximate number of retries per block. diff --git a/crates/relayer/src/connection/error.rs b/crates/relayer/src/connection/error.rs index 8b77f83bf2..5e13d6f374 100644 --- a/crates/relayer/src/connection/error.rs +++ b/crates/relayer/src/connection/error.rs @@ -1,30 +1,17 @@ use core::time::Duration; -use flex_error::{ - define_error, - ErrorMessageTracer, -}; +use flex_error::{define_error, ErrorMessageTracer}; use ibc_relayer_types::{ core::{ - ics03_connection::connection::{ - Counterparty, - State, - }, - ics24_host::identifier::{ - ChainId, - ClientId, - ConnectionId, - }, + ics03_connection::connection::{Counterparty, State}, + ics24_host::identifier::{ChainId, ClientId, ConnectionId}, }, events::IbcEvent, }; use crate::{ error::Error as RelayerError, - foreign_client::{ - ForeignClientError, - HasExpiredOrFrozenError, - }, + foreign_client::{ForeignClientError, HasExpiredOrFrozenError}, supervisor::Error as SupervisorError, }; diff --git a/crates/relayer/src/consensus_state.rs b/crates/relayer/src/consensus_state.rs index 8f1f9f9549..855b5ec9dc 100644 --- a/crates/relayer/src/consensus_state.rs +++ b/crates/relayer/src/consensus_state.rs @@ -14,24 +14,16 @@ use ibc_relayer_types::mock::consensus_state::MockConsensusState; use ibc_relayer_types::mock::consensus_state::MOCK_CONSENSUS_STATE_TYPE_URL; use ibc_relayer_types::{ clients::ics07_tendermint::consensus_state::{ - ConsensusState as TmConsensusState, - TENDERMINT_CONSENSUS_STATE_TYPE_URL, + ConsensusState as TmConsensusState, TENDERMINT_CONSENSUS_STATE_TYPE_URL, }, core::{ - ics02_client::{ - client_type::ClientType, - consensus_state::ConsensusState, - error::Error, - }, + ics02_client::{client_type::ClientType, consensus_state::ConsensusState, error::Error}, ics23_commitment::commitment::CommitmentRoot, }, timestamp::Timestamp, Height, }; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(tag = "type")] diff --git a/crates/relayer/src/denom.rs b/crates/relayer/src/denom.rs index 73f8f6dd63..cd6d33bcdc 100644 --- a/crates/relayer/src/denom.rs +++ b/crates/relayer/src/denom.rs @@ -1,9 +1,6 @@ //! Data structures related to the denomination of coins used by the relayer. -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; /// The denom trace #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index d561524a54..a16f0266ef 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -2,76 +2,45 @@ use core::time::Duration; -use flex_error::{ - define_error, - DisplayOnly, - TraceError, -}; +use flex_error::{define_error, DisplayOnly, TraceError}; use http::uri::InvalidUri; use humantime::format_duration; use ibc_relayer_types::{ applications::{ - ics29_fee::error::Error as FeeError, - ics31_icq::error::Error as CrossChainQueryError, + ics29_fee::error::Error as FeeError, ics31_icq::error::Error as CrossChainQueryError, }, clients::ics07_tendermint::error as tendermint_error, core::{ - ics02_client::{ - client_type::ClientType, - error as client_error, - }, + ics02_client::{client_type::ClientType, error as client_error}, ics03_connection::error as connection_error, ics23_commitment::error as commitment_error, - ics24_host::identifier::{ - ChainId, - ChannelId, - ConnectionId, - }, + ics24_host::identifier::{ChainId, ChannelId, ConnectionId}, }, proofs::ProofError, }; -use prost::{ - DecodeError, - EncodeError, -}; +use prost::{DecodeError, EncodeError}; use regex::Regex; -use tendermint::{ - abci, - Error as TendermintError, -}; +use tendermint::{abci, Error as TendermintError}; use tendermint_light_client::{ builder::error::Error as LightClientBuilderError, components::io::IoError as LightClientIoError, - errors::{ - Error as LightClientError, - ErrorDetail as LightClientErrorDetail, - }, + errors::{Error as LightClientError, ErrorDetail as LightClientErrorDetail}, }; use tendermint_proto::Error as TendermintProtoError; use tendermint_rpc::{ - endpoint::{ - abci_query::AbciQuery, - broadcast::tx_sync::Response as TxSyncResponse, - }, + endpoint::{abci_query::AbciQuery, broadcast::tx_sync::Response as TxSyncResponse}, Error as TendermintRpcError, }; use tonic::{ - metadata::errors::InvalidMetadataValue, - transport::Error as TransportError, + metadata::errors::InvalidMetadataValue, transport::Error as TransportError, Status as GrpcStatus, }; use crate::{ - chain::cosmos::{ - version, - BLOCK_MAX_BYTES_MAX_FRACTION, - }, + chain::cosmos::{version, BLOCK_MAX_BYTES_MAX_FRACTION}, config::Error as ConfigError, event::source, - keyring::{ - errors::Error as KeyringError, - KeyType, - }, + keyring::{errors::Error as KeyringError, KeyType}, sdk_error::SdkError, }; diff --git a/crates/relayer/src/event.rs b/crates/relayer/src/event.rs index fa3fff5e54..3734dd40f6 100644 --- a/crates/relayer/src/event.rs +++ b/crates/relayer/src/event.rs @@ -1,53 +1,29 @@ -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use ibc_relayer_types::{ applications::{ - ics29_fee::events::{ - DistributeFeePacket, - IncentivizedPacket, - }, + ics29_fee::events::{DistributeFeePacket, IncentivizedPacket}, ics31_icq::events::CrossChainQueryPacket, }, core::{ ics02_client::{ error::Error as ClientError, - events::{ - self as client_events, - Attributes as ClientAttributes, - HEADER_ATTRIBUTE_KEY, - }, - header::{ - decode_header, - AnyHeader, - }, + events::{self as client_events, Attributes as ClientAttributes, HEADER_ATTRIBUTE_KEY}, + header::{decode_header, AnyHeader}, height::HeightErrorDetail, }, ics03_connection::{ error::Error as ConnectionError, - events::{ - self as connection_events, - Attributes as ConnectionAttributes, - }, + events::{self as connection_events, Attributes as ConnectionAttributes}, }, ics04_channel::{ error::Error as ChannelError, - events::{ - self as channel_events, - Attributes as ChannelAttributes, - }, + events::{self as channel_events, Attributes as ChannelAttributes}, packet::Packet, timeout::TimeoutHeight, }, }, - events::{ - Error as IbcEventError, - IbcEvent, - IbcEventType, - }, + events::{Error as IbcEventError, IbcEvent, IbcEventType}, Height, }; use serde::Serialize; @@ -487,17 +463,11 @@ pub fn parse_timeout_height(s: &str) -> Result { #[cfg(test)] mod tests { - use ibc_proto::{ - google::protobuf::Any, - Protobuf, - }; + use ibc_proto::{google::protobuf::Any, Protobuf}; use ibc_relayer_types::{ clients::ics07_tendermint::header::test_util::get_dummy_ics07_header, core::{ - ics02_client::header::{ - decode_header, - AnyHeader, - }, + ics02_client::header::{decode_header, AnyHeader}, ics04_channel::packet::Sequence, }, timestamp::Timestamp, diff --git a/crates/relayer/src/event/bus.rs b/crates/relayer/src/event/bus.rs index d302e542fc..b7486ed693 100644 --- a/crates/relayer/src/event/bus.rs +++ b/crates/relayer/src/event/bus.rs @@ -47,10 +47,7 @@ impl EventBus { #[cfg(test)] mod tests { - use core::sync::atomic::{ - AtomicUsize, - Ordering, - }; + use core::sync::atomic::{AtomicUsize, Ordering}; use serial_test::serial; use test_log::test; diff --git a/crates/relayer/src/event/error.rs b/crates/relayer/src/event/error.rs index d81607d13e..8ec9592ffe 100644 --- a/crates/relayer/src/event/error.rs +++ b/crates/relayer/src/event/error.rs @@ -1,12 +1,6 @@ -use flex_error::{ - define_error, - TraceError, -}; +use flex_error::{define_error, TraceError}; use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use tendermint_rpc::{ - Error as RpcError, - WebSocketClientUrl, -}; +use tendermint_rpc::{Error as RpcError, WebSocketClientUrl}; define_error! { #[derive(Debug, Clone)] diff --git a/crates/relayer/src/event/source.rs b/crates/relayer/src/event/source.rs index 1b62ae276f..8f1e683dec 100644 --- a/crates/relayer/src/event/source.rs +++ b/crates/relayer/src/event/source.rs @@ -1,35 +1,19 @@ pub mod rpc; pub mod websocket; -use std::{ - sync::Arc, - time::Duration, -}; +use std::{sync::Arc, time::Duration}; use crossbeam_channel as channel; use futures::Stream; -use ibc_relayer_types::core::{ - ics02_client::height::Height, - ics24_host::identifier::ChainId, -}; +use ibc_relayer_types::core::{ics02_client::height::Height, ics24_host::identifier::ChainId}; use tendermint_rpc::{ - client::CompatMode, - event::Event as RpcEvent, - Error as RpcError, - HttpClient, - WebSocketClientUrl, + client::CompatMode, event::Event as RpcEvent, Error as RpcError, HttpClient, WebSocketClientUrl, }; use tokio::runtime::Runtime as TokioRuntime; -pub use super::error::{ - Error, - ErrorDetail, -}; +pub use super::error::{Error, ErrorDetail}; use super::IbcEventWithHeight; -use crate::chain::{ - handle::Subscription, - tracking::TrackingId, -}; +use crate::chain::{handle::Subscription, tracking::TrackingId}; pub type Result = core::result::Result; @@ -117,10 +101,7 @@ pub enum EventSourceCmd { // TODO: These are SDK specific, should be eventually moved. pub mod queries { - use tendermint_rpc::query::{ - EventType, - Query, - }; + use tendermint_rpc::query::{EventType, Query}; pub fn all() -> Vec { // Note: Tendermint-go supports max 5 query specifiers! diff --git a/crates/relayer/src/event/source/rpc.rs b/crates/relayer/src/event/source/rpc.rs index 2e40d33956..c3768dbb06 100644 --- a/crates/relayer/src/event/source/rpc.rs +++ b/crates/relayer/src/event/source/rpc.rs @@ -5,50 +5,24 @@ use std::sync::Arc; use crossbeam_channel as channel; use ibc_relayer_types::{ core::{ - ics02_client::{ - events::NewBlock, - height::Height, - }, + ics02_client::{events::NewBlock, height::Height}, ics24_host::identifier::ChainId, }, events::IbcEvent, }; -use tendermint::{ - abci, - block::Height as BlockHeight, -}; -use tendermint_rpc::{ - Client, - HttpClient, -}; +use tendermint::{abci, block::Height as BlockHeight}; +use tendermint_rpc::{Client, HttpClient}; use tokio::{ runtime::Runtime as TokioRuntime, - time::{ - sleep, - Duration, - Instant, - }, -}; -use tracing::{ - debug, - error, - error_span, - trace, + time::{sleep, Duration, Instant}, }; +use tracing::{debug, error, error_span, trace}; use self::extract::extract_events; -use super::{ - EventBatch, - EventSourceCmd, - TxEventSourceCmd, -}; +use super::{EventBatch, EventSourceCmd, TxEventSourceCmd}; use crate::{ chain::tracking::TrackingId, - event::{ - bus::EventBus, - source::Error, - IbcEventWithHeight, - }, + event::{bus::EventBus, source::Error, IbcEventWithHeight}, telemetry, util::retry::ConstantGrowth, }; @@ -266,10 +240,7 @@ fn poll_backoff(poll_interval: Duration) -> impl Iterator { } fn dedupe(events: Vec) -> Vec { - use std::hash::{ - Hash, - Hasher, - }; + use std::hash::{Hash, Hasher}; use itertools::Itertools; diff --git a/crates/relayer/src/event/source/rpc/extract.rs b/crates/relayer/src/event/source/rpc/extract.rs index 43188c33c4..399792345c 100644 --- a/crates/relayer/src/event/source/rpc/extract.rs +++ b/crates/relayer/src/event/source/rpc/extract.rs @@ -1,18 +1,12 @@ use ibc_relayer_types::{ applications::ics29_fee::events::DistributionType, - core::{ - ics02_client::height::Height, - ics24_host::identifier::ChainId, - }, + core::{ics02_client::height::Height, ics24_host::identifier::ChainId}, events::IbcEvent, }; use tendermint::abci; use crate::{ - event::{ - ibc_event_try_from_abci_event, - IbcEventWithHeight, - }, + event::{ibc_event_try_from_abci_event, IbcEventWithHeight}, telemetry, }; diff --git a/crates/relayer/src/event/source/websocket.rs b/crates/relayer/src/event/source/websocket.rs index db32ed5928..578d12393c 100644 --- a/crates/relayer/src/event/source/websocket.rs +++ b/crates/relayer/src/event/source/websocket.rs @@ -7,61 +7,25 @@ use std::time::Duration; use crossbeam_channel as channel; use futures::{ pin_mut, - stream::{ - self, - select_all, - StreamExt, - }, - Stream, - TryStreamExt, -}; -use ibc_relayer_types::{ - core::ics24_host::identifier::ChainId, - events::IbcEvent, + stream::{self, select_all, StreamExt}, + Stream, TryStreamExt, }; +use ibc_relayer_types::{core::ics24_host::identifier::ChainId, events::IbcEvent}; use tendermint_rpc::{ - client::CompatMode, - event::Event as RpcEvent, - query::Query, - SubscriptionClient, - WebSocketClient, - WebSocketClientDriver, - WebSocketClientUrl, -}; -use tokio::{ - runtime::Runtime as TokioRuntime, - sync::mpsc, - task::JoinHandle, -}; -use tracing::{ - debug, - error, - info, - instrument, - trace, + client::CompatMode, event::Event as RpcEvent, query::Query, SubscriptionClient, + WebSocketClient, WebSocketClientDriver, WebSocketClientUrl, }; +use tokio::{runtime::Runtime as TokioRuntime, sync::mpsc, task::JoinHandle}; +use tracing::{debug, error, info, instrument, trace}; use self::extract::extract_events; -use super::{ - EventBatch, - EventSourceCmd, - Result, - SubscriptionStream, - TxEventSourceCmd, -}; +use super::{EventBatch, EventSourceCmd, Result, SubscriptionStream, TxEventSourceCmd}; use crate::{ chain::tracking::TrackingId, - event::{ - bus::EventBus, - error::*, - IbcEventWithHeight, - }, + event::{bus::EventBus, error::*, IbcEventWithHeight}, telemetry, util::{ - retry::{ - retry_with_index, - RetryResult, - }, + retry::{retry_with_index, RetryResult}, stream::try_group_while_timeout, }, }; diff --git a/crates/relayer/src/event/source/websocket/extract.rs b/crates/relayer/src/event/source/websocket/extract.rs index 0fcedb8fd5..a203a7669a 100644 --- a/crates/relayer/src/event/source/websocket/extract.rs +++ b/crates/relayer/src/event/source/websocket/extract.rs @@ -2,32 +2,19 @@ use alloc::collections::BTreeMap as HashMap; use core::convert::TryFrom; use ibc_relayer_types::{ - applications::{ - ics29_fee::events::DistributionType, - ics31_icq::events::CrossChainQueryPacket, - }, + applications::{ics29_fee::events::DistributionType, ics31_icq::events::CrossChainQueryPacket}, core::{ - ics02_client::{ - events as ClientEvents, - height::Height, - }, + ics02_client::{events as ClientEvents, height::Height}, ics04_channel::events as ChannelEvents, ics24_host::identifier::ChainId, }, events::IbcEvent, }; -use tendermint_rpc::event::{ - Event as RpcEvent, - EventData as RpcEventData, -}; +use tendermint_rpc::event::{Event as RpcEvent, EventData as RpcEventData}; use crate::{ chain::cosmos::types::events::channel::RawObject, - event::{ - ibc_event_try_from_abci_event, - source::queries, - IbcEventWithHeight, - }, + event::{ibc_event_try_from_abci_event, source::queries, IbcEventWithHeight}, telemetry, }; diff --git a/crates/relayer/src/extension_options.rs b/crates/relayer/src/extension_options.rs index ceff3c50e3..b796a5cbbe 100644 --- a/crates/relayer/src/extension_options.rs +++ b/crates/relayer/src/extension_options.rs @@ -1,9 +1,6 @@ use ibc_proto::google::protobuf::Any; use prost::Message; -use serde_derive::{ - Deserialize, - Serialize, -}; +use serde_derive::{Deserialize, Serialize}; use crate::error::Error; diff --git a/crates/relayer/src/foreign_client.rs b/crates/relayer/src/foreign_client.rs index eb1bb88fa2..0d08de2ccb 100644 --- a/crates/relayer/src/foreign_client.rs +++ b/crates/relayer/src/foreign_client.rs @@ -4,14 +4,8 @@ //! i.e. they are *foreign* to the relayer. In contrast, the term "local client" //! refers to light clients running *locally* as part of the relayer. -use core::{ - fmt, - time::Duration, -}; -use std::{ - thread, - time::Instant, -}; +use core::{fmt, time::Duration}; +use std::{thread, time::Instant}; use flex_error::define_error; use ibc_proto::google::protobuf::Any; @@ -22,69 +16,36 @@ use ibc_relayer_types::{ client_state::ClientState, error::Error as ClientError, events::UpdateClient, - header::{ - AnyHeader, - Header, - }, + header::{AnyHeader, Header}, msgs::{ - create_client::MsgCreateClient, - misbehaviour::MsgSubmitMisbehaviour, - update_client::MsgUpdateClient, - upgrade_client::MsgUpgradeClient, + create_client::MsgCreateClient, misbehaviour::MsgSubmitMisbehaviour, + update_client::MsgUpdateClient, upgrade_client::MsgUpgradeClient, }, trust_threshold::TrustThreshold, }, - ics24_host::identifier::{ - ChainId, - ClientId, - }, + ics24_host::identifier::{ChainId, ClientId}, }, downcast, - events::{ - IbcEvent, - IbcEventType, - WithBlockDataType, - }, - timestamp::{ - Timestamp, - TimestampOverflowError, - }, + events::{IbcEvent, IbcEventType, WithBlockDataType}, + timestamp::{Timestamp, TimestampOverflowError}, tx_msg::Msg, Height, }; use itertools::Itertools; -use tracing::{ - debug, - error, - info, - instrument, - trace, - warn, -}; +use tracing::{debug, error, info, instrument, trace, warn}; use crate::{ - chain::{ - client::ClientSettings, - handle::ChainHandle, - requests::*, - tracking::TrackedMsgs, - }, + chain::{client::ClientSettings, handle::ChainHandle, requests::*, tracking::TrackedMsgs}, client_state::AnyClientState, config::ChainConfig, consensus_state::AnyConsensusState, error::Error as RelayerError, event::IbcEventWithHeight, - misbehaviour::{ - AnyMisbehaviour, - MisbehaviourEvidence, - }, + misbehaviour::{AnyMisbehaviour, MisbehaviourEvidence}, telemetry, util::{ collate::CollatedIterExt, - pretty::{ - PrettyDuration, - PrettySlice, - }, + pretty::{PrettyDuration, PrettySlice}, }, }; diff --git a/crates/relayer/src/keyring.rs b/crates/relayer/src/keyring.rs index 5c21615132..1bea504caf 100644 --- a/crates/relayer/src/keyring.rs +++ b/crates/relayer/src/keyring.rs @@ -3,10 +3,7 @@ pub use any_signing_key_pair::AnySigningKeyPair; pub use ed25519_key_pair::Ed25519KeyPair; pub use key_type::KeyType; pub use secp256k1_key_pair::Secp256k1KeyPair; -pub use signing_key_pair::{ - SigningKeyPair, - SigningKeyPairSized, -}; +pub use signing_key_pair::{SigningKeyPair, SigningKeyPairSized}; mod any_signing_key_pair; mod ed25519_key_pair; @@ -19,19 +16,13 @@ mod signing_key_pair; use alloc::collections::btree_map::BTreeMap as HashMap; use std::{ ffi::OsStr, - fs::{ - self, - File, - }, + fs::{self, File}, path::PathBuf, }; use errors::Error; use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; pub const KEYSTORE_DEFAULT_FOLDER: &str = ".hermes/keys/"; pub const KEYSTORE_DISK_BACKEND: &str = "keyring-test"; diff --git a/crates/relayer/src/keyring/any_signing_key_pair.rs b/crates/relayer/src/keyring/any_signing_key_pair.rs index fc0c559086..b9dd880c10 100644 --- a/crates/relayer/src/keyring/any_signing_key_pair.rs +++ b/crates/relayer/src/keyring/any_signing_key_pair.rs @@ -1,11 +1,6 @@ use serde::Serialize; -use super::{ - Ed25519KeyPair, - KeyType, - Secp256k1KeyPair, - SigningKeyPair, -}; +use super::{Ed25519KeyPair, KeyType, Secp256k1KeyPair, SigningKeyPair}; #[derive(Clone, Debug, Serialize)] #[serde(untagged)] diff --git a/crates/relayer/src/keyring/ed25519_key_pair.rs b/crates/relayer/src/keyring/ed25519_key_pair.rs index 93d8374322..0f1188fc1c 100644 --- a/crates/relayer/src/keyring/ed25519_key_pair.rs +++ b/crates/relayer/src/keyring/ed25519_key_pair.rs @@ -1,32 +1,13 @@ use core::any::Any; -use bip39::{ - Language, - Mnemonic, - Seed, -}; -use ed25519_dalek::{ - SigningKey, - VerifyingKey, -}; -use ed25519_dalek_bip32::{ - ChildIndex, - DerivationPath, - ExtendedSigningKey, -}; +use bip39::{Language, Mnemonic, Seed}; +use ed25519_dalek::{SigningKey, VerifyingKey}; +use ed25519_dalek_bip32::{ChildIndex, DerivationPath, ExtendedSigningKey}; use hdpath::StandardHDPath; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use signature::Signer; -use super::{ - errors::Error, - KeyFile, - KeyType, - SigningKeyPair, -}; +use super::{errors::Error, KeyFile, KeyType, SigningKeyPair}; use crate::config::AddressType; pub fn private_key_from_mnemonic( @@ -158,10 +139,7 @@ impl SigningKeyPair for Ed25519KeyPair { bs58::encode(&self.signing_key.verifying_key()).into_string() } Ed25519AddressType::Astria => { - use astria_core::{ - crypto::VerificationKey, - primitive::v1::Address, - }; + use astria_core::{crypto::VerificationKey, primitive::v1::Address}; let verification_key = VerificationKey::try_from(self.signing_key.verifying_key().to_bytes()) .expect("can convert ed25519 public key bytes to astria verification key"); diff --git a/crates/relayer/src/keyring/errors.rs b/crates/relayer/src/keyring/errors.rs index 96b1af8fc1..d6b811b478 100644 --- a/crates/relayer/src/keyring/errors.rs +++ b/crates/relayer/src/keyring/errors.rs @@ -1,10 +1,6 @@ use std::io::Error as IoError; -use flex_error::{ - define_error, - DisplayOnly, - TraceError, -}; +use flex_error::{define_error, DisplayOnly, TraceError}; use super::KeyType; use crate::config::AddressType; diff --git a/crates/relayer/src/keyring/key_utils.rs b/crates/relayer/src/keyring/key_utils.rs index 18f5c86923..0defa4e81f 100644 --- a/crates/relayer/src/keyring/key_utils.rs +++ b/crates/relayer/src/keyring/key_utils.rs @@ -1,11 +1,5 @@ -use bech32::{ - FromBase32, - ToBase32, -}; -use tiny_keccak::{ - Hasher, - Keccak, -}; +use bech32::{FromBase32, ToBase32}; +use tiny_keccak::{Hasher, Keccak}; use super::errors::Error; diff --git a/crates/relayer/src/keyring/pub_key.rs b/crates/relayer/src/keyring/pub_key.rs index b9ad529174..923e7ad657 100644 --- a/crates/relayer/src/keyring/pub_key.rs +++ b/crates/relayer/src/keyring/pub_key.rs @@ -1,19 +1,10 @@ use core::str::FromStr; -use serde::{ - Deserialize, - Deserializer, -}; +use serde::{Deserialize, Deserializer}; use subtle_encoding::base64; -use tracing::{ - error, - trace, -}; +use tracing::{error, trace}; -use super::{ - errors::Error, - key_utils::decode_bech32, -}; +use super::{errors::Error, key_utils::decode_bech32}; #[derive(Debug)] pub enum EncodedPubKey { diff --git a/crates/relayer/src/keyring/secp256k1_key_pair.rs b/crates/relayer/src/keyring/secp256k1_key_pair.rs index 7655b3ab46..5f067696ef 100644 --- a/crates/relayer/src/keyring/secp256k1_key_pair.rs +++ b/crates/relayer/src/keyring/secp256k1_key_pair.rs @@ -1,53 +1,24 @@ use core::any::Any; -use bip39::{ - Language, - Mnemonic, - Seed, -}; +use bip39::{Language, Mnemonic, Seed}; use bitcoin::{ - bip32::{ - ChildNumber, - DerivationPath, - Xpriv, - Xpub, - }, + bip32::{ChildNumber, DerivationPath, Xpriv, Xpub}, network::Network, }; use digest::Digest; -use generic_array::{ - typenum::U32, - GenericArray, -}; +use generic_array::{typenum::U32, GenericArray}; use hdpath::StandardHDPath; use ripemd::Ripemd160; -use secp256k1::{ - Message, - PublicKey, - Secp256k1, - SecretKey, -}; -use serde::{ - Deserialize, - Serialize, -}; +use secp256k1::{Message, PublicKey, Secp256k1, SecretKey}; +use serde::{Deserialize, Serialize}; use sha2::Sha256; -use strum::{ - EnumIter, - IntoEnumIterator, -}; +use strum::{EnumIter, IntoEnumIterator}; use super::{ errors::Error, - key_utils::{ - decode_bech32, - encode_bech32, - keccak256_hash, - }, + key_utils::{decode_bech32, encode_bech32, keccak256_hash}, pub_key::EncodedPubKey, - KeyFile, - KeyType, - SigningKeyPair, + KeyFile, KeyType, SigningKeyPair, }; use crate::config::AddressType; diff --git a/crates/relayer/src/keyring/signing_key_pair.rs b/crates/relayer/src/keyring/signing_key_pair.rs index f8506a0e77..4609840f01 100644 --- a/crates/relayer/src/keyring/signing_key_pair.rs +++ b/crates/relayer/src/keyring/signing_key_pair.rs @@ -1,15 +1,9 @@ use core::any::Any; use hdpath::StandardHDPath; -use serde::{ - de::DeserializeOwned, - Serialize, -}; - -use super::{ - errors::Error, - KeyType, -}; +use serde::{de::DeserializeOwned, Serialize}; + +use super::{errors::Error, KeyType}; use crate::config::AddressType; pub trait SigningKeyPair { diff --git a/crates/relayer/src/light_client.rs b/crates/relayer/src/light_client.rs index 44e93d6adc..17e870b244 100644 --- a/crates/relayer/src/light_client.rs +++ b/crates/relayer/src/light_client.rs @@ -1,15 +1,10 @@ pub mod io; pub mod tendermint; -use ibc_relayer_types::{ - core::ics02_client::events::UpdateClient, - Height, -}; +use ibc_relayer_types::{core::ics02_client::events::UpdateClient, Height}; use crate::{ - chain::endpoint::ChainEndpoint, - client_state::AnyClientState, - error, + chain::endpoint::ChainEndpoint, client_state::AnyClientState, error, misbehaviour::MisbehaviourEvidence, }; diff --git a/crates/relayer/src/light_client/io.rs b/crates/relayer/src/light_client/io.rs index 3db93f723d..280a53db5a 100644 --- a/crates/relayer/src/light_client/io.rs +++ b/crates/relayer/src/light_client/io.rs @@ -1,14 +1,6 @@ -use tendermint::{ - account, - block::Height, -}; +use tendermint::{account, block::Height}; use tendermint_light_client::{ - components::io::{ - AtHeight, - Io, - IoError, - ProdIo, - }, + components::io::{AtHeight, Io, IoError, ProdIo}, types::LightBlock, }; diff --git a/crates/relayer/src/light_client/tendermint.rs b/crates/relayer/src/light_client/tendermint.rs index c6ac726294..886dc9ef74 100644 --- a/crates/relayer/src/light_client/tendermint.rs +++ b/crates/relayer/src/light_client/tendermint.rs @@ -6,14 +6,10 @@ use std::time::Duration; use ibc_relayer_types::core::ics02_client::client_type::ClientType; use ibc_relayer_types::{ clients::ics07_tendermint::{ - header::Header as TmHeader, - misbehaviour::Misbehaviour as TmMisbehaviour, + header::Header as TmHeader, misbehaviour::Misbehaviour as TmMisbehaviour, }, core::{ - ics02_client::{ - events::UpdateClient, - header::AnyHeader, - }, + ics02_client::{events::UpdateClient, header::AnyHeader}, ics24_host::identifier::ChainId, }, Height as ICSHeight, @@ -23,55 +19,29 @@ use tendermint::Time; use tendermint_light_client::{ components::{ self, - io::{ - AtHeight, - Io, - ProdIo, - }, + io::{AtHeight, Io, ProdIo}, }, light_client::LightClient as TmLightClient, state::State as LightClientState, - store::{ - memory::MemoryStore, - LightStore, - }, + store::{memory::MemoryStore, LightStore}, verifier::{ - types::{ - Height as TMHeight, - LightBlock, - PeerId, - Status, - }, + types::{Height as TMHeight, LightBlock, PeerId, Status}, ProdVerifier, }, }; use tendermint_light_client_detector::Divergence; use tendermint_rpc as rpc; -use tracing::{ - debug, - error, - trace, - warn, -}; +use tracing::{debug, error, trace, warn}; use super::{ - io::{ - AnyIo, - RestartAwareIo, - }, + io::{AnyIo, RestartAwareIo}, Verified, }; use crate::{ - chain::cosmos::{ - config::CosmosSdkConfig, - CosmosSdkChain, - }, + chain::cosmos::{config::CosmosSdkConfig, CosmosSdkChain}, client_state::AnyClientState, error::Error, - misbehaviour::{ - AnyMisbehaviour, - MisbehaviourEvidence, - }, + misbehaviour::{AnyMisbehaviour, MisbehaviourEvidence}, }; pub struct LightClient { diff --git a/crates/relayer/src/light_client/tendermint/detector.rs b/crates/relayer/src/light_client/tendermint/detector.rs index 8914ee8663..8362f9a81c 100644 --- a/crates/relayer/src/light_client/tendermint/detector.rs +++ b/crates/relayer/src/light_client/tendermint/detector.rs @@ -1,45 +1,21 @@ use ibc_relayer_types::clients::ics07_tendermint::client_state::ClientState; use tendermint::{ - evidence::{ - Evidence, - LightClientAttackEvidence, - }, - Hash, - Time, + evidence::{Evidence, LightClientAttackEvidence}, + Hash, Time, }; use tendermint_light_client::{ builder::LightClientBuilder, - components::{ - clock::FixedClock, - io::ProdIo, - scheduler, - }, + components::{clock::FixedClock, io::ProdIo, scheduler}, predicates::ProdPredicates, store::memory::MemoryStore, - types::{ - LightBlock, - PeerId, - }, + types::{LightBlock, PeerId}, verifier::ProdVerifier, }; -use tendermint_light_client_detector::{ - detect_divergence, - Divergence, - Provider, -}; -use tendermint_rpc::{ - Client, - HttpClient, -}; -use tracing::{ - error, - info, -}; +use tendermint_light_client_detector::{detect_divergence, Divergence, Provider}; +use tendermint_rpc::{Client, HttpClient}; +use tracing::{error, info}; -use crate::{ - error::Error, - util::block_on, -}; +use crate::{error::Error, util::block_on}; type Hasher = tendermint::crypto::default::Sha256; diff --git a/crates/relayer/src/link.rs b/crates/relayer/src/link.rs index 873a0f95b0..079f9abdc5 100644 --- a/crates/relayer/src/link.rs +++ b/crates/relayer/src/link.rs @@ -1,11 +1,7 @@ use ibc_relayer_types::core::{ ics03_connection::connection::State as ConnectionState, ics04_channel::channel::State as ChannelState, - ics24_host::identifier::{ - ChannelId, - PortChannelId, - PortId, - }, + ics24_host::identifier::{ChannelId, PortChannelId, PortId}, }; use tracing::info; @@ -13,17 +9,9 @@ use crate::{ chain::{ counterparty::check_channel_counterparty, handle::ChainHandle, - requests::{ - IncludeProof, - QueryChannelRequest, - QueryConnectionRequest, - QueryHeight, - }, - }, - channel::{ - Channel, - ChannelSide, + requests::{IncludeProof, QueryChannelRequest, QueryConnectionRequest, QueryHeight}, }, + channel::{Channel, ChannelSide}, config::types::ics20_field_size_limit::Ics20FieldSizeLimit, link::error::LinkError, }; @@ -39,10 +27,7 @@ mod relay_sender; mod relay_summary; mod tx_hashes; -pub use relay_path::{ - RelayPath, - Resubmit, -}; +pub use relay_path::{RelayPath, Resubmit}; // Re-export the telemetries summary pub use relay_summary::RelaySummary; use tx_hashes::TxHashes; diff --git a/crates/relayer/src/link/cli.rs b/crates/relayer/src/link/cli.rs index fd7b78ba34..a0d9c046c4 100644 --- a/crates/relayer/src/link/cli.rs +++ b/crates/relayer/src/link/cli.rs @@ -2,33 +2,21 @@ use std::{ convert::TryInto, ops::RangeInclusive, thread, - time::{ - Duration, - Instant, - }, + time::{Duration, Instant}, }; use ibc_relayer_types::{ core::ics04_channel::packet::Sequence, events::IbcEvent, - utils::pretty::{ - PrettyDuration, - PrettySlice, - }, + utils::pretty::{PrettyDuration, PrettySlice}, Height, }; use itertools::Itertools; -use tracing::{ - error_span, - info, -}; +use tracing::{error_span, info}; use crate::{ chain::{ - counterparty::{ - unreceived_acknowledgements, - unreceived_packets, - }, + counterparty::{unreceived_acknowledgements, unreceived_packets}, handle::ChainHandle, requests::Qualified, tracking::TrackingId, @@ -37,18 +25,12 @@ use crate::{ event::IbcEventWithHeight, link::{ error::LinkError, - operational_data::{ - OperationalData, - TrackedEvents, - }, + operational_data::{OperationalData, TrackedEvents}, packet_events::{ - query_packet_events_with, - query_send_packet_events, - query_write_ack_events, + query_packet_events_with, query_send_packet_events, query_write_ack_events, }, relay_sender::SyncSender, - Link, - RelayPath, + Link, RelayPath, }, path::PathIdentifiers, util::collate::CollatedIterExt as _, diff --git a/crates/relayer/src/link/error.rs b/crates/relayer/src/link/error.rs index d9ea749b50..4cd077751e 100644 --- a/crates/relayer/src/link/error.rs +++ b/crates/relayer/src/link/error.rs @@ -2,11 +2,7 @@ use flex_error::define_error; use ibc_relayer_types::{ core::{ ics02_client::error::Error as Ics02Error, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }, events::IbcEvent, Height, @@ -16,10 +12,7 @@ use crate::{ channel::ChannelError, connection::ConnectionError, error::Error, - foreign_client::{ - ForeignClientError, - HasExpiredOrFrozenError, - }, + foreign_client::{ForeignClientError, HasExpiredOrFrozenError}, supervisor::Error as SupervisorError, transfer::TransferError, }; diff --git a/crates/relayer/src/link/operational_data.rs b/crates/relayer/src/link/operational_data.rs index 8cc5820f04..34189f941e 100644 --- a/crates/relayer/src/link/operational_data.rs +++ b/crates/relayer/src/link/operational_data.rs @@ -1,44 +1,21 @@ -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use std::{ ops::Add, - time::{ - Duration, - Instant, - }, + time::{Duration, Instant}, }; use ibc_proto::google::protobuf::Any; -use ibc_relayer_types::{ - core::ics02_client::client_state::ClientState, - Height, -}; -use tracing::{ - debug, - info, -}; +use ibc_relayer_types::{core::ics02_client::client_state::ClientState, Height}; +use tracing::{debug, info}; use crate::{ chain::{ handle::ChainHandle, - requests::{ - IncludeProof, - QueryClientStateRequest, - QueryHeight, - }, - tracking::{ - TrackedMsgs, - TrackingId, - }, + requests::{IncludeProof, QueryClientStateRequest, QueryHeight}, + tracking::{TrackedMsgs, TrackingId}, }, event::IbcEventWithHeight, - link::{ - error::LinkError, - RelayPath, - }, + link::{error::LinkError, RelayPath}, }; /// The chain that the events associated with a piece of [`OperationalData`] are bound for. diff --git a/crates/relayer/src/link/packet_events.rs b/crates/relayer/src/link/packet_events.rs index 9a2dcbc589..73bc3a8c4d 100644 --- a/crates/relayer/src/link/packet_events.rs +++ b/crates/relayer/src/link/packet_events.rs @@ -1,26 +1,13 @@ //! Utility methods for querying packet event data. -use ibc_relayer_types::{ - core::ics04_channel::packet::Sequence, - events::WithBlockDataType, - Height, -}; +use ibc_relayer_types::{core::ics04_channel::packet::Sequence, events::WithBlockDataType, Height}; use itertools::Itertools; -use tracing::{ - info, - span, - warn, - Level, -}; +use tracing::{info, span, warn, Level}; use crate::{ chain::{ handle::ChainHandle, - requests::{ - Qualified, - QueryHeight, - QueryPacketEventDataRequest, - }, + requests::{Qualified, QueryHeight, QueryPacketEventDataRequest}, }, error::Error, event::IbcEventWithHeight, diff --git a/crates/relayer/src/link/pending.rs b/crates/relayer/src/link/pending.rs index c2284cc0a1..d3e545c753 100644 --- a/crates/relayer/src/link/pending.rs +++ b/crates/relayer/src/link/pending.rs @@ -1,41 +1,22 @@ -use core::{ - iter::Iterator, - time::Duration, -}; +use core::{iter::Iterator, time::Duration}; use std::time::Instant; use ibc_relayer_types::{ - core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChainId, ChannelId, PortId}, events::IbcEvent, }; -use tracing::{ - debug, - error, - trace, - trace_span, -}; +use tracing::{debug, error, trace, trace_span}; use crate::{ chain::{ handle::ChainHandle, - requests::{ - QueryTxHash, - QueryTxRequest, - }, + requests::{QueryTxHash, QueryTxRequest}, tracking::TrackingId, }, error::Error as RelayerError, link::{ - error::LinkError, - operational_data::OperationalData, - relay_sender::AsyncReply, - RelayPath, - RelaySummary, - TxHashes, + error::LinkError, operational_data::OperationalData, relay_sender::AsyncReply, RelayPath, + RelaySummary, TxHashes, }, telemetry, util::queue::Queue, diff --git a/crates/relayer/src/link/relay_path.rs b/crates/relayer/src/link/relay_path.rs index 2a3a5f228e..c7a4463cb3 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -1,13 +1,7 @@ -use alloc::collections::{ - BTreeMap as HashMap, - VecDeque, -}; +use alloc::collections::{BTreeMap as HashMap, VecDeque}; use std::{ ops::Sub, - time::{ - Duration, - Instant, - }, + time::{Duration, Instant}, }; use ibc_proto::{ @@ -18,130 +12,59 @@ use ibc_relayer_types::{ core::{ ics02_client::events::ClientMisbehaviour, ics04_channel::{ - channel::{ - ChannelEnd, - Ordering, - }, - events::{ - SendPacket, - WriteAcknowledgement, - }, + channel::{ChannelEnd, Ordering}, + events::{SendPacket, WriteAcknowledgement}, msgs::{ - acknowledgement::MsgAcknowledgement, - chan_close_confirm::MsgChannelCloseConfirm, - recv_packet::MsgRecvPacket, - timeout::MsgTimeout, + acknowledgement::MsgAcknowledgement, chan_close_confirm::MsgChannelCloseConfirm, + recv_packet::MsgRecvPacket, timeout::MsgTimeout, timeout_on_close::MsgTimeoutOnClose, }, - packet::{ - Packet, - PacketMsgType, - }, + packet::{Packet, PacketMsgType}, }, - ics24_host::identifier::{ - ChannelId, - ClientId, - ConnectionId, - PortId, - }, - }, - events::{ - IbcEvent, - IbcEventType, - WithBlockDataType, + ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}, }, + events::{IbcEvent, IbcEventType, WithBlockDataType}, signer::Signer, timestamp::Timestamp, tx_msg::Msg, Height, }; use itertools::Itertools; -use tracing::{ - debug, - error, - info, - span, - trace, - warn, - Level, -}; +use tracing::{debug, error, info, span, trace, warn, Level}; use crate::{ chain::{ - counterparty::{ - unreceived_acknowledgements, - unreceived_packets, - }, + counterparty::{unreceived_acknowledgements, unreceived_packets}, endpoint::ChainStatus, handle::ChainHandle, requests::{ - IncludeProof, - Qualified, - QueryChannelRequest, - QueryClientEventRequest, - QueryHeight, - QueryHostConsensusStateRequest, - QueryNextSequenceReceiveRequest, - QueryPacketCommitmentRequest, - QueryTxRequest, - QueryUnreceivedAcksRequest, + IncludeProof, Qualified, QueryChannelRequest, QueryClientEventRequest, QueryHeight, + QueryHostConsensusStateRequest, QueryNextSequenceReceiveRequest, + QueryPacketCommitmentRequest, QueryTxRequest, QueryUnreceivedAcksRequest, QueryUnreceivedPacketsRequest, }, - tracking::{ - TrackedMsgs, - TrackingId, - }, - }, - channel::{ - error::ChannelError, - Channel, - }, - config::types::ics20_field_size_limit::{ - Ics20FieldSizeLimit, - ValidationResult, - }, - event::{ - source::EventBatch, - IbcEventWithHeight, - }, - foreign_client::{ - ForeignClient, - ForeignClientError, + tracking::{TrackedMsgs, TrackingId}, }, + channel::{error::ChannelError, Channel}, + config::types::ics20_field_size_limit::{Ics20FieldSizeLimit, ValidationResult}, + event::{source::EventBatch, IbcEventWithHeight}, + foreign_client::{ForeignClient, ForeignClientError}, link::{ - error::{ - self, - LinkError, - }, - operational_data::{ - OperationalData, - OperationalDataTarget, - TrackedEvents, - TransitMessage, - }, + error::{self, LinkError}, + operational_data::{OperationalData, OperationalDataTarget, TrackedEvents, TransitMessage}, packet_events::{ - query_packet_events_with, - query_send_packet_events, - query_write_ack_events, + query_packet_events_with, query_send_packet_events, query_write_ack_events, }, pending, pending::PendingTxs, relay_sender, - relay_sender::{ - AsyncReply, - SubmitReply, - }, + relay_sender::{AsyncReply, SubmitReply}, relay_summary::RelaySummary, - ChannelState, - LinkParameters, + ChannelState, LinkParameters, }, path::PathIdentifiers, telemetry, - util::{ - collate::CollatedIterExt, - pretty::PrettyEvents, - queue::Queue, - }, + util::{collate::CollatedIterExt, pretty::PrettyEvents, queue::Queue}, }; const MAX_RETRIES: usize = 5; diff --git a/crates/relayer/src/link/relay_sender.rs b/crates/relayer/src/link/relay_sender.rs index 185073c176..12efc62525 100644 --- a/crates/relayer/src/link/relay_sender.rs +++ b/crates/relayer/src/link/relay_sender.rs @@ -1,26 +1,13 @@ -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use ibc_relayer_types::events::IbcEvent; use tendermint_rpc::endpoint::broadcast::tx_sync; use tracing::info; use crate::{ - chain::{ - handle::ChainHandle, - tracking::TrackedMsgs, - }, - link::{ - error::LinkError, - RelaySummary, - }, - util::pretty::{ - PrettyCode, - PrettyEvents, - }, + chain::{handle::ChainHandle, tracking::TrackedMsgs}, + link::{error::LinkError, RelaySummary}, + util::pretty::{PrettyCode, PrettyEvents}, }; pub trait SubmitReply { diff --git a/crates/relayer/src/link/relay_summary.rs b/crates/relayer/src/link/relay_summary.rs index 97164af99e..73260438fa 100644 --- a/crates/relayer/src/link/relay_summary.rs +++ b/crates/relayer/src/link/relay_summary.rs @@ -1,8 +1,4 @@ -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use ibc_relayer_types::events::IbcEvent; diff --git a/crates/relayer/src/link/tx_hashes.rs b/crates/relayer/src/link/tx_hashes.rs index d682e48297..4516d74f79 100644 --- a/crates/relayer/src/link/tx_hashes.rs +++ b/crates/relayer/src/link/tx_hashes.rs @@ -1,8 +1,4 @@ -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use tendermint::Hash as TxHash; diff --git a/crates/relayer/src/misbehaviour.rs b/crates/relayer/src/misbehaviour.rs index 2d6cfe19e2..14685b6fb9 100644 --- a/crates/relayer/src/misbehaviour.rs +++ b/crates/relayer/src/misbehaviour.rs @@ -5,23 +5,15 @@ use ibc_relayer_types::mock::misbehaviour::Misbehaviour as MockMisbehaviour; use ibc_relayer_types::mock::misbehaviour::MOCK_MISBEHAVIOUR_TYPE_URL; use ibc_relayer_types::{ clients::ics07_tendermint::misbehaviour::{ - Misbehaviour as TmMisbehaviour, - TENDERMINT_MISBEHAVIOR_TYPE_URL, + Misbehaviour as TmMisbehaviour, TENDERMINT_MISBEHAVIOR_TYPE_URL, }, core::{ - ics02_client::{ - error::Error, - header::AnyHeader, - misbehaviour::Misbehaviour, - }, + ics02_client::{error::Error, header::AnyHeader, misbehaviour::Misbehaviour}, ics24_host::identifier::ClientId, }, Height, }; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use tendermint_proto::Protobuf; #[derive(Clone, Debug, PartialEq, Eq)] diff --git a/crates/relayer/src/object.rs b/crates/relayer/src/object.rs index d1ac7e2a09..d951da97af 100644 --- a/crates/relayer/src/object.rs +++ b/crates/relayer/src/object.rs @@ -7,40 +7,21 @@ use ibc_relayer_types::{ ics02_client::events::UpdateClient, ics03_connection::events::Attributes as ConnectionAttributes, ics04_channel::events::{ - Attributes, - CloseInit, - SendPacket, - TimeoutPacket, - WriteAcknowledgement, - }, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, + Attributes, CloseInit, SendPacket, TimeoutPacket, WriteAcknowledgement, }, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, }; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use crate::{ chain::{ counterparty::{ - channel_connection_client, - channel_connection_client_no_checks, - counterparty_chain_from_channel, - counterparty_chain_from_connection, + channel_connection_client, channel_connection_client_no_checks, + counterparty_chain_from_channel, counterparty_chain_from_connection, }, handle::ChainHandle, - requests::{ - IncludeProof, - QueryClientStateRequest, - QueryHeight, - }, + requests::{IncludeProof, QueryClientStateRequest, QueryHeight}, }, error::Error as RelayerError, supervisor::Error as SupervisorError, diff --git a/crates/relayer/src/path.rs b/crates/relayer/src/path.rs index e37510cc9b..5f0513e376 100644 --- a/crates/relayer/src/path.rs +++ b/crates/relayer/src/path.rs @@ -1,9 +1,6 @@ use ibc_relayer_types::core::{ ics04_channel::channel::IdentifiedChannelEnd, - ics24_host::identifier::{ - ChannelId, - PortId, - }, + ics24_host::identifier::{ChannelId, PortId}, }; /// Defines the channel & port identifiers which comprise diff --git a/crates/relayer/src/registry.rs b/crates/relayer/src/registry.rs index ea0a254d9f..efafa3a8f5 100644 --- a/crates/relayer/src/registry.rs +++ b/crates/relayer/src/registry.rs @@ -1,29 +1,16 @@ //! Registry for keeping track of [`ChainHandle`]s indexed by a `ChainId`. -use alloc::{ - collections::btree_map::BTreeMap as HashMap, - sync::Arc, -}; -use std::sync::{ - RwLock, - RwLockReadGuard, - RwLockWriteGuard, -}; +use alloc::{collections::btree_map::BTreeMap as HashMap, sync::Arc}; +use std::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard}; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use tokio::runtime::Runtime as TokioRuntime; -use tracing::{ - trace, - warn, -}; +use tracing::{trace, warn}; use crate::{ chain::handle::ChainHandle, config::Config, - spawn::{ - spawn_chain_runtime, - SpawnError, - }, + spawn::{spawn_chain_runtime, SpawnError}, util::lock::RwArc, }; diff --git a/crates/relayer/src/rest.rs b/crates/relayer/src/rest.rs index 91458c7ab4..4900c5e7bf 100644 --- a/crates/relayer/src/rest.rs +++ b/crates/relayer/src/rest.rs @@ -1,17 +1,10 @@ use crossbeam_channel::TryRecvError; use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use tracing::{ - error, - trace, -}; +use tracing::{error, trace}; use crate::{ config::Config, - rest::request::{ - ReplySender, - Request, - VersionInfo, - }, + rest::request::{ReplySender, Request, VersionInfo}, supervisor::dump_state::SupervisorState, }; diff --git a/crates/relayer/src/rest/error.rs b/crates/relayer/src/rest/error.rs index cbb0665307..5751be7c64 100644 --- a/crates/relayer/src/rest/error.rs +++ b/crates/relayer/src/rest/error.rs @@ -1,12 +1,5 @@ -use ibc_relayer_types::core::ics24_host::{ - error::ValidationErrorDetail, - identifier::ChainId, -}; -use serde::ser::{ - Serialize, - SerializeMap, - Serializer, -}; +use ibc_relayer_types::core::ics24_host::{error::ValidationErrorDetail, identifier::ChainId}; +use serde::ser::{Serialize, SerializeMap, Serializer}; use thiserror::Error; #[derive(Error, Debug)] diff --git a/crates/relayer/src/rest/request.rs b/crates/relayer/src/rest/request.rs index c9d1252f74..84ac6b696b 100644 --- a/crates/relayer/src/rest/request.rs +++ b/crates/relayer/src/rest/request.rs @@ -1,14 +1,7 @@ use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use serde::{ - Deserialize, - Serialize, -}; - -use crate::{ - config::ChainConfig, - rest::RestApiError, - supervisor::dump_state::SupervisorState, -}; +use serde::{Deserialize, Serialize}; + +use crate::{config::ChainConfig, rest::RestApiError, supervisor::dump_state::SupervisorState}; pub type ReplySender = crossbeam_channel::Sender>; pub type ReplyReceiver = crossbeam_channel::Receiver>; diff --git a/crates/relayer/src/spawn.rs b/crates/relayer/src/spawn.rs index ad143d7868..38cdb10830 100644 --- a/crates/relayer/src/spawn.rs +++ b/crates/relayer/src/spawn.rs @@ -6,15 +6,9 @@ use tokio::runtime::Runtime as TokioRuntime; use crate::{ chain::{ - astria::AstriaEndpoint, - cosmos::CosmosSdkChain, - handle::ChainHandle, - runtime::ChainRuntime, - }, - config::{ - ChainConfig, - Config, + astria::AstriaEndpoint, cosmos::CosmosSdkChain, handle::ChainHandle, runtime::ChainRuntime, }, + config::{ChainConfig, Config}, error::Error as RelayerError, }; diff --git a/crates/relayer/src/supervisor.rs b/crates/relayer/src/supervisor.rs index 26830f08d4..c897898967 100644 --- a/crates/relayer/src/supervisor.rs +++ b/crates/relayer/src/supervisor.rs @@ -1,86 +1,40 @@ -use alloc::{ - collections::btree_map::BTreeMap as HashMap, - sync::Arc, -}; -use core::{ - convert::Infallible, - ops::Deref, - time::Duration, -}; +use alloc::{collections::btree_map::BTreeMap as HashMap, sync::Arc}; +use core::{convert::Infallible, ops::Deref, time::Duration}; use std::sync::RwLock; -use crossbeam_channel::{ - unbounded, - Receiver, - Sender, -}; +use crossbeam_channel::{unbounded, Receiver, Sender}; use ibc_relayer_types::{ - core::ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + core::ics24_host::identifier::{ChainId, ChannelId, PortId}, events::IbcEvent, Height, }; use itertools::Itertools; -use tracing::{ - debug, - error, - error_span, - info, - instrument, - trace, - warn, -}; +use tracing::{debug, error, error_span, info, instrument, trace, warn}; use crate::{ - chain::{ - endpoint::HealthCheck, - handle::ChainHandle, - tracking::TrackingId, - }, + chain::{endpoint::HealthCheck, handle::ChainHandle, tracking::TrackingId}, config::Config, event::{ - source::{ - self, - Error as EventError, - ErrorDetail as EventErrorDetail, - EventBatch, - }, + source::{self, Error as EventError, ErrorDetail as EventErrorDetail, EventBatch}, IbcEventWithHeight, }, object::Object, - registry::{ - Registry, - SharedRegistry, - }, + registry::{Registry, SharedRegistry}, rest, supervisor::scan::ScanMode, telemetry, util::{ lock::LockExt, - task::{ - spawn_background_task, - Next, - TaskError, - TaskHandle, - }, + task::{spawn_background_task, Next, TaskError, TaskHandle}, }, worker::WorkerMap, }; pub mod client_state_filter; -use client_state_filter::{ - FilterPolicy, - Permission, -}; +use client_state_filter::{FilterPolicy, Permission}; pub mod error; -pub use error::{ - Error, - ErrorDetail, -}; +pub use error::{Error, ErrorDetail}; pub mod dump_state; use dump_state::SupervisorState; @@ -91,10 +45,7 @@ pub mod spawn; pub mod cmd; use cmd::SupervisorCmd; -use self::{ - scan::ChainScanner, - spawn::SpawnContext, -}; +use self::{scan::ChainScanner, spawn::SpawnContext}; type ArcBatch = Arc>; type Subscription = Receiver; diff --git a/crates/relayer/src/supervisor/client_state_filter.rs b/crates/relayer/src/supervisor/client_state_filter.rs index 0575a60f5e..bd1aebbde1 100644 --- a/crates/relayer/src/supervisor/client_state_filter.rs +++ b/crates/relayer/src/supervisor/client_state_filter.rs @@ -5,27 +5,15 @@ use ibc_relayer_types::core::{ ics02_client::trust_threshold::TrustThreshold, ics03_connection::connection::ConnectionEnd, ics04_channel::error::Error as ChannelError, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, - }, -}; -use tracing::{ - debug, - trace, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }; +use tracing::{debug, trace}; use crate::{ chain::{ handle::ChainHandle, requests::{ - IncludeProof, - QueryChannelRequest, - QueryClientStateRequest, - QueryConnectionRequest, + IncludeProof, QueryChannelRequest, QueryClientStateRequest, QueryConnectionRequest, QueryHeight, }, }, diff --git a/crates/relayer/src/supervisor/dump_state.rs b/crates/relayer/src/supervisor/dump_state.rs index da601611c5..31bf07c093 100644 --- a/crates/relayer/src/supervisor/dump_state.rs +++ b/crates/relayer/src/supervisor/dump_state.rs @@ -1,30 +1,16 @@ use alloc::{ collections::BTreeMap, - fmt::{ - Display, - Error as FmtError, - Formatter, - }, + fmt::{Display, Error as FmtError, Formatter}, }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use itertools::Itertools; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use tracing::info; use crate::{ - object::{ - Object, - ObjectType, - }, - worker::{ - WorkerData, - WorkerHandle, - WorkerId, - }, + object::{Object, ObjectType}, + worker::{WorkerData, WorkerHandle, WorkerId}, }; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] diff --git a/crates/relayer/src/supervisor/error.rs b/crates/relayer/src/supervisor/error.rs index 51f3f8d88e..97b22ffb97 100644 --- a/crates/relayer/src/supervisor/error.rs +++ b/crates/relayer/src/supervisor/error.rs @@ -1,18 +1,11 @@ use flex_error::define_error; use ibc_relayer_types::core::{ ics03_connection::connection::Counterparty, - ics24_host::identifier::{ - ChainId, - ChannelId, - ConnectionId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, ConnectionId, PortId}, }; use crate::{ - error::Error as RelayerError, - spawn::SpawnError, - supervisor::scan::Error as ScanError, + error::Error as RelayerError, spawn::SpawnError, supervisor::scan::Error as ScanError, }; define_error! { diff --git a/crates/relayer/src/supervisor/scan.rs b/crates/relayer/src/supervisor/scan.rs index ed3d4df4d5..df371ef9f3 100644 --- a/crates/relayer/src/supervisor/scan.rs +++ b/crates/relayer/src/supervisor/scan.rs @@ -1,77 +1,40 @@ -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use std::collections::BTreeMap; use ibc_relayer_types::core::{ - ics03_connection::connection::{ - IdentifiedConnectionEnd, - State as ConnectionState, - }, + ics03_connection::connection::{IdentifiedConnectionEnd, State as ConnectionState}, ics04_channel::{ - channel::{ - IdentifiedChannelEnd, - State as ChannelState, - }, + channel::{IdentifiedChannelEnd, State as ChannelState}, packet::Sequence, }, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }; use itertools::Itertools; -use tracing::{ - debug, - error, - error_span, - info, - warn, -}; +use tracing::{debug, error, error_span, info, warn}; use crate::{ chain::{ counterparty::{ - channel_on_destination, - connection_state_on_destination, - unreceived_acknowledgements, + channel_on_destination, connection_state_on_destination, unreceived_acknowledgements, unreceived_packets, }, handle::ChainHandle, requests::{ - IncludeProof, - PageRequest, - QueryChannelRequest, - QueryClientConnectionsRequest, - QueryClientStateRequest, - QueryClientStatesRequest, - QueryConnectionChannelsRequest, - QueryConnectionRequest, - QueryHeight, + IncludeProof, PageRequest, QueryChannelRequest, QueryClientConnectionsRequest, + QueryClientStateRequest, QueryClientStatesRequest, QueryConnectionChannelsRequest, + QueryConnectionRequest, QueryHeight, }, }, client_state::IdentifiedAnyClientState, config::{ - filter::{ - ChannelFilters, - ChannelPolicy, - }, - ChainConfig, - Config, + filter::{ChannelFilters, ChannelPolicy}, + ChainConfig, Config, }, error::Error as RelayerError, path::PathIdentifiers, registry::Registry, spawn::SpawnError, - supervisor::client_state_filter::{ - FilterPolicy, - Permission, - }, + supervisor::client_state_filter::{FilterPolicy, Permission}, telemetry, }; diff --git a/crates/relayer/src/supervisor/spawn.rs b/crates/relayer/src/supervisor/spawn.rs index 132f4067e7..7ea51a6f66 100644 --- a/crates/relayer/src/supervisor/spawn.rs +++ b/crates/relayer/src/supervisor/spawn.rs @@ -2,36 +2,17 @@ use ibc_relayer_types::core::{ ics03_connection::connection::IdentifiedConnectionEnd, ics04_channel::channel::State as ChannelState, }; -use tracing::{ - error, - info, -}; +use tracing::{error, info}; use super::{ - scan::{ - ChainScan, - ChainsScan, - ChannelScan, - ClientScan, - ConnectionScan, - }, + scan::{ChainScan, ChainsScan, ChannelScan, ClientScan, ConnectionScan}, Error, }; use crate::{ - chain::{ - counterparty::connection_state_on_destination, - handle::ChainHandle, - }, + chain::{counterparty::connection_state_on_destination, handle::ChainHandle}, client_state::IdentifiedAnyClientState, config::Config, - object::{ - Channel, - Client, - Connection, - Object, - Packet, - Wallet, - }, + object::{Channel, Client, Connection, Object, Packet, Wallet}, registry::Registry, supervisor::error::Error as SupervisorError, telemetry, diff --git a/crates/relayer/src/transfer.rs b/crates/relayer/src/transfer.rs index b776f68e57..a6c74b8ffc 100644 --- a/crates/relayer/src/transfer.rs +++ b/crates/relayer/src/transfer.rs @@ -1,53 +1,27 @@ use core::time::Duration; -use std::{ - ops::Add, - str::FromStr, -}; +use std::{ops::Add, str::FromStr}; -use flex_error::{ - define_error, - DetailOnly, -}; -use ibc_proto::{ - cosmos::base::v1beta1::Coin, - google::protobuf::Any, -}; +use flex_error::{define_error, DetailOnly}; +use ibc_proto::{cosmos::base::v1beta1::Coin, google::protobuf::Any}; use ibc_relayer_types::{ applications::transfer::{ error::Error as Ics20Error, - msgs::{ - transfer::MsgTransfer, - ASTRIA_WITHDRAWAL_TYPE_URL, - }, + msgs::{transfer::MsgTransfer, ASTRIA_WITHDRAWAL_TYPE_URL}, Amount, }, core::{ ics04_channel::timeout::TimeoutHeight, - ics24_host::identifier::{ - ChainId, - ChannelId, - PortId, - }, + ics24_host::identifier::{ChainId, ChannelId, PortId}, }, events::IbcEvent, - signer::{ - Signer, - SignerError, - }, - timestamp::{ - Timestamp, - TimestampOverflowError, - }, + signer::{Signer, SignerError}, + timestamp::{Timestamp, TimestampOverflowError}, tx_msg::Msg, }; use prost::Message; use crate::{ - chain::{ - endpoint::ChainStatus, - handle::ChainHandle, - tracking::TrackedMsgs, - }, + chain::{endpoint::ChainStatus, handle::ChainHandle, tracking::TrackedMsgs}, error::Error, event::IbcEventWithHeight, }; @@ -195,10 +169,7 @@ fn build_transfer_message_astria( timeout_height: TimeoutHeight, timeout_timestamp: Timestamp, ) -> Any { - use astria_core::primitive::v1::{ - asset::Denom, - Address, - }; + use astria_core::primitive::v1::{asset::Denom, Address}; let sender: Address = sender .as_ref() diff --git a/crates/relayer/src/upgrade_chain.rs b/crates/relayer/src/upgrade_chain.rs index 145817804c..d1861f1a76 100644 --- a/crates/relayer/src/upgrade_chain.rs +++ b/crates/relayer/src/upgrade_chain.rs @@ -7,40 +7,26 @@ use bytes::BufMut; use flex_error::define_error; use ibc_proto::{ cosmos::{ - gov::{ - v1::MsgSubmitProposal, - v1beta1::MsgSubmitProposal as LegacyMsgSubmitProposal, - }, + gov::{v1::MsgSubmitProposal, v1beta1::MsgSubmitProposal as LegacyMsgSubmitProposal}, upgrade::v1beta1::Plan, }, google::protobuf::Any, - ibc::core::client::v1::{ - MsgIbcSoftwareUpgrade, - UpgradeProposal, - }, + ibc::core::client::v1::{MsgIbcSoftwareUpgrade, UpgradeProposal}, }; use ibc_relayer_types::{ clients::ics07_tendermint::client_state::UpgradeOptions, core::{ ics02_client::client_state::ClientState, - ics24_host::identifier::{ - ChainId, - ClientId, - }, + ics24_host::identifier::{ChainId, ClientId}, }, - downcast, - Height, + downcast, Height, }; use tendermint::Hash as TxHash; use crate::{ chain::{ handle::ChainHandle, - requests::{ - IncludeProof, - QueryClientStateRequest, - QueryHeight, - }, + requests::{IncludeProof, QueryClientStateRequest, QueryHeight}, tracking::TrackedMsgs, }, client_state::AnyClientState, diff --git a/crates/relayer/src/util.rs b/crates/relayer/src/util.rs index 4233f9d6e5..e589e8c7c8 100644 --- a/crates/relayer/src/util.rs +++ b/crates/relayer/src/util.rs @@ -1,8 +1,5 @@ mod block_on; -pub use block_on::{ - block_on, - spawn_blocking, -}; +pub use block_on::{block_on, spawn_blocking}; pub mod collate; pub mod compat_mode; diff --git a/crates/relayer/src/util/collate.rs b/crates/relayer/src/util/collate.rs index 4190c1e98b..092a579bd1 100644 --- a/crates/relayer/src/util/collate.rs +++ b/crates/relayer/src/util/collate.rs @@ -1,12 +1,6 @@ -use std::{ - fmt, - ops::Add, -}; - -use serde::{ - Deserialize, - Serialize, -}; +use std::{fmt, ops::Add}; + +use serde::{Deserialize, Serialize}; #[derive(Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct Collated { diff --git a/crates/relayer/src/util/compat_mode.rs b/crates/relayer/src/util/compat_mode.rs index b5f3300f92..97d4ffd6e8 100644 --- a/crates/relayer/src/util/compat_mode.rs +++ b/crates/relayer/src/util/compat_mode.rs @@ -2,10 +2,7 @@ use tendermint::Version; use tendermint_rpc::client::CompatMode as TmCompatMode; use tracing::warn; -use crate::{ - config::compat_mode::CompatMode, - error::Error, -}; +use crate::{config::compat_mode::CompatMode, error::Error}; /// This is a wrapper around tendermint-rs CompatMode::from_version() method. /// diff --git a/crates/relayer/src/util/diff.rs b/crates/relayer/src/util/diff.rs index 802f81f7aa..e641213a84 100644 --- a/crates/relayer/src/util/diff.rs +++ b/crates/relayer/src/util/diff.rs @@ -1,8 +1,5 @@ use alloc::collections::BTreeMap as HashMap; -use core::{ - cmp::Ord, - hash::Hash, -}; +use core::{cmp::Ord, hash::Hash}; /// A change between two dictionaries. #[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] diff --git a/crates/relayer/src/util/lock.rs b/crates/relayer/src/util/lock.rs index 66f7f5bb23..5fa139b9fd 100644 --- a/crates/relayer/src/util/lock.rs +++ b/crates/relayer/src/util/lock.rs @@ -1,9 +1,4 @@ -use std::sync::{ - Arc, - RwLock, - RwLockReadGuard, - RwLockWriteGuard, -}; +use std::sync::{Arc, RwLock, RwLockReadGuard, RwLockWriteGuard}; pub type RwArc = Arc>; diff --git a/crates/relayer/src/util/pretty.rs b/crates/relayer/src/util/pretty.rs index 5124b7b410..0b433bd289 100644 --- a/crates/relayer/src/util/pretty.rs +++ b/crates/relayer/src/util/pretty.rs @@ -1,29 +1,13 @@ -use core::fmt::{ - Debug, - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Debug, Display, Error as FmtError, Formatter}; use std::time::Duration; use ibc_proto::{ cosmos::tx::v1beta1::Fee, google::protobuf::Any, ibc::core::{ - channel::v1::{ - Counterparty as ChannelCounterparty, - IdentifiedChannel, - }, - client::v1::{ - ConsensusStateWithHeight, - Height, - IdentifiedClientState, - }, - connection::v1::{ - Counterparty as ConnectionCounterparty, - IdentifiedConnection, - Version, - }, + channel::v1::{Counterparty as ChannelCounterparty, IdentifiedChannel}, + client::v1::{ConsensusStateWithHeight, Height, IdentifiedClientState}, + connection::v1::{Counterparty as ConnectionCounterparty, IdentifiedConnection, Version}, }, }; use tendermint::abci::Code; diff --git a/crates/relayer/src/util/profiling.rs b/crates/relayer/src/util/profiling.rs index 498b0255ca..9f2f4f3254 100644 --- a/crates/relayer/src/util/profiling.rs +++ b/crates/relayer/src/util/profiling.rs @@ -1,14 +1,8 @@ use std::{ - fs::{ - File, - OpenOptions, - }, + fs::{File, OpenOptions}, path::Path, sync::{ - atomic::{ - AtomicUsize, - Ordering::Relaxed, - }, + atomic::{AtomicUsize, Ordering::Relaxed}, Mutex, }, }; diff --git a/crates/relayer/src/util/queue.rs b/crates/relayer/src/util/queue.rs index f270919a5b..2e9a0115eb 100644 --- a/crates/relayer/src/util/queue.rs +++ b/crates/relayer/src/util/queue.rs @@ -1,8 +1,5 @@ use alloc::collections::VecDeque; -use std::sync::{ - Arc, - RwLock, -}; +use std::sync::{Arc, RwLock}; use crate::util::lock::LockExt; diff --git a/crates/relayer/src/util/retry.rs b/crates/relayer/src/util/retry.rs index feeec67b94..e851fe1adb 100644 --- a/crates/relayer/src/util/retry.rs +++ b/crates/relayer/src/util/retry.rs @@ -1,13 +1,8 @@ use core::time::Duration; pub use retry::{ - delay::{ - Fibonacci, - Fixed, - }, - retry_with_index, - Error as RetryError, - OperationResult as RetryResult, + delay::{Fibonacci, Fixed}, + retry_with_index, Error as RetryError, OperationResult as RetryResult, }; #[derive(Copy, Clone, Debug)] diff --git a/crates/relayer/src/util/stream.rs b/crates/relayer/src/util/stream.rs index 1f125a31b5..407fe0c47d 100644 --- a/crates/relayer/src/util/stream.rs +++ b/crates/relayer/src/util/stream.rs @@ -162,11 +162,7 @@ where #[cfg(test)] mod tests { - use futures::{ - executor::block_on, - stream, - StreamExt, - }; + use futures::{executor::block_on, stream, StreamExt}; use test_log::test; use super::*; diff --git a/crates/relayer/src/util/task.rs b/crates/relayer/src/util/task.rs index 32c63cd70d..707bda8ee9 100644 --- a/crates/relayer/src/util/task.rs +++ b/crates/relayer/src/util/task.rs @@ -1,25 +1,11 @@ -use core::{ - fmt::Display, - mem, - time::Duration, -}; +use core::{fmt::Display, mem, time::Duration}; use std::{ - sync::{ - Arc, - RwLock, - }, + sync::{Arc, RwLock}, thread, }; -use crossbeam_channel::{ - bounded, - Sender, -}; -use tracing::{ - debug, - error, - warn, -}; +use crossbeam_channel::{bounded, Sender}; +use tracing::{debug, error, warn}; use crate::util::lock::LockExt; diff --git a/crates/relayer/src/worker.rs b/crates/relayer/src/worker.rs index 71df19994e..7404aed8bf 100644 --- a/crates/relayer/src/worker.rs +++ b/crates/relayer/src/worker.rs @@ -1,30 +1,16 @@ use alloc::sync::Arc; -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use std::sync::Mutex; use ibc_relayer_types::core::ics04_channel::channel::Ordering; -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; use tracing::error; use crate::{ - chain::handle::{ - ChainHandle, - ChainHandlePair, - }, + chain::handle::{ChainHandle, ChainHandlePair}, config::Config, foreign_client::ForeignClient, - link::{ - Link, - LinkParameters, - Resubmit, - }, + link::{Link, LinkParameters, Resubmit}, object::Object, }; @@ -34,10 +20,7 @@ mod error; pub use error::RunError; mod handle; -pub use handle::{ - WorkerData, - WorkerHandle, -}; +pub use handle::{WorkerData, WorkerHandle}; mod cmd; pub use cmd::WorkerCmd; diff --git a/crates/relayer/src/worker/channel.rs b/crates/relayer/src/worker/channel.rs index d9f7269990..cd60a64a79 100644 --- a/crates/relayer/src/worker/channel.rs +++ b/crates/relayer/src/worker/channel.rs @@ -1,36 +1,16 @@ use core::time::Duration; use crossbeam_channel::Receiver; -use tracing::{ - debug, - error_span, -}; +use tracing::{debug, error_span}; -use super::{ - error::RunError, - WorkerCmd, -}; +use super::{error::RunError, WorkerCmd}; use crate::{ - chain::handle::{ - ChainHandle, - ChainHandlePair, - }, - channel::{ - channel_handshake_retry, - Channel as RelayChannel, - }, + chain::handle::{ChainHandle, ChainHandlePair}, + channel::{channel_handshake_retry, Channel as RelayChannel}, object::Channel, util::{ - retry::{ - retry_with_index, - RetryResult, - }, - task::{ - spawn_background_task, - Next, - TaskError, - TaskHandle, - }, + retry::{retry_with_index, RetryResult}, + task::{spawn_background_task, Next, TaskError, TaskHandle}, }, }; diff --git a/crates/relayer/src/worker/client.rs b/crates/relayer/src/worker/client.rs index 068b062040..bb601106ba 100644 --- a/crates/relayer/src/worker/client.rs +++ b/crates/relayer/src/worker/client.rs @@ -1,40 +1,17 @@ -use core::{ - convert::Infallible, - time::Duration, -}; +use core::{convert::Infallible, time::Duration}; use crossbeam_channel::Receiver; -use ibc_relayer_types::{ - core::ics02_client::events::UpdateClient, - events::IbcEvent, -}; -use retry::{ - delay::Fibonacci, - retry_with_index, -}; -use tracing::{ - debug, - debug_span, - error_span, - trace, - warn, -}; +use ibc_relayer_types::{core::ics02_client::events::UpdateClient, events::IbcEvent}; +use retry::{delay::Fibonacci, retry_with_index}; +use tracing::{debug, debug_span, error_span, trace, warn}; use super::WorkerCmd; use crate::{ chain::handle::ChainHandle, - foreign_client::{ - ForeignClient, - MisbehaviourResults, - }, + foreign_client::{ForeignClient, MisbehaviourResults}, util::{ retry::clamp_total, - task::{ - spawn_background_task, - Next, - TaskError, - TaskHandle, - }, + task::{spawn_background_task, Next, TaskError, TaskHandle}, }, }; diff --git a/crates/relayer/src/worker/cmd.rs b/crates/relayer/src/worker/cmd.rs index 5cd2f6c0b7..f4113bc7a4 100644 --- a/crates/relayer/src/worker/cmd.rs +++ b/crates/relayer/src/worker/cmd.rs @@ -1,13 +1,6 @@ -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; -use ibc_relayer_types::{ - core::ics02_client::events::NewBlock, - Height, -}; +use ibc_relayer_types::{core::ics02_client::events::NewBlock, Height}; use crate::event::source::EventBatch; diff --git a/crates/relayer/src/worker/connection.rs b/crates/relayer/src/worker/connection.rs index 18b8495ecb..724c7f1b79 100644 --- a/crates/relayer/src/worker/connection.rs +++ b/crates/relayer/src/worker/connection.rs @@ -1,30 +1,16 @@ use core::time::Duration; use crossbeam_channel::Receiver; -use tracing::{ - debug, - error_span, -}; +use tracing::{debug, error_span}; -use super::{ - error::RunError, - WorkerCmd, -}; +use super::{error::RunError, WorkerCmd}; use crate::{ - chain::handle::{ - ChainHandle, - ChainHandlePair, - }, + chain::handle::{ChainHandle, ChainHandlePair}, connection::Connection as RelayConnection, object::Connection, util::{ retry::retry_with_index, - task::{ - spawn_background_task, - Next, - TaskError, - TaskHandle, - }, + task::{spawn_background_task, Next, TaskError, TaskHandle}, }, worker::retry_strategy, }; diff --git a/crates/relayer/src/worker/cross_chain_query.rs b/crates/relayer/src/worker/cross_chain_query.rs index 04b6a05013..2fe96d9850 100644 --- a/crates/relayer/src/worker/cross_chain_query.rs +++ b/crates/relayer/src/worker/cross_chain_query.rs @@ -2,34 +2,21 @@ use std::time::Duration; use crossbeam_channel::Receiver; use ibc_relayer_types::core::ics02_client::height::Height; -use tracing::{ - info, - info_span, -}; +use tracing::{info, info_span}; use uuid::Uuid; use super::error::RunError; use crate::{ chain::{ handle::ChainHandle, - requests::{ - CrossChainQueryRequest, - IncludeProof, - QueryConnectionRequest, - QueryHeight, - }, + requests::{CrossChainQueryRequest, IncludeProof, QueryConnectionRequest, QueryHeight}, tracking::TrackedMsgs, }, error::Error, event::IbcEventWithHeight, foreign_client::ForeignClient, object::CrossChainQuery, - util::task::{ - spawn_background_task, - Next, - TaskError, - TaskHandle, - }, + util::task::{spawn_background_task, Next, TaskError, TaskHandle}, worker::WorkerCmd, }; diff --git a/crates/relayer/src/worker/error.rs b/crates/relayer/src/worker/error.rs index d967a5f7df..70561d1305 100644 --- a/crates/relayer/src/worker/error.rs +++ b/crates/relayer/src/worker/error.rs @@ -1,15 +1,8 @@ use crossbeam_channel::RecvError; -use flex_error::{ - define_error, - DisplayOnly, -}; +use flex_error::{define_error, DisplayOnly}; use ibc_relayer_types::core::ics02_client::error::Error as Ics02Error; -use crate::{ - channel::ChannelError, - connection::ConnectionError, - link::error::LinkError, -}; +use crate::{channel::ChannelError, connection::ConnectionError, link::error::LinkError}; define_error! { RunError { diff --git a/crates/relayer/src/worker/handle.rs b/crates/relayer/src/worker/handle.rs index 46ba388b33..e3fc4fa7bc 100644 --- a/crates/relayer/src/worker/handle.rs +++ b/crates/relayer/src/worker/handle.rs @@ -1,41 +1,20 @@ -use core::{ - fmt, - mem, -}; +use core::{fmt, mem}; use crossbeam_channel::Sender; use ibc_relayer_types::{ - core::{ - ics02_client::events::NewBlock, - ics24_host::identifier::ChainId, - }, + core::{ics02_client::events::NewBlock, ics24_host::identifier::ChainId}, Height, }; -use serde::{ - Deserialize, - Serialize, -}; -use tracing::{ - debug, - trace, -}; +use serde::{Deserialize, Serialize}; +use tracing::{debug, trace}; -use super::{ - WorkerCmd, - WorkerId, -}; +use super::{WorkerCmd, WorkerId}; use crate::{ chain::tracking::TrackingId, - event::{ - source::EventBatch, - IbcEventWithHeight, - }, + event::{source::EventBatch, IbcEventWithHeight}, object::Object, util::{ - lock::{ - LockExt, - RwArc, - }, + lock::{LockExt, RwArc}, task::TaskHandle, }, }; diff --git a/crates/relayer/src/worker/map.rs b/crates/relayer/src/worker/map.rs index 367057152d..305454255c 100644 --- a/crates/relayer/src/worker/map.rs +++ b/crates/relayer/src/worker/map.rs @@ -2,27 +2,14 @@ use alloc::collections::btree_map::BTreeMap as HashMap; use core::mem; use ibc_relayer_types::{ - core::{ - ics02_client::events::NewBlock, - ics24_host::identifier::ChainId, - }, + core::{ics02_client::events::NewBlock, ics24_host::identifier::ChainId}, Height, }; -use tracing::{ - debug, - trace, -}; +use tracing::{debug, trace}; -use super::{ - spawn_worker_tasks, - WorkerHandle, - WorkerId, -}; +use super::{spawn_worker_tasks, WorkerHandle, WorkerId}; use crate::{ - chain::handle::{ - ChainHandle, - ChainHandlePair, - }, + chain::handle::{ChainHandle, ChainHandlePair}, config::Config, object::Object, telemetry, diff --git a/crates/relayer/src/worker/packet.rs b/crates/relayer/src/worker/packet.rs index d175480a30..172aa41999 100644 --- a/crates/relayer/src/worker/packet.rs +++ b/crates/relayer/src/worker/packet.rs @@ -1,82 +1,44 @@ use core::time::Duration; use std::{ borrow::BorrowMut, - sync::{ - Arc, - Mutex, - }, + sync::{Arc, Mutex}, }; use crossbeam_channel::Receiver; use ibc_proto::ibc::{ - apps::fee::v1::{ - IdentifiedPacketFees, - QueryIncentivizedPacketRequest, - }, + apps::fee::v1::{IdentifiedPacketFees, QueryIncentivizedPacketRequest}, core::channel::v1::PacketId, }; use ibc_relayer_types::{ applications::{ ics29_fee::events::IncentivizedPacket, - transfer::{ - Amount, - Coin, - RawCoin, - }, - }, - core::ics04_channel::{ - events::WriteAcknowledgement, - packet::Sequence, - }, - events::{ - IbcEvent, - IbcEventType, + transfer::{Amount, Coin, RawCoin}, }, + core::ics04_channel::{events::WriteAcknowledgement, packet::Sequence}, + events::{IbcEvent, IbcEventType}, Height, }; use itertools::Itertools; use moka::sync::Cache; -use tracing::{ - debug, - error, - error_span, - info, - trace, - warn, -}; +use tracing::{debug, error, error_span, info, trace, warn}; #[cfg(feature = "telemetry")] use { ibc_relayer_types::core::ics24_host::identifier::ChannelId, ibc_relayer_types::core::ics24_host::identifier::PortId, }; -use super::{ - error::RunError, - WorkerCmd, -}; +use super::{error::RunError, WorkerCmd}; use crate::{ chain::handle::ChainHandle, config::filter::FeePolicy, event::source::EventBatch, foreign_client::HasExpiredOrFrozenError, - link::{ - error::LinkError, - Link, - Resubmit, - }, + link::{error::LinkError, Link, Resubmit}, object::Packet, telemetry, util::{ - lock::{ - LockExt, - RwArc, - }, - task::{ - spawn_background_task, - Next, - TaskError, - TaskHandle, - }, + lock::{LockExt, RwArc}, + task::{spawn_background_task, Next, TaskError, TaskHandle}, }, }; diff --git a/crates/relayer/src/worker/retry_strategy.rs b/crates/relayer/src/worker/retry_strategy.rs index c2a352078f..3ffb484457 100644 --- a/crates/relayer/src/worker/retry_strategy.rs +++ b/crates/relayer/src/worker/retry_strategy.rs @@ -1,9 +1,6 @@ use core::time::Duration; -use crate::util::retry::{ - clamp_total, - ConstantGrowth, -}; +use crate::util::retry::{clamp_total, ConstantGrowth}; /// A basic worker retry strategy. /// diff --git a/crates/relayer/src/worker/wallet.rs b/crates/relayer/src/worker/wallet.rs index ad3d6c57b0..a065274995 100644 --- a/crates/relayer/src/worker/wallet.rs +++ b/crates/relayer/src/worker/wallet.rs @@ -1,20 +1,11 @@ use std::time::Duration; -use tracing::{ - error_span, - trace, - warn, -}; +use tracing::{error_span, trace, warn}; use crate::{ chain::handle::ChainHandle, telemetry, - util::task::{ - spawn_background_task, - Next, - TaskError, - TaskHandle, - }, + util::task::{spawn_background_task, Next, TaskError, TaskHandle}, }; pub fn spawn_wallet_worker(chain: Chain) -> TaskHandle { diff --git a/crates/telemetry/src/encoder.rs b/crates/telemetry/src/encoder.rs index eb6237dc6f..73d83b7542 100644 --- a/crates/telemetry/src/encoder.rs +++ b/crates/telemetry/src/encoder.rs @@ -2,21 +2,12 @@ use std::{ collections::BTreeMap, - io::{ - self, - Write, - }, + io::{self, Write}, }; use prometheus::{ - proto::{ - self, - MetricFamily, - MetricType, - }, - Encoder, - Error, - Result, + proto::{self, MetricFamily, MetricType}, + Encoder, Error, Result, }; use serde::Serialize; diff --git a/crates/telemetry/src/lib.rs b/crates/telemetry/src/lib.rs index ccd1cd1767..dfb66813d8 100644 --- a/crates/telemetry/src/lib.rs +++ b/crates/telemetry/src/lib.rs @@ -6,20 +6,14 @@ pub mod state; use std::{ error::Error, - net::{ - SocketAddr, - ToSocketAddrs, - }, + net::{SocketAddr, ToSocketAddrs}, ops::Range, sync::Arc, }; use once_cell::sync::OnceCell; use tokio::task::JoinHandle; -use tracing::{ - debug, - warn, -}; +use tracing::{debug, warn}; pub use crate::state::TelemetryState; diff --git a/crates/telemetry/src/server.rs b/crates/telemetry/src/server.rs index 2268334860..13e96c98d1 100644 --- a/crates/telemetry/src/server.rs +++ b/crates/telemetry/src/server.rs @@ -1,25 +1,9 @@ -use std::{ - error::Error, - net::SocketAddr, - sync::Arc, -}; +use std::{error::Error, net::SocketAddr, sync::Arc}; -use axum::{ - extract::Query, - response::IntoResponse, - routing::get, - Extension, - Router, -}; -use prometheus::{ - Encoder, - TextEncoder, -}; +use axum::{extract::Query, response::IntoResponse, routing::get, Extension, Router}; +use prometheus::{Encoder, TextEncoder}; -use crate::{ - encoder::JsonEncoder, - state::TelemetryState, -}; +use crate::{encoder::JsonEncoder, state::TelemetryState}; #[derive(Copy, Clone, Debug, Default, serde::Deserialize)] enum Format { diff --git a/crates/telemetry/src/state.rs b/crates/telemetry/src/state.rs index c4eb3e4ea5..5e1c8963fd 100644 --- a/crates/telemetry/src/state.rs +++ b/crates/telemetry/src/state.rs @@ -1,49 +1,26 @@ -use core::fmt::{ - Display, - Error as FmtError, - Formatter, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; use std::{ ops::Range, sync::Mutex, - time::{ - Duration, - Instant, - }, + time::{Duration, Instant}, }; -use dashmap::{ - DashMap, - DashSet, -}; +use dashmap::{DashMap, DashSet}; use ibc_relayer_types::{ applications::transfer::Coin, - core::ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - PortId, - }, + core::ics24_host::identifier::{ChainId, ChannelId, ClientId, PortId}, signer::Signer, }; use opentelemetry::{ global, - metrics::{ - Counter, - ObservableGauge, - UpDownCounter, - }, - Context, - KeyValue, + metrics::{Counter, ObservableGauge, UpDownCounter}, + Context, KeyValue, }; use opentelemetry_prometheus::PrometheusExporter; use prometheus::proto::MetricFamily; use tendermint::Time; -use crate::{ - broadcast_error::BroadcastError, - path_identifier::PathIdentifier, -}; +use crate::{broadcast_error::BroadcastError, path_identifier::PathIdentifier}; const EMPTY_BACKLOG_SYMBOL: u64 = 0; const BACKLOG_CAPACITY: usize = 1000; @@ -232,10 +209,7 @@ impl TelemetryState { ) -> Self { use opentelemetry::sdk::{ export::metrics::aggregation, - metrics::{ - controllers, - processors, - }, + metrics::{controllers, processors}, }; let controller = controllers::basic(processors::factory( @@ -1162,12 +1136,7 @@ use opentelemetry::{ sdk::{ export::metrics::AggregatorSelector, metrics::{ - aggregators::{ - histogram, - last_value, - sum, - Aggregator, - }, + aggregators::{histogram, last_value, sum, Aggregator}, sdk_api::Descriptor, }, }, diff --git a/tools/integration-test/src/bin/test_setup_with_binary_channel.rs b/tools/integration-test/src/bin/test_setup_with_binary_channel.rs index 66a5f4e54e..842388692b 100644 --- a/tools/integration-test/src/bin/test_setup_with_binary_channel.rs +++ b/tools/integration-test/src/bin/test_setup_with_binary_channel.rs @@ -25,15 +25,9 @@ ``` */ -use std::{ - env, - path::PathBuf, -}; +use std::{env, path::PathBuf}; -use ibc_relayer::{ - config::ChainConfig, - keyring::Store, -}; +use ibc_relayer::{config::ChainConfig, keyring::Store}; use ibc_test_framework::prelude::*; struct Test { diff --git a/tools/integration-test/src/bin/test_setup_with_fee_enabled_binary_channel.rs b/tools/integration-test/src/bin/test_setup_with_fee_enabled_binary_channel.rs index 4200ee68e8..fa79885589 100644 --- a/tools/integration-test/src/bin/test_setup_with_fee_enabled_binary_channel.rs +++ b/tools/integration-test/src/bin/test_setup_with_fee_enabled_binary_channel.rs @@ -25,15 +25,9 @@ ``` */ -use std::{ - env, - path::PathBuf, -}; - -use ibc_relayer::{ - config::ChainConfig, - keyring::Store, -}; +use std::{env, path::PathBuf}; + +use ibc_relayer::{config::ChainConfig, keyring::Store}; use ibc_relayer_types::core::ics04_channel::version::Version; use ibc_test_framework::prelude::*; diff --git a/tools/integration-test/src/bin/test_setup_with_ternary_channel.rs b/tools/integration-test/src/bin/test_setup_with_ternary_channel.rs index 8062f3f993..2832627465 100644 --- a/tools/integration-test/src/bin/test_setup_with_ternary_channel.rs +++ b/tools/integration-test/src/bin/test_setup_with_ternary_channel.rs @@ -25,15 +25,9 @@ ``` */ -use std::{ - env, - path::PathBuf, -}; - -use ibc_relayer::{ - config::ChainConfig, - keyring::Store, -}; +use std::{env, path::PathBuf}; + +use ibc_relayer::{config::ChainConfig, keyring::Store}; use ibc_test_framework::prelude::*; struct Test { diff --git a/tools/integration-test/src/mbt/handlers.rs b/tools/integration-test/src/mbt/handlers.rs index 5cd677e848..49b2128fe1 100644 --- a/tools/integration-test/src/mbt/handlers.rs +++ b/tools/integration-test/src/mbt/handlers.rs @@ -1,44 +1,22 @@ -use ibc_relayer::{ - util::task::TaskHandle, - worker::client::spawn_refresh_client, -}; +use ibc_relayer::{util::task::TaskHandle, worker::client::spawn_refresh_client}; use ibc_test_framework::{ - bootstrap::binary::{ - chain::bootstrap_foreign_client_pair, - connection::bootstrap_connection, - }, - chain::{ - ext::transfer::ChainTransferMethodsExt, - tagged::TaggedChainDriverExt, - }, + bootstrap::binary::{chain::bootstrap_foreign_client_pair, connection::bootstrap_connection}, + chain::{ext::transfer::ChainTransferMethodsExt, tagged::TaggedChainDriverExt}, ibc::denom::derive_ibc_denom, prelude::*, relayer::{ - channel::{ - assert_eventually_channel_established, - init_channel, - }, - connection::{ - assert_eventually_connection_established, - init_connection, - }, + channel::{assert_eventually_channel_established, init_channel}, + connection::{assert_eventually_connection_established, init_connection}, }, types::{ - binary::{ - client::ClientIdPair, - connection::ConnectedConnection, - }, + binary::{client::ClientIdPair, connection::ConnectedConnection}, tagged::mono::Tagged, }, }; use super::{ state::Packet, - utils::{ - get_denom, - get_wallet, - wait_for_client, - }, + utils::{get_denom, get_wallet, wait_for_client}, }; pub fn setup_chains( diff --git a/tools/integration-test/src/mbt/itf.rs b/tools/integration-test/src/mbt/itf.rs index 72cb6bcbb2..57a87aadb8 100644 --- a/tools/integration-test/src/mbt/itf.rs +++ b/tools/integration-test/src/mbt/itf.rs @@ -1,8 +1,4 @@ -use serde::{ - Deserialize, - Deserializer, - Serialize, -}; +use serde::{Deserialize, Deserializer, Serialize}; #[derive(Debug, Serialize, Deserialize)] pub struct Meta { @@ -64,10 +60,7 @@ where } mod test { - use super::{ - Map, - Set, - }; + use super::{Map, Set}; #[test] fn test_empty_set() { @@ -108,10 +101,7 @@ mod test { #[test] #[cfg(feature = "manual")] fn parse_itf() { - use super::super::{ - itf::InformalTrace, - state::State, - }; + use super::super::{itf::InformalTrace, state::State}; let itf_path = concat!( env!("CARGO_MANIFEST_DIR"), diff --git a/tools/integration-test/src/mbt/state.rs b/tools/integration-test/src/mbt/state.rs index e6050763c5..b9ddf34e9e 100644 --- a/tools/integration-test/src/mbt/state.rs +++ b/tools/integration-test/src/mbt/state.rs @@ -1,12 +1,6 @@ -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; -use super::itf::{ - Map, - Set, -}; +use super::itf::{Map, Set}; pub type ChainId = u128; pub type DenomId = ChainId; diff --git a/tools/integration-test/src/mbt/transfer.rs b/tools/integration-test/src/mbt/transfer.rs index e07688d9ec..3404ef6f3e 100644 --- a/tools/integration-test/src/mbt/transfer.rs +++ b/tools/integration-test/src/mbt/transfer.rs @@ -1,34 +1,18 @@ use std::{ io::Write, - panic::{ - RefUnwindSafe, - UnwindSafe, - }, + panic::{RefUnwindSafe, UnwindSafe}, }; use ibc_relayer::config::{ - ChainConfig, - Channels as ConfigChannels, - Clients as ConfigClients, - Connections as ConfigConnections, - ModeConfig, - Packets as ConfigPackets, -}; -use ibc_test_framework::{ - prelude::*, - types::tagged::mono::Tagged, + ChainConfig, Channels as ConfigChannels, Clients as ConfigClients, + Connections as ConfigConnections, ModeConfig, Packets as ConfigPackets, }; +use ibc_test_framework::{prelude::*, types::tagged::mono::Tagged}; use super::{ itf::InformalTrace, - state::{ - Action, - State, - }, - utils::{ - get_chain, - CLIENT_EXPIRY, - }, + state::{Action, State}, + utils::{get_chain, CLIENT_EXPIRY}, }; const TEST_NAMES: &[&str] = &[ @@ -144,8 +128,7 @@ fn test_ibc_transfer() -> Result<(), Error> { #[cfg(feature = "manual")] fn test_self_connected_ibc_transfer() -> Result<(), Error> { use ibc_test_framework::framework::binary::{ - chain::run_self_connected_binary_chain_test, - channel::RunBinaryChannelTest, + chain::run_self_connected_binary_chain_test, channel::RunBinaryChannelTest, }; execute_mbt(|trace| { diff --git a/tools/integration-test/src/mbt/utils.rs b/tools/integration-test/src/mbt/utils.rs index fdd8215a82..3f638fcc12 100644 --- a/tools/integration-test/src/mbt/utils.rs +++ b/tools/integration-test/src/mbt/utils.rs @@ -1,27 +1,15 @@ -use std::{ - thread::sleep, - time::Duration, -}; +use std::{thread::sleep, time::Duration}; use ibc_relayer::chain::requests::{ - QueryPacketAcknowledgementsRequest, - QueryPacketCommitmentsRequest, - QueryUnreceivedAcksRequest, + QueryPacketAcknowledgementsRequest, QueryPacketCommitmentsRequest, QueryUnreceivedAcksRequest, QueryUnreceivedPacketsRequest, }; use ibc_relayer_types::core::ics04_channel::packet::Sequence; -use ibc_test_framework::{ - ibc::denom::Denom, - prelude::*, - types::tagged::mono::Tagged, -}; +use ibc_test_framework::{ibc::denom::Denom, prelude::*, types::tagged::mono::Tagged}; use super::{ itf::InformalTrace, - state::{ - DenomId, - State, - }, + state::{DenomId, State}, }; pub const CLIENT_EXPIRY: Duration = Duration::from_secs(15); diff --git a/tools/integration-test/src/tests/async_icq/simple_query.rs b/tools/integration-test/src/tests/async_icq/simple_query.rs index ad06cea3b0..f4ad69a1b8 100644 --- a/tools/integration-test/src/tests/async_icq/simple_query.rs +++ b/tools/integration-test/src/tests/async_icq/simple_query.rs @@ -1,30 +1,15 @@ -use ibc_relayer::{ - channel::version::Version, - config::ChainConfig, -}; +use ibc_relayer::{channel::version::Version, config::ChainConfig}; use ibc_test_framework::{ chain::{ - config::{ - set_max_deposit_period, - set_voting_period, - }, - ext::{ - async_icq::AsyncIcqMethodsExt, - bootstrap::ChainBootstrapMethodsExt, - }, + config::{set_max_deposit_period, set_voting_period}, + ext::{async_icq::AsyncIcqMethodsExt, bootstrap::ChainBootstrapMethodsExt}, }, prelude::*, - relayer::channel::{ - assert_eventually_channel_established, - init_channel_version, - }, + relayer::channel::{assert_eventually_channel_established, init_channel_version}, util::proposal_status::ProposalStatus, }; use tendermint::abci::Event; -use tendermint_rpc::{ - Client, - HttpClient, -}; +use tendermint_rpc::{Client, HttpClient}; #[test] fn test_async_icq() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/clean_workers.rs b/tools/integration-test/src/tests/clean_workers.rs index 5edfec50c7..546bb44376 100644 --- a/tools/integration-test/src/tests/clean_workers.rs +++ b/tools/integration-test/src/tests/clean_workers.rs @@ -1,14 +1,9 @@ use ibc_relayer::{ - config::{ - self, - ModeConfig, - }, + config::{self, ModeConfig}, object::ObjectType, }; use ibc_test_framework::{ - prelude::*, - relayer::channel::init_channel, - util::random::random_u128_range, + prelude::*, relayer::channel::init_channel, util::random::random_u128_range, }; #[test] diff --git a/tools/integration-test/src/tests/clear_packet.rs b/tools/integration-test/src/tests/clear_packet.rs index f2287c4aa4..ec82f3f95a 100644 --- a/tools/integration-test/src/tests/clear_packet.rs +++ b/tools/integration-test/src/tests/clear_packet.rs @@ -1,13 +1,8 @@ use std::thread; -use ibc_relayer::{ - chain::counterparty::pending_packet_summary, - config::ChainConfig, -}; +use ibc_relayer::{chain::counterparty::pending_packet_summary, config::ChainConfig}; use ibc_test_framework::{ - prelude::*, - relayer::channel::query_identified_channel_end, - util::random::random_u128_range, + prelude::*, relayer::channel::query_identified_channel_end, util::random::random_u128_range, }; #[test] @@ -439,10 +434,7 @@ impl TestOverrides for ClearPacketSequencesTest { } } -use ibc_relayer::link::{ - Link, - LinkParameters, -}; +use ibc_relayer::link::{Link, LinkParameters}; impl BinaryChannelTest for ClearPacketSequencesTest { fn run( diff --git a/tools/integration-test/src/tests/client_expiration.rs b/tools/integration-test/src/tests/client_expiration.rs index a4ded4a522..c7877dfc6b 100644 --- a/tools/integration-test/src/tests/client_expiration.rs +++ b/tools/integration-test/src/tests/client_expiration.rs @@ -1,12 +1,7 @@ use core::time::Duration; use std::thread::sleep; -use ibc_relayer::config::{ - self, - ChainConfig, - Config, - ModeConfig, -}; +use ibc_relayer::config::{self, ChainConfig, Config, ModeConfig}; use ibc_relayer_types::core::{ ics03_connection::connection::State as ConnectionState, ics04_channel::channel::State as ChannelState, @@ -14,24 +9,15 @@ use ibc_relayer_types::core::{ use ibc_test_framework::{ bootstrap::binary::{ chain::bootstrap_foreign_client_pair, - channel::{ - bootstrap_channel_with_chains, - bootstrap_channel_with_connection, - }, + channel::{bootstrap_channel_with_chains, bootstrap_channel_with_connection}, connection::bootstrap_connection, }, ibc::denom::derive_ibc_denom, prelude::*, relayer::{ - channel::{ - assert_eventually_channel_established, - init_channel, - query_channel_end, - }, + channel::{assert_eventually_channel_established, init_channel, query_channel_end}, connection::{ - assert_eventually_connection_established, - init_connection, - query_connection_end, + assert_eventually_connection_established, init_connection, query_connection_end, }, refresh::spawn_refresh_client_tasks, }, diff --git a/tools/integration-test/src/tests/client_filter.rs b/tools/integration-test/src/tests/client_filter.rs index 2b010e55de..6d71d4f102 100644 --- a/tools/integration-test/src/tests/client_filter.rs +++ b/tools/integration-test/src/tests/client_filter.rs @@ -19,18 +19,11 @@ use std::time::Duration; use ibc_relayer::{ - chain::requests::{ - IncludeProof, - QueryClientStateRequest, - QueryHeight, - }, + chain::requests::{IncludeProof, QueryClientStateRequest, QueryHeight}, client_state::AnyClientState, foreign_client::CreateOptions, object::ObjectType, - supervisor::client_state_filter::{ - FilterPolicy, - Permission, - }, + supervisor::client_state_filter::{FilterPolicy, Permission}, }; use ibc_relayer_types::{ clients::ics07_tendermint::client_state::ClientState as TmClientState, diff --git a/tools/integration-test/src/tests/client_refresh.rs b/tools/integration-test/src/tests/client_refresh.rs index 14f86e2106..c5381b9ecb 100644 --- a/tools/integration-test/src/tests/client_refresh.rs +++ b/tools/integration-test/src/tests/client_refresh.rs @@ -1,19 +1,12 @@ use std::time::Duration; use ibc_relayer::{ - config::{ - gas_multiplier::GasMultiplier, - ChainConfig, - }, + config::{gas_multiplier::GasMultiplier, ChainConfig}, foreign_client::CreateOptions, }; use ibc_relayer_types::core::ics02_client::trust_threshold::TrustThreshold; use ibc_test_framework::{ - bootstrap::binary::chain::{ - add_chain_config, - new_registry, - spawn_chain_handle, - }, + bootstrap::binary::chain::{add_chain_config, new_registry, spawn_chain_handle}, prelude::*, }; diff --git a/tools/integration-test/src/tests/client_settings.rs b/tools/integration-test/src/tests/client_settings.rs index 6553d401a8..2365d45868 100644 --- a/tools/integration-test/src/tests/client_settings.rs +++ b/tools/integration-test/src/tests/client_settings.rs @@ -1,11 +1,7 @@ use std::time::Duration; use ibc_relayer::{ - chain::requests::{ - IncludeProof, - QueryClientStateRequest, - QueryHeight, - }, + chain::requests::{IncludeProof, QueryClientStateRequest, QueryHeight}, client_state::AnyClientState, config::ChainConfig, foreign_client::CreateOptions, diff --git a/tools/integration-test/src/tests/client_upgrade.rs b/tools/integration-test/src/tests/client_upgrade.rs index e072b8bc22..cdb7345cd1 100644 --- a/tools/integration-test/src/tests/client_upgrade.rs +++ b/tools/integration-test/src/tests/client_upgrade.rs @@ -16,25 +16,14 @@ use std::str::FromStr; use http::Uri; use ibc_relayer::{ - chain::requests::{ - IncludeProof, - QueryClientStateRequest, - QueryHeight, - }, + chain::requests::{IncludeProof, QueryClientStateRequest, QueryHeight}, client_state::AnyClientState, - upgrade_chain::{ - build_and_send_ibc_upgrade_proposal, - UpgradePlanOptions, - }, + upgrade_chain::{build_and_send_ibc_upgrade_proposal, UpgradePlanOptions}, }; use ibc_relayer_types::core::ics02_client::height::Height; use ibc_test_framework::{ chain::{ - config::{ - set_max_deposit_period, - set_min_deposit_amount, - set_voting_period, - }, + config::{set_max_deposit_period, set_min_deposit_amount, set_voting_period}, ext::bootstrap::ChainBootstrapMethodsExt, }, prelude::*, diff --git a/tools/integration-test/src/tests/connection_delay.rs b/tools/integration-test/src/tests/connection_delay.rs index 31210aa147..60cb8a2869 100644 --- a/tools/integration-test/src/tests/connection_delay.rs +++ b/tools/integration-test/src/tests/connection_delay.rs @@ -1,9 +1,7 @@ use core::time::Duration; use ibc_test_framework::{ - ibc::denom::derive_ibc_denom, - prelude::*, - util::random::random_u128_range, + ibc::denom::derive_ibc_denom, prelude::*, util::random::random_u128_range, }; use time::OffsetDateTime; diff --git a/tools/integration-test/src/tests/consensus_states.rs b/tools/integration-test/src/tests/consensus_states.rs index 6872dd32a3..541da0bfca 100644 --- a/tools/integration-test/src/tests/consensus_states.rs +++ b/tools/integration-test/src/tests/consensus_states.rs @@ -2,11 +2,7 @@ use std::time::Duration; use ibc_relayer::chain::{ cosmos::query::consensus_state::query_consensus_states, - requests::{ - PageRequest, - QueryConsensusStateHeightsRequest, - QueryConsensusStatesRequest, - }, + requests::{PageRequest, QueryConsensusStateHeightsRequest, QueryConsensusStatesRequest}, }; use ibc_test_framework::prelude::*; diff --git a/tools/integration-test/src/tests/denom_trace.rs b/tools/integration-test/src/tests/denom_trace.rs index daada2ff45..baefbb5330 100644 --- a/tools/integration-test/src/tests/denom_trace.rs +++ b/tools/integration-test/src/tests/denom_trace.rs @@ -1,7 +1,4 @@ -use ibc_test_framework::{ - ibc::denom::derive_ibc_denom, - prelude::*, -}; +use ibc_test_framework::{ibc::denom::derive_ibc_denom, prelude::*}; #[test] fn test_ibc_denom_trace() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/error_events.rs b/tools/integration-test/src/tests/error_events.rs index abfc76c4e1..e34f3be517 100644 --- a/tools/integration-test/src/tests/error_events.rs +++ b/tools/integration-test/src/tests/error_events.rs @@ -1,9 +1,6 @@ use ibc_relayer::chain::tracking::TrackedMsgs; use ibc_relayer_types::events::IbcEvent; -use ibc_test_framework::{ - prelude::*, - relayer::transfer::build_transfer_message, -}; +use ibc_test_framework::{prelude::*, relayer::transfer::build_transfer_message}; #[test] fn test_error_events() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/execute_schedule.rs b/tools/integration-test/src/tests/execute_schedule.rs index 5cb10a9a86..2e51ddfbc7 100644 --- a/tools/integration-test/src/tests/execute_schedule.rs +++ b/tools/integration-test/src/tests/execute_schedule.rs @@ -12,14 +12,8 @@ //! later found in the pending queue), but all of the subsequent messages should //! exist in the pending queue. -use ibc_relayer::link::{ - Link, - LinkParameters, -}; -use ibc_test_framework::{ - prelude::*, - util::random::random_u128_range, -}; +use ibc_relayer::link::{Link, LinkParameters}; +use ibc_test_framework::{prelude::*, util::random::random_u128_range}; /// The number of messages to be sent in a batch contained in a piece of operational data. const BATCH_SIZE: usize = 10; diff --git a/tools/integration-test/src/tests/fee/auto_forward_relayer.rs b/tools/integration-test/src/tests/fee/auto_forward_relayer.rs index 5e35c9c233..9b4c6b4853 100644 --- a/tools/integration-test/src/tests/fee/auto_forward_relayer.rs +++ b/tools/integration-test/src/tests/fee/auto_forward_relayer.rs @@ -10,10 +10,7 @@ //! correct parties involved in the transaction. use ibc_relayer_types::core::ics04_channel::version::Version; -use ibc_test_framework::{ - prelude::*, - util::random::random_u128_range, -}; +use ibc_test_framework::{prelude::*, util::random::random_u128_range}; #[test] fn test_auto_forward_relayer() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/fee/filter_fees.rs b/tools/integration-test/src/tests/fee/filter_fees.rs index 66df617743..e738eebeb5 100644 --- a/tools/integration-test/src/tests/fee/filter_fees.rs +++ b/tools/integration-test/src/tests/fee/filter_fees.rs @@ -1,20 +1,11 @@ use std::collections::HashMap; use ibc_relayer::config::{ - filter::{ - ChannelPolicy, - FeePolicy, - FilterPattern, - MinFee, - }, - ChainConfig, - PacketFilter, + filter::{ChannelPolicy, FeePolicy, FilterPattern, MinFee}, + ChainConfig, PacketFilter, }; use ibc_relayer_types::core::ics04_channel::version::Version; -use ibc_test_framework::{ - prelude::*, - util::random::random_u128_range, -}; +use ibc_test_framework::{prelude::*, util::random::random_u128_range}; #[test] fn test_filter_incentivized_fees_relayer() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/fee/forward_relayer.rs b/tools/integration-test/src/tests/fee/forward_relayer.rs index f9ec7da7be..93a292aaf1 100644 --- a/tools/integration-test/src/tests/fee/forward_relayer.rs +++ b/tools/integration-test/src/tests/fee/forward_relayer.rs @@ -9,10 +9,7 @@ //! correct parties involved in the transaction. use ibc_relayer_types::core::ics04_channel::version::Version; -use ibc_test_framework::{ - prelude::*, - util::random::random_u128_range, -}; +use ibc_test_framework::{prelude::*, util::random::random_u128_range}; #[test] fn test_forward_relayer() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/fee/no_forward_relayer.rs b/tools/integration-test/src/tests/fee/no_forward_relayer.rs index 753546d212..10d2ee3d5b 100644 --- a/tools/integration-test/src/tests/fee/no_forward_relayer.rs +++ b/tools/integration-test/src/tests/fee/no_forward_relayer.rs @@ -11,10 +11,7 @@ //! refunded to the payer. use ibc_relayer_types::core::ics04_channel::version::Version; -use ibc_test_framework::{ - prelude::*, - util::random::random_u128_range, -}; +use ibc_test_framework::{prelude::*, util::random::random_u128_range}; #[test] fn test_no_forward_relayer() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/fee/non_fee_channel.rs b/tools/integration-test/src/tests/fee/non_fee_channel.rs index be124078d1..c9a99d2cd3 100644 --- a/tools/integration-test/src/tests/fee/non_fee_channel.rs +++ b/tools/integration-test/src/tests/fee/non_fee_channel.rs @@ -8,10 +8,7 @@ //! ensures then that the transaction still follows through using //! `ibc_transfer_token` if the transfer without fees is used. -use ibc_test_framework::{ - prelude::*, - util::random::random_u128_range, -}; +use ibc_test_framework::{prelude::*, util::random::random_u128_range}; #[test] fn test_non_fee_channel() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/fee/pay_fee_async.rs b/tools/integration-test/src/tests/fee/pay_fee_async.rs index dc34d49e5f..55080df6c5 100644 --- a/tools/integration-test/src/tests/fee/pay_fee_async.rs +++ b/tools/integration-test/src/tests/fee/pay_fee_async.rs @@ -18,14 +18,8 @@ //! Finally, the test initializes the supervisor in order to relay the pending packets so that the //! balances on the two chains can be asserted. -use ibc_relayer_types::{ - core::ics04_channel::version::Version, - events::IbcEvent, -}; -use ibc_test_framework::{ - prelude::*, - util::random::random_u128_range, -}; +use ibc_relayer_types::{core::ics04_channel::version::Version, events::IbcEvent}; +use ibc_test_framework::{prelude::*, util::random::random_u128_range}; #[test] fn test_pay_packet_fee_async() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/fee/register_payee.rs b/tools/integration-test/src/tests/fee/register_payee.rs index 22c99bf2bd..64c994c3a4 100644 --- a/tools/integration-test/src/tests/fee/register_payee.rs +++ b/tools/integration-test/src/tests/fee/register_payee.rs @@ -12,10 +12,7 @@ //! `ack_fee` in separate wallets. use ibc_relayer_types::core::ics04_channel::version::Version; -use ibc_test_framework::{ - prelude::*, - util::random::random_u128_range, -}; +use ibc_test_framework::{prelude::*, util::random::random_u128_range}; #[test] fn test_register_payee() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/fee/timeout_fee.rs b/tools/integration-test/src/tests/fee/timeout_fee.rs index 6bc533fe14..4d69e8fe1a 100644 --- a/tools/integration-test/src/tests/fee/timeout_fee.rs +++ b/tools/integration-test/src/tests/fee/timeout_fee.rs @@ -5,10 +5,7 @@ use std::thread; use ibc_relayer_types::core::ics04_channel::version::Version; -use ibc_test_framework::{ - prelude::*, - util::random::random_u128_range, -}; +use ibc_test_framework::{prelude::*, util::random::random_u128_range}; #[test] fn test_timeout_fee() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/fee_grant.rs b/tools/integration-test/src/tests/fee_grant.rs index 704185bf0e..f9ce78e942 100644 --- a/tools/integration-test/src/tests/fee_grant.rs +++ b/tools/integration-test/src/tests/fee_grant.rs @@ -14,10 +14,7 @@ use std::thread; use ibc_relayer::config::ChainConfig; use ibc_relayer_types::bigint::U256; -use ibc_test_framework::{ - chain::ext::fee_grant::FeeGrantMethodsExt, - prelude::*, -}; +use ibc_test_framework::{chain::ext::fee_grant::FeeGrantMethodsExt, prelude::*}; #[test] fn test_fee_grant() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/forward/forward_hop_transfer.rs b/tools/integration-test/src/tests/forward/forward_hop_transfer.rs index 432dc6bf0d..3ae0337aba 100644 --- a/tools/integration-test/src/tests/forward/forward_hop_transfer.rs +++ b/tools/integration-test/src/tests/forward/forward_hop_transfer.rs @@ -6,11 +6,7 @@ //! - The `AtomicIbcForwardHopTransferTest` tests the case where the //! hop between chain C and D fails. In this case the sender is still refunded. -use ibc_relayer::config::{ - self, - Config, - ModeConfig, -}; +use ibc_relayer::config::{self, Config, ModeConfig}; use ibc_test_framework::prelude::*; use crate::tests::forward::memo::HopMemoField; diff --git a/tools/integration-test/src/tests/forward/forward_transfer.rs b/tools/integration-test/src/tests/forward/forward_transfer.rs index 93c0aced5a..4830ee43b6 100644 --- a/tools/integration-test/src/tests/forward/forward_transfer.rs +++ b/tools/integration-test/src/tests/forward/forward_transfer.rs @@ -18,19 +18,11 @@ //! the memo fields are misspelled: //! - Misspelled receiver address, port or channel: The intermediary chain will refund the sender. -use ibc_relayer::config::{ - self, - Config, - ModeConfig, -}; +use ibc_relayer::config::{self, Config, ModeConfig}; use ibc_test_framework::prelude::*; use crate::tests::forward::memo::{ - MemoField, - MemoInfo, - MemoMisspelledField, - MisspelledChannelMemoInfo, - MisspelledPortMemoInfo, + MemoField, MemoInfo, MemoMisspelledField, MisspelledChannelMemoInfo, MisspelledPortMemoInfo, MisspelledReceiverMemoInfo, }; diff --git a/tools/integration-test/src/tests/forward/memo.rs b/tools/integration-test/src/tests/forward/memo.rs index f581109f81..6f5b173592 100644 --- a/tools/integration-test/src/tests/forward/memo.rs +++ b/tools/integration-test/src/tests/forward/memo.rs @@ -2,10 +2,7 @@ //! The base structure of the memos are taken from //! https://github.com/strangelove-ventures/packet-forward-middleware#examples -use serde::{ - Deserialize, - Serialize, -}; +use serde::{Deserialize, Serialize}; pub trait HasForwardMemoInfo { fn new_memo(receiver: String, port: String, channel: String) -> Self; diff --git a/tools/integration-test/src/tests/handshake_on_start.rs b/tools/integration-test/src/tests/handshake_on_start.rs index 2ef80986ec..e5b744fc3d 100644 --- a/tools/integration-test/src/tests/handshake_on_start.rs +++ b/tools/integration-test/src/tests/handshake_on_start.rs @@ -2,16 +2,11 @@ use ibc_test_framework::{ prelude::*, relayer::{ channel::{ - ack_channel, - assert_eventually_channel_established, - init_channel, - init_channel_optimistic, - try_channel, + ack_channel, assert_eventually_channel_established, init_channel, + init_channel_optimistic, try_channel, }, connection::{ - ack_connection, - assert_eventually_connection_established, - init_connection, + ack_connection, assert_eventually_connection_established, init_connection, try_connection, }, }, diff --git a/tools/integration-test/src/tests/ica.rs b/tools/integration-test/src/tests/ica.rs index 47237bf578..9275e47db6 100644 --- a/tools/integration-test/src/tests/ica.rs +++ b/tools/integration-test/src/tests/ica.rs @@ -1,16 +1,11 @@ -use std::{ - collections::HashMap, - str::FromStr, -}; +use std::{collections::HashMap, str::FromStr}; use ibc_test_framework::{ chain::ext::ica::register_interchain_account, ibc::denom::Denom, prelude::*, relayer::channel::{ - assert_eventually_channel_closed, - assert_eventually_channel_established, - query_channel_end, + assert_eventually_channel_closed, assert_eventually_channel_established, query_channel_end, }, }; diff --git a/tools/integration-test/src/tests/ics31.rs b/tools/integration-test/src/tests/ics31.rs index f79830bed7..154c955193 100644 --- a/tools/integration-test/src/tests/ics31.rs +++ b/tools/integration-test/src/tests/ics31.rs @@ -9,18 +9,12 @@ //! The test then waits for a Cross-chain Query to be pending and //! then processed. -use ibc_relayer::config::{ - self, - ModeConfig, -}; +use ibc_relayer::config::{self, ModeConfig}; use ibc_test_framework::{ chain::{ cli::host_zone::register_host_zone, config::{ - set_crisis_denom, - set_mint_mint_denom, - set_staking_bond_denom, - set_staking_max_entries, + set_crisis_denom, set_mint_mint_denom, set_staking_bond_denom, set_staking_max_entries, set_voting_period, }, ext::crosschainquery::CrossChainQueryMethodsExt, diff --git a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs index 583d247561..5d6cd4ef36 100644 --- a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs +++ b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs @@ -3,22 +3,13 @@ //! the second chain a Consumer chain. use std::str::FromStr; -use ibc_relayer::{ - chain::tracking::TrackedMsgs, - event::IbcEventWithHeight, -}; +use ibc_relayer::{chain::tracking::TrackedMsgs, event::IbcEventWithHeight}; use ibc_relayer_types::{ applications::{ ics27_ica::{ - cosmos_tx::CosmosTx, - msgs::send_tx::MsgSendTx, - packet_data::InterchainAccountPacketData, - }, - transfer::{ - msgs::send::MsgSend, - Amount, - Coin, + cosmos_tx::CosmosTx, msgs::send_tx::MsgSendTx, packet_data::InterchainAccountPacketData, }, + transfer::{msgs::send::MsgSend, Amount, Coin}, }, bigint::U256, signer::Signer, @@ -31,8 +22,7 @@ use ibc_test_framework::{ prelude::*, relayer::channel::assert_eventually_channel_established, util::interchain_security::{ - update_genesis_for_consumer_chain, - update_relayer_config_for_consumer_chain, + update_genesis_for_consumer_chain, update_relayer_config_for_consumer_chain, }, }; diff --git a/tools/integration-test/src/tests/interchain_security/icq.rs b/tools/integration-test/src/tests/interchain_security/icq.rs index 79c94660d6..ee2082e8d4 100644 --- a/tools/integration-test/src/tests/interchain_security/icq.rs +++ b/tools/integration-test/src/tests/interchain_security/icq.rs @@ -9,18 +9,12 @@ //! The test then waits for a Cross-chain Query to be pending and //! then processed. -use ibc_relayer::config::{ - self, - ModeConfig, -}; +use ibc_relayer::config::{self, ModeConfig}; use ibc_test_framework::{ chain::{ cli::host_zone::register_host_zone, config::{ - set_crisis_denom, - set_mint_mint_denom, - set_staking_bond_denom, - set_staking_max_entries, + set_crisis_denom, set_mint_mint_denom, set_staking_bond_denom, set_staking_max_entries, set_voting_period, }, ext::crosschainquery::CrossChainQueryMethodsExt, @@ -29,8 +23,7 @@ use ibc_test_framework::{ prelude::*, util::{ interchain_security::{ - update_genesis_for_consumer_chain, - update_relayer_config_for_consumer_chain, + update_genesis_for_consumer_chain, update_relayer_config_for_consumer_chain, }, random::random_u128_range, }, diff --git a/tools/integration-test/src/tests/interchain_security/simple_transfer.rs b/tools/integration-test/src/tests/interchain_security/simple_transfer.rs index cc3a437457..a8b414dd0e 100644 --- a/tools/integration-test/src/tests/interchain_security/simple_transfer.rs +++ b/tools/integration-test/src/tests/interchain_security/simple_transfer.rs @@ -6,8 +6,7 @@ use ibc_test_framework::{ prelude::*, util::{ interchain_security::{ - update_genesis_for_consumer_chain, - update_relayer_config_for_consumer_chain, + update_genesis_for_consumer_chain, update_relayer_config_for_consumer_chain, }, random::random_u128_range, }, diff --git a/tools/integration-test/src/tests/manual/simulation.rs b/tools/integration-test/src/tests/manual/simulation.rs index 0133ec3555..6ad421172a 100644 --- a/tools/integration-test/src/tests/manual/simulation.rs +++ b/tools/integration-test/src/tests/manual/simulation.rs @@ -14,15 +14,8 @@ use core::time::Duration; use ibc_relayer::{ - config::{ - types::MaxMsgNum, - ChainConfig, - Config, - }, - transfer::{ - build_and_send_transfer_messages, - TransferOptions, - }, + config::{types::MaxMsgNum, ChainConfig, Config}, + transfer::{build_and_send_transfer_messages, TransferOptions}, }; use ibc_relayer_types::events::IbcEvent; use ibc_test_framework::prelude::*; diff --git a/tools/integration-test/src/tests/memo.rs b/tools/integration-test/src/tests/memo.rs index c37d74d330..cc2ca4e75d 100644 --- a/tools/integration-test/src/tests/memo.rs +++ b/tools/integration-test/src/tests/memo.rs @@ -4,18 +4,11 @@ //! You can find a more thorough walkthrough of this test at //! `tools/test-framework/src/docs/walkthroughs/memo.rs`. -use ibc_relayer::config::{ - types::Memo, - ChainConfig, - Config, -}; +use ibc_relayer::config::{types::Memo, ChainConfig, Config}; use ibc_test_framework::{ ibc::denom::derive_ibc_denom, prelude::*, - util::random::{ - random_string, - random_u128_range, - }, + util::random::{random_string, random_u128_range}, }; use serde_json as json; diff --git a/tools/integration-test/src/tests/ordered_channel.rs b/tools/integration-test/src/tests/ordered_channel.rs index 35050f451f..61fb2d3afc 100644 --- a/tools/integration-test/src/tests/ordered_channel.rs +++ b/tools/integration-test/src/tests/ordered_channel.rs @@ -14,9 +14,7 @@ //! `tools/test-framework/src/docs/walkthroughs/ordered_channel.rs`. use ibc_test_framework::{ - ibc::denom::derive_ibc_denom, - prelude::*, - util::random::random_u128_range, + ibc::denom::derive_ibc_denom, prelude::*, util::random::random_u128_range, }; #[test] diff --git a/tools/integration-test/src/tests/ordered_channel_clear.rs b/tools/integration-test/src/tests/ordered_channel_clear.rs index 0774bbeb60..815aa2700d 100644 --- a/tools/integration-test/src/tests/ordered_channel_clear.rs +++ b/tools/integration-test/src/tests/ordered_channel_clear.rs @@ -1,22 +1,11 @@ use ibc_relayer::{ - config::{ - types::MaxMsgNum, - ChainConfig, - }, - link::{ - Link, - LinkParameters, - }, - transfer::{ - build_and_send_transfer_messages, - TransferOptions, - }, + config::{types::MaxMsgNum, ChainConfig}, + link::{Link, LinkParameters}, + transfer::{build_and_send_transfer_messages, TransferOptions}, }; use ibc_relayer_types::events::IbcEvent; use ibc_test_framework::{ - ibc::denom::derive_ibc_denom, - prelude::*, - util::random::random_u64_range, + ibc::denom::derive_ibc_denom, prelude::*, util::random::random_u64_range, }; #[test] diff --git a/tools/integration-test/src/tests/python.rs b/tools/integration-test/src/tests/python.rs index 74381db1c1..9f3c295144 100644 --- a/tools/integration-test/src/tests/python.rs +++ b/tools/integration-test/src/tests/python.rs @@ -1,15 +1,9 @@ use std::{ env, - process::{ - Command, - Stdio, - }, + process::{Command, Stdio}, }; -use ibc_relayer::{ - config::ChainConfig, - keyring::Store, -}; +use ibc_relayer::{config::ChainConfig, keyring::Store}; use ibc_test_framework::prelude::*; struct PythonTest; diff --git a/tools/integration-test/src/tests/query_packet.rs b/tools/integration-test/src/tests/query_packet.rs index 6567c0bfab..582e8d9706 100644 --- a/tools/integration-test/src/tests/query_packet.rs +++ b/tools/integration-test/src/tests/query_packet.rs @@ -1,19 +1,10 @@ use ibc_relayer::{ - chain::counterparty::{ - channel_on_destination, - pending_packet_summary, - }, - link::{ - Link, - LinkParameters, - }, + chain::counterparty::{channel_on_destination, pending_packet_summary}, + link::{Link, LinkParameters}, }; use ibc_test_framework::{ prelude::*, - relayer::{ - channel::query_identified_channel_end, - connection::query_identified_connection_end, - }, + relayer::{channel::query_identified_channel_end, connection::query_identified_connection_end}, util::random::random_u128_range, }; diff --git a/tools/integration-test/src/tests/supervisor.rs b/tools/integration-test/src/tests/supervisor.rs index 5ea032b14b..d2c54857ce 100644 --- a/tools/integration-test/src/tests/supervisor.rs +++ b/tools/integration-test/src/tests/supervisor.rs @@ -1,20 +1,10 @@ -use ibc_relayer::config::{ - self, - Config, - ModeConfig, -}; +use ibc_relayer::config::{self, Config, ModeConfig}; use ibc_test_framework::{ ibc::denom::derive_ibc_denom, prelude::*, relayer::{ - channel::{ - assert_eventually_channel_established, - init_channel, - }, - connection::{ - assert_eventually_connection_established, - init_connection, - }, + channel::{assert_eventually_channel_established, init_channel}, + connection::{assert_eventually_connection_established, init_connection}, }, }; diff --git a/tools/integration-test/src/tests/tendermint/sequential.rs b/tools/integration-test/src/tests/tendermint/sequential.rs index 7a9422df41..b4ae4be12e 100644 --- a/tools/integration-test/src/tests/tendermint/sequential.rs +++ b/tools/integration-test/src/tests/tendermint/sequential.rs @@ -2,16 +2,9 @@ use std::time::Instant; use ibc_relayer::{ chain::tracking::TrackedMsgs, - config::{ - types::max_msg_num::MaxMsgNum, - ChainConfig, - }, -}; -use ibc_test_framework::{ - chain::config, - prelude::*, - relayer::transfer::build_transfer_message, + config::{types::max_msg_num::MaxMsgNum, ChainConfig}, }; +use ibc_test_framework::{chain::config, prelude::*, relayer::transfer::build_transfer_message}; const MESSAGES_PER_BATCH: usize = 5; const TOTAL_TRANSACTIONS: usize = 5; diff --git a/tools/integration-test/src/tests/ternary_transfer.rs b/tools/integration-test/src/tests/ternary_transfer.rs index 4e435fe855..8d34f4a95f 100644 --- a/tools/integration-test/src/tests/ternary_transfer.rs +++ b/tools/integration-test/src/tests/ternary_transfer.rs @@ -1,7 +1,4 @@ -use ibc_test_framework::{ - ibc::denom::derive_ibc_denom, - prelude::*, -}; +use ibc_test_framework::{ibc::denom::derive_ibc_denom, prelude::*}; #[test] fn test_ternary_ibc_transfer() -> Result<(), Error> { diff --git a/tools/integration-test/src/tests/transfer.rs b/tools/integration-test/src/tests/transfer.rs index 169a971005..7b3b941113 100644 --- a/tools/integration-test/src/tests/transfer.rs +++ b/tools/integration-test/src/tests/transfer.rs @@ -1,7 +1,4 @@ -use ibc_test_framework::{ - prelude::*, - util::random::random_u128_range, -}; +use ibc_test_framework::{prelude::*, util::random::random_u128_range}; #[test] fn test_ibc_transfer() -> Result<(), Error> { diff --git a/tools/test-framework/src/bootstrap/binary/chain.rs b/tools/test-framework/src/bootstrap/binary/chain.rs index 788f203895..850c083cdc 100644 --- a/tools/test-framework/src/bootstrap/binary/chain.rs +++ b/tools/test-framework/src/bootstrap/binary/chain.rs @@ -3,49 +3,28 @@ with connected foreign clients. */ -use std::{ - fs, - path::Path, - thread, - time::Duration, -}; +use std::{fs, path::Path, thread, time::Duration}; use eyre::Report as Error; use ibc_relayer::{ - chain::handle::{ - ChainHandle, - CountingAndCachingChainHandle, - }, + chain::handle::{ChainHandle, CountingAndCachingChainHandle}, config::Config, error::ErrorDetail as RelayerErrorDetail, - foreign_client::{ - extract_client_id, - CreateOptions as ClientOptions, - ForeignClient, - }, + foreign_client::{extract_client_id, CreateOptions as ClientOptions, ForeignClient}, keyring::errors::ErrorDetail as KeyringErrorDetail, registry::SharedRegistry, }; use ibc_relayer_types::core::ics24_host::identifier::ClientId; -use tracing::{ - debug, - info, -}; +use tracing::{debug, info}; use crate::{ relayer::driver::RelayerDriver, types::{ - binary::{ - chains::ConnectedChains, - foreign_client::ForeignClientPair, - }, + binary::{chains::ConnectedChains, foreign_client::ForeignClientPair}, config::TestConfig, single::node::FullNode, tagged::*, - wallet::{ - TestWallets, - Wallet, - }, + wallet::{TestWallets, Wallet}, }, util::random::random_u64_range, }; diff --git a/tools/test-framework/src/bootstrap/binary/channel.rs b/tools/test-framework/src/bootstrap/binary/channel.rs index efbda6621d..967256277f 100644 --- a/tools/test-framework/src/bootstrap/binary/channel.rs +++ b/tools/test-framework/src/bootstrap/binary/channel.rs @@ -2,39 +2,22 @@ Helper functions for bootstrapping a channel between two chains. */ -use eyre::{ - eyre, - Report as Error, -}; +use eyre::{eyre, Report as Error}; use ibc_relayer::{ chain::handle::ChainHandle, - channel::{ - Channel, - ChannelSide, - }, + channel::{Channel, ChannelSide}, }; use ibc_relayer_types::core::{ - ics04_channel::{ - channel::Ordering, - version::Version, - }, + ics04_channel::{channel::Ordering, version::Version}, ics24_host::identifier::PortId, }; -use tracing::{ - debug, - info, -}; +use tracing::{debug, info}; -use super::connection::{ - bootstrap_connection, - BootstrapConnectionOptions, -}; +use super::connection::{bootstrap_connection, BootstrapConnectionOptions}; use crate::{ types::{ binary::{ - chains::ConnectedChains, - channel::ConnectedChannel, - connection::ConnectedConnection, + chains::ConnectedChains, channel::ConnectedChannel, connection::ConnectedConnection, foreign_client::ForeignClientPair, }, id::TaggedPortIdRef, diff --git a/tools/test-framework/src/bootstrap/binary/connection.rs b/tools/test-framework/src/bootstrap/binary/connection.rs index b762fdc8a2..20c7d252a0 100644 --- a/tools/test-framework/src/bootstrap/binary/connection.rs +++ b/tools/test-framework/src/bootstrap/binary/connection.rs @@ -4,30 +4,20 @@ use core::time::Duration; -use eyre::{ - eyre, - Report as Error, -}; +use eyre::{eyre, Report as Error}; use ibc_relayer::{ chain::handle::ChainHandle, config::default::connection_delay as default_connection_delay, - connection::{ - Connection, - ConnectionSide, - }, + connection::{Connection, ConnectionSide}, }; use ibc_relayer_types::timestamp::ZERO_DURATION; -use tracing::{ - debug, - info, -}; +use tracing::{debug, info}; use crate::{ relayer::connection::TaggedConnectionExt, types::{ binary::{ - client::ClientIdPair, - connection::ConnectedConnection, + client::ClientIdPair, connection::ConnectedConnection, foreign_client::ForeignClientPair, }, id::TaggedClientIdRef, diff --git a/tools/test-framework/src/bootstrap/consumer.rs b/tools/test-framework/src/bootstrap/consumer.rs index 72d8227a08..bdd5f524ea 100644 --- a/tools/test-framework/src/bootstrap/consumer.rs +++ b/tools/test-framework/src/bootstrap/consumer.rs @@ -2,10 +2,7 @@ Helper functions for bootstrapping a consumer full node. */ use std::{ - sync::{ - Arc, - RwLock, - }, + sync::{Arc, RwLock}, thread, time::Duration, }; @@ -15,19 +12,9 @@ use toml; use tracing::info; use crate::{ - chain::{ - builder::ChainBuilder, - config, - ext::bootstrap::ChainBootstrapMethodsExt, - }, + chain::{builder::ChainBuilder, config, ext::bootstrap::ChainBootstrapMethodsExt}, error::Error, - prelude::{ - ChainDriver, - Denom, - FullNode, - TestWallets, - Token, - }, + prelude::{ChainDriver, Denom, FullNode, TestWallets, Token}, util::random::random_u128_range, }; diff --git a/tools/test-framework/src/bootstrap/init.rs b/tools/test-framework/src/bootstrap/init.rs index 0762fb0c0d..ce40fafb4d 100644 --- a/tools/test-framework/src/bootstrap/init.rs +++ b/tools/test-framework/src/bootstrap/init.rs @@ -3,28 +3,18 @@ session. */ -use std::{ - env, - fs, - sync::Once, -}; +use std::{env, fs, sync::Once}; use eyre::Report as Error; use ibc_relayer_cli::components::enable_ansi; use tracing_subscriber::{ self as ts, - filter::{ - EnvFilter, - LevelFilter, - }, + filter::{EnvFilter, LevelFilter}, layer::SubscriberExt, util::SubscriberInitExt, }; -use crate::{ - types::config::TestConfig, - util::random::random_u32, -}; +use crate::{types::config::TestConfig, util::random::random_u32}; static INIT: Once = Once::new(); diff --git a/tools/test-framework/src/bootstrap/nary/chain.rs b/tools/test-framework/src/bootstrap/nary/chain.rs index 3c80d7e86d..d811c54ec9 100644 --- a/tools/test-framework/src/bootstrap/nary/chain.rs +++ b/tools/test-framework/src/bootstrap/nary/chain.rs @@ -5,31 +5,20 @@ use core::convert::TryInto; use ibc_relayer::{ - chain::handle::ChainHandle, - config::Config, - foreign_client::ForeignClient, + chain::handle::ChainHandle, config::Config, foreign_client::ForeignClient, registry::SharedRegistry, }; use crate::{ bootstrap::binary::chain::{ - add_chain_config, - add_keys_to_chain_handle, - bootstrap_foreign_client, - new_registry, + add_chain_config, add_keys_to_chain_handle, bootstrap_foreign_client, new_registry, save_relayer_config, }, - error::{ - handle_generic_error, - Error, - }, + error::{handle_generic_error, Error}, relayer::driver::RelayerDriver, types::{ config::TestConfig, - nary::chains::{ - DynamicConnectedChains, - NaryConnectedChains, - }, + nary::chains::{DynamicConnectedChains, NaryConnectedChains}, single::node::FullNode, }, }; diff --git a/tools/test-framework/src/bootstrap/nary/channel.rs b/tools/test-framework/src/bootstrap/nary/channel.rs index b96b123bf8..b64e8e8227 100644 --- a/tools/test-framework/src/bootstrap/nary/channel.rs +++ b/tools/test-framework/src/bootstrap/nary/channel.rs @@ -2,51 +2,27 @@ Functions for bootstrapping N-ary number of channels. */ -use core::{ - convert::TryInto, - time::Duration, -}; +use core::{convert::TryInto, time::Duration}; use ibc_relayer::chain::handle::ChainHandle; -use ibc_relayer_types::core::{ - ics04_channel::channel::Ordering, - ics24_host::identifier::PortId, -}; +use ibc_relayer_types::core::{ics04_channel::channel::Ordering, ics24_host::identifier::PortId}; use crate::{ bootstrap::{ - binary::channel::{ - bootstrap_channel_with_connection, - BootstrapChannelOptions, - }, + binary::channel::{bootstrap_channel_with_connection, BootstrapChannelOptions}, nary::connection::bootstrap_connections_dynamic, }, - error::{ - handle_generic_error, - Error, - }, + error::{handle_generic_error, Error}, types::{ binary::channel::ConnectedChannel, nary::{ - chains::{ - DynamicConnectedChains, - NaryConnectedChains, - }, - channel::{ - ConnectedChannels, - DynamicConnectedChannels, - }, - connection::{ - ConnectedConnections, - DynamicConnectedConnections, - }, + chains::{DynamicConnectedChains, NaryConnectedChains}, + channel::{ConnectedChannels, DynamicConnectedChannels}, + connection::{ConnectedConnections, DynamicConnectedConnections}, }, tagged::*, }, - util::array::{ - assert_same_dimension, - into_nested_vec, - }, + util::array::{assert_same_dimension, into_nested_vec}, }; /** diff --git a/tools/test-framework/src/bootstrap/nary/connection.rs b/tools/test-framework/src/bootstrap/nary/connection.rs index 03c4bd092c..6be32c6f72 100644 --- a/tools/test-framework/src/bootstrap/nary/connection.rs +++ b/tools/test-framework/src/bootstrap/nary/connection.rs @@ -2,32 +2,17 @@ Functions for bootstrapping N-ary number of connections. */ -use core::{ - convert::TryInto, - time::Duration, -}; +use core::{convert::TryInto, time::Duration}; -use ibc_relayer::{ - chain::handle::ChainHandle, - foreign_client::ForeignClient, -}; +use ibc_relayer::{chain::handle::ChainHandle, foreign_client::ForeignClient}; use crate::{ - bootstrap::binary::connection::{ - bootstrap_connection, - BootstrapConnectionOptions, - }, + bootstrap::binary::connection::{bootstrap_connection, BootstrapConnectionOptions}, error::Error, types::{ - binary::{ - connection::ConnectedConnection, - foreign_client::ForeignClientPair, - }, + binary::{connection::ConnectedConnection, foreign_client::ForeignClientPair}, nary::{ - connection::{ - ConnectedConnections, - DynamicConnectedConnections, - }, + connection::{ConnectedConnections, DynamicConnectedConnections}, foreign_client::ForeignClientPairs, }, }, diff --git a/tools/test-framework/src/bootstrap/single.rs b/tools/test-framework/src/bootstrap/single.rs index d75d64b2ce..a27d7f3686 100644 --- a/tools/test-framework/src/bootstrap/single.rs +++ b/tools/test-framework/src/bootstrap/single.rs @@ -2,10 +2,7 @@ Helper functions for bootstrapping a single full node. */ use core::time::Duration; -use std::sync::{ - Arc, - RwLock, -}; +use std::sync::{Arc, RwLock}; use eyre::eyre; use toml; @@ -13,27 +10,16 @@ use tracing::info; use crate::{ chain::{ - builder::ChainBuilder, - config, - driver::ChainDriver, + builder::ChainBuilder, config, driver::ChainDriver, ext::bootstrap::ChainBootstrapMethodsExt, }, error::Error, - ibc::{ - denom::Denom, - token::Token, - }, + ibc::{denom::Denom, token::Token}, types::{ single::node::FullNode, - wallet::{ - TestWallets, - Wallet, - }, - }, - util::random::{ - random_u128_range, - random_u32, + wallet::{TestWallets, Wallet}, }, + util::random::{random_u128_range, random_u32}, }; /** diff --git a/tools/test-framework/src/chain/builder.rs b/tools/test-framework/src/chain/builder.rs index 4637e4ea73..8de9150590 100644 --- a/tools/test-framework/src/chain/builder.rs +++ b/tools/test-framework/src/chain/builder.rs @@ -11,9 +11,7 @@ use tokio::runtime::Runtime; use super::chain_type::ChainType; use crate::{ - chain::driver::ChainDriver, - error::Error, - types::config::TestConfig, + chain::driver::ChainDriver, error::Error, types::config::TestConfig, util::random::random_unused_tcp_port, }; diff --git a/tools/test-framework/src/chain/chain_type.rs b/tools/test-framework/src/chain/chain_type.rs index 160d3f3a36..bf8f883bd0 100644 --- a/tools/test-framework/src/chain/chain_type.rs +++ b/tools/test-framework/src/chain/chain_type.rs @@ -5,10 +5,7 @@ use ibc_relayer_types::core::ics24_host::identifier::ChainId; use crate::{ error::Error, - util::random::{ - random_u32, - random_unused_tcp_port, - }, + util::random::{random_u32, random_unused_tcp_port}, }; const COSMOS_HD_PATH: &str = "m/44'/118'/0'/0/0"; diff --git a/tools/test-framework/src/chain/cli/async_icq.rs b/tools/test-framework/src/chain/cli/async_icq.rs index ed97f32893..8f761889fd 100644 --- a/tools/test-framework/src/chain/cli/async_icq.rs +++ b/tools/test-framework/src/chain/cli/async_icq.rs @@ -1,9 +1,6 @@ use std::str; -use crate::{ - chain::exec::simple_exec, - error::Error, -}; +use crate::{chain::exec::simple_exec, error::Error}; pub fn update_oracle( chain_id: &str, diff --git a/tools/test-framework/src/chain/cli/bootstrap.rs b/tools/test-framework/src/chain/cli/bootstrap.rs index ebdc848b4e..621ef5661e 100644 --- a/tools/test-framework/src/chain/cli/bootstrap.rs +++ b/tools/test-framework/src/chain/cli/bootstrap.rs @@ -1,10 +1,7 @@ use core::time::Duration; use std::{ fs, - process::{ - Command, - Stdio, - }, + process::{Command, Stdio}, str, thread::sleep, }; @@ -12,10 +9,7 @@ use std::{ use eyre::eyre; use crate::{ - chain::exec::simple_exec, - error::Error, - types::process::ChildProcess, - util::file::pipe_to_file, + chain::exec::simple_exec, error::Error, types::process::ChildProcess, util::file::pipe_to_file, }; pub fn initialize(chain_id: &str, command_path: &str, home_path: &str) -> Result<(), Error> { diff --git a/tools/test-framework/src/chain/cli/fee_grant.rs b/tools/test-framework/src/chain/cli/fee_grant.rs index 738f4e991d..a594a35cb2 100644 --- a/tools/test-framework/src/chain/cli/fee_grant.rs +++ b/tools/test-framework/src/chain/cli/fee_grant.rs @@ -1,7 +1,4 @@ -use crate::{ - chain::exec::simple_exec, - error::Error, -}; +use crate::{chain::exec::simple_exec, error::Error}; pub fn feegrant_grant( chain_id: &str, diff --git a/tools/test-framework/src/chain/cli/host_zone.rs b/tools/test-framework/src/chain/cli/host_zone.rs index ab6883fa80..e0dd6595c3 100644 --- a/tools/test-framework/src/chain/cli/host_zone.rs +++ b/tools/test-framework/src/chain/cli/host_zone.rs @@ -1,7 +1,4 @@ -use crate::{ - chain::exec::simple_exec, - error::Error, -}; +use crate::{chain::exec::simple_exec, error::Error}; pub fn register_host_zone( chain_id: &str, diff --git a/tools/test-framework/src/chain/cli/ica.rs b/tools/test-framework/src/chain/cli/ica.rs index 3c2cd98d58..b6fc325987 100644 --- a/tools/test-framework/src/chain/cli/ica.rs +++ b/tools/test-framework/src/chain/cli/ica.rs @@ -3,10 +3,7 @@ use serde_json as json; use crate::{ chain::exec::simple_exec, - error::{ - handle_generic_error, - Error, - }, + error::{handle_generic_error, Error}, }; /// Register a new interchain account controlled by the given account diff --git a/tools/test-framework/src/chain/cli/provider.rs b/tools/test-framework/src/chain/cli/provider.rs index f62204fdd2..eddd1ba3a8 100644 --- a/tools/test-framework/src/chain/cli/provider.rs +++ b/tools/test-framework/src/chain/cli/provider.rs @@ -1,13 +1,7 @@ -use std::{ - collections::HashMap, - str, -}; +use std::{collections::HashMap, str}; use crate::{ - chain::exec::{ - simple_exec, - ExecOutput, - }, + chain::exec::{simple_exec, ExecOutput}, error::Error, }; diff --git a/tools/test-framework/src/chain/cli/query.rs b/tools/test-framework/src/chain/cli/query.rs index a6e12d49ea..e6f0756b72 100644 --- a/tools/test-framework/src/chain/cli/query.rs +++ b/tools/test-framework/src/chain/cli/query.rs @@ -9,10 +9,7 @@ use tracing::debug; use crate::{ chain::exec::simple_exec, - error::{ - handle_generic_error, - Error, - }, + error::{handle_generic_error, Error}, }; pub fn query_balance( diff --git a/tools/test-framework/src/chain/cli/transfer.rs b/tools/test-framework/src/chain/cli/transfer.rs index a35df3a1da..679acad431 100644 --- a/tools/test-framework/src/chain/cli/transfer.rs +++ b/tools/test-framework/src/chain/cli/transfer.rs @@ -2,10 +2,7 @@ Methods for performing IBC token transfer on a chain. */ -use crate::{ - chain::exec::simple_exec, - error::Error, -}; +use crate::{chain::exec::simple_exec, error::Error}; pub fn local_transfer_token( chain_id: &str, diff --git a/tools/test-framework/src/chain/cli/upgrade.rs b/tools/test-framework/src/chain/cli/upgrade.rs index a723163482..e7949f37d4 100644 --- a/tools/test-framework/src/chain/cli/upgrade.rs +++ b/tools/test-framework/src/chain/cli/upgrade.rs @@ -1,10 +1,7 @@ /*! Methods for voting on a proposal. */ -use crate::{ - chain::exec::simple_exec, - error::Error, -}; +use crate::{chain::exec::simple_exec, error::Error}; pub fn vote_proposal( chain_id: &str, diff --git a/tools/test-framework/src/chain/cli/version.rs b/tools/test-framework/src/chain/cli/version.rs index 8286f88f2b..c01402f6a7 100644 --- a/tools/test-framework/src/chain/cli/version.rs +++ b/tools/test-framework/src/chain/cli/version.rs @@ -1,8 +1,4 @@ -use crate::{ - chain::exec::simple_exec, - error::Error, - prelude::handle_generic_error, -}; +use crate::{chain::exec::simple_exec, error::Error, prelude::handle_generic_error}; pub fn major_version(command_path: &str) -> Result { let output = simple_exec("version", command_path, &["version"])?; diff --git a/tools/test-framework/src/chain/config.rs b/tools/test-framework/src/chain/config.rs index 29fcc6b956..c1d0a2095a 100644 --- a/tools/test-framework/src/chain/config.rs +++ b/tools/test-framework/src/chain/config.rs @@ -8,10 +8,7 @@ use core::time::Duration; -use eyre::{ - eyre, - Report as Error, -}; +use eyre::{eyre, Report as Error}; use toml::Value; use tracing::debug; diff --git a/tools/test-framework/src/chain/driver.rs b/tools/test-framework/src/chain/driver.rs index c5592917c6..74b5df7303 100644 --- a/tools/test-framework/src/chain/driver.rs +++ b/tools/test-framework/src/chain/driver.rs @@ -6,32 +6,19 @@ use alloc::sync::Arc; use core::time::Duration; use eyre::eyre; -use ibc_relayer::{ - chain::cosmos::types::config::TxConfig, - config::compat_mode::CompatMode, -}; +use ibc_relayer::{chain::cosmos::types::config::TxConfig, config::compat_mode::CompatMode}; use ibc_relayer_types::{ - applications::transfer::amount::Amount, - core::ics24_host::identifier::ChainId, + applications::transfer::amount::Amount, core::ics24_host::identifier::ChainId, }; use tokio::runtime::Runtime; use crate::{ - chain::{ - chain_type::ChainType, - cli::query::query_balance, - }, + chain::{chain_type::ChainType, cli::query::query_balance}, error::Error, - ibc::{ - denom::Denom, - token::Token, - }, + ibc::{denom::Denom, token::Token}, relayer::tx::new_tx_config_for_test, types::{ - env::{ - EnvWriter, - ExportEnv, - }, + env::{EnvWriter, ExportEnv}, wallet::WalletAddress, }, util::retry::assert_eventually_succeed, diff --git a/tools/test-framework/src/chain/exec.rs b/tools/test-framework/src/chain/exec.rs index 2e2d649276..3ffb3000fa 100644 --- a/tools/test-framework/src/chain/exec.rs +++ b/tools/test-framework/src/chain/exec.rs @@ -1,19 +1,9 @@ -use std::{ - process::Command, - str, -}; +use std::{process::Command, str}; use eyre::eyre; -use tracing::{ - debug, - trace, -}; - -use crate::error::{ - handle_exec_error, - handle_generic_error, - Error, -}; +use tracing::{debug, trace}; + +use crate::error::{handle_exec_error, handle_generic_error, Error}; pub struct ExecOutput { pub stdout: String, diff --git a/tools/test-framework/src/chain/ext/async_icq.rs b/tools/test-framework/src/chain/ext/async_icq.rs index cbbef12ba8..774de45a0f 100644 --- a/tools/test-framework/src/chain/ext/async_icq.rs +++ b/tools/test-framework/src/chain/ext/async_icq.rs @@ -1,9 +1,6 @@ use crate::{ chain::{ - cli::async_icq::{ - async_icq, - update_oracle, - }, + cli::async_icq::{async_icq, update_oracle}, driver::ChainDriver, }, error::Error, diff --git a/tools/test-framework/src/chain/ext/bootstrap.rs b/tools/test-framework/src/chain/ext/bootstrap.rs index 51be41f773..2ce809c73b 100644 --- a/tools/test-framework/src/chain/ext/bootstrap.rs +++ b/tools/test-framework/src/chain/ext/bootstrap.rs @@ -1,17 +1,9 @@ use core::str::FromStr; -use std::{ - fs, - path::PathBuf, - str, - time::Duration, -}; +use std::{fs, path::PathBuf, str, time::Duration}; use eyre::eyre; use hdpath::StandardHDPath; -use ibc_relayer::keyring::{ - Secp256k1KeyPair, - SigningKeyPair, -}; +use ibc_relayer::keyring::{Secp256k1KeyPair, SigningKeyPair}; use serde_json as json; use toml; use tracing::debug; @@ -20,37 +12,23 @@ use crate::{ chain::{ cli::{ bootstrap::{ - add_genesis_account, - add_genesis_validator, - add_wallet, - collect_gen_txs, - initialize, - start_chain, + add_genesis_account, add_genesis_validator, add_wallet, collect_gen_txs, + initialize, start_chain, }, provider::{ - copy_validator_key_pair, - query_consumer_genesis, - query_gov_proposal, - replace_genesis_state, - submit_consumer_chain_proposal, + copy_validator_key_pair, query_consumer_genesis, query_gov_proposal, + replace_genesis_state, submit_consumer_chain_proposal, }, }, driver::ChainDriver, exec::simple_exec, }, - error::{ - handle_generic_error, - Error, - }, + error::{handle_generic_error, Error}, ibc::token::Token, prelude::assert_eventually_succeed, types::{ process::ChildProcess, - wallet::{ - Wallet, - WalletAddress, - WalletId, - }, + wallet::{Wallet, WalletAddress, WalletId}, }, util::proposal_status::ProposalStatus, }; diff --git a/tools/test-framework/src/chain/ext/crosschainquery.rs b/tools/test-framework/src/chain/ext/crosschainquery.rs index eea4426bee..ff8c5436e1 100644 --- a/tools/test-framework/src/chain/ext/crosschainquery.rs +++ b/tools/test-framework/src/chain/ext/crosschainquery.rs @@ -6,11 +6,7 @@ use serde_json as json; use crate::{ chain::cli::query::query_cross_chain_query, error::Error, - prelude::{ - assert_eventually_succeed, - handle_generic_error, - ChainDriver, - }, + prelude::{assert_eventually_succeed, handle_generic_error, ChainDriver}, types::tagged::MonoTagged, }; diff --git a/tools/test-framework/src/chain/ext/fee.rs b/tools/test-framework/src/chain/ext/fee.rs index 3380bcd32c..6f23e2eb9d 100644 --- a/tools/test-framework/src/chain/ext/fee.rs +++ b/tools/test-framework/src/chain/ext/fee.rs @@ -7,30 +7,17 @@ use ibc_relayer_types::{ }; use crate::{ - chain::{ - driver::ChainDriver, - tagged::TaggedChainDriverExt, - }, + chain::{driver::ChainDriver, tagged::TaggedChainDriverExt}, error::Error, ibc::token::TaggedTokenRef, relayer::fee::{ - ibc_token_transfer_with_fee, - pay_packet_fee, - query_counterparty_payee, - query_incentivized_packets, - register_counterparty_payee, - register_payee, + ibc_token_transfer_with_fee, pay_packet_fee, query_counterparty_payee, + query_incentivized_packets, register_counterparty_payee, register_payee, }, types::{ - id::{ - TaggedChannelIdRef, - TaggedPortIdRef, - }, + id::{TaggedChannelIdRef, TaggedPortIdRef}, tagged::*, - wallet::{ - Wallet, - WalletAddress, - }, + wallet::{Wallet, WalletAddress}, }, }; diff --git a/tools/test-framework/src/chain/ext/fee_grant.rs b/tools/test-framework/src/chain/ext/fee_grant.rs index 907f0edd11..32fef9724e 100644 --- a/tools/test-framework/src/chain/ext/fee_grant.rs +++ b/tools/test-framework/src/chain/ext/fee_grant.rs @@ -1,10 +1,7 @@ use crate::{ chain::cli::fee_grant::feegrant_grant, error::Error, - prelude::{ - ChainDriver, - TaggedTokenRef, - }, + prelude::{ChainDriver, TaggedTokenRef}, types::tagged::MonoTagged, }; pub trait FeeGrantMethodsExt { diff --git a/tools/test-framework/src/chain/ext/forward.rs b/tools/test-framework/src/chain/ext/forward.rs index acaafc2d80..1e0c23ace9 100644 --- a/tools/test-framework/src/chain/ext/forward.rs +++ b/tools/test-framework/src/chain/ext/forward.rs @@ -1,13 +1,6 @@ -use ibc_relayer_types::core::ics24_host::identifier::{ - ChannelId, - PortId, -}; +use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId}; -use crate::prelude::{ - DualTagged, - MonoTagged, - WalletAddress, -}; +use crate::prelude::{DualTagged, MonoTagged, WalletAddress}; /// Build the recipient address as following: /// {intermediate_refund_address}|{foward_port}/{forward_channel}:{final_destination_address} diff --git a/tools/test-framework/src/chain/ext/ica.rs b/tools/test-framework/src/chain/ext/ica.rs index 73edc5328b..3a0e6b4442 100644 --- a/tools/test-framework/src/chain/ext/ica.rs +++ b/tools/test-framework/src/chain/ext/ica.rs @@ -1,28 +1,17 @@ -use ibc_relayer::chain::{ - handle::ChainHandle, - tracking::TrackedMsgs, -}; +use ibc_relayer::chain::{handle::ChainHandle, tracking::TrackedMsgs}; use ibc_relayer_types::{ applications::ics27_ica::msgs::register::MsgRegisterInterchainAccount, - core::ics04_channel::version::Version, - events::IbcEvent, - tx_msg::Msg, + core::ics04_channel::version::Version, events::IbcEvent, tx_msg::Msg, }; use crate::{ chain::{ - cli::ica::{ - query_interchain_account, - register_interchain_account_cli, - }, + cli::ica::{query_interchain_account, register_interchain_account_cli}, driver::ChainDriver, }, error::Error, prelude::*, - types::{ - tagged::*, - wallet::WalletAddress, - }, + types::{tagged::*, wallet::WalletAddress}, }; pub trait InterchainAccountMethodsExt { diff --git a/tools/test-framework/src/chain/ext/proposal.rs b/tools/test-framework/src/chain/ext/proposal.rs index 2d38fa0902..d1400a9ef4 100644 --- a/tools/test-framework/src/chain/ext/proposal.rs +++ b/tools/test-framework/src/chain/ext/proposal.rs @@ -1,26 +1,14 @@ use eyre::eyre; use http::Uri; use ibc_proto::{ - cosmos::gov::v1beta1::{ - query_client::QueryClient, - QueryProposalRequest, - }, - ibc::core::client::v1::{ - MsgIbcSoftwareUpgrade, - UpgradeProposal, - }, -}; -use ibc_relayer::{ - config::default::max_grpc_decoding_size, - error::Error as RelayerError, + cosmos::gov::v1beta1::{query_client::QueryClient, QueryProposalRequest}, + ibc::core::client::v1::{MsgIbcSoftwareUpgrade, UpgradeProposal}, }; +use ibc_relayer::{config::default::max_grpc_decoding_size, error::Error as RelayerError}; use prost::Message; use crate::{ - chain::{ - cli::upgrade::vote_proposal, - driver::ChainDriver, - }, + chain::{cli::upgrade::vote_proposal, driver::ChainDriver}, error::Error, prelude::handle_generic_error, types::tagged::*, diff --git a/tools/test-framework/src/chain/ext/transfer.rs b/tools/test-framework/src/chain/ext/transfer.rs index 2a3d1a975d..344284deb2 100644 --- a/tools/test-framework/src/chain/ext/transfer.rs +++ b/tools/test-framework/src/chain/ext/transfer.rs @@ -3,37 +3,22 @@ use core::time::Duration; use ibc_relayer_types::core::{ ics02_client::height::Height, ics04_channel::packet::Packet, - ics24_host::identifier::{ - ChannelId, - PortId, - }, + ics24_host::identifier::{ChannelId, PortId}, }; use crate::{ chain::{ - cli::transfer::{ - local_transfer_token, - transfer_from_chain, - }, + cli::transfer::{local_transfer_token, transfer_from_chain}, driver::ChainDriver, tagged::TaggedChainDriverExt, }, error::Error, ibc::token::TaggedTokenRef, - relayer::transfer::{ - batched_ibc_token_transfer, - ibc_token_transfer, - }, + relayer::transfer::{batched_ibc_token_transfer, ibc_token_transfer}, types::{ - id::{ - TaggedChannelIdRef, - TaggedPortIdRef, - }, + id::{TaggedChannelIdRef, TaggedPortIdRef}, tagged::*, - wallet::{ - Wallet, - WalletAddress, - }, + wallet::{Wallet, WalletAddress}, }, }; diff --git a/tools/test-framework/src/chain/ext/version.rs b/tools/test-framework/src/chain/ext/version.rs index 315685c307..5b2bf46927 100644 --- a/tools/test-framework/src/chain/ext/version.rs +++ b/tools/test-framework/src/chain/ext/version.rs @@ -1,8 +1,5 @@ use crate::{ - chain::{ - cli::version::major_version, - driver::ChainDriver, - }, + chain::{cli::version::major_version, driver::ChainDriver}, error::Error, types::tagged::*, }; diff --git a/tools/test-framework/src/chain/tagged.rs b/tools/test-framework/src/chain/tagged.rs index f45d2efa93..153fa181ef 100644 --- a/tools/test-framework/src/chain/tagged.rs +++ b/tools/test-framework/src/chain/tagged.rs @@ -4,46 +4,27 @@ use ibc_proto::google::protobuf::Any; use ibc_relayer::{ - chain::cosmos::{ - tx::simple_send_tx, - types::config::TxConfig, - }, + chain::cosmos::{tx::simple_send_tx, types::config::TxConfig}, event::IbcEventWithHeight, util::compat_mode::compat_mode_from_version, }; use serde_json as json; -use tendermint_rpc::client::{ - Client, - HttpClient, -}; +use tendermint_rpc::client::{Client, HttpClient}; use crate::{ chain::{ - cli::query::{ - query_auth_module, - query_recipient_transactions, - }, + cli::query::{query_auth_module, query_recipient_transactions}, driver::ChainDriver, }, - error::{ - handle_generic_error, - Error, - }, + error::{handle_generic_error, Error}, ibc::{ denom::Denom, - token::{ - TaggedDenomExt, - TaggedToken, - TaggedTokenRef, - }, + token::{TaggedDenomExt, TaggedToken, TaggedTokenRef}, }, types::{ id::TaggedChainIdRef, tagged::*, - wallet::{ - Wallet, - WalletAddress, - }, + wallet::{Wallet, WalletAddress}, }, }; diff --git a/tools/test-framework/src/chain/version.rs b/tools/test-framework/src/chain/version.rs index 96438b5f70..de9a20b03d 100644 --- a/tools/test-framework/src/chain/version.rs +++ b/tools/test-framework/src/chain/version.rs @@ -3,10 +3,7 @@ use tracing::debug; use crate::{ chain::exec::simple_exec, - error::{ - handle_generic_error, - Error, - }, + error::{handle_generic_error, Error}, }; pub fn get_chain_command_version(command: &str) -> Result, Error> { diff --git a/tools/test-framework/src/error.rs b/tools/test-framework/src/error.rs index 270ef44506..6195c4b274 100644 --- a/tools/test-framework/src/error.rs +++ b/tools/test-framework/src/error.rs @@ -1,27 +1,14 @@ //! Error type used for the tests. -use core::convert::{ - From, - Into, -}; -use std::io::{ - Error as IoError, - ErrorKind as IoErrorKind, -}; +use core::convert::{From, Into}; +use std::io::{Error as IoError, ErrorKind as IoErrorKind}; use eyre::Report; -use flex_error::{ - define_error, - TraceError, -}; +use flex_error::{define_error, TraceError}; use ibc_relayer::{ - channel::error::ChannelError, - connection::ConnectionError, - error::Error as RelayerError, - foreign_client::ForeignClientError, - link::error::LinkError, - supervisor::error::Error as SupervisorError, - transfer::TransferError, + channel::error::ChannelError, connection::ConnectionError, error::Error as RelayerError, + foreign_client::ForeignClientError, link::error::LinkError, + supervisor::error::Error as SupervisorError, transfer::TransferError, upgrade_chain::UpgradeChainError, }; diff --git a/tools/test-framework/src/framework/base.rs b/tools/test-framework/src/framework/base.rs index f0137e7f3e..90519019fe 100644 --- a/tools/test-framework/src/framework/base.rs +++ b/tools/test-framework/src/framework/base.rs @@ -9,9 +9,7 @@ use tokio::runtime::Runtime; use tracing::info; use crate::{ - bootstrap::init::init_test, - chain::builder::ChainBuilder, - error::Error, + bootstrap::init::init_test, chain::builder::ChainBuilder, error::Error, types::config::TestConfig, }; diff --git a/tools/test-framework/src/framework/binary/chain.rs b/tools/test-framework/src/framework/binary/chain.rs index 980fa726e9..7ac7314552 100644 --- a/tools/test-framework/src/framework/binary/chain.rs +++ b/tools/test-framework/src/framework/binary/chain.rs @@ -4,44 +4,27 @@ */ use ibc_relayer::{ - chain::handle::ChainHandle, - config::Config, - foreign_client::CreateOptions as ClientOptions, + chain::handle::ChainHandle, config::Config, foreign_client::CreateOptions as ClientOptions, }; use tracing::info; use crate::{ - bootstrap::binary::chain::{ - bootstrap_chains_with_full_nodes, - BootstrapClientOptions, - }, + bootstrap::binary::chain::{bootstrap_chains_with_full_nodes, BootstrapClientOptions}, error::Error, framework::{ - base::{ - HasOverrides, - TestConfigOverride, - }, + base::{HasOverrides, TestConfigOverride}, binary::{ ics::InterchainSecurityChainTest, node::{ - run_binary_node_test, - run_single_node_test, - BinaryNodeTest, - NodeConfigOverride, + run_binary_node_test, run_single_node_test, BinaryNodeTest, NodeConfigOverride, NodeGenesisOverride, }, }, - supervisor::{ - RunWithSupervisor, - SupervisorOverride, - }, + supervisor::{RunWithSupervisor, SupervisorOverride}, }, relayer::driver::RelayerDriver, types::{ - binary::chains::{ - ConnectedChains, - DropChainHandle, - }, + binary::chains::{ConnectedChains, DropChainHandle}, config::TestConfig, env::write_env, single::node::FullNode, diff --git a/tools/test-framework/src/framework/binary/channel.rs b/tools/test-framework/src/framework/binary/channel.rs index db79994023..d59786cb4e 100644 --- a/tools/test-framework/src/framework/binary/channel.rs +++ b/tools/test-framework/src/framework/binary/channel.rs @@ -6,54 +6,28 @@ use ibc_relayer::chain::handle::ChainHandle; use ibc_relayer_types::core::{ - ics04_channel::{ - channel::Ordering, - version::Version, - }, + ics04_channel::{channel::Ordering, version::Version}, ics24_host::identifier::PortId, }; use tracing::info; use crate::{ - bootstrap::binary::channel::{ - bootstrap_channel_with_connection, - BootstrapChannelOptions, - }, + bootstrap::binary::channel::{bootstrap_channel_with_connection, BootstrapChannelOptions}, error::Error, framework::{ - base::{ - HasOverrides, - TestConfigOverride, - }, + base::{HasOverrides, TestConfigOverride}, binary::{ - chain::{ - ClientOptionsOverride, - RelayerConfigOverride, - RunBinaryChainTest, - }, - connection::{ - BinaryConnectionTest, - ConnectionDelayOverride, - RunBinaryConnectionTest, - }, + chain::{ClientOptionsOverride, RelayerConfigOverride, RunBinaryChainTest}, + connection::{BinaryConnectionTest, ConnectionDelayOverride, RunBinaryConnectionTest}, ics::run_binary_interchain_security_node_test, - node::{ - run_binary_node_test, - NodeConfigOverride, - NodeGenesisOverride, - }, - }, - supervisor::{ - RunWithSupervisor, - SupervisorOverride, + node::{run_binary_node_test, NodeConfigOverride, NodeGenesisOverride}, }, + supervisor::{RunWithSupervisor, SupervisorOverride}, }, relayer::driver::RelayerDriver, types::{ binary::{ - chains::ConnectedChains, - channel::ConnectedChannel, - connection::ConnectedConnection, + chains::ConnectedChains, channel::ConnectedChannel, connection::ConnectedConnection, }, config::TestConfig, env::write_env, diff --git a/tools/test-framework/src/framework/binary/connection.rs b/tools/test-framework/src/framework/binary/connection.rs index 0b99f62b03..a998ba837a 100644 --- a/tools/test-framework/src/framework/binary/connection.rs +++ b/tools/test-framework/src/framework/binary/connection.rs @@ -10,40 +10,21 @@ use ibc_relayer::chain::handle::ChainHandle; use tracing::info; use crate::{ - bootstrap::binary::connection::{ - bootstrap_connection, - BootstrapConnectionOptions, - }, + bootstrap::binary::connection::{bootstrap_connection, BootstrapConnectionOptions}, error::Error, framework::{ - base::{ - HasOverrides, - TestConfigOverride, - }, + base::{HasOverrides, TestConfigOverride}, binary::{ chain::{ - BinaryChainTest, - ClientOptionsOverride, - RelayerConfigOverride, - RunBinaryChainTest, - }, - node::{ - run_binary_node_test, - NodeConfigOverride, - NodeGenesisOverride, + BinaryChainTest, ClientOptionsOverride, RelayerConfigOverride, RunBinaryChainTest, }, + node::{run_binary_node_test, NodeConfigOverride, NodeGenesisOverride}, }, - supervisor::{ - RunWithSupervisor, - SupervisorOverride, - }, + supervisor::{RunWithSupervisor, SupervisorOverride}, }, relayer::driver::RelayerDriver, types::{ - binary::{ - chains::ConnectedChains, - connection::ConnectedConnection, - }, + binary::{chains::ConnectedChains, connection::ConnectedConnection}, config::TestConfig, env::write_env, }, diff --git a/tools/test-framework/src/framework/binary/ics.rs b/tools/test-framework/src/framework/binary/ics.rs index 4842cf1369..9db21a7e60 100644 --- a/tools/test-framework/src/framework/binary/ics.rs +++ b/tools/test-framework/src/framework/binary/ics.rs @@ -1,28 +1,15 @@ use std::str::FromStr; use crate::{ - bootstrap::{ - consumer::bootstrap_consumer_node, - single::bootstrap_single_node, - }, + bootstrap::{consumer::bootstrap_consumer_node, single::bootstrap_single_node}, chain::{ - builder::ChainBuilder, - chain_type::ChainType, - cli::upgrade::vote_proposal, + builder::ChainBuilder, chain_type::ChainType, cli::upgrade::vote_proposal, ext::bootstrap::ChainBootstrapMethodsExt, }, error::Error, framework::{ - base::{ - run_basic_test, - BasicTest, - HasOverrides, - TestConfigOverride, - }, - binary::node::{ - NodeConfigOverride, - NodeGenesisOverride, - }, + base::{run_basic_test, BasicTest, HasOverrides, TestConfigOverride}, + binary::node::{NodeConfigOverride, NodeGenesisOverride}, }, prelude::FullNode, types::config::TestConfig, diff --git a/tools/test-framework/src/framework/binary/node.rs b/tools/test-framework/src/framework/binary/node.rs index 579ebe87d8..2e853d4073 100644 --- a/tools/test-framework/src/framework/binary/node.rs +++ b/tools/test-framework/src/framework/binary/node.rs @@ -9,16 +9,8 @@ use crate::{ bootstrap::single::bootstrap_single_node, chain::builder::ChainBuilder, error::Error, - framework::base::{ - run_basic_test, - BasicTest, - HasOverrides, - TestConfigOverride, - }, - types::{ - config::TestConfig, - single::node::FullNode, - }, + framework::base::{run_basic_test, BasicTest, HasOverrides, TestConfigOverride}, + types::{config::TestConfig, single::node::FullNode}, }; /** diff --git a/tools/test-framework/src/framework/nary/chain.rs b/tools/test-framework/src/framework/nary/chain.rs index 872593e961..807f970ade 100644 --- a/tools/test-framework/src/framework/nary/chain.rs +++ b/tools/test-framework/src/framework/nary/chain.rs @@ -8,38 +8,22 @@ use tracing::info; use crate::{ bootstrap::nary::chain::{ - boostrap_chains_with_nodes, - boostrap_chains_with_self_connected_node, + boostrap_chains_with_nodes, boostrap_chains_with_self_connected_node, }, error::Error, framework::{ - base::{ - HasOverrides, - TestConfigOverride, - }, + base::{HasOverrides, TestConfigOverride}, binary::{ chain::RelayerConfigOverride, - node::{ - NodeConfigOverride, - NodeGenesisOverride, - }, - }, - nary::node::{ - run_nary_node_test, - NaryNodeTest, - }, - supervisor::{ - RunWithSupervisor, - SupervisorOverride, + node::{NodeConfigOverride, NodeGenesisOverride}, }, + nary::node::{run_nary_node_test, NaryNodeTest}, + supervisor::{RunWithSupervisor, SupervisorOverride}, }, relayer::driver::RelayerDriver, types::{ - binary::chains::DropChainHandle, - config::TestConfig, - env::write_env, - nary::chains::NaryConnectedChains, - single::node::FullNode, + binary::chains::DropChainHandle, config::TestConfig, env::write_env, + nary::chains::NaryConnectedChains, single::node::FullNode, }, util::suspend::hang_on_error, }; diff --git a/tools/test-framework/src/framework/nary/channel.rs b/tools/test-framework/src/framework/nary/channel.rs index ac780d4eaf..d8b2ef90bc 100644 --- a/tools/test-framework/src/framework/nary/channel.rs +++ b/tools/test-framework/src/framework/nary/channel.rs @@ -12,42 +12,26 @@ use crate::{ bootstrap::nary::channel::bootstrap_channels_with_connections, error::Error, framework::{ - base::{ - HasOverrides, - TestConfigOverride, - }, + base::{HasOverrides, TestConfigOverride}, binary::{ chain::RelayerConfigOverride, - channel::{ - BinaryChannelTest, - ChannelOrderOverride, - }, + channel::{BinaryChannelTest, ChannelOrderOverride}, connection::ConnectionDelayOverride, - node::{ - NodeConfigOverride, - NodeGenesisOverride, - }, + node::{NodeConfigOverride, NodeGenesisOverride}, }, nary::{ chain::RunNaryChainTest, - connection::{ - NaryConnectionTest, - RunNaryConnectionTest, - }, + connection::{NaryConnectionTest, RunNaryConnectionTest}, node::run_nary_node_test, }, - supervisor::{ - RunWithSupervisor, - SupervisorOverride, - }, + supervisor::{RunWithSupervisor, SupervisorOverride}, }, relayer::driver::RelayerDriver, types::{ config::TestConfig, env::write_env, nary::{ - chains::NaryConnectedChains, - channel::ConnectedChannels, + chains::NaryConnectedChains, channel::ConnectedChannels, connection::ConnectedConnections, }, }, diff --git a/tools/test-framework/src/framework/nary/connection.rs b/tools/test-framework/src/framework/nary/connection.rs index c66e20823f..81d8ecb8b0 100644 --- a/tools/test-framework/src/framework/nary/connection.rs +++ b/tools/test-framework/src/framework/nary/connection.rs @@ -11,41 +11,23 @@ use crate::{ bootstrap::nary::connection::bootstrap_connections, error::Error, framework::{ - base::{ - HasOverrides, - TestConfigOverride, - }, + base::{HasOverrides, TestConfigOverride}, binary::{ chain::RelayerConfigOverride, - connection::{ - BinaryConnectionTest, - ConnectionDelayOverride, - }, - node::{ - NodeConfigOverride, - NodeGenesisOverride, - }, + connection::{BinaryConnectionTest, ConnectionDelayOverride}, + node::{NodeConfigOverride, NodeGenesisOverride}, }, nary::{ - chain::{ - NaryChainTest, - RunNaryChainTest, - }, + chain::{NaryChainTest, RunNaryChainTest}, node::run_nary_node_test, }, - supervisor::{ - RunWithSupervisor, - SupervisorOverride, - }, + supervisor::{RunWithSupervisor, SupervisorOverride}, }, relayer::driver::RelayerDriver, types::{ config::TestConfig, env::write_env, - nary::{ - chains::NaryConnectedChains, - connection::ConnectedConnections, - }, + nary::{chains::NaryConnectedChains, connection::ConnectedConnections}, }, util::suspend::hang_on_error, }; diff --git a/tools/test-framework/src/framework/nary/node.rs b/tools/test-framework/src/framework/nary/node.rs index 5666d34c8c..a90d86af8a 100644 --- a/tools/test-framework/src/framework/nary/node.rs +++ b/tools/test-framework/src/framework/nary/node.rs @@ -8,21 +8,10 @@ use crate::{ chain::builder::ChainBuilder, error::Error, framework::{ - base::{ - run_basic_test, - BasicTest, - HasOverrides, - TestConfigOverride, - }, - binary::node::{ - NodeConfigOverride, - NodeGenesisOverride, - }, - }, - types::{ - config::TestConfig, - single::node::FullNode, + base::{run_basic_test, BasicTest, HasOverrides, TestConfigOverride}, + binary::node::{NodeConfigOverride, NodeGenesisOverride}, }, + types::{config::TestConfig, single::node::FullNode}, util::array::try_into_array, }; diff --git a/tools/test-framework/src/framework/overrides.rs b/tools/test-framework/src/framework/overrides.rs index 3b14dcd3d4..641da5db90 100644 --- a/tools/test-framework/src/framework/overrides.rs +++ b/tools/test-framework/src/framework/overrides.rs @@ -5,42 +5,23 @@ use core::time::Duration; use ibc_relayer::{ - config::{ - default::connection_delay as default_connection_delay, - Config, - }, + config::{default::connection_delay as default_connection_delay, Config}, foreign_client::CreateOptions as ClientOptions, }; use ibc_relayer_types::core::{ - ics04_channel::{ - channel::Ordering, - version::Version, - }, + ics04_channel::{channel::Ordering, version::Version}, ics24_host::identifier::PortId, }; use crate::{ error::Error, framework::{ - base::{ - HasOverrides, - TestConfigOverride, - }, + base::{HasOverrides, TestConfigOverride}, binary::{ - chain::{ - ClientOptionsOverride, - RelayerConfigOverride, - }, - channel::{ - ChannelOrderOverride, - ChannelVersionOverride, - PortsOverride, - }, + chain::{ClientOptionsOverride, RelayerConfigOverride}, + channel::{ChannelOrderOverride, ChannelVersionOverride, PortsOverride}, connection::ConnectionDelayOverride, - node::{ - NodeConfigOverride, - NodeGenesisOverride, - }, + node::{NodeConfigOverride, NodeGenesisOverride}, }, nary::channel::PortsOverride as NaryPortsOverride, supervisor::SupervisorOverride, diff --git a/tools/test-framework/src/ibc/denom.rs b/tools/test-framework/src/ibc/denom.rs index 9627abf473..c325881716 100644 --- a/tools/test-framework/src/ibc/denom.rs +++ b/tools/test-framework/src/ibc/denom.rs @@ -2,27 +2,15 @@ Helper functions for deriving IBC denom. */ -use core::fmt::{ - self, - Display, -}; +use core::fmt::{self, Display}; use eyre::Report as Error; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChannelId, - PortId, -}; -use sha2::{ - Digest, - Sha256, -}; +use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId}; +use sha2::{Digest, Sha256}; use subtle_encoding::hex; use crate::types::{ - id::{ - TaggedChannelIdRef, - TaggedPortIdRef, - }, + id::{TaggedChannelIdRef, TaggedPortIdRef}, tagged::*, }; diff --git a/tools/test-framework/src/ibc/token.rs b/tools/test-framework/src/ibc/token.rs index 438e1dcb9b..b60071009f 100644 --- a/tools/test-framework/src/ibc/token.rs +++ b/tools/test-framework/src/ibc/token.rs @@ -1,29 +1,15 @@ -use core::ops::{ - Add, - Sub, -}; +use core::ops::{Add, Sub}; use ibc_relayer_types::applications::transfer::{ amount::Amount, - coin::{ - Coin, - RawCoin, - }, + coin::{Coin, RawCoin}, }; use crate::{ error::Error, - ibc::denom::{ - derive_ibc_denom, - Denom, - TaggedDenom, - TaggedDenomRef, - }, + ibc::denom::{derive_ibc_denom, Denom, TaggedDenom, TaggedDenomRef}, types::{ - id::{ - TaggedChannelIdRef, - TaggedPortIdRef, - }, + id::{TaggedChannelIdRef, TaggedPortIdRef}, tagged::MonoTagged, }, }; diff --git a/tools/test-framework/src/prelude.rs b/tools/test-framework/src/prelude.rs index 1bd81a6574..15feba608f 100644 --- a/tools/test-framework/src/prelude.rs +++ b/tools/test-framework/src/prelude.rs @@ -7,159 +7,84 @@ pub use std::thread::sleep; pub use eyre::eyre; pub use ibc_relayer::{ - chain::handle::ChainHandle, - config::Config, - foreign_client::ForeignClient, - registry::SharedRegistry, - supervisor::SupervisorHandle, + chain::handle::ChainHandle, config::Config, foreign_client::ForeignClient, + registry::SharedRegistry, supervisor::SupervisorHandle, }; pub use ibc_relayer_types::core::{ ics04_channel::channel::Ordering, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, - }, -}; -pub use tracing::{ - debug, - error, - info, - warn, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }; +pub use tracing::{debug, error, info, warn}; pub use crate::{ chain::{ driver::ChainDriver, ext::{ - fee::ChainFeeMethodsExt, - ica::InterchainAccountMethodsExt, - proposal::ChainProposalMethodsExt, - transfer::ChainTransferMethodsExt, + fee::ChainFeeMethodsExt, ica::InterchainAccountMethodsExt, + proposal::ChainProposalMethodsExt, transfer::ChainTransferMethodsExt, }, tagged::TaggedChainDriverExt, }, - error::{ - handle_generic_error, - Error, - }, + error::{handle_generic_error, Error}, framework::{ base::HasOverrides, binary::{ chain::{ - run_binary_chain_test, - run_self_connected_binary_chain_test, - run_two_way_binary_chain_test, - BinaryChainTest, - RunBinaryChainTest, + run_binary_chain_test, run_self_connected_binary_chain_test, + run_two_way_binary_chain_test, BinaryChainTest, RunBinaryChainTest, RunSelfConnectedBinaryChainTest, }, channel::{ - run_binary_channel_test, - run_two_way_binary_channel_test, - BinaryChannelTest, + run_binary_channel_test, run_two_way_binary_channel_test, BinaryChannelTest, RunBinaryChannelTest, }, connection::{ - run_binary_connection_test, - run_two_way_binary_connection_test, - BinaryConnectionTest, - RunBinaryConnectionTest, - }, - node::{ - run_binary_node_test, - BinaryNodeTest, - RunBinaryNodeTest, + run_binary_connection_test, run_two_way_binary_connection_test, + BinaryConnectionTest, RunBinaryConnectionTest, }, + node::{run_binary_node_test, BinaryNodeTest, RunBinaryNodeTest}, }, nary::{ chain::{ - run_nary_chain_test, - run_self_connected_nary_chain_test, - NaryChainTest, - RunNaryChainTest, - RunSelfConnectedNaryChainTest, + run_nary_chain_test, run_self_connected_nary_chain_test, NaryChainTest, + RunNaryChainTest, RunSelfConnectedNaryChainTest, }, channel::{ - run_binary_as_nary_channel_test, - run_nary_channel_test, - NaryChannelTest, - PortsOverride, - RunBinaryAsNaryChannelTest, - RunNaryChannelTest, - }, - connection::{ - run_nary_connection_test, - NaryConnectionTest, - RunNaryConnectionTest, - }, - node::{ - run_nary_node_test, - NaryNodeTest, - RunNaryNodeTest, + run_binary_as_nary_channel_test, run_nary_channel_test, NaryChannelTest, + PortsOverride, RunBinaryAsNaryChannelTest, RunNaryChannelTest, }, + connection::{run_nary_connection_test, NaryConnectionTest, RunNaryConnectionTest}, + node::{run_nary_node_test, NaryNodeTest, RunNaryNodeTest}, }, overrides::TestOverrides, supervisor::RunWithSupervisor, }, ibc::{ - denom::{ - derive_ibc_denom, - Denom, - }, - token::{ - TaggedDenomExt, - TaggedToken, - TaggedTokenExt, - TaggedTokenRef, - Token, - }, + denom::{derive_ibc_denom, Denom}, + token::{TaggedDenomExt, TaggedToken, TaggedTokenExt, TaggedTokenRef, Token}, }, relayer::{ channel::TaggedChannelEndExt, - connection::{ - TaggedConnectionEndExt, - TaggedConnectionExt, - }, + connection::{TaggedConnectionEndExt, TaggedConnectionExt}, driver::RelayerDriver, foreign_client::TaggedForeignClientExt, }, types::{ binary::{ - chains::ConnectedChains, - channel::ConnectedChannel, - connection::ConnectedConnection, + chains::ConnectedChains, channel::ConnectedChannel, connection::ConnectedConnection, foreign_client::ForeignClientPair, }, config::TestConfig, id::*, nary::{ - chains::NaryConnectedChains, - channel::ConnectedChannels as NaryConnectedChannels, + chains::NaryConnectedChains, channel::ConnectedChannels as NaryConnectedChannels, connection::ConnectedConnections as NaryConnectedConnections, }, - single::node::{ - FullNode, - TaggedFullNodeExt, - }, - tagged::{ - DualTagged, - MonoTagged, - }, + single::node::{FullNode, TaggedFullNodeExt}, + tagged::{DualTagged, MonoTagged}, wallet::{ - TaggedTestWalletsExt, - TaggedWallet, - TestWallets, - Wallet, - WalletAddress, - WalletId, + TaggedTestWalletsExt, TaggedWallet, TestWallets, Wallet, WalletAddress, WalletId, }, }, - util::{ - assert::*, - retry::assert_eventually_succeed, - suspend::suspend, - }, + util::{assert::*, retry::assert_eventually_succeed, suspend::suspend}, }; diff --git a/tools/test-framework/src/relayer/chain.rs b/tools/test-framework/src/relayer/chain.rs index 68f1a74bf1..d68c4e00cf 100644 --- a/tools/test-framework/src/relayer/chain.rs +++ b/tools/test-framework/src/relayer/chain.rs @@ -22,30 +22,19 @@ use crossbeam_channel as channel; use ibc_proto::ibc::apps::fee::v1::{ - QueryIncentivizedPacketRequest, - QueryIncentivizedPacketResponse, + QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, }; use ibc_relayer::{ account::Balance, chain::{ client::ClientSettings, cosmos::version::Specs, - endpoint::{ - ChainStatus, - HealthCheck, - }, - handle::{ - ChainHandle, - ChainRequest, - Subscription, - }, + endpoint::{ChainStatus, HealthCheck}, + handle::{ChainHandle, ChainRequest, Subscription}, requests::*, tracking::TrackedMsgs, }, - client_state::{ - AnyClientState, - IdentifiedAnyClientState, - }, + client_state::{AnyClientState, IdentifiedAnyClientState}, config::ChainConfig, connection::ConnectionMsgType, consensus_state::AnyConsensusState, @@ -58,38 +47,17 @@ use ibc_relayer::{ use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, core::{ - ics02_client::{ - events::UpdateClient, - header::AnyHeader, - }, + ics02_client::{events::UpdateClient, header::AnyHeader}, ics03_connection::{ - connection::{ - ConnectionEnd, - IdentifiedConnectionEnd, - }, + connection::{ConnectionEnd, IdentifiedConnectionEnd}, version::Version, }, ics04_channel::{ - channel::{ - ChannelEnd, - IdentifiedChannelEnd, - }, - packet::{ - PacketMsgType, - Sequence, - }, - }, - ics23_commitment::{ - commitment::CommitmentPrefix, - merkle::MerkleProof, - }, - ics24_host::identifier::{ - ChainId, - ChannelId, - ClientId, - ConnectionId, - PortId, + channel::{ChannelEnd, IdentifiedChannelEnd}, + packet::{PacketMsgType, Sequence}, }, + ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, proofs::Proofs, signer::Signer, diff --git a/tools/test-framework/src/relayer/channel.rs b/tools/test-framework/src/relayer/channel.rs index 61374eea3d..4bfd20160f 100644 --- a/tools/test-framework/src/relayer/channel.rs +++ b/tools/test-framework/src/relayer/channel.rs @@ -4,26 +4,12 @@ use eyre::eyre; use ibc_relayer::{ chain::{ handle::ChainHandle, - requests::{ - IncludeProof, - QueryChannelRequest, - QueryHeight, - }, - }, - channel::{ - extract_channel_id, - version::Version, - Channel, - ChannelSide, + requests::{IncludeProof, QueryChannelRequest, QueryHeight}, }, + channel::{extract_channel_id, version::Version, Channel, ChannelSide}, }; use ibc_relayer_types::core::{ - ics04_channel::channel::{ - ChannelEnd, - IdentifiedChannelEnd, - Ordering, - State as ChannelState, - }, + ics04_channel::channel::{ChannelEnd, IdentifiedChannelEnd, Ordering, State as ChannelState}, ics24_host::identifier::ConnectionId, }; @@ -31,12 +17,8 @@ use crate::{ error::Error, types::{ id::{ - TaggedChannelId, - TaggedChannelIdRef, - TaggedClientIdRef, - TaggedConnectionIdRef, - TaggedPortId, - TaggedPortIdRef, + TaggedChannelId, TaggedChannelIdRef, TaggedClientIdRef, TaggedConnectionIdRef, + TaggedPortId, TaggedPortIdRef, }, tagged::DualTagged, }, diff --git a/tools/test-framework/src/relayer/connection.rs b/tools/test-framework/src/relayer/connection.rs index dde6c477cd..bc7f5b9c2f 100644 --- a/tools/test-framework/src/relayer/connection.rs +++ b/tools/test-framework/src/relayer/connection.rs @@ -8,23 +8,13 @@ use eyre::eyre; use ibc_relayer::{ chain::{ handle::ChainHandle, - requests::{ - IncludeProof, - QueryConnectionRequest, - QueryHeight, - }, - }, - connection::{ - extract_connection_id, - Connection, - ConnectionSide, + requests::{IncludeProof, QueryConnectionRequest, QueryHeight}, }, + connection::{extract_connection_id, Connection, ConnectionSide}, }; use ibc_relayer_types::{ core::ics03_connection::connection::{ - ConnectionEnd, - IdentifiedConnectionEnd, - State as ConnectionState, + ConnectionEnd, IdentifiedConnectionEnd, State as ConnectionState, }, timestamp::ZERO_DURATION, }; @@ -32,11 +22,7 @@ use ibc_relayer_types::{ use crate::{ error::Error, types::{ - id::{ - TaggedClientIdRef, - TaggedConnectionId, - TaggedConnectionIdRef, - }, + id::{TaggedClientIdRef, TaggedConnectionId, TaggedConnectionIdRef}, tagged::DualTagged, }, util::retry::assert_eventually_succeed, diff --git a/tools/test-framework/src/relayer/driver.rs b/tools/test-framework/src/relayer/driver.rs index 8db9d79f9c..ac91a9b24a 100644 --- a/tools/test-framework/src/relayer/driver.rs +++ b/tools/test-framework/src/relayer/driver.rs @@ -8,19 +8,12 @@ use ibc_relayer::{ chain::handle::CountingAndCachingChainHandle, config::Config, registry::SharedRegistry, - supervisor::{ - spawn_supervisor, - SupervisorHandle, - SupervisorOptions, - }, + supervisor::{spawn_supervisor, SupervisorHandle, SupervisorOptions}, }; use crate::{ error::Error, - types::env::{ - EnvWriter, - ExportEnv, - }, + types::env::{EnvWriter, ExportEnv}, util::suspend::hang_on_error, }; diff --git a/tools/test-framework/src/relayer/fee.rs b/tools/test-framework/src/relayer/fee.rs index 288dd3041c..56315d8acd 100644 --- a/tools/test-framework/src/relayer/fee.rs +++ b/tools/test-framework/src/relayer/fee.rs @@ -18,8 +18,7 @@ use ibc_relayer_types::{ pay_packet::build_pay_packet_message, pay_packet_async::build_pay_packet_fee_async_message, register_payee::{ - build_register_counterparty_payee_message, - build_register_payee_message, + build_register_counterparty_payee_message, build_register_payee_message, }, }, packet_fee::IdentifiedPacketFees, @@ -29,28 +28,13 @@ use ibc_relayer_types::{ use tendermint_rpc::HttpClient; use crate::{ - error::{ - handle_generic_error, - Error, - }, - ibc::token::{ - TaggedTokenExt, - TaggedTokenRef, - }, + error::{handle_generic_error, Error}, + ibc::token::{TaggedTokenExt, TaggedTokenRef}, relayer::transfer::build_transfer_message, types::{ - id::{ - TaggedChannelIdRef, - TaggedPortIdRef, - }, - tagged::{ - DualTagged, - MonoTagged, - }, - wallet::{ - Wallet, - WalletAddress, - }, + id::{TaggedChannelIdRef, TaggedPortIdRef}, + tagged::{DualTagged, MonoTagged}, + wallet::{Wallet, WalletAddress}, }, }; diff --git a/tools/test-framework/src/relayer/foreign_client.rs b/tools/test-framework/src/relayer/foreign_client.rs index 74b4bfec00..199a2b79a6 100644 --- a/tools/test-framework/src/relayer/foreign_client.rs +++ b/tools/test-framework/src/relayer/foreign_client.rs @@ -2,16 +2,10 @@ Definition for extension trait methods for [`ForeignClient`] */ -use ibc_relayer::{ - chain::handle::ChainHandle, - foreign_client::ForeignClient, -}; +use ibc_relayer::{chain::handle::ChainHandle, foreign_client::ForeignClient}; use crate::types::{ - id::{ - TaggedChainId, - TaggedClientIdRef, - }, + id::{TaggedChainId, TaggedClientIdRef}, tagged::*, }; diff --git a/tools/test-framework/src/relayer/refresh.rs b/tools/test-framework/src/relayer/refresh.rs index 364474835f..fbf4285a18 100644 --- a/tools/test-framework/src/relayer/refresh.rs +++ b/tools/test-framework/src/relayer/refresh.rs @@ -1,14 +1,9 @@ use eyre::eyre; use ibc_relayer::{ - chain::handle::ChainHandle, - util::task::TaskHandle, - worker::client::spawn_refresh_client, + chain::handle::ChainHandle, util::task::TaskHandle, worker::client::spawn_refresh_client, }; -use crate::{ - error::Error, - types::binary::foreign_client::ForeignClientPair, -}; +use crate::{error::Error, types::binary::foreign_client::ForeignClientPair}; pub fn spawn_refresh_client_tasks( foreign_clients: &ForeignClientPair, diff --git a/tools/test-framework/src/relayer/transfer.rs b/tools/test-framework/src/relayer/transfer.rs index 8b086aadb1..647d1788c4 100644 --- a/tools/test-framework/src/relayer/transfer.rs +++ b/tools/test-framework/src/relayer/transfer.rs @@ -3,53 +3,32 @@ `hermes tx ft-transfer`. */ -use core::{ - ops::Add, - time::Duration, -}; +use core::{ops::Add, time::Duration}; use eyre::eyre; use ibc_proto::google::protobuf::Any; use ibc_relayer::{ chain::cosmos::{ - tx::{ - batched_send_tx, - simple_send_tx, - }, + tx::{batched_send_tx, simple_send_tx}, types::config::TxConfig, }, - transfer::{ - build_transfer_message as raw_build_transfer_message, - TransferError, - }, + transfer::{build_transfer_message as raw_build_transfer_message, TransferError}, }; use ibc_relayer_types::{ applications::transfer::error::Error as Ics20Error, - core::ics04_channel::{ - packet::Packet, - timeout::TimeoutHeight, - }, + core::ics04_channel::{packet::Packet, timeout::TimeoutHeight}, events::IbcEvent, timestamp::Timestamp, }; use tendermint_rpc::HttpClient; use crate::{ - error::{ - handle_generic_error, - Error, - }, + error::{handle_generic_error, Error}, ibc::token::TaggedTokenRef, types::{ - id::{ - TaggedChannelIdRef, - TaggedPortIdRef, - }, + id::{TaggedChannelIdRef, TaggedPortIdRef}, tagged::*, - wallet::{ - Wallet, - WalletAddress, - }, + wallet::{Wallet, WalletAddress}, }, }; diff --git a/tools/test-framework/src/relayer/tx.rs b/tools/test-framework/src/relayer/tx.rs index 6950c5f88e..8d8d59efb6 100644 --- a/tools/test-framework/src/relayer/tx.rs +++ b/tools/test-framework/src/relayer/tx.rs @@ -1,30 +1,18 @@ -use core::{ - str::FromStr, - time::Duration, -}; +use core::{str::FromStr, time::Duration}; use http::uri::Uri; use ibc_proto::cosmos::tx::v1beta1::Fee; use ibc_relayer::{ chain::cosmos::{ gas::calculate_fee, - types::{ - config::TxConfig, - gas::GasConfig, - }, - }, - config::{ - AddressType, - GasPrice, + types::{config::TxConfig, gas::GasConfig}, }, + config::{AddressType, GasPrice}, }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use tendermint_rpc::Url; -use crate::error::{ - handle_generic_error, - Error, -}; +use crate::error::{handle_generic_error, Error}; pub fn gas_config_for_test(native_token: String) -> GasConfig { let max_gas = 3000000; diff --git a/tools/test-framework/src/types/binary/chains.rs b/tools/test-framework/src/types/binary/chains.rs index bcf87999c8..2526de9f32 100644 --- a/tools/test-framework/src/types/binary/chains.rs +++ b/tools/test-framework/src/types/binary/chains.rs @@ -7,19 +7,9 @@ use tracing::info; use super::foreign_client::ForeignClientPair; use crate::types::{ - env::{ - prefix_writer, - EnvWriter, - ExportEnv, - }, - id::{ - TaggedChainIdRef, - TaggedClientIdRef, - }, - single::node::{ - FullNode, - TaggedFullNodeExt, - }, + env::{prefix_writer, EnvWriter, ExportEnv}, + id::{TaggedChainIdRef, TaggedClientIdRef}, + single::node::{FullNode, TaggedFullNodeExt}, tagged::*, }; diff --git a/tools/test-framework/src/types/binary/channel.rs b/tools/test-framework/src/types/binary/channel.rs index 0f4e243c52..74eb96710c 100644 --- a/tools/test-framework/src/types/binary/channel.rs +++ b/tools/test-framework/src/types/binary/channel.rs @@ -2,21 +2,12 @@ Type definitions for channel connected between two chains. */ -use ibc_relayer::{ - chain::handle::ChainHandle, - channel::Channel, -}; +use ibc_relayer::{chain::handle::ChainHandle, channel::Channel}; use super::connection::ConnectedConnection; use crate::types::{ - env::{ - EnvWriter, - ExportEnv, - }, - id::{ - TaggedChannelId, - TaggedPortId, - }, + env::{EnvWriter, ExportEnv}, + id::{TaggedChannelId, TaggedPortId}, }; /** diff --git a/tools/test-framework/src/types/binary/client.rs b/tools/test-framework/src/types/binary/client.rs index 933ed4371e..fb24a306a3 100644 --- a/tools/test-framework/src/types/binary/client.rs +++ b/tools/test-framework/src/types/binary/client.rs @@ -3,10 +3,7 @@ */ use crate::types::{ - env::{ - EnvWriter, - ExportEnv, - }, + env::{EnvWriter, ExportEnv}, id::TaggedClientId, }; diff --git a/tools/test-framework/src/types/binary/connection.rs b/tools/test-framework/src/types/binary/connection.rs index a67027735c..50574737e0 100644 --- a/tools/test-framework/src/types/binary/connection.rs +++ b/tools/test-framework/src/types/binary/connection.rs @@ -2,17 +2,11 @@ Type definitions for connection that is connected between two chains. */ -use ibc_relayer::{ - chain::handle::ChainHandle, - connection::Connection, -}; +use ibc_relayer::{chain::handle::ChainHandle, connection::Connection}; use super::client::ClientIdPair; use crate::types::{ - env::{ - EnvWriter, - ExportEnv, - }, + env::{EnvWriter, ExportEnv}, id::TaggedConnectionId, }; diff --git a/tools/test-framework/src/types/binary/foreign_client.rs b/tools/test-framework/src/types/binary/foreign_client.rs index 37f1fb8172..81fd9aa3ac 100644 --- a/tools/test-framework/src/types/binary/foreign_client.rs +++ b/tools/test-framework/src/types/binary/foreign_client.rs @@ -1,12 +1,6 @@ -use ibc_relayer::{ - chain::handle::ChainHandle, - foreign_client::ForeignClient, -}; +use ibc_relayer::{chain::handle::ChainHandle, foreign_client::ForeignClient}; -use crate::{ - relayer::foreign_client::TaggedForeignClientExt, - types::id::TaggedClientIdRef, -}; +use crate::{relayer::foreign_client::TaggedForeignClientExt, types::id::TaggedClientIdRef}; #[derive(Clone)] pub struct ForeignClientPair { diff --git a/tools/test-framework/src/types/env.rs b/tools/test-framework/src/types/env.rs index b92fa16cff..6344b4ccf9 100644 --- a/tools/test-framework/src/types/env.rs +++ b/tools/test-framework/src/types/env.rs @@ -3,18 +3,11 @@ */ use core::convert::AsRef; -use std::{ - collections::BTreeMap, - fs::write, - path::Path, -}; +use std::{collections::BTreeMap, fs::write, path::Path}; use itertools::Itertools; -use crate::{ - error::Error, - types::tagged::*, -}; +use crate::{error::Error, types::tagged::*}; /** This trait is implemented by data types that can export the contained diff --git a/tools/test-framework/src/types/nary/chains.rs b/tools/test-framework/src/types/nary/chains.rs index 1148789f5e..6ef91293e7 100644 --- a/tools/test-framework/src/types/nary/chains.rs +++ b/tools/test-framework/src/types/nary/chains.rs @@ -2,30 +2,17 @@ Constructs for N-ary connected chains. */ -use core::convert::{ - From, - TryFrom, -}; +use core::convert::{From, TryFrom}; use eyre::eyre; -use ibc_relayer::{ - chain::handle::ChainHandle, - foreign_client::ForeignClient, -}; +use ibc_relayer::{chain::handle::ChainHandle, foreign_client::ForeignClient}; use crate::{ error::Error, types::{ binary::chains::ConnectedChains as BinaryConnectedChains, - env::{ - prefix_writer, - EnvWriter, - ExportEnv, - }, - nary::{ - aliases::*, - foreign_client::*, - }, + env::{prefix_writer, EnvWriter, ExportEnv}, + nary::{aliases::*, foreign_client::*}, single::node::FullNode, tagged::*, }, diff --git a/tools/test-framework/src/types/nary/channel.rs b/tools/test-framework/src/types/nary/channel.rs index 0a9f252747..18681bed8f 100644 --- a/tools/test-framework/src/types/nary/channel.rs +++ b/tools/test-framework/src/types/nary/channel.rs @@ -5,24 +5,15 @@ use core::convert::TryFrom; use eyre::eyre; -use ibc_relayer::{ - chain::handle::ChainHandle, - channel::Channel, -}; -use ibc_relayer_types::core::ics24_host::identifier::{ - ChannelId, - PortId, -}; +use ibc_relayer::{chain::handle::ChainHandle, channel::Channel}; +use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId}; use super::aliases::NthChainHandle; use crate::{ error::Error, types::{ binary::channel::ConnectedChannel, - env::{ - EnvWriter, - ExportEnv, - }, + env::{EnvWriter, ExportEnv}, tagged::*, }, util::array::try_into_nested_array, diff --git a/tools/test-framework/src/types/nary/connection.rs b/tools/test-framework/src/types/nary/connection.rs index a86e458a75..a4495586a3 100644 --- a/tools/test-framework/src/types/nary/connection.rs +++ b/tools/test-framework/src/types/nary/connection.rs @@ -13,16 +13,10 @@ use crate::{ error::Error, types::{ binary::connection::ConnectedConnection, - env::{ - EnvWriter, - ExportEnv, - }, + env::{EnvWriter, ExportEnv}, tagged::*, }, - util::array::{ - into_nested_vec, - try_into_nested_array, - }, + util::array::{into_nested_vec, try_into_nested_array}, }; /** diff --git a/tools/test-framework/src/types/nary/foreign_client.rs b/tools/test-framework/src/types/nary/foreign_client.rs index 409c0c5d75..6e3b3418c8 100644 --- a/tools/test-framework/src/types/nary/foreign_client.rs +++ b/tools/test-framework/src/types/nary/foreign_client.rs @@ -1,26 +1,17 @@ use core::convert::TryFrom; use eyre::eyre; -use ibc_relayer::{ - chain::handle::ChainHandle, - foreign_client::ForeignClient, -}; +use ibc_relayer::{chain::handle::ChainHandle, foreign_client::ForeignClient}; use super::aliases::NthChainHandle; use crate::{ error::Error, types::{ binary::foreign_client::ForeignClientPair, - env::{ - EnvWriter, - ExportEnv, - }, + env::{EnvWriter, ExportEnv}, tagged::*, }, - util::array::{ - into_nested_vec, - try_into_nested_array, - }, + util::array::{into_nested_vec, try_into_nested_array}, }; /** diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index 9e386964af..1841510ada 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -2,47 +2,25 @@ Type definition for a single running full node. */ -use core::{ - str::FromStr, - time::Duration, -}; -use std::sync::{ - Arc, - RwLock, -}; +use core::{str::FromStr, time::Duration}; +use std::sync::{Arc, RwLock}; -use eyre::{ - eyre, - Report as Error, -}; +use eyre::{eyre, Report as Error}; use ibc_relayer::{ chain::cosmos::config::CosmosSdkConfig, config, - config::{ - compat_mode::CompatMode, - gas_multiplier::GasMultiplier, - }, + config::{compat_mode::CompatMode, gas_multiplier::GasMultiplier}, keyring::Store, }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use tendermint_rpc::{ - Url, - WebSocketClientUrl, -}; +use tendermint_rpc::{Url, WebSocketClientUrl}; use crate::{ - chain::{ - chain_type::ChainType as TestedChainType, - driver::ChainDriver, - }, + chain::{chain_type::ChainType as TestedChainType, driver::ChainDriver}, ibc::denom::Denom, prelude::TestConfig, types::{ - env::{ - prefix_writer, - EnvWriter, - ExportEnv, - }, + env::{prefix_writer, EnvWriter, ExportEnv}, process::ChildProcess, tagged::*, wallet::TestWallets, diff --git a/tools/test-framework/src/types/tagged/dual.rs b/tools/test-framework/src/types/tagged/dual.rs index 65912d11b4..6589ac4f59 100644 --- a/tools/test-framework/src/types/tagged/dual.rs +++ b/tools/test-framework/src/types/tagged/dual.rs @@ -13,22 +13,9 @@ */ use core::{ - cmp::{ - Eq, - Ord, - Ordering, - PartialEq, - PartialOrd, - }, - fmt::{ - self, - Debug, - Display, - }, - iter::{ - IntoIterator, - Iterator, - }, + cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd}, + fmt::{self, Debug, Display}, + iter::{IntoIterator, Iterator}, marker::PhantomData, }; diff --git a/tools/test-framework/src/types/tagged/mono.rs b/tools/test-framework/src/types/tagged/mono.rs index 24e989f1ed..c452ee0b3c 100644 --- a/tools/test-framework/src/types/tagged/mono.rs +++ b/tools/test-framework/src/types/tagged/mono.rs @@ -18,29 +18,13 @@ */ use core::{ - cmp::{ - Eq, - Ord, - Ordering, - PartialEq, - PartialOrd, - }, - fmt::{ - self, - Debug, - Display, - }, - iter::{ - IntoIterator, - Iterator, - }, + cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd}, + fmt::{self, Debug, Display}, + iter::{IntoIterator, Iterator}, marker::PhantomData, }; -use serde::{ - Serialize, - Serializer, -}; +use serde::{Serialize, Serializer}; use super::dual::Tagged as DualTagged; diff --git a/tools/test-framework/src/types/wallet.rs b/tools/test-framework/src/types/wallet.rs index 2c8f83a621..40e1618f48 100644 --- a/tools/test-framework/src/types/wallet.rs +++ b/tools/test-framework/src/types/wallet.rs @@ -2,19 +2,12 @@ Types for information about a chain wallet. */ -use core::fmt::{ - self, - Display, -}; +use core::fmt::{self, Display}; use ibc_relayer::keyring::Secp256k1KeyPair; use crate::types::{ - env::{ - prefix_writer, - EnvWriter, - ExportEnv, - }, + env::{prefix_writer, EnvWriter, ExportEnv}, tagged::*, }; diff --git a/tools/test-framework/src/util/file.rs b/tools/test-framework/src/util/file.rs index 7bb1274c3e..d238410f6b 100644 --- a/tools/test-framework/src/util/file.rs +++ b/tools/test-framework/src/util/file.rs @@ -2,11 +2,7 @@ Filesystem utilities. */ -use std::{ - fs, - io, - thread, -}; +use std::{fs, io, thread}; use crate::error::Error; diff --git a/tools/test-framework/src/util/interchain_security.rs b/tools/test-framework/src/util/interchain_security.rs index c4fcfa0b84..c59b4a264c 100644 --- a/tools/test-framework/src/util/interchain_security.rs +++ b/tools/test-framework/src/util/interchain_security.rs @@ -1,9 +1,6 @@ use ibc_relayer::config::ChainConfig; -use crate::{ - chain::config::set_voting_period, - prelude::*, -}; +use crate::{chain::config::set_voting_period, prelude::*}; pub fn update_genesis_for_consumer_chain(genesis: &mut serde_json::Value) -> Result<(), Error> { // Consumer chain doesn't have a gov key. diff --git a/tools/test-framework/src/util/random.rs b/tools/test-framework/src/util/random.rs index 95c08c0b78..608a8653b0 100644 --- a/tools/test-framework/src/util/random.rs +++ b/tools/test-framework/src/util/random.rs @@ -4,11 +4,7 @@ use std::{ collections::HashSet, - net::{ - Ipv4Addr, - SocketAddrV4, - TcpListener, - }, + net::{Ipv4Addr, SocketAddrV4, TcpListener}, sync::Mutex, }; diff --git a/tools/test-framework/src/util/retry.rs b/tools/test-framework/src/util/retry.rs index 9867f152cb..27509c7064 100644 --- a/tools/test-framework/src/util/retry.rs +++ b/tools/test-framework/src/util/retry.rs @@ -5,10 +5,7 @@ use core::time::Duration; use std::thread::sleep; -use tracing::{ - info, - trace, -}; +use tracing::{info, trace}; use crate::error::Error; diff --git a/tools/test-framework/src/util/suspend.rs b/tools/test-framework/src/util/suspend.rs index afaec475ab..85c4321f4f 100644 --- a/tools/test-framework/src/util/suspend.rs +++ b/tools/test-framework/src/util/suspend.rs @@ -4,18 +4,11 @@ use core::time::Duration; use std::{ - panic::{ - catch_unwind, - resume_unwind, - AssertUnwindSafe, - }, + panic::{catch_unwind, resume_unwind, AssertUnwindSafe}, thread::sleep, }; -use tracing::{ - error, - warn, -}; +use tracing::{error, warn}; use crate::error::Error; From 879584aaff698a831ce691fbc380642de6a118aa Mon Sep 17 00:00:00 2001 From: elizabeth Date: Tue, 8 Oct 2024 12:25:16 -0400 Subject: [PATCH 198/200] wip fixing astria after merge --- Cargo.lock | 135 +++++------------- crates/relayer/Cargo.toml | 4 +- crates/relayer/src/chain/astria/endpoint.rs | 45 ++++-- .../src/chain/cosmos/query/consensus_state.rs | 2 - crates/relayer/src/config.rs | 11 +- .../relayer/src/keyring/ed25519_key_pair.rs | 6 +- crates/relayer/src/transfer.rs | 2 + 7 files changed, 88 insertions(+), 117 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 26746b6e33..b45570b080 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -409,7 +409,7 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "astria-core" version = "0.1.0" -source = "git+https://github.com/astriaorg/astria?tag=sequencer-v0.16.0#6251eaae61cb0f22b4c9f1f6cf6dcbf980a8c95f" +source = "git+https://github.com/astriaorg/astria?rev=9e1c5196db199e6cb46316fa116767b3e17571da#9e1c5196db199e6cb46316fa116767b3e17571da" dependencies = [ "astria-merkle", "base64 0.21.7", @@ -426,17 +426,26 @@ dependencies = [ "prost 0.12.6", "rand", "sha2 0.10.8", - "tendermint 0.34.1", - "tendermint-proto 0.34.1", + "tendermint 0.38.1", + "tendermint-proto 0.38.1", "thiserror", "tracing", "zeroize", ] +[[package]] +name = "astria-eyre" +version = "0.1.0" +source = "git+https://github.com/astriaorg/astria?rev=9e1c5196db199e6cb46316fa116767b3e17571da#9e1c5196db199e6cb46316fa116767b3e17571da" +dependencies = [ + "eyre", + "itoa", +] + [[package]] name = "astria-merkle" version = "0.1.0" -source = "git+https://github.com/astriaorg/astria?tag=sequencer-v0.16.0#6251eaae61cb0f22b4c9f1f6cf6dcbf980a8c95f" +source = "git+https://github.com/astriaorg/astria?rev=9e1c5196db199e6cb46316fa116767b3e17571da#9e1c5196db199e6cb46316fa116767b3e17571da" dependencies = [ "sha2 0.10.8", ] @@ -444,21 +453,24 @@ dependencies = [ [[package]] name = "astria-sequencer-client" version = "0.1.0" -source = "git+https://github.com/astriaorg/astria?tag=sequencer-v0.16.0#6251eaae61cb0f22b4c9f1f6cf6dcbf980a8c95f" +source = "git+https://github.com/astriaorg/astria?rev=9e1c5196db199e6cb46316fa116767b3e17571da#9e1c5196db199e6cb46316fa116767b3e17571da" dependencies = [ "astria-core", + "astria-eyre", "async-trait", "futures", "futures-util", "hex", + "humantime", "prost 0.12.6", - "tendermint 0.34.1", - "tendermint-proto 0.34.1", - "tendermint-rpc 0.34.1", + "tendermint 0.38.1", + "tendermint-proto 0.38.1", + "tendermint-rpc", "thiserror", "tokio", "tokio-stream", "tracing", + "tryhard", ] [[package]] @@ -494,22 +506,6 @@ dependencies = [ "syn 2.0.76", ] -[[package]] -name = "async-tungstenite" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e9efbe14612da0a19fb983059a0b621e9cf6225d7018ecab4f9988215540dc" -dependencies = [ - "futures-io", - "futures-util", - "log", - "pin-project-lite", - "rustls-native-certs 0.6.3", - "tokio", - "tokio-rustls 0.24.1", - "tungstenite 0.20.1", -] - [[package]] name = "async-tungstenite" version = "0.24.0" @@ -524,7 +520,7 @@ dependencies = [ "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", - "tungstenite 0.21.0", + "tungstenite", ] [[package]] @@ -2340,7 +2336,7 @@ dependencies = [ "reqwest", "serde", "serde_json", - "tendermint-rpc 0.38.1", + "tendermint-rpc", "tokio", "tracing", ] @@ -2358,7 +2354,7 @@ dependencies = [ "serde", "serde_json", "tendermint 0.38.1", - "tendermint-rpc 0.38.1", + "tendermint-rpc", "time", "toml 0.8.19", "tonic", @@ -2461,7 +2457,7 @@ dependencies = [ "tendermint-light-client-detector", "tendermint-light-client-verifier 0.38.1", "tendermint-proto 0.38.1", - "tendermint-rpc 0.38.1", + "tendermint-rpc", "tendermint-testgen", "test-log", "thiserror", @@ -2510,7 +2506,7 @@ dependencies = [ "subtle-encoding", "tendermint 0.38.1", "tendermint-light-client-verifier 0.38.1", - "tendermint-rpc 0.38.1", + "tendermint-rpc", "time", "tokio", "tracing", @@ -2554,7 +2550,7 @@ dependencies = [ "tendermint 0.38.1", "tendermint-light-client-verifier 0.38.1", "tendermint-proto 0.38.1", - "tendermint-rpc 0.38.1", + "tendermint-rpc", "tendermint-testgen", "test-log", "time", @@ -2607,7 +2603,7 @@ dependencies = [ "serde_yaml", "sha2 0.10.8", "subtle-encoding", - "tendermint-rpc 0.38.1", + "tendermint-rpc", "tokio", "toml 0.8.19", "tonic", @@ -5305,20 +5301,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "tendermint-config" -version = "0.34.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1a02da769166e2052cd537b1a97c78017632c2d9e19266367b27e73910434fc" -dependencies = [ - "flex-error", - "serde", - "serde_json", - "tendermint 0.34.1", - "toml 0.5.11", - "url", -] - [[package]] name = "tendermint-config" version = "0.38.1" @@ -5352,7 +5334,7 @@ dependencies = [ "static_assertions", "tendermint 0.38.1", "tendermint-light-client-verifier 0.38.1", - "tendermint-rpc 0.38.1", + "tendermint-rpc", "time", "tokio", "tracing", @@ -5376,7 +5358,7 @@ dependencies = [ "tendermint 0.38.1", "tendermint-light-client", "tendermint-proto 0.38.1", - "tendermint-rpc 0.38.1", + "tendermint-rpc", "time", "tracing", ] @@ -5441,40 +5423,6 @@ dependencies = [ "time", ] -[[package]] -name = "tendermint-rpc" -version = "0.34.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71afae8bb5f6b14ed48d4e1316a643b6c2c3cbad114f510be77b4ed20b7b3e42" -dependencies = [ - "async-trait", - "async-tungstenite 0.23.0", - "bytes", - "flex-error", - "futures", - "getrandom", - "peg", - "pin-project", - "rand", - "reqwest", - "semver", - "serde", - "serde_bytes", - "serde_json", - "subtle", - "subtle-encoding", - "tendermint 0.34.1", - "tendermint-config 0.34.1", - "tendermint-proto 0.34.1", - "thiserror", - "time", - "tokio", - "tracing", - "url", - "uuid", - "walkdir", -] - [[package]] name = "tendermint-rpc" version = "0.38.1" @@ -5482,7 +5430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02f96a2b8a0d3d0b59e4024b1a6bdc1589efc6af4709d08a480a20cc4ba90f63" dependencies = [ "async-trait", - "async-tungstenite 0.24.0", + "async-tungstenite", "bytes", "flex-error", "futures", @@ -5498,7 +5446,7 @@ dependencies = [ "subtle", "subtle-encoding", "tendermint 0.38.1", - "tendermint-config 0.38.1", + "tendermint-config", "tendermint-proto 0.38.1", "thiserror", "time", @@ -5977,23 +5925,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] -name = "tungstenite" -version = "0.20.1" +name = "tryhard" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +checksum = "9c9f0a709784e86923586cff0d872dba54cd2d2e116b3bc57587d15737cfce9d" dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 0.2.12", - "httparse", - "log", - "rand", - "rustls 0.21.12", - "sha1", - "thiserror", - "url", - "utf-8", + "futures", + "pin-project-lite", + "tokio", ] [[package]] diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 8dcc13a97c..912d9297e2 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -19,8 +19,8 @@ all-features = true default = ["flex-error/std", "flex-error/eyre_tracer"] [dependencies] -astria-core = { git = "https://github.com/astriaorg/astria", tag = "sequencer-v0.16.0" } -astria-sequencer-client = { git = "https://github.com/astriaorg/astria", tag = "sequencer-v0.16.0", features = [ "http" ] } +astria-core = { git = "https://github.com/astriaorg/astria", rev = "9e1c5196db199e6cb46316fa116767b3e17571da" } +astria-sequencer-client = { git = "https://github.com/astriaorg/astria", rev = "9e1c5196db199e6cb46316fa116767b3e17571da", features = [ "http" ] } ed25519-consensus = "2.1.0" ibc-types = "0.12.0" jmt = "0.6" diff --git a/crates/relayer/src/chain/astria/endpoint.rs b/crates/relayer/src/chain/astria/endpoint.rs index 97ad84a430..842430766e 100644 --- a/crates/relayer/src/chain/astria/endpoint.rs +++ b/crates/relayer/src/chain/astria/endpoint.rs @@ -1,6 +1,7 @@ use alloc::sync::Arc; use std::{str::FromStr as _, time::Duration}; +use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; use ibc_proto::ibc::{ apps::fee::v1::{QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse}, core::{ @@ -9,6 +10,8 @@ use ibc_proto::ibc::{ connection::v1::query_client::QueryClient as IbcConnectionQueryClient, }, }; +use ibc_relayer_types::core::ics02_client::height::Height; +use ibc_relayer_types::core::ics04_channel::upgrade::{ErrorReceipt, Upgrade}; use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, clients::ics07_tendermint::{ @@ -64,6 +67,7 @@ use crate::{ light_client::{tendermint::LightClient, LightClient as _}, misbehaviour::MisbehaviourEvidence, }; +use astria_core::protocol::transaction::v1alpha1::UnsignedTransactionBuilder; const DEFAULT_RPC_TIMEOUT: Duration = Duration::from_secs(60); @@ -165,7 +169,10 @@ impl AstriaEndpoint { *batch_delay, self.rt.clone(), ), - Mode::Pull { interval, max_retries } => EventSource::rpc( + Mode::Pull { + interval, + max_retries, + } => EventSource::rpc( self.id().clone(), self.sequencer_client.clone(), *interval, @@ -184,16 +191,13 @@ impl AstriaEndpoint { crypto::{SigningKey, VerificationKey}, generated::protocol::transactions::v1alpha1::Ics20Withdrawal as RawIcs20Withdrawal, primitive::v1::Address, - protocol::transaction::v1alpha1::{ - action::Ics20Withdrawal, Action, TransactionParams, UnsignedTransaction, - }, + protocol::transaction::v1alpha1::{action::Ics20Withdrawal, Action}, Protobuf as _, }; use astria_sequencer_client::SequencerClientExt as _; use ibc_relayer_types::applications::transfer::msgs::ASTRIA_WITHDRAWAL_TYPE_URL; use penumbra_ibc::IbcRelay; use penumbra_proto::core::component::ibc::v1::IbcRelay as RawIbcRelay; - use penumbra_proto::Message as _; let msg_len = tracked_msgs.msgs.len(); let mut actions: Vec = Vec::with_capacity(msg_len); @@ -232,13 +236,12 @@ impl AstriaEndpoint { .await .map_err(|e| Error::other(Box::new(e)))?; - let unsigned_tx = UnsignedTransaction { - params: TransactionParams::builder() - .nonce(nonce.nonce) - .chain_id(self.id().to_string()) - .build(), - actions, - }; + let unsigned_tx = UnsignedTransactionBuilder::new() + .nonce(nonce.nonce) + .chain_id(self.id().to_string()) + .actions(actions) + .try_build() + .map_err(|e| Error::other(e.into()))?; let signed_tx = unsigned_tx.into_signed(&SigningKey::from(signing_key.to_bytes())); let tx_bytes = signed_tx.into_raw().encode_to_vec(); @@ -1471,4 +1474,22 @@ impl ChainEndpoint for AstriaEndpoint { fn query_consumer_chains(&self) -> Result, Error> { todo!() } + + fn query_upgrade( + &self, + request: QueryUpgradeRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(Upgrade, Option), Error> { + todo!() + } + + fn query_upgrade_error( + &self, + request: QueryUpgradeErrorRequest, + height: Height, + include_proof: IncludeProof, + ) -> Result<(ErrorReceipt, Option), Error> { + todo!() + } } diff --git a/crates/relayer/src/chain/cosmos/query/consensus_state.rs b/crates/relayer/src/chain/cosmos/query/consensus_state.rs index dea803b814..220a3619a2 100644 --- a/crates/relayer/src/chain/cosmos/query/consensus_state.rs +++ b/crates/relayer/src/chain/cosmos/query/consensus_state.rs @@ -2,8 +2,6 @@ use http::Uri; use ibc_relayer_types::{core::ics24_host::identifier::ChainId, Height}; use tracing::{debug, warn}; -use ibc_relayer_types::{core::ics24_host::identifier::ChainId, Height}; - use crate::chain::requests::{QueryConsensusStateHeightsRequest, QueryConsensusStatesRequest}; use crate::config::default::max_grpc_decoding_size; use crate::consensus_state::AnyConsensusStateWithHeight; diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index c355102504..968a45001e 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -788,12 +788,19 @@ impl ChainConfig { .get(channel_id) .map(|seqs| Cow::Borrowed(seqs.as_slice())) .unwrap_or_else(|| Cow::Owned(Vec::new())), + Self::Astria(config) => config + .excluded_sequences + .map + .get(channel_id) + .map(|seqs| Cow::Borrowed(seqs.as_slice())) + .unwrap_or_else(|| Cow::Owned(Vec::new())), } } pub fn allow_ccq(&self) -> bool { match self { Self::CosmosSdk(config) => config.allow_ccq, + Self::Astria(config) => config.allow_ccq, } } } @@ -822,7 +829,9 @@ impl<'de> Deserialize<'de> for ChainConfig { "CosmosSdk" => CosmosSdkConfig::deserialize(value) .map(Self::CosmosSdk) .map_err(|e| serde::de::Error::custom(format!("invalid CosmosSdk config: {e}"))), - + "Astria" => CosmosSdkConfig::deserialize(value) + .map(Self::Astria) + .map_err(|e| serde::de::Error::custom(format!("invalid Astria config: {e}"))), // // <-- Add new chain types here --> // diff --git a/crates/relayer/src/keyring/ed25519_key_pair.rs b/crates/relayer/src/keyring/ed25519_key_pair.rs index 0f1188fc1c..34faa17d36 100644 --- a/crates/relayer/src/keyring/ed25519_key_pair.rs +++ b/crates/relayer/src/keyring/ed25519_key_pair.rs @@ -139,12 +139,14 @@ impl SigningKeyPair for Ed25519KeyPair { bs58::encode(&self.signing_key.verifying_key()).into_string() } Ed25519AddressType::Astria => { + use astria_core::primitive::v1::Bech32m; use astria_core::{crypto::VerificationKey, primitive::v1::Address}; + let verification_key = VerificationKey::try_from(self.signing_key.verifying_key().to_bytes()) .expect("can convert ed25519 public key bytes to astria verification key"); - let address = Address::builder() - .array(verification_key.address_bytes()) + let address: Address = Address::builder() + .array(*verification_key.address_bytes()) .prefix("astria") .try_build() .expect("can build astria address from ed25519 public key"); diff --git a/crates/relayer/src/transfer.rs b/crates/relayer/src/transfer.rs index a6c74b8ffc..94031c5ba0 100644 --- a/crates/relayer/src/transfer.rs +++ b/crates/relayer/src/transfer.rs @@ -170,6 +170,7 @@ fn build_transfer_message_astria( timeout_timestamp: Timestamp, ) -> Any { use astria_core::primitive::v1::{asset::Denom, Address}; + use prost::Message as _; let sender: Address = sender .as_ref() @@ -211,6 +212,7 @@ fn build_transfer_message_astria( .to_string(), memo: String::new(), bridge_address: None, + use_compat_address: false, // TODO: set to true for noble }; Any { From 85cd075930a8839cc2af2fa7970e7acef429d5f2 Mon Sep 17 00:00:00 2001 From: elizabeth Date: Wed, 9 Oct 2024 10:36:01 -0400 Subject: [PATCH 199/200] bump astria and penumbra deps to patches --- Cargo.lock | 1055 ++++++++++++++++--------------------- Cargo.toml | 6 + crates/relayer/Cargo.toml | 14 +- 3 files changed, 467 insertions(+), 608 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b45570b080..10e25dba9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -35,7 +35,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a3473aa652e90865a06b723102aaa4a54a7d9f2092dbf4582497a61d0537d3f" dependencies = [ "ident_case", - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "syn 1.0.109", "synstructure", @@ -169,9 +169,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "arc-swap" @@ -278,7 +278,7 @@ checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ "num-bigint", "num-traits", - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "syn 1.0.109", ] @@ -360,7 +360,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "syn 1.0.109", ] @@ -390,9 +390,9 @@ dependencies = [ [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -409,7 +409,7 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "astria-core" version = "0.1.0" -source = "git+https://github.com/astriaorg/astria?rev=9e1c5196db199e6cb46316fa116767b3e17571da#9e1c5196db199e6cb46316fa116767b3e17571da" +source = "git+https://github.com/astriaorg/astria?rev=070cfee5b87c82819f87dc62a48870c5c22bc108#070cfee5b87c82819f87dc62a48870c5c22bc108" dependencies = [ "astria-merkle", "base64 0.21.7", @@ -419,15 +419,15 @@ dependencies = [ "ed25519-consensus", "hex", "ibc-types", - "indexmap 2.4.0", + "indexmap 2.6.0", "pbjson-types", "penumbra-ibc", "penumbra-proto", - "prost 0.12.6", + "prost 0.13.3", "rand", "sha2 0.10.8", - "tendermint 0.38.1", - "tendermint-proto 0.38.1", + "tendermint", + "tendermint-proto", "thiserror", "tracing", "zeroize", @@ -436,7 +436,7 @@ dependencies = [ [[package]] name = "astria-eyre" version = "0.1.0" -source = "git+https://github.com/astriaorg/astria?rev=9e1c5196db199e6cb46316fa116767b3e17571da#9e1c5196db199e6cb46316fa116767b3e17571da" +source = "git+https://github.com/astriaorg/astria?rev=070cfee5b87c82819f87dc62a48870c5c22bc108#070cfee5b87c82819f87dc62a48870c5c22bc108" dependencies = [ "eyre", "itoa", @@ -445,7 +445,7 @@ dependencies = [ [[package]] name = "astria-merkle" version = "0.1.0" -source = "git+https://github.com/astriaorg/astria?rev=9e1c5196db199e6cb46316fa116767b3e17571da#9e1c5196db199e6cb46316fa116767b3e17571da" +source = "git+https://github.com/astriaorg/astria?rev=070cfee5b87c82819f87dc62a48870c5c22bc108#070cfee5b87c82819f87dc62a48870c5c22bc108" dependencies = [ "sha2 0.10.8", ] @@ -453,7 +453,7 @@ dependencies = [ [[package]] name = "astria-sequencer-client" version = "0.1.0" -source = "git+https://github.com/astriaorg/astria?rev=9e1c5196db199e6cb46316fa116767b3e17571da#9e1c5196db199e6cb46316fa116767b3e17571da" +source = "git+https://github.com/astriaorg/astria?rev=070cfee5b87c82819f87dc62a48870c5c22bc108#070cfee5b87c82819f87dc62a48870c5c22bc108" dependencies = [ "astria-core", "astria-eyre", @@ -462,9 +462,9 @@ dependencies = [ "futures-util", "hex", "humantime", - "prost 0.12.6", - "tendermint 0.38.1", - "tendermint-proto 0.38.1", + "prost 0.13.3", + "tendermint", + "tendermint-proto", "tendermint-rpc", "thiserror", "tokio", @@ -475,9 +475,9 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -486,24 +486,24 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -542,9 +542,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" @@ -573,19 +573,19 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 0.1.2", "tokio", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", ] [[package]] name = "axum" -version = "0.7.5" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +checksum = "504e3947307ac8326a5437504c517c4b56716c9d98fac0028c2acc7ca47d70ae" dependencies = [ "async-trait", - "axum-core 0.4.3", + "axum-core 0.4.5", "bytes", "futures-util", "http 1.1.0", @@ -600,7 +600,7 @@ dependencies = [ "rustversion", "serde", "sync_wrapper 1.0.1", - "tower", + "tower 0.5.1", "tower-layer", "tower-service", ] @@ -624,9 +624,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ "async-trait", "bytes", @@ -637,7 +637,7 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 0.1.2", + "sync_wrapper 1.0.1", "tower-layer", "tower-service", ] @@ -663,12 +663,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -870,47 +864,26 @@ dependencies = [ [[package]] name = "borsh" -version = "0.10.4" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "115e54d64eb62cdebad391c19efc9dce4981c690c85a33a12199d99bb9546fee" +checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" dependencies = [ "borsh-derive", - "hashbrown 0.13.2", + "cfg_aliases", ] [[package]] name = "borsh-derive" -version = "0.10.4" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831213f80d9423998dd696e2c5345aba6be7a0bd8cd19e31c5243e13df1cef89" +checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", - "proc-macro-crate 0.1.5", - "proc-macro2 1.0.86", - "syn 1.0.109", -] - -[[package]] -name = "borsh-derive-internal" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65d6ba50644c98714aa2a70d13d7df3cd75cd2b523a2b452bf010443800976b3" -dependencies = [ - "proc-macro2 1.0.86", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-schema-derive-internal" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276691d96f063427be83e6692b86148e488ebba9f48f77788724ca027ba3b6d4" -dependencies = [ - "proc-macro2 1.0.86", + "once_cell", + "proc-macro-crate", + "proc-macro2 1.0.87", "quote", - "syn 1.0.109", + "syn 2.0.79", + "syn_derive", ] [[package]] @@ -953,9 +926,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" dependencies = [ "serde", ] @@ -968,9 +941,9 @@ checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" [[package]] name = "cc" -version = "1.1.15" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" dependencies = [ "shlex", ] @@ -1028,6 +1001,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chacha20" version = "0.8.2" @@ -1117,9 +1096,9 @@ version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro-error", - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "syn 1.0.109", ] @@ -1203,7 +1182,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1d1429e3bd78171c65aa010eabcdf8f863ba3254728dbfb0ad4b1545beac15c" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "syn 1.0.109", ] @@ -1226,9 +1205,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -1317,9 +1296,9 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -1353,10 +1332,10 @@ checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "strsim 0.11.1", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -1367,7 +1346,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -1417,8 +1396,8 @@ dependencies = [ [[package]] name = "decaf377-fmd" -version = "0.80.2" -source = "git+https://github.com/penumbra-zone/penumbra.git?rev=87adc8d6b15f6081c1adf169daed4ca8873bd9f6#87adc8d6b15f6081c1adf169daed4ca8873bd9f6" +version = "0.80.6" +source = "git+https://github.com/noot/penumbra.git?rev=93fe7fd0771a958e3888c158d9d1fb94322724f1#93fe7fd0771a958e3888c158d9d1fb94322724f1" dependencies = [ "ark-ff", "ark-serialize", @@ -1431,8 +1410,8 @@ dependencies = [ [[package]] name = "decaf377-ka" -version = "0.80.2" -source = "git+https://github.com/penumbra-zone/penumbra.git?rev=87adc8d6b15f6081c1adf169daed4ca8873bd9f6#87adc8d6b15f6081c1adf169daed4ca8873bd9f6" +version = "0.80.6" +source = "git+https://github.com/noot/penumbra.git?rev=93fe7fd0771a958e3888c158d9d1fb94322724f1#93fe7fd0771a958e3888c158d9d1fb94322724f1" dependencies = [ "ark-ff", "decaf377", @@ -1493,7 +1472,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "syn 1.0.109", ] @@ -1504,9 +1483,9 @@ version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -1570,9 +1549,9 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -1842,9 +1821,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1857,9 +1836,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1867,15 +1846,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1884,38 +1863,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1985,7 +1964,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "729f9bd3449d77e7831a18abfb7ba2f99ee813dfd15b8c2167c9a54ba20aa99d" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "syn 1.0.109", ] @@ -2002,7 +1981,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.4.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -2021,7 +2000,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.4.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -2065,6 +2044,12 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + [[package]] name = "hdpath" version = "0.6.3" @@ -2080,6 +2065,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -2180,9 +2171,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -2280,9 +2271,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", @@ -2293,7 +2284,6 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] @@ -2329,7 +2319,7 @@ dependencies = [ "flex-error", "futures", "http 1.1.0", - "ibc-proto 0.47.1", + "ibc-proto", "ibc-relayer", "ibc-relayer-types", "itertools 0.13.0", @@ -2350,33 +2340,16 @@ dependencies = [ "ibc-relayer", "ibc-relayer-types", "ibc-test-framework", - "prost 0.13.1", + "prost 0.13.3", "serde", "serde_json", - "tendermint 0.38.1", + "tendermint", "tendermint-rpc", "time", "toml 0.8.19", "tonic", ] -[[package]] -name = "ibc-proto" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd4ee32b22d3b06f31529b956f4928e5c9a068d71e46cf6abfa19c31ca550553" -dependencies = [ - "base64 0.21.7", - "bytes", - "flex-error", - "ics23 0.11.3", - "informalsystems-pbjson 0.7.0", - "prost 0.12.6", - "serde", - "subtle-encoding", - "tendermint-proto 0.34.1", -] - [[package]] name = "ibc-proto" version = "0.47.1" @@ -2386,12 +2359,12 @@ dependencies = [ "base64 0.22.1", "bytes", "flex-error", - "ics23 0.12.0", - "informalsystems-pbjson 0.7.0", - "prost 0.13.1", + "ics23", + "informalsystems-pbjson", + "prost 0.13.3", "serde", "subtle-encoding", - "tendermint-proto 0.38.1", + "tendermint-proto", "tonic", ] @@ -2424,7 +2397,7 @@ dependencies = [ "http 1.1.0", "humantime", "humantime-serde", - "ibc-proto 0.47.1", + "ibc-proto", "ibc-relayer-types", "ibc-telemetry", "ibc-types", @@ -2437,7 +2410,7 @@ dependencies = [ "pbjson-types", "penumbra-ibc", "penumbra-proto", - "prost 0.13.1", + "prost 0.13.3", "regex", "reqwest", "retry", @@ -2452,11 +2425,11 @@ dependencies = [ "signature", "strum", "subtle-encoding", - "tendermint 0.38.1", + "tendermint", "tendermint-light-client", "tendermint-light-client-detector", - "tendermint-light-client-verifier 0.38.1", - "tendermint-proto 0.38.1", + "tendermint-light-client-verifier", + "tendermint-proto", "tendermint-rpc", "tendermint-testgen", "test-log", @@ -2504,8 +2477,8 @@ dependencies = [ "serial_test", "signal-hook", "subtle-encoding", - "tendermint 0.38.1", - "tendermint-light-client-verifier 0.38.1", + "tendermint", + "tendermint-light-client-verifier", "tendermint-rpc", "time", "tokio", @@ -2536,20 +2509,20 @@ dependencies = [ "derive_more", "env_logger", "flex-error", - "ibc-proto 0.47.1", - "ics23 0.12.0", + "ibc-proto", + "ics23", "itertools 0.13.0", "num-rational", "primitive-types", - "prost 0.13.1", + "prost 0.13.3", "regex", "serde", "serde_derive", "serde_json", "subtle-encoding", - "tendermint 0.38.1", - "tendermint-light-client-verifier 0.38.1", - "tendermint-proto 0.38.1", + "tendermint", + "tendermint-light-client-verifier", + "tendermint-proto", "tendermint-rpc", "tendermint-testgen", "test-log", @@ -2573,7 +2546,7 @@ dependencies = [ "prometheus", "serde", "serde_json", - "tendermint 0.38.1", + "tendermint", "tokio", "tracing", ] @@ -2589,13 +2562,13 @@ dependencies = [ "hdpath", "hex", "http 1.1.0", - "ibc-proto 0.47.1", + "ibc-proto", "ibc-relayer", "ibc-relayer-cli", "ibc-relayer-types", "itertools 0.13.0", "once_cell", - "prost 0.13.1", + "prost 0.13.3", "rand", "semver", "serde", @@ -2613,9 +2586,8 @@ dependencies = [ [[package]] name = "ibc-types" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f45534bc1118d30f6537040bdf822f17245dcb5467a14094070f7365d49428df" +version = "0.14.1" +source = "git+https://github.com/noot/ibc-types.git?rev=b1c17a074980216a8f8d620937c77357b1797bac#b1c17a074980216a8f8d620937c77357b1797bac" dependencies = [ "ibc-types-core-channel", "ibc-types-core-client", @@ -2631,67 +2603,64 @@ dependencies = [ [[package]] name = "ibc-types-core-channel" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dcce2afa6b83fc6f6bd0d626d3f31aaf62a9e9087fcef24e0f705148915cb56" +version = "0.14.1" +source = "git+https://github.com/noot/ibc-types.git?rev=b1c17a074980216a8f8d620937c77357b1797bac#b1c17a074980216a8f8d620937c77357b1797bac" dependencies = [ "anyhow", "bytes", "derive_more", "displaydoc", - "ibc-proto 0.41.0", + "ibc-proto", "ibc-types-core-client", "ibc-types-core-commitment", "ibc-types-core-connection", "ibc-types-domain-type", "ibc-types-identifier", "ibc-types-timestamp", - "ics23 0.11.3", + "ics23", "num-traits", "proc-macro2 0.1.10", - "prost 0.12.6", + "prost 0.13.3", "safe-regex", "serde", "serde_json", "sha2 0.10.8", "subtle-encoding", - "tendermint 0.34.1", - "tendermint-proto 0.34.1", + "tendermint", + "tendermint-proto", "time", "tracing", ] [[package]] name = "ibc-types-core-client" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ea8df52f9218da5f8e7daed1b22ca6b01b64711950b1c72a493f2d11660b9f" +version = "0.14.1" +source = "git+https://github.com/noot/ibc-types.git?rev=b1c17a074980216a8f8d620937c77357b1797bac#b1c17a074980216a8f8d620937c77357b1797bac" dependencies = [ "anyhow", "bytes", "derive_more", "displaydoc", - "ibc-proto 0.41.0", + "ibc-proto", "ibc-types-domain-type", "ibc-types-identifier", "ibc-types-timestamp", - "ics23 0.11.3", + "ics23", "num-traits", - "prost 0.12.6", + "prost 0.13.3", "serde", "serde_json", "sha2 0.10.8", "subtle-encoding", - "tendermint 0.34.1", - "tendermint-proto 0.34.1", + "tendermint", + "tendermint-proto", "time", ] [[package]] name = "ibc-types-core-commitment" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b3583a2b7bd4d7f0b75177b619e9b0e0c317ece069170a348675913ad9a8125" +version = "0.14.1" +source = "git+https://github.com/noot/ibc-types.git?rev=b1c17a074980216a8f8d620937c77357b1797bac#b1c17a074980216a8f8d620937c77357b1797bac" dependencies = [ "anyhow", "bytes", @@ -2700,22 +2669,22 @@ dependencies = [ "dyn-clone", "erased-serde", "hex", - "ibc-proto 0.41.0", + "ibc-proto", "ibc-types-domain-type", "ibc-types-identifier", "ibc-types-timestamp", - "ics23 0.11.3", + "ics23", "num-traits", "primitive-types", - "prost 0.12.6", + "prost 0.13.3", "safe-regex", "serde", "serde_json", "sha2 0.10.8", "subtle-encoding", - "tendermint 0.34.1", - "tendermint-light-client-verifier 0.34.1", - "tendermint-proto 0.34.1", + "tendermint", + "tendermint-light-client-verifier", + "tendermint-proto", "time", "tracing", "uint", @@ -2723,49 +2692,46 @@ dependencies = [ [[package]] name = "ibc-types-core-connection" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a989af1209864891c95645585fb2048720087968ae419288949965aa65fc4b5" +version = "0.14.1" +source = "git+https://github.com/noot/ibc-types.git?rev=b1c17a074980216a8f8d620937c77357b1797bac#b1c17a074980216a8f8d620937c77357b1797bac" dependencies = [ "anyhow", "bytes", "derive_more", "displaydoc", - "ibc-proto 0.41.0", + "ibc-proto", "ibc-types-core-client", "ibc-types-core-commitment", "ibc-types-domain-type", "ibc-types-identifier", "ibc-types-timestamp", - "ics23 0.11.3", + "ics23", "num-traits", - "prost 0.12.6", + "prost 0.13.3", "safe-regex", "serde", "serde_json", "sha2 0.10.8", "subtle-encoding", - "tendermint 0.34.1", - "tendermint-proto 0.34.1", + "tendermint", + "tendermint-proto", "time", ] [[package]] name = "ibc-types-domain-type" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fabf22b6da00e7d41dd50e8f3009fc112be5f8c9cdc131d3e37ed264844f5131" +version = "0.14.1" +source = "git+https://github.com/noot/ibc-types.git?rev=b1c17a074980216a8f8d620937c77357b1797bac#b1c17a074980216a8f8d620937c77357b1797bac" dependencies = [ "anyhow", "bytes", - "prost 0.12.6", + "prost 0.13.3", ] [[package]] name = "ibc-types-identifier" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd1070c50d4f031474472d404a77847a32233396cd8397b1145cfd555f88573d" +version = "0.14.1" +source = "git+https://github.com/noot/ibc-types.git?rev=b1c17a074980216a8f8d620937c77357b1797bac#b1c17a074980216a8f8d620937c77357b1797bac" dependencies = [ "displaydoc", "serde", @@ -2773,9 +2739,8 @@ dependencies = [ [[package]] name = "ibc-types-lightclients-tendermint" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50390dbcbcb4d6f34a9ab4a1823196813c6171a9a7c28f0c6f498162c3d3aa0b" +version = "0.14.1" +source = "git+https://github.com/noot/ibc-types.git?rev=b1c17a074980216a8f8d620937c77357b1797bac#b1c17a074980216a8f8d620937c77357b1797bac" dependencies = [ "anyhow", "bytes", @@ -2783,25 +2748,25 @@ dependencies = [ "displaydoc", "dyn-clone", "erased-serde", - "ibc-proto 0.41.0", + "ibc-proto", "ibc-types-core-client", "ibc-types-core-commitment", "ibc-types-core-connection", "ibc-types-domain-type", "ibc-types-identifier", "ibc-types-timestamp", - "ics23 0.11.3", + "ics23", "num-traits", "primitive-types", - "prost 0.12.6", + "prost 0.13.3", "safe-regex", "serde", "serde_json", "sha2 0.10.8", "subtle-encoding", - "tendermint 0.34.1", - "tendermint-light-client-verifier 0.34.1", - "tendermint-proto 0.34.1", + "tendermint", + "tendermint-light-client-verifier", + "tendermint-proto", "time", "tracing", "uint", @@ -2809,9 +2774,8 @@ dependencies = [ [[package]] name = "ibc-types-path" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3088ab0bd2a33ccd4fb522497a65a23a540be699f63342ff3c22268708a08271" +version = "0.14.1" +source = "git+https://github.com/noot/ibc-types.git?rev=b1c17a074980216a8f8d620937c77357b1797bac#b1c17a074980216a8f8d620937c77357b1797bac" dependencies = [ "bytes", "derive_more", @@ -2820,38 +2784,36 @@ dependencies = [ "ibc-types-core-client", "ibc-types-core-connection", "num-traits", - "prost 0.12.6", + "prost 0.13.3", "serde", "serde_json", "subtle-encoding", - "tendermint 0.34.1", - "tendermint-proto 0.34.1", + "tendermint", + "tendermint-proto", "time", ] [[package]] name = "ibc-types-timestamp" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a108c721a477aaf2f3fd8c392577d6c71f03b5c54c8cd09d58365ab7aa16182b" +version = "0.14.1" +source = "git+https://github.com/noot/ibc-types.git?rev=b1c17a074980216a8f8d620937c77357b1797bac#b1c17a074980216a8f8d620937c77357b1797bac" dependencies = [ "bytes", "displaydoc", "num-traits", - "prost 0.12.6", + "prost 0.13.3", "serde", "serde_json", "subtle-encoding", - "tendermint 0.34.1", - "tendermint-proto 0.34.1", + "tendermint", + "tendermint-proto", "time", ] [[package]] name = "ibc-types-transfer" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f7198d1f63d8428a96a60b2534dbf2bba5594d36745db6166538ef9d89c3fef" +version = "0.14.1" +source = "git+https://github.com/noot/ibc-types.git?rev=b1c17a074980216a8f8d620937c77357b1797bac#b1c17a074980216a8f8d620937c77357b1797bac" dependencies = [ "displaydoc", "serde", @@ -2869,42 +2831,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "ics23" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "442d4bab37956e76f739c864f246c825d87c0bb7f9afa65660c57833c91bf6d4" -dependencies = [ - "anyhow", - "bytes", - "hex", - "informalsystems-pbjson 0.6.0", - "prost 0.11.9", - "ripemd", - "serde", - "sha2 0.10.8", - "sha3", -] - -[[package]] -name = "ics23" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18798160736c1e368938ba6967dbcb3c7afb3256b442a5506ba5222eebb68a5a" -dependencies = [ - "anyhow", - "blake2", - "blake3", - "bytes", - "hex", - "informalsystems-pbjson 0.7.0", - "prost 0.12.6", - "ripemd", - "serde", - "sha2 0.10.8", - "sha3", -] - [[package]] name = "ics23" version = "0.12.0" @@ -2916,8 +2842,8 @@ dependencies = [ "blake3", "bytes", "hex", - "informalsystems-pbjson 0.7.0", - "prost 0.13.1", + "informalsystems-pbjson", + "prost 0.13.3", "ripemd", "serde", "sha2 0.10.8", @@ -2979,7 +2905,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "syn 1.0.109", ] @@ -3003,22 +2929,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.5", - "serde", -] - -[[package]] -name = "informalsystems-pbjson" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eecd90f87bea412eac91c6ef94f6b1e390128290898cbe14f2b926787ae1fb" -dependencies = [ - "base64 0.13.1", + "hashbrown 0.15.0", "serde", ] @@ -3043,9 +2959,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is_terminal_polyfill" @@ -3062,15 +2978,6 @@ dependencies = [ "either", ] -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.12.1" @@ -3097,15 +3004,15 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jmt" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1a302f0defd323b833c9848c20ab40c3156128f50d7bf8eebeed2ef58167258" +version = "0.10.0" +source = "git+https://github.com/noot/jmt.git?rev=9a41b264c9db8afb07c337274691e3127411ac47#9a41b264c9db8afb07c337274691e3127411ac47" dependencies = [ "anyhow", "borsh", + "digest 0.10.7", "hashbrown 0.13.2", "hex", - "ics23 0.10.2", + "ics23", "itertools 0.10.5", "mirai-annotations", "num-derive", @@ -3127,9 +3034,9 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if", "ecdsa", @@ -3154,9 +3061,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libredox" @@ -3313,7 +3220,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "syn 1.0.109", ] @@ -3359,9 +3266,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oneline-eyre" @@ -3479,8 +3386,8 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate 3.2.0", - "proc-macro2 1.0.86", + "proc-macro-crate", + "proc-macro2 1.0.87", "quote", "syn 1.0.109", ] @@ -3516,9 +3423,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pbjson" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1030c719b0ec2a2d25a5df729d6cff1acf3cc230bf766f4f97833591f7577b90" +checksum = "c7e6349fa080353f4a597daffd05cb81572a9c031a6d4fff7e504947496fcc68" dependencies = [ "base64 0.21.7", "serde", @@ -3526,27 +3433,27 @@ dependencies = [ [[package]] name = "pbjson-build" -version = "0.6.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2580e33f2292d34be285c5bc3dba5259542b083cfad6037b6d70345f24dcb735" +checksum = "6eea3058763d6e656105d1403cb04e0a41b7bbac6362d413e7c33be0c32279c9" dependencies = [ - "heck", - "itertools 0.11.0", - "prost 0.12.6", - "prost-types 0.12.6", + "heck 0.5.0", + "itertools 0.13.0", + "prost 0.13.3", + "prost-types 0.13.3", ] [[package]] name = "pbjson-types" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18f596653ba4ac51bdecbb4ef6773bc7f56042dc13927910de1684ad3d32aa12" +checksum = "e54e5e7bfb1652f95bc361d76f3c780d8e526b134b85417e774166ee941f0887" dependencies = [ "bytes", "chrono", "pbjson", "pbjson-build", - "prost 0.12.6", + "prost 0.13.3", "prost-build", "serde", ] @@ -3587,7 +3494,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bdad6a1d9cf116a059582ce415d5f5566aabcd4008646779dab7fdc2a9a9d426" dependencies = [ "peg-runtime", - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", ] @@ -3599,8 +3506,8 @@ checksum = "e3aeb8f54c078314c2065ee649a7241f46b9d8e418e1a9581ba0546657d7aa3a" [[package]] name = "penumbra-asset" -version = "0.80.2" -source = "git+https://github.com/penumbra-zone/penumbra.git?rev=87adc8d6b15f6081c1adf169daed4ca8873bd9f6#87adc8d6b15f6081c1adf169daed4ca8873bd9f6" +version = "0.80.6" +source = "git+https://github.com/noot/penumbra.git?rev=93fe7fd0771a958e3888c158d9d1fb94322724f1#93fe7fd0771a958e3888c158d9d1fb94322724f1" dependencies = [ "anyhow", "ark-ff", @@ -3637,8 +3544,8 @@ dependencies = [ [[package]] name = "penumbra-ibc" -version = "0.80.2" -source = "git+https://github.com/penumbra-zone/penumbra.git?rev=87adc8d6b15f6081c1adf169daed4ca8873bd9f6#87adc8d6b15f6081c1adf169daed4ca8873bd9f6" +version = "0.80.6" +source = "git+https://github.com/noot/penumbra.git?rev=93fe7fd0771a958e3888c158d9d1fb94322724f1#93fe7fd0771a958e3888c158d9d1fb94322724f1" dependencies = [ "anyhow", "ark-ff", @@ -3647,9 +3554,9 @@ dependencies = [ "blake2b_simd 1.0.2", "futures", "hex", - "ibc-proto 0.41.0", + "ibc-proto", "ibc-types", - "ics23 0.11.3", + "ics23", "metrics", "num-traits", "once_cell", @@ -3659,21 +3566,21 @@ dependencies = [ "penumbra-proto", "penumbra-sct", "penumbra-txhash", - "prost 0.12.6", + "prost 0.13.3", "serde", "serde_json", "sha2 0.10.8", - "tendermint 0.34.1", - "tendermint-light-client-verifier 0.34.1", + "tendermint", + "tendermint-light-client-verifier", "time", - "tower", + "tower 0.4.13", "tracing", ] [[package]] name = "penumbra-keys" -version = "0.80.2" -source = "git+https://github.com/penumbra-zone/penumbra.git?rev=87adc8d6b15f6081c1adf169daed4ca8873bd9f6#87adc8d6b15f6081c1adf169daed4ca8873bd9f6" +version = "0.80.6" +source = "git+https://github.com/noot/penumbra.git?rev=93fe7fd0771a958e3888c158d9d1fb94322724f1#93fe7fd0771a958e3888c158d9d1fb94322724f1" dependencies = [ "aes", "anyhow", @@ -3716,8 +3623,8 @@ dependencies = [ [[package]] name = "penumbra-num" -version = "0.80.2" -source = "git+https://github.com/penumbra-zone/penumbra.git?rev=87adc8d6b15f6081c1adf169daed4ca8873bd9f6#87adc8d6b15f6081c1adf169daed4ca8873bd9f6" +version = "0.80.6" +source = "git+https://github.com/noot/penumbra.git?rev=93fe7fd0771a958e3888c158d9d1fb94322724f1#93fe7fd0771a958e3888c158d9d1fb94322724f1" dependencies = [ "anyhow", "ark-ff", @@ -3752,8 +3659,8 @@ dependencies = [ [[package]] name = "penumbra-proto" -version = "0.80.2" -source = "git+https://github.com/penumbra-zone/penumbra.git?rev=87adc8d6b15f6081c1adf169daed4ca8873bd9f6#87adc8d6b15f6081c1adf169daed4ca8873bd9f6" +version = "0.80.6" +source = "git+https://github.com/noot/penumbra.git?rev=93fe7fd0771a958e3888c158d9d1fb94322724f1#93fe7fd0771a958e3888c158d9d1fb94322724f1" dependencies = [ "anyhow", "async-trait", @@ -3763,24 +3670,24 @@ dependencies = [ "decaf377-rdsa", "futures", "hex", - "ibc-proto 0.41.0", + "ibc-proto", "ibc-types", - "ics23 0.11.3", + "ics23", "pbjson", "pbjson-types", "pin-project", - "prost 0.12.6", + "prost 0.13.3", "serde", "serde_json", "subtle-encoding", - "tendermint 0.34.1", + "tendermint", "tracing", ] [[package]] name = "penumbra-sct" -version = "0.80.2" -source = "git+https://github.com/penumbra-zone/penumbra.git?rev=87adc8d6b15f6081c1adf169daed4ca8873bd9f6#87adc8d6b15f6081c1adf169daed4ca8873bd9f6" +version = "0.80.6" +source = "git+https://github.com/noot/penumbra.git?rev=93fe7fd0771a958e3888c158d9d1fb94322724f1#93fe7fd0771a958e3888c158d9d1fb94322724f1" dependencies = [ "anyhow", "ark-ff", @@ -3806,14 +3713,14 @@ dependencies = [ "rand", "rand_core", "serde", - "tendermint 0.34.1", + "tendermint", "tracing", ] [[package]] name = "penumbra-tct" -version = "0.80.2" -source = "git+https://github.com/penumbra-zone/penumbra.git?rev=87adc8d6b15f6081c1adf169daed4ca8873bd9f6#87adc8d6b15f6081c1adf169daed4ca8873bd9f6" +version = "0.80.6" +source = "git+https://github.com/noot/penumbra.git?rev=93fe7fd0771a958e3888c158d9d1fb94322724f1#93fe7fd0771a958e3888c158d9d1fb94322724f1" dependencies = [ "ark-ed-on-bls12-377", "ark-ff", @@ -3840,8 +3747,8 @@ dependencies = [ [[package]] name = "penumbra-txhash" -version = "0.80.2" -source = "git+https://github.com/penumbra-zone/penumbra.git?rev=87adc8d6b15f6081c1adf169daed4ca8873bd9f6#87adc8d6b15f6081c1adf169daed4ca8873bd9f6" +version = "0.80.6" +source = "git+https://github.com/noot/penumbra.git?rev=93fe7fd0771a958e3888c158d9d1fb94322724f1#93fe7fd0771a958e3888c158d9d1fb94322724f1" dependencies = [ "anyhow", "blake2b_simd 1.0.2", @@ -3865,27 +3772,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.4.0", + "indexmap 2.6.0", ] [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -3990,8 +3897,8 @@ version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ - "proc-macro2 1.0.86", - "syn 2.0.76", + "proc-macro2 1.0.87", + "syn 2.0.79", ] [[package]] @@ -4006,15 +3913,6 @@ dependencies = [ "uint", ] -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml 0.5.11", -] - [[package]] name = "proc-macro-crate" version = "3.2.0" @@ -4031,7 +3929,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "syn 1.0.109", "version_check", @@ -4043,7 +3941,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "version_check", ] @@ -4059,9 +3957,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -4081,16 +3979,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive 0.11.9", -] - [[package]] name = "prost" version = "0.12.6" @@ -4103,48 +3991,35 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", - "prost-derive 0.13.1", + "prost-derive 0.13.3", ] [[package]] name = "prost-build" -version = "0.12.6" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +checksum = "0c1318b19085f08681016926435853bbf7858f9c082d0999b80550ff5d9abe15" dependencies = [ "bytes", - "heck", - "itertools 0.12.1", + "heck 0.5.0", + "itertools 0.13.0", "log", "multimap", "once_cell", "petgraph", "prettyplease", - "prost 0.12.6", - "prost-types 0.12.6", + "prost 0.13.3", + "prost-types 0.13.3", "regex", - "syn 2.0.76", + "syn 2.0.79", "tempfile", ] -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools 0.10.5", - "proc-macro2 1.0.86", - "quote", - "syn 1.0.109", -] - [[package]] name = "prost-derive" version = "0.12.6" @@ -4153,22 +4028,22 @@ checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", "itertools 0.12.1", - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] name = "prost-derive" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", "itertools 0.13.0", - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -4182,11 +4057,11 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" +checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" dependencies = [ - "prost 0.13.1", + "prost 0.13.3", ] [[package]] @@ -4216,7 +4091,7 @@ version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", ] [[package]] @@ -4266,9 +4141,9 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.1.0" +version = "11.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" dependencies = [ "bitflags 2.6.0", ] @@ -4295,9 +4170,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -4315,14 +4190,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.8", + "regex-syntax 0.8.5", ] [[package]] @@ -4336,13 +4211,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -4353,9 +4228,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" @@ -4467,9 +4342,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.35" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -4499,22 +4374,22 @@ dependencies = [ "log", "ring", "rustls-pki-types", - "rustls-webpki 0.102.7", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.7", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -4538,7 +4413,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", "security-framework", @@ -4555,19 +4443,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" [[package]] name = "rustls-webpki" @@ -4581,9 +4468,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.7" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", @@ -4660,20 +4547,20 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.16" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeb7ac86243095b70a7920639507b71d51a63390d1ba26c4f60a552fbb914a37" +checksum = "836f1e0f4963ef5288b539b643b35e043e76a32d0f4e47e67febf69576527f50" dependencies = [ "sdd", ] [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4694,9 +4581,9 @@ dependencies = [ [[package]] name = "sdd" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0495e4577c672de8254beb68d01a9b62d0e8a13c099edecdbedccce3223cd29f" +checksum = "60a7b59a5d9b0099720b417b6325d91a52cbf5b3dcb5041d864be53eefa58abc" [[package]] name = "sec1" @@ -4758,9 +4645,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -4777,9 +4664,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] @@ -4805,20 +4692,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] name = "serde_json" -version = "1.0.127" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", "memchr", @@ -4842,16 +4729,16 @@ version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -4878,7 +4765,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.4.0", + "indexmap 2.6.0", "serde", "serde_derive", "serde_json", @@ -4893,9 +4780,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling", - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -4904,7 +4791,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.6.0", "itoa", "ryu", "serde", @@ -4931,9 +4818,9 @@ version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -5121,11 +5008,11 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "heck", - "proc-macro2 1.0.86", + "heck 0.4.1", + "proc-macro2 1.0.87", "quote", "rustversion", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -5155,22 +5042,34 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.76" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "unicode-ident", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2 1.0.87", + "quote", + "syn 2.0.79", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -5189,10 +5088,10 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", "syn 1.0.109", - "unicode-xid 0.2.5", + "unicode-xid 0.2.6", ] [[package]] @@ -5230,9 +5129,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -5241,35 +5140,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "tendermint" -version = "0.34.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15ab8f0a25d0d2ad49ac615da054d6a76aa6603ff95f7d18bafdd34450a1a04b" -dependencies = [ - "bytes", - "digest 0.10.7", - "ed25519", - "ed25519-consensus", - "flex-error", - "futures", - "num-traits", - "once_cell", - "prost 0.12.6", - "prost-types 0.12.6", - "serde", - "serde_bytes", - "serde_json", - "serde_repr", - "sha2 0.10.8", - "signature", - "subtle", - "subtle-encoding", - "tendermint-proto 0.34.1", - "time", - "zeroize", -] - [[package]] name = "tendermint" version = "0.38.1" @@ -5285,8 +5155,8 @@ dependencies = [ "k256", "num-traits", "once_cell", - "prost 0.13.1", - "prost-types 0.13.1", + "prost 0.13.3", + "prost-types 0.13.3", "ripemd", "serde", "serde_bytes", @@ -5296,7 +5166,7 @@ dependencies = [ "signature", "subtle", "subtle-encoding", - "tendermint-proto 0.38.1", + "tendermint-proto", "time", "zeroize", ] @@ -5310,7 +5180,7 @@ dependencies = [ "flex-error", "serde", "serde_json", - "tendermint 0.38.1", + "tendermint", "toml 0.8.19", "url", ] @@ -5332,8 +5202,8 @@ dependencies = [ "serde_derive", "serde_json", "static_assertions", - "tendermint 0.38.1", - "tendermint-light-client-verifier 0.38.1", + "tendermint", + "tendermint-light-client-verifier", "tendermint-rpc", "time", "tokio", @@ -5355,27 +5225,14 @@ dependencies = [ "serde_derive", "serde_json", "static_assertions", - "tendermint 0.38.1", + "tendermint", "tendermint-light-client", - "tendermint-proto 0.38.1", + "tendermint-proto", "tendermint-rpc", "time", "tracing", ] -[[package]] -name = "tendermint-light-client-verifier" -version = "0.34.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b8090d0eef9ad57b1b913b5e358e26145c86017e87338136509b94383a4af25" -dependencies = [ - "derive_more", - "flex-error", - "serde", - "tendermint 0.34.1", - "time", -] - [[package]] name = "tendermint-light-client-verifier" version = "0.38.1" @@ -5385,25 +5242,7 @@ dependencies = [ "derive_more", "flex-error", "serde", - "tendermint 0.38.1", - "time", -] - -[[package]] -name = "tendermint-proto" -version = "0.34.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b797dd3d2beaaee91d2f065e7bdf239dc8d80bba4a183a288bc1279dd5a69a1e" -dependencies = [ - "bytes", - "flex-error", - "num-derive", - "num-traits", - "prost 0.12.6", - "prost-types 0.12.6", - "serde", - "serde_bytes", - "subtle-encoding", + "tendermint", "time", ] @@ -5415,8 +5254,8 @@ checksum = "8ed14abe3b0502a3afe21ca74ca5cdd6c7e8d326d982c26f98a394445eb31d6e" dependencies = [ "bytes", "flex-error", - "prost 0.13.1", - "prost-types 0.13.1", + "prost 0.13.3", + "prost-types 0.13.3", "serde", "serde_bytes", "subtle-encoding", @@ -5445,9 +5284,9 @@ dependencies = [ "serde_json", "subtle", "subtle-encoding", - "tendermint 0.38.1", + "tendermint", "tendermint-config", - "tendermint-proto 0.38.1", + "tendermint-proto", "thiserror", "time", "tokio", @@ -5469,7 +5308,7 @@ dependencies = [ "serde_json", "simple-error", "tempfile", - "tendermint 0.38.1", + "tendermint", "time", ] @@ -5499,9 +5338,9 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -5512,22 +5351,22 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -5616,9 +5455,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -5638,9 +5477,9 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -5670,16 +5509,16 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.12", + "rustls 0.23.14", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -5688,9 +5527,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -5731,11 +5570,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.20" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.4.0", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -5744,13 +5583,13 @@ dependencies = [ [[package]] name = "tonic" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f6ba989e4b2c58ae83d862d3a3e27690b6e3ae630d0deb59f3697f32aa88ad" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", - "axum 0.7.5", + "axum 0.7.7", "base64 0.22.1", "bytes", "h2 0.4.6", @@ -5762,14 +5601,14 @@ dependencies = [ "hyper-util", "percent-encoding", "pin-project", - "prost 0.13.1", - "rustls-native-certs 0.7.3", - "rustls-pemfile 2.1.3", + "prost 0.13.3", + "rustls-native-certs 0.8.0", + "rustls-pemfile 2.2.0", "socket2", "tokio", "tokio-rustls 0.26.0", "tokio-stream", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -5795,6 +5634,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -5825,9 +5678,9 @@ version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -5976,30 +5829,30 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" @@ -6009,9 +5862,9 @@ checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" [[package]] name = "unicode-xid" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "universal-hash" @@ -6145,9 +5998,9 @@ dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", "wasm-bindgen-shared", ] @@ -6179,9 +6032,9 @@ version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6392,9 +6245,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -6434,9 +6287,9 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] [[package]] @@ -6454,7 +6307,7 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.86", + "proc-macro2 1.0.87", "quote", - "syn 2.0.76", + "syn 2.0.79", ] diff --git a/Cargo.toml b/Cargo.toml index ef8483f32a..16d9531df7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -127,3 +127,9 @@ overflow-checks = true # tendermint-light-client-verifier = { git = "https://github.com/informalsystems/tendermint-rs.git", branch = "main" } # tendermint-light-client-detector = { git = "https://github.com/informalsystems/tendermint-rs.git", branch = "main" } # tendermint-testgen = { git = "https://github.com/informalsystems/tendermint-rs.git", branch = "main" } +ibc-types = { git = "https://github.com/noot/ibc-types.git", rev = "b1c17a074980216a8f8d620937c77357b1797bac" } +jmt = { git = "https://github.com/noot/jmt.git", rev = "9a41b264c9db8afb07c337274691e3127411ac47" } + +[patch.'https://github.com/penumbra-zone/penumbra.git'] +penumbra-ibc = { git = "https://github.com/noot/penumbra.git", rev = "93fe7fd0771a958e3888c158d9d1fb94322724f1" } +penumbra-proto = { git = "https://github.com/noot/penumbra.git", rev = "93fe7fd0771a958e3888c158d9d1fb94322724f1" } diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 912d9297e2..0ac6285ac8 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -19,14 +19,14 @@ all-features = true default = ["flex-error/std", "flex-error/eyre_tracer"] [dependencies] -astria-core = { git = "https://github.com/astriaorg/astria", rev = "9e1c5196db199e6cb46316fa116767b3e17571da" } -astria-sequencer-client = { git = "https://github.com/astriaorg/astria", rev = "9e1c5196db199e6cb46316fa116767b3e17571da", features = [ "http" ] } +astria-core = { git = "https://github.com/astriaorg/astria", rev = "070cfee5b87c82819f87dc62a48870c5c22bc108" } +astria-sequencer-client = { git = "https://github.com/astriaorg/astria", rev = "070cfee5b87c82819f87dc62a48870c5c22bc108", features = [ "http" ] } ed25519-consensus = "2.1.0" -ibc-types = "0.12.0" -jmt = "0.6" -penumbra-ibc = { git = "https://github.com/penumbra-zone/penumbra.git", rev = "87adc8d6b15f6081c1adf169daed4ca8873bd9f6", default-features = false } -penumbra-proto = { git = "https://github.com/penumbra-zone/penumbra.git", rev = "87adc8d6b15f6081c1adf169daed4ca8873bd9f6" } -pbjson-types = "0.6" +ibc-types = "0.14" +jmt = "0.10" +penumbra-ibc = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.80.5", default-features = false } +penumbra-proto = { git = "https://github.com/penumbra-zone/penumbra.git", tag = "v0.80.5" } +pbjson-types = "0.7" ibc-proto = { workspace = true, features = ["serde"] } ibc-telemetry = { workspace = true } From 0789c118401e9ef0bad13aeb2452cce1b0621ed7 Mon Sep 17 00:00:00 2001 From: elizabeth Date: Wed, 9 Oct 2024 10:50:24 -0400 Subject: [PATCH 200/200] fix relayer-cli and testS --- crates/chain-registry/src/formatter.rs | 2 +- crates/relayer-cli/src/commands/clear.rs | 25 ++++--------- .../relayer-cli/src/commands/config/auto.rs | 3 -- .../src/commands/create/channel.rs | 20 +++------- crates/relayer-cli/src/commands/evidence.rs | 37 +++++++++++++++---- crates/relayer-cli/src/commands/health.rs | 11 +++--- .../relayer-cli/src/commands/misbehaviour.rs | 27 ++------------ .../relayer-cli/src/commands/query/channel.rs | 14 ++++--- .../src/commands/query/channel_ends.rs | 17 +++++++-- .../src/commands/query/channels.rs | 16 +++++++- .../relayer-cli/src/commands/query/client.rs | 14 ++++--- .../relayer-cli/src/commands/query/clients.rs | 13 ++++--- .../src/commands/query/connection.rs | 15 +++++--- .../src/commands/query/packet/ack.rs | 15 +++++--- .../src/commands/query/packet/pending.rs | 1 - crates/relayer-cli/src/commands/tx/channel.rs | 6 ++- crates/relayer-cli/src/commands/tx/packet.rs | 27 ++++++-------- crates/relayer/src/config.rs | 3 ++ crates/relayer/src/event.rs | 10 +---- .../src/util/interchain_security.rs | 1 + 20 files changed, 146 insertions(+), 131 deletions(-) diff --git a/crates/chain-registry/src/formatter.rs b/crates/chain-registry/src/formatter.rs index 877f5ce86e..fe520fac0e 100644 --- a/crates/chain-registry/src/formatter.rs +++ b/crates/chain-registry/src/formatter.rs @@ -99,7 +99,7 @@ impl UriFormatter for SimpleGrpcFormatter { #[cfg(test)] mod tests { - use std::{cmp::PartialEq, fmt::Debug}; + use super::*; use std::fmt::Debug; diff --git a/crates/relayer-cli/src/commands/clear.rs b/crates/relayer-cli/src/commands/clear.rs index 35be5f9f03..14868011a2 100644 --- a/crates/relayer-cli/src/commands/clear.rs +++ b/crates/relayer-cli/src/commands/clear.rs @@ -1,20 +1,9 @@ use eyre::eyre; use std::ops::RangeInclusive; -use abscissa_core::{clap::Parser, config::Override, Command, FrameworkErrorKind, Runnable}; -use ibc_relayer::{ - chain::handle::{BaseChainHandle, ChainHandle}, - config::Config, - link::{error::LinkError, Link, LinkParameters}, - util::seq_range::parse_seq_range, -}; -use ibc_relayer_types::{ - core::{ - ics04_channel::packet::Sequence, - ics24_host::identifier::{ChainId, ChannelId, PortId}, - }, - events::IbcEvent, -}; +use abscissa_core::clap::Parser; +use abscissa_core::config::Override; +use abscissa_core::{Command, FrameworkErrorKind, Runnable}; use ibc_relayer::chain::handle::{BaseChainHandle, ChainHandle}; use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeight}; @@ -276,13 +265,13 @@ where #[cfg(test)] mod tests { + use super::ClearPacketsCmd; + use std::str::FromStr; use abscissa_core::clap::Parser; - use ibc_relayer_types::core::{ - ics04_channel::packet::Sequence, - ics24_host::identifier::{ChainId, ChannelId, PortId}, - }; + use ibc_relayer_types::core::ics04_channel::packet::Sequence; + use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; #[test] fn test_clear_packets_required_only() { diff --git a/crates/relayer-cli/src/commands/config/auto.rs b/crates/relayer-cli/src/commands/config/auto.rs index 2669f928d5..2e837c801e 100644 --- a/crates/relayer-cli/src/commands/config/auto.rs +++ b/crates/relayer-cli/src/commands/config/auto.rs @@ -5,15 +5,12 @@ use itertools::Itertools; use crate::conclude::Output; -use abscissa_core::{clap::Parser, Command, Runnable}; use ibc_relayer::config::{store, ChainConfig, Config}; use std::collections::HashSet; use std::path::PathBuf; use tracing::{error, info, warn}; -use crate::{chain_registry::get_configs, conclude::Output}; - fn find_key(chain_config: &ChainConfig) -> Option { let keys = chain_config.list_keys().ok()?; keys.into_iter().next().map(|(name, _)| name) diff --git a/crates/relayer-cli/src/commands/create/channel.rs b/crates/relayer-cli/src/commands/create/channel.rs index 3029cab3df..30e306dbee 100644 --- a/crates/relayer-cli/src/commands/create/channel.rs +++ b/crates/relayer-cli/src/commands/create/channel.rs @@ -2,29 +2,19 @@ use abscissa_core::clap::Parser; use console::style; use dialoguer::Confirm; + +use ibc_relayer::chain::handle::ChainHandle; +use ibc_relayer::chain::requests::{ + IncludeProof, QueryClientStateRequest, QueryConnectionRequest, QueryHeight, +}; use ibc_relayer::channel::Channel; use ibc_relayer::config::default::connection_delay; use ibc_relayer::connection::Connection; use ibc_relayer::foreign_client::ForeignClient; -use ibc_relayer::{ - chain::{ - handle::ChainHandle, - requests::{IncludeProof, QueryClientStateRequest, QueryConnectionRequest, QueryHeight}, - }, - channel::Channel, - config::default::connection_delay, - connection::Connection, - foreign_client::ForeignClient, -}; use ibc_relayer_types::core::ics03_connection::connection::IdentifiedConnectionEnd; use ibc_relayer_types::core::ics04_channel::channel::Ordering; use ibc_relayer_types::core::ics04_channel::version::Version; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ConnectionId, PortId}; -use ibc_relayer_types::core::{ - ics03_connection::connection::IdentifiedConnectionEnd, - ics04_channel::{channel::Ordering, version::Version}, - ics24_host::identifier::{ChainId, ConnectionId, PortId}, -}; use crate::cli_utils::{spawn_chain_runtime, ChainHandlePair}; use crate::conclude::{exit_with_unrecoverable_error, Output}; diff --git a/crates/relayer-cli/src/commands/evidence.rs b/crates/relayer-cli/src/commands/evidence.rs index e15010ce99..3c4fb15877 100644 --- a/crates/relayer-cli/src/commands/evidence.rs +++ b/crates/relayer-cli/src/commands/evidence.rs @@ -1,16 +1,37 @@ -use std::{ - collections::HashMap, - ops::{ControlFlow, Deref}, - sync::Arc, - thread::sleep, - time::Duration, -}; +use std::collections::HashMap; +use std::ops::{ControlFlow, Deref}; +use std::sync::Arc; +use std::thread::sleep; +use std::time::Duration; use abscissa_core::clap::Parser; use ibc_relayer::config::{ChainConfig, Config}; use tokio::runtime::Runtime as TokioRuntime; -use crate::{conclude::Output, prelude::*}; +use tendermint::block::Height as TendermintHeight; +use tendermint::evidence::{DuplicateVoteEvidence, LightClientAttackEvidence}; +use tendermint::validator; +use tendermint_rpc::{Client, Paging}; + +use ibc_relayer::chain::cosmos::CosmosSdkChain; +use ibc_relayer::chain::endpoint::ChainEndpoint; +use ibc_relayer::chain::handle::{BaseChainHandle, ChainHandle}; +use ibc_relayer::chain::requests::{IncludeProof, PageRequest, QueryHeight}; +use ibc_relayer::chain::tracking::TrackedMsgs; +use ibc_relayer::foreign_client::ForeignClient; +use ibc_relayer::spawn::spawn_chain_runtime_with_modified_config; +use ibc_relayer_types::applications::ics28_ccv::msgs::ccv_double_voting::MsgSubmitIcsConsumerDoubleVoting; +use ibc_relayer_types::applications::ics28_ccv::msgs::ccv_misbehaviour::MsgSubmitIcsConsumerMisbehaviour; +use ibc_relayer_types::clients::ics07_tendermint::header::Header as TendermintHeader; +use ibc_relayer_types::clients::ics07_tendermint::misbehaviour::Misbehaviour as TendermintMisbehaviour; +use ibc_relayer_types::core::ics02_client::height::Height; +use ibc_relayer_types::core::ics02_client::msgs::misbehaviour::MsgSubmitMisbehaviour; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; +use ibc_relayer_types::events::IbcEvent; +use ibc_relayer_types::tx_msg::Msg; + +use crate::conclude::Output; +use crate::prelude::*; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct EvidenceCmd { diff --git a/crates/relayer-cli/src/commands/health.rs b/crates/relayer-cli/src/commands/health.rs index 375797eff7..6ecdd588dd 100644 --- a/crates/relayer-cli/src/commands/health.rs +++ b/crates/relayer-cli/src/commands/health.rs @@ -1,10 +1,11 @@ use abscissa_core::clap::Parser; -use crate::{ - cli_utils::spawn_chain_runtime, - conclude::{exit_with_unrecoverable_error, Output}, - prelude::*, -}; +use ibc_relayer::chain::endpoint::HealthCheck::*; +use ibc_relayer::chain::handle::ChainHandle; + +use crate::cli_utils::spawn_chain_runtime; +use crate::conclude::{exit_with_unrecoverable_error, Output}; +use crate::prelude::*; #[derive(Clone, Command, Debug, Parser)] pub struct HealthCheckCmd {} diff --git a/crates/relayer-cli/src/commands/misbehaviour.rs b/crates/relayer-cli/src/commands/misbehaviour.rs index b7a71bb3a4..e6e40e0cda 100644 --- a/crates/relayer-cli/src/commands/misbehaviour.rs +++ b/crates/relayer-cli/src/commands/misbehaviour.rs @@ -10,30 +10,11 @@ use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; use ibc_relayer_types::events::IbcEvent; use std::ops::Deref; -use abscissa_core::{clap::Parser, Command, Runnable}; +use crate::cli_utils::{spawn_chain_runtime, spawn_chain_runtime_generic}; +use crate::conclude::Output; +use crate::prelude::*; use eyre::eyre; -use ibc_relayer::{ - chain::{ - handle::ChainHandle, - requests::{IncludeProof, QueryClientStateRequest, QueryHeight}, - }, - config::Config, - foreign_client::{ForeignClient, MisbehaviourResults}, - util::pretty::PrettySlice, -}; -use ibc_relayer_types::{ - core::{ - ics02_client::{client_state::ClientState, events::UpdateClient}, - ics24_host::identifier::{ChainId, ClientId}, - }, - events::IbcEvent, -}; - -use crate::{ - cli_utils::{spawn_chain_runtime, spawn_chain_runtime_generic}, - conclude::Output, - prelude::*, -}; +use ibc_relayer_types::core::ics02_client::client_state::ClientState; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct MisbehaviourCmd { diff --git a/crates/relayer-cli/src/commands/query/channel.rs b/crates/relayer-cli/src/commands/query/channel.rs index 22c60a5b13..87f2012d29 100644 --- a/crates/relayer-cli/src/commands/query/channel.rs +++ b/crates/relayer-cli/src/commands/query/channel.rs @@ -1,11 +1,15 @@ use abscissa_core::clap::Parser; use ibc_relayer::chain::handle::ChainHandle; -use crate::{ - cli_utils::spawn_chain_runtime, - conclude::{exit_with_unrecoverable_error, Output}, - prelude::*, -}; +use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeight}; +use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId}; + +use crate::cli_utils::spawn_chain_runtime; +use crate::conclude::{exit_with_unrecoverable_error, Output}; +use crate::prelude::*; +use ibc_relayer_types::core::ics04_channel::channel::State; +use ibc_relayer_types::Height; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryChannelEndCmd { diff --git a/crates/relayer-cli/src/commands/query/channel_ends.rs b/crates/relayer-cli/src/commands/query/channel_ends.rs index 1096adb85e..6ea357facf 100644 --- a/crates/relayer-cli/src/commands/query/channel_ends.rs +++ b/crates/relayer-cli/src/commands/query/channel_ends.rs @@ -1,10 +1,21 @@ use abscissa_core::clap::Parser; use serde::{Deserialize, Serialize}; -use crate::{ - conclude::{exit_with_unrecoverable_error, Output}, - prelude::*, +use eyre::eyre; +use ibc_relayer::chain::handle::{BaseChainHandle, ChainHandle}; +use ibc_relayer::chain::requests::{ + IncludeProof, QueryChannelRequest, QueryClientStateRequest, QueryConnectionRequest, QueryHeight, }; +use ibc_relayer::client_state::AnyClientState; +use ibc_relayer::registry::Registry; +use ibc_relayer_types::core::ics03_connection::connection::ConnectionEnd; +use ibc_relayer_types::core::ics04_channel::channel::{ChannelEnd, State}; +use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}; +use ibc_relayer_types::Height; + +use crate::conclude::{exit_with_unrecoverable_error, Output}; +use crate::prelude::*; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryChannelEndsCmd { diff --git a/crates/relayer-cli/src/commands/query/channels.rs b/crates/relayer-cli/src/commands/query/channels.rs index 3722ff7d32..3091537784 100644 --- a/crates/relayer-cli/src/commands/query/channels.rs +++ b/crates/relayer-cli/src/commands/query/channels.rs @@ -3,7 +3,21 @@ use core::fmt::{Debug, Error, Formatter}; use abscissa_core::clap::Parser; use serde::Serialize; -use crate::{commands::query::channel_ends::ChannelEnds, conclude::Output, prelude::*}; +use eyre::eyre; +use ibc_relayer::chain::handle::{BaseChainHandle, ChainHandle}; +use ibc_relayer::chain::requests::{ + IncludeProof, PageRequest, QueryChannelRequest, QueryChannelsRequest, QueryClientStateRequest, + QueryConnectionRequest, QueryHeight, +}; +use ibc_relayer::registry::Registry; +use ibc_relayer_types::core::ics04_channel::channel::{ChannelEnd, State}; +use ibc_relayer_types::core::ics24_host::identifier::{ + ChainId, ChannelId, ConnectionId, PortChannelId, PortId, +}; + +use crate::commands::query::channel_ends::ChannelEnds; +use crate::conclude::Output; +use crate::prelude::*; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryChannelsCmd { diff --git a/crates/relayer-cli/src/commands/query/client.rs b/crates/relayer-cli/src/commands/query/client.rs index 45045b00d4..ad5ffd0fd9 100644 --- a/crates/relayer-cli/src/commands/query/client.rs +++ b/crates/relayer-cli/src/commands/query/client.rs @@ -8,11 +8,15 @@ use ibc_relayer::chain::requests::{ QueryHeight, QueryTxRequest, }; -use crate::{ - application::app_config, - cli_utils::spawn_chain_runtime, - conclude::{exit_with_unrecoverable_error, Output}, -}; +use ibc_relayer_types::core::ics02_client::client_state::ClientState; +use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use ibc_relayer_types::core::ics24_host::identifier::ClientId; +use ibc_relayer_types::events::WithBlockDataType; +use ibc_relayer_types::Height; + +use crate::application::app_config; +use crate::cli_utils::spawn_chain_runtime; +use crate::conclude::{exit_with_unrecoverable_error, Output}; /// Query client state command #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] diff --git a/crates/relayer-cli/src/commands/query/clients.rs b/crates/relayer-cli/src/commands/query/clients.rs index eb902f3c13..94cdff3e49 100644 --- a/crates/relayer-cli/src/commands/query/clients.rs +++ b/crates/relayer-cli/src/commands/query/clients.rs @@ -2,12 +2,13 @@ use abscissa_core::clap::Parser; use ibc_relayer::chain::handle::ChainHandle; use serde::Serialize; -use crate::{ - cli_utils::spawn_chain_runtime, - conclude::{exit_with_unrecoverable_error, Output}, - error::Error, - prelude::*, -}; +use ibc_relayer::chain::requests::{PageRequest, QueryClientStatesRequest}; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ClientId}; + +use crate::cli_utils::spawn_chain_runtime; +use crate::conclude::{exit_with_unrecoverable_error, Output}; +use crate::error::Error; +use crate::prelude::*; /// Query clients command #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] diff --git a/crates/relayer-cli/src/commands/query/connection.rs b/crates/relayer-cli/src/commands/query/connection.rs index db3d72851c..4dff3f9e85 100644 --- a/crates/relayer-cli/src/commands/query/connection.rs +++ b/crates/relayer-cli/src/commands/query/connection.rs @@ -4,12 +4,17 @@ use ibc_relayer::chain::requests::{ IncludeProof, PageRequest, QueryConnectionChannelsRequest, QueryConnectionRequest, QueryHeight, }; -use crate::{ - cli_utils::spawn_chain_runtime, - conclude::{exit_with_unrecoverable_error, Output}, - error::Error, - prelude::*, +use ibc_relayer_types::core::{ + ics03_connection::connection::State, + ics24_host::identifier::ConnectionId, + ics24_host::identifier::{ChainId, PortChannelId}, }; +use ibc_relayer_types::Height; + +use crate::cli_utils::spawn_chain_runtime; +use crate::conclude::{exit_with_unrecoverable_error, Output}; +use crate::error::Error; +use crate::prelude::*; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryConnectionEndCmd { diff --git a/crates/relayer-cli/src/commands/query/packet/ack.rs b/crates/relayer-cli/src/commands/query/packet/ack.rs index 0f162a79da..5efe178ca8 100644 --- a/crates/relayer-cli/src/commands/query/packet/ack.rs +++ b/crates/relayer-cli/src/commands/query/packet/ack.rs @@ -2,12 +2,15 @@ use abscissa_core::clap::Parser; use ibc_relayer::chain::requests::{IncludeProof, QueryHeight, QueryPacketAcknowledgementRequest}; use subtle_encoding::{Encoding, Hex}; -use crate::{ - cli_utils::spawn_chain_runtime, - conclude::{exit_with_unrecoverable_error, Output}, - error::Error, - prelude::*, -}; +use ibc_relayer::chain::handle::ChainHandle; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; +use ibc_relayer_types::Height; + +use crate::cli_utils::spawn_chain_runtime; +use crate::conclude::{exit_with_unrecoverable_error, Output}; +use crate::error::Error; +use crate::prelude::*; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct QueryPacketAcknowledgmentCmd { diff --git a/crates/relayer-cli/src/commands/query/packet/pending.rs b/crates/relayer-cli/src/commands/query/packet/pending.rs index 36bbb59e90..3974d7935d 100644 --- a/crates/relayer-cli/src/commands/query/packet/pending.rs +++ b/crates/relayer-cli/src/commands/query/packet/pending.rs @@ -16,7 +16,6 @@ use crate::error::Error; use crate::prelude::*; use super::util::CollatedPendingPackets; -use crate::{cli_utils::spawn_chain_counterparty, conclude::Output, error::Error, prelude::*}; /// A structure to display pending packet commitment sequence IDs /// at both ends of a channel. diff --git a/crates/relayer-cli/src/commands/tx/channel.rs b/crates/relayer-cli/src/commands/tx/channel.rs index 03e16ae9c4..7db47011e7 100644 --- a/crates/relayer-cli/src/commands/tx/channel.rs +++ b/crates/relayer-cli/src/commands/tx/channel.rs @@ -11,8 +11,12 @@ use ibc_relayer_types::core::ics04_channel::channel::Ordering; use ibc_relayer_types::core::ics24_host::identifier::{ ChainId, ChannelId, ClientId, ConnectionId, PortId, }; +use ibc_relayer_types::events::IbcEvent; -use crate::{cli_utils::ChainHandlePair, conclude::Output, error::Error, prelude::*}; +use crate::cli_utils::ChainHandlePair; +use crate::conclude::Output; +use crate::error::Error; +use crate::prelude::*; /// Macro that generates the `Runnable::run` implementation for a /// `tx channel` subcommand. diff --git a/crates/relayer-cli/src/commands/tx/packet.rs b/crates/relayer-cli/src/commands/tx/packet.rs index 0752093847..f2b437cfad 100644 --- a/crates/relayer-cli/src/commands/tx/packet.rs +++ b/crates/relayer-cli/src/commands/tx/packet.rs @@ -2,22 +2,17 @@ use abscissa_core::clap::Parser; use ibc_relayer_types::core::ics02_client::height::Height; use std::ops::RangeInclusive; -use abscissa_core::{clap::Parser, Command, Runnable}; -use ibc_relayer::{ - chain::handle::ChainHandle, - link::{Link, LinkParameters}, - util::seq_range::parse_seq_range, -}; -use ibc_relayer_types::{ - core::{ - ics02_client::height::Height, - ics04_channel::packet::Sequence, - ics24_host::identifier::{ChainId, ChannelId, PortId}, - }, - events::IbcEvent, -}; - -use crate::{cli_utils::ChainHandlePair, conclude::Output, error::Error, prelude::*}; +use ibc_relayer::chain::handle::ChainHandle; +use ibc_relayer::link::{Link, LinkParameters}; +use ibc_relayer::util::seq_range::parse_seq_range; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; +use ibc_relayer_types::events::IbcEvent; + +use crate::cli_utils::ChainHandlePair; +use crate::conclude::Output; +use crate::error::Error; +use crate::prelude::*; #[derive(Clone, Command, Debug, Parser, PartialEq, Eq)] pub struct TxPacketRecvCmd { diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index 968a45001e..02ce0ebb06 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -989,6 +989,7 @@ mod tests { super::ChainConfig::CosmosSdk(_) => { // all good } + super::ChainConfig::Astria(_) => panic!("expected CosmosSdk chain type"), } } @@ -1016,10 +1017,12 @@ mod tests { let excluded_sequences1 = match config.chains.first().unwrap() { ChainConfig::CosmosSdk(chain_config) => chain_config.excluded_sequences.clone(), + ChainConfig::Astria(chain_config) => chain_config.excluded_sequences.clone(), }; let excluded_sequences2 = match config.chains.last().unwrap() { ChainConfig::CosmosSdk(chain_config) => chain_config.excluded_sequences.clone(), + ChainConfig::Astria(chain_config) => chain_config.excluded_sequences.clone(), }; assert_eq!(excluded_sequences1, excluded_sequences2); diff --git a/crates/relayer/src/event.rs b/crates/relayer/src/event.rs index 9bed20d852..f5219f4750 100644 --- a/crates/relayer/src/event.rs +++ b/crates/relayer/src/event.rs @@ -660,15 +660,7 @@ pub fn parse_timeout_height(s: &str) -> Result { #[cfg(test)] mod tests { - use ibc_proto::{google::protobuf::Any, Protobuf}; - use ibc_relayer_types::{ - clients::ics07_tendermint::header::test_util::get_dummy_ics07_header, - core::{ - ics02_client::header::{decode_header, AnyHeader}, - ics04_channel::packet::Sequence, - }, - timestamp::Timestamp, - }; + use super::*; #[test] fn connection_event_to_abci_event() { diff --git a/tools/test-framework/src/util/interchain_security.rs b/tools/test-framework/src/util/interchain_security.rs index ea66e12f4f..f2bf9fef2c 100644 --- a/tools/test-framework/src/util/interchain_security.rs +++ b/tools/test-framework/src/util/interchain_security.rs @@ -36,6 +36,7 @@ pub fn update_relayer_config_for_consumer_chain(config: &mut Config) { chain_config.trusting_period = Some(Duration::from_secs(99)); } ChainConfig::CosmosSdk(_) => {} + ChainConfig::Astria(_) => {} } } }