From 446731b5f2cf0f32ab5ca80d8e9de6c8c615c210 Mon Sep 17 00:00:00 2001 From: Adi Seredinschi Date: Wed, 31 Jan 2024 08:58:09 +0100 Subject: [PATCH 001/224] 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 002/224] 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 003/224] 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 004/224] 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 005/224] 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 006/224] 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 007/224] 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 008/224] 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 009/224] 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 010/224] 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 011/224] 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 012/224] 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 013/224] 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 014/224] 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 015/224] 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 016/224] 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 017/224] 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 018/224] 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 019/224] 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 020/224] 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 021/224] 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 022/224] 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 023/224] 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 024/224] 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 025/224] 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 026/224] 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 027/224] 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 028/224] 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 029/224] 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 030/224] 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 031/224] 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 032/224] 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 033/224] 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 034/224] 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 035/224] 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 036/224] 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 037/224] 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 038/224] 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 039/224] 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 040/224] 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 041/224] 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 042/224] 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 043/224] 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 044/224] 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 045/224] 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 046/224] 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 047/224] 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 048/224] 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 049/224] 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 050/224] 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 051/224] 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 052/224] 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 053/224] 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 054/224] 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 055/224] 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 056/224] 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 057/224] 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 058/224] 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 059/224] 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 060/224] 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 061/224] 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 062/224] 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 063/224] 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 064/224] 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 065/224] 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 066/224] 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 067/224] 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 068/224] 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 069/224] 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 070/224] 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 071/224] 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 072/224] 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 073/224] 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 074/224] 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 075/224] 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 076/224] 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 077/224] 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 078/224] 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 079/224] 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 080/224] 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 081/224] 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 082/224] 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 083/224] 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 084/224] 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 085/224] --- (#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 086/224] --- (#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 087/224] --- (#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 088/224] --- (#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 089/224] --- (#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 090/224] --- (#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 091/224] 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 092/224] 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 093/224] 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 094/224] 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 095/224] 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 096/224] 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 097/224] 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 098/224] 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 099/224] 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 100/224] 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 101/224] 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 102/224] 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 103/224] 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 104/224] 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 105/224] 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 106/224] 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 107/224] 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 108/224] 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 109/224] 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 110/224] 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 111/224] 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 112/224] 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 113/224] 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 114/224] 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 115/224] 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 116/224] 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 117/224] 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 118/224] 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 119/224] 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 120/224] 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 121/224] 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 122/224] 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 123/224] 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 124/224] 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 125/224] 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 126/224] 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 127/224] 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 128/224] 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 129/224] 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 130/224] 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 131/224] 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 132/224] 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 133/224] 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 134/224] 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 135/224] 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 136/224] 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 137/224] 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 138/224] 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 139/224] 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 140/224] 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 141/224] 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 142/224] 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 143/224] 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 144/224] 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 145/224] 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 146/224] 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 147/224] 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 148/224] 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 149/224] 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 150/224] 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 151/224] 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 152/224] 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 153/224] 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 154/224] 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 155/224] 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 156/224] 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 157/224] 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 158/224] 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 159/224] 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 160/224] 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 161/224] 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 162/224] 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 163/224] 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 164/224] 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 165/224] 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 166/224] 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 167/224] 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 168/224] 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 169/224] 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 170/224] 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 171/224] 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 172/224] 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 173/224] 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 174/224] 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 175/224] 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 176/224] 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 177/224] 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 178/224] 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 aeca07b517ad3ba9aee554e5b44e674916996b86 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 5 Sep 2024 17:46:14 +0200 Subject: [PATCH 179/224] Infer compatibility mode from version specs and fallback to node info only if necessary (#4181) * Infer compatibility mode from version specs and fallback to node info only if necessary * Improve min gas price check error message * Fix integration tests * Fix clippy warnings * Add changelog entry * Show collated excluded sequences --- .../improvements/4178-compat-mode-infer.md | 3 + crates/relayer-cli/src/commands/listen.rs | 32 ++++------ crates/relayer/src/chain/cosmos.rs | 60 +++++++++++++---- crates/relayer/src/config/compat_mode.rs | 8 +-- crates/relayer/src/error.rs | 3 +- crates/relayer/src/util/compat_mode.rs | 64 +++++++++++++++++-- tools/test-framework/src/chain/tagged.rs | 50 +++++++++++++-- 7 files changed, 173 insertions(+), 47 deletions(-) create mode 100644 .changelog/unreleased/improvements/4178-compat-mode-infer.md diff --git a/.changelog/unreleased/improvements/4178-compat-mode-infer.md b/.changelog/unreleased/improvements/4178-compat-mode-infer.md new file mode 100644 index 0000000000..b4a8a05d78 --- /dev/null +++ b/.changelog/unreleased/improvements/4178-compat-mode-infer.md @@ -0,0 +1,3 @@ +- Improve detection of Tendermint/CometBFT compatibility + mode when a chain runs a non-standard version + ([\#4178](https://github.com/informalsystems/hermes/issues/4178)) \ 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 121f4c6034..ea8bd979cb 100644 --- a/crates/relayer-cli/src/commands/listen.rs +++ b/crates/relayer-cli/src/commands/listen.rs @@ -1,27 +1,24 @@ use alloc::sync::Arc; -use core::{ - fmt::{Display, Error as FmtError, Formatter}, - str::FromStr, -}; +use core::fmt::{Display, Error as FmtError, Formatter}; +use core::str::FromStr; use std::thread; use abscissa_core::application::fatal_error; use abscissa_core::clap::Parser; use eyre::eyre; use itertools::Itertools; -use tendermint_rpc::{client::CompatMode, Client, HttpClient}; +use tendermint_rpc::{client::CompatMode, HttpClient}; use tokio::runtime::Runtime as TokioRuntime; 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, - HERMES_VERSION, -}; -use ibc_relayer_types::{core::ics24_host::identifier::ChainId, events::IbcEvent}; +use ibc_relayer::chain::cosmos::fetch_compat_mode; +use ibc_relayer::chain::handle::Subscription; +use ibc_relayer::config::{ChainConfig, EventSourceMode}; +use ibc_relayer::error::Error; +use ibc_relayer::event::source::EventSource; +use ibc_relayer::HERMES_VERSION; +use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use ibc_relayer_types::events::IbcEvent; use crate::prelude::*; @@ -194,16 +191,15 @@ fn detect_compatibility_mode( let rpc_addr = match config { ChainConfig::CosmosSdk(config) => config.rpc_addr.clone(), }; + 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) => { - compat_mode_from_version(&config.compat_mode, status.node_info.version)?.into() - } + ChainConfig::CosmosSdk(config) => rt.block_on(fetch_compat_mode(&client, config))?, }; + Ok(compat_mode) } diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 338a7f9af1..cc5b809cad 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -1,8 +1,10 @@ use alloc::sync::Arc; use bytes::Buf; use bytes::Bytes; +use config::CosmosSdkConfig; use core::{future::Future, str::FromStr, time::Duration}; use futures::future::join_all; +use itertools::Itertools; use num_bigint::BigInt; use prost::Message; use std::cmp::Ordering; @@ -106,9 +108,8 @@ use crate::keyring::{KeyRing, Secp256k1KeyPair, SigningKeyPair}; 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::collate::CollatedIterExt; use crate::util::create_grpc_client; -use crate::util::pretty::PrettySlice; use crate::util::pretty::{ PrettyIdentifiedChannel, PrettyIdentifiedClientState, PrettyIdentifiedConnection, }; @@ -917,11 +918,10 @@ impl ChainEndpoint for CosmosSdkChain { .build() .map_err(|e| Error::rpc(config.rpc_addr.clone(), e))?; - let node_info = rt.block_on(fetch_node_info(&rpc_client, &config))?; - - let compat_mode = compat_mode_from_version(&config.compat_mode, node_info.version)?.into(); + let compat_mode = rt.block_on(fetch_compat_mode(&rpc_client, &config))?; rpc_client.set_compat_mode(compat_mode); + let node_info = rt.block_on(fetch_node_info(&rpc_client, &config))?; let light_client = TmLightClient::from_cosmos_sdk_config(&config, node_info.id)?; // Initialize key store and load key @@ -1116,6 +1116,7 @@ impl ChainEndpoint for CosmosSdkChain { &self.rpc_client, &self.config.rpc_addr, ))?; + Ok(version_specs) } @@ -2682,7 +2683,7 @@ fn do_health_check(chain: &CosmosSdkChain) -> Result<(), Error> { 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) + Ignore this warning if this configuration is correct.", seqs.iter().copied().collated().format(", ") ); } } @@ -2732,17 +2733,16 @@ fn do_health_check(chain: &CosmosSdkChain) -> Result<(), Error> { 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 - ); + "chain '{}' does not provide a minimum gas price for denomination '{}'.\ + This is usually a sign of misconfiguration, please check your chain configuration", + chain_id, relayer_gas_price.denom + ); } } 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", + "chain '{}' does not provide a minimum gas price for denomination '{}'. \ + This is usually a sign of misconfiguration, please check your chain configuration", chain_id, relayer_gas_price.denom ), @@ -2774,6 +2774,40 @@ fn do_health_check(chain: &CosmosSdkChain) -> Result<(), Error> { Ok(()) } +pub async fn fetch_compat_mode( + client: &HttpClient, + config: &CosmosSdkConfig, +) -> Result { + use crate::util::compat_mode::compat_mode_from_node_version; + use crate::util::compat_mode::compat_mode_from_version_specs; + + let version_specs = fetch_version_specs(&config.id, client, &config.rpc_addr).await; + + let compat_mode = match version_specs { + Ok(specs) => compat_mode_from_version_specs(&config.compat_mode, specs.consensus), + Err(e) => { + warn!( + "Failed to fetch version specs for chain '{}': {e}", + config.id + ); + + let status = client + .status() + .await + .map_err(|e| Error::rpc(config.rpc_addr.clone(), e))?; + + warn!( + "Will fall back on using the node version: {}", + status.node_info.version + ); + + compat_mode_from_node_version(&config.compat_mode, status.node_info.version) + } + }?; + + Ok(compat_mode.into()) +} + #[cfg(test)] mod tests { use super::calculate_fee; diff --git a/crates/relayer/src/config/compat_mode.rs b/crates/relayer/src/config/compat_mode.rs index 79323888f7..cb2a035855 100644 --- a/crates/relayer/src/config/compat_mode.rs +++ b/crates/relayer/src/config/compat_mode.rs @@ -10,14 +10,11 @@ use tendermint_rpc::client::CompatMode as TmCompatMode; use crate::config::Error; /// CometBFT RPC compatibility mode -/// -/// Can be removed in favor of the one in tendermint-rs, once -/// is merged. #[derive(Clone, Debug, Eq, PartialEq)] pub enum CompatMode { /// Use version 0.34 of the protocol. V0_34, - /// Use version 0.37 of the protocol. + /// Use version 0.37+ of the protocol. V0_37, } @@ -34,12 +31,13 @@ impl FromStr for CompatMode { type Err = Error; fn from_str(s: &str) -> Result { - const VALID_COMPAT_MODES: &str = "0.34, 0.37"; + const VALID_COMPAT_MODES: &str = "0.34, 0.37, 0.38"; // Trim leading 'v', if present match s.trim_start_matches('v') { "0.34" => Ok(CompatMode::V0_34), "0.37" => Ok(CompatMode::V0_37), + "0.38" => Ok(CompatMode::V0_37), // v0.38 is compatible with v0.37 _ => Err(Error::invalid_compat_mode( s.to_string(), VALID_COMPAT_MODES, diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index a825bba6f2..6d46f90fe0 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -591,7 +591,8 @@ 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" }, + |_| { "Invalid compatibility mode queried from chain and no `compat_mode` configured in Hermes. \ + This can be fixed by specifying a `compat_mode` for chain '{}' in Hermes config.toml" }, HttpRequest [ TraceError ] diff --git a/crates/relayer/src/util/compat_mode.rs b/crates/relayer/src/util/compat_mode.rs index fd4bc1ed1a..716534bb95 100644 --- a/crates/relayer/src/util/compat_mode.rs +++ b/crates/relayer/src/util/compat_mode.rs @@ -3,12 +3,11 @@ use tracing::warn; use tendermint::Version; use tendermint_rpc::client::CompatMode as TmCompatMode; +use crate::chain::cosmos::version::ConsensusVersion; use crate::config::compat_mode::CompatMode; use crate::error::Error; -/// This is a wrapper around tendermint-rs CompatMode::from_version() method. -/// -pub fn compat_mode_from_version( +pub fn compat_mode_from_node_version( configured_version: &Option, version: Version, ) -> Result { @@ -17,7 +16,12 @@ pub fn compat_mode_from_version( // This will prioritize the use of the CompatMode specified in Hermes configuration file match (configured_version, queried_version) { (Some(configured), Ok(queried)) if !configured.equal_to_tm_compat_mode(queried) => { - warn!("be wary of potential `compat_mode` misconfiguration. Configured version: {}, chain version: {}. Hermes will use the configured `compat_mode` version `{}`. If this configuration is done on purpose this message can be ignored.", configured, queried, configured); + warn!( + "potential `compat_mode` misconfiguration! Configured version '{configured}' does not match chain version '{queried}'. \ + Hermes will use the configured `compat_mode` version '{configured}'. \ + If this configuration is done on purpose this message can be ignored.", + ); + Ok(configured.clone()) } (Some(configured), _) => Ok(configured.clone()), @@ -25,3 +29,55 @@ pub fn compat_mode_from_version( (_, Err(e)) => Err(Error::invalid_compat_mode(e)), } } + +pub fn compat_mode_from_version_specs( + configured_mode: &Option, + version: Option, +) -> Result { + let queried_mode = match version { + Some(ConsensusVersion::Tendermint(v) | ConsensusVersion::Comet(v)) => { + compat_mode_from_semver(v) + } + None => None, + }; + + match (configured_mode, queried_mode) { + (Some(configured), Some(queried)) if configured == &queried => Ok(queried), + (Some(configured), Some(queried)) => { + warn!( + "potential `compat_mode` misconfiguration! Configured version: {configured}, chain version: {queried}. \ + Hermes will use the configured `compat_mode` version `{configured}`. \ + If this configuration is done on purpose this message can be ignored." + ); + + Ok(configured.clone()) + } + (Some(configured), None) => { + warn!( + "Hermes could not infer the compatibility mode for this chain, \ + and will use the configured `compat_mode` version `{configured}`." + ); + + Ok(configured.clone()) + } + (None, Some(queried)) => Ok(queried), + (None, None) => { + warn!( + "Hermes could not infer the compatibility mode for this chain, and no `compat_mode` was configured, \ + and will use the default compatibility mode `0.37`. \ + Please consider configuring the `compat_mode` in the Hermes configuration file." + ); + + Ok(CompatMode::V0_37) + } + } +} + +fn compat_mode_from_semver(v: semver::Version) -> Option { + match (v.major, v.minor) { + (0, 34) => Some(CompatMode::V0_34), + (0, 37) => Some(CompatMode::V0_37), + (0, 38) => Some(CompatMode::V0_37), + _ => None, + } +} diff --git a/tools/test-framework/src/chain/tagged.rs b/tools/test-framework/src/chain/tagged.rs index 8a17e8df55..b574c6eef1 100644 --- a/tools/test-framework/src/chain/tagged.rs +++ b/tools/test-framework/src/chain/tagged.rs @@ -5,10 +5,13 @@ use ibc_proto::google::protobuf::Any; use ibc_relayer::chain::cosmos::tx::simple_send_tx; use ibc_relayer::chain::cosmos::types::config::TxConfig; +use ibc_relayer::config::compat_mode::CompatMode; use ibc_relayer::event::IbcEventWithHeight; -use ibc_relayer::util::compat_mode::compat_mode_from_version; +use ibc_relayer_types::core::ics24_host::identifier::ChainId; use serde_json as json; use tendermint_rpc::client::{Client, HttpClient}; +use tendermint_rpc::Url; +use tracing::warn; use crate::chain::cli::query::query_auth_module; use crate::chain::cli::query::query_recipient_transactions; @@ -120,12 +123,16 @@ impl<'a, Chain: Send> TaggedChainDriverExt for MonoTagged TaggedChainDriverExt for MonoTagged, +) -> Result { + use ibc_relayer::chain::cosmos::query::fetch_version_specs; + use ibc_relayer::util::compat_mode::compat_mode_from_node_version; + use ibc_relayer::util::compat_mode::compat_mode_from_version_specs; + + let version_specs = fetch_version_specs(id, client, rpc_addr).await; + + let compat_mode = match version_specs { + Ok(specs) => compat_mode_from_version_specs(configured_mode, specs.consensus), + Err(e) => { + warn!("Failed to fetch version specs for chain '{id}': {e}"); + + let status = client.status().await.map_err(handle_generic_error)?; + + warn!( + "Will fall back on using the node version: {}", + status.node_info.version + ); + + compat_mode_from_node_version(configured_mode, status.node_info.version) + } + }?; + + Ok(compat_mode) +} From 1ee344fe5be1670fcb629e01b3ccb08c9e1ad9c2 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Thu, 5 Sep 2024 20:08:06 +0200 Subject: [PATCH 180/224] Fix new clippy warnings --- crates/relayer/src/config.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index 9494a1cc1b..fa4725a6d2 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -106,7 +106,7 @@ impl PartialOrd for GasPrice { /// the parsing of other prices. pub fn parse_gas_prices(prices: String) -> Vec { prices - .split(|c| c == ',' || c == ';') + .split([',', ';']) .filter_map(|gp| GasPrice::from_str(gp).ok()) .collect() } From 5af09b02ce481dd33b61d301c84022b716d800d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:40:53 +0200 Subject: [PATCH 181/224] Bump ibc-proto from 0.47.0 to 0.47.1 (#4189) Bumps [ibc-proto](https://github.com/cosmos/ibc-proto-rs) from 0.47.0 to 0.47.1. - [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.47.0...v0.47.1) --- updated-dependencies: - dependency-name: ibc-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 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2e4f2e7523..56ead09a24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1549,9 +1549,9 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.47.0" +version = "0.47.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1678333cf68c9094ca66aaf9a271269f1f6bf5c26881161def8bd88cee831a23" +checksum = "c852d22b782d2d793f4a646f968de419be635e02bc8798d5d74a6e44eef27733" dependencies = [ "base64 0.22.1", "bytes", diff --git a/Cargo.toml b/Cargo.toml index ef8483f32a..5fdebcb3fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,7 +72,7 @@ hex = "0.4.3" http = "1.0.0" humantime = "2.1.0" humantime-serde = "1.1.1" -ibc-proto = "0.47.0" +ibc-proto = "0.47.1" ics23 = "0.12.0" itertools = "0.13.0" moka = "0.12.8" From 71645cf4c2aace9a6b54769b38d528f3d9b10355 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:41:02 +0200 Subject: [PATCH 182/224] Bump tokio-stream from 0.1.15 to 0.1.16 (#4188) Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.15 to 0.1.16. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.15...tokio-stream-0.1.16) --- updated-dependencies: - dependency-name: tokio-stream 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 56ead09a24..a2d3834e74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3696,9 +3696,9 @@ dependencies = [ [[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", diff --git a/Cargo.toml b/Cargo.toml index 5fdebcb3fd..e345cf53be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -108,7 +108,7 @@ time = "0.3" tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } tokio = "1.39.2" -tokio-stream = "0.1.14" +tokio-stream = "0.1.16" toml = "0.8.19" tonic = "0.12" tracing = { version = "0.1.36", default-features = false } From 252a5cc2394043f3484df8468e708752bfc57065 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:41:14 +0200 Subject: [PATCH 183/224] Bump prost from 0.13.1 to 0.13.2 (#4179) Bumps [prost](https://github.com/tokio-rs/prost) from 0.13.1 to 0.13.2. - [Release notes](https://github.com/tokio-rs/prost/releases) - [Changelog](https://github.com/tokio-rs/prost/blob/master/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/prost/compare/v0.13.1...v0.13.2) --- 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 a2d3834e74..d602dc7149 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2379,9 +2379,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13db3d3fde688c61e2446b4d843bc27a7e8af269a69440c0308021dc92333cc" +checksum = "3b2ecbe40f08db5c006b5764a2645f7f3f141ce756412ac9e1dd6087e6d32995" dependencies = [ "bytes", "prost-derive", @@ -2389,9 +2389,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18bec9b0adc4eba778b33684b7ba3e7137789434769ee3ce3930463ef904cfca" +checksum = "acf0c195eebb4af52c752bec4f52f645da98b6e92077a04110c7f349477ae5ac" dependencies = [ "anyhow", "itertools", From 0f912e78a5ee902572ee0e41e86d91a355d83dfa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2024 14:41:19 +0200 Subject: [PATCH 184/224] Bump async-trait from 0.1.81 to 0.1.82 (#4180) Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.81 to 0.1.82. - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.81...0.1.82) --- 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 d602dc7149..bc73115080 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,9 +162,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index e345cf53be..196b0277af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ tendermint-testgen = { version = "0.38.1" } abscissa_core = "=0.6.0" anyhow = "1.0" async-stream = "0.3.5" -async-trait = "0.1.81" +async-trait = "0.1.82" axum = "0.6.18" bech32 = "0.9.1" bitcoin = "0.31.2" From 84743a21c3be533c4b362276a6f213bf6cf27454 Mon Sep 17 00:00:00 2001 From: Anca Zamfir Date: Sat, 28 Sep 2024 04:29:04 -0400 Subject: [PATCH 185/224] Add height parameter to query commitments (#4194) * Add height parameter to query commitments * Cleanup * Update guide templates --- .../src/commands/query/packet/commitments.rs | 44 ++++++++++++++----- crates/relayer/src/chain/cosmos.rs | 15 ++++++- crates/relayer/src/chain/counterparty.rs | 22 ++++++++-- crates/relayer/src/chain/requests.rs | 1 + .../hermes/query/packet/commitments_1.md | 2 +- .../query/packet/commitments.md | 5 ++- 6 files changed, 70 insertions(+), 19 deletions(-) diff --git a/crates/relayer-cli/src/commands/query/packet/commitments.rs b/crates/relayer-cli/src/commands/query/packet/commitments.rs index 725b5de562..836df55b27 100644 --- a/crates/relayer-cli/src/commands/query/packet/commitments.rs +++ b/crates/relayer-cli/src/commands/query/packet/commitments.rs @@ -1,11 +1,13 @@ use abscissa_core::clap::Parser; use ibc_relayer::chain::counterparty::commitments_on_chain; -use ibc_relayer::chain::requests::Paginate; +use ibc_relayer::chain::handle::ChainHandle; +use ibc_relayer::chain::requests::{Paginate, QueryHeight}; +use ibc_relayer_types::core::ics02_client::height::Height; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, PortId}; use crate::cli_utils::spawn_chain_runtime; -use crate::conclude::Output; +use crate::conclude::{exit_with_unrecoverable_error, Output}; use crate::error::Error; use crate::prelude::*; @@ -40,6 +42,13 @@ pub struct QueryPacketCommitmentsCmd { help = "Identifier of the channel to query" )] channel_id: ChannelId, + + #[clap( + long = "height", + value_name = "HEIGHT", + help = "Height of the state to query. Leave unspecified for latest height." + )] + height: Option, } impl QueryPacketCommitmentsCmd { @@ -48,12 +57,25 @@ impl QueryPacketCommitmentsCmd { let chain = spawn_chain_runtime(&config, &self.chain_id)?; - commitments_on_chain(&chain, &self.port_id, &self.channel_id, Paginate::All) - .map_err(Error::supervisor) - .map(|(seqs_vec, height)| PacketSeqs { - height, - seqs: seqs_vec, - }) + let query_height = self.height.map_or(QueryHeight::Latest, |revision_height| { + QueryHeight::Specific( + Height::new(chain.id().version(), revision_height) + .unwrap_or_else(exit_with_unrecoverable_error), + ) + }); + + commitments_on_chain( + &chain, + &query_height, + &self.port_id, + &self.channel_id, + Paginate::All, + ) + .map_err(Error::supervisor) + .map(|(seqs_vec, height)| PacketSeqs { + height, + seqs: seqs_vec, + }) } } @@ -85,7 +107,8 @@ mod tests { QueryPacketCommitmentsCmd { chain_id: ChainId::from_string("chain_id"), port_id: PortId::from_str("port_id").unwrap(), - channel_id: ChannelId::from_str("channel-07").unwrap() + channel_id: ChannelId::from_str("channel-07").unwrap(), + height: None, }, QueryPacketCommitmentsCmd::parse_from([ "test", @@ -105,7 +128,8 @@ mod tests { QueryPacketCommitmentsCmd { chain_id: ChainId::from_string("chain_id"), port_id: PortId::from_str("port_id").unwrap(), - channel_id: ChannelId::from_str("channel-07").unwrap() + channel_id: ChannelId::from_str("channel-07").unwrap(), + height: None, }, QueryPacketCommitmentsCmd::parse_from([ "test", diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index cc5b809cad..5e53f57fdf 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -1863,6 +1863,8 @@ impl ChainEndpoint for CosmosSdkChain { ) })?; + let height_param = AsciiMetadataValue::try_from(request.query_height)?; + if request.pagination.is_enabled() { let mut results = Vec::new(); let mut page_key = Vec::new(); @@ -1890,6 +1892,10 @@ impl ChainEndpoint for CosmosSdkChain { // TODO: This should either be configurable or inferred from the pagination tonic_request.set_timeout(Duration::from_secs(10)); + tonic_request + .metadata_mut() + .insert("x-cosmos-block-height", height_param.clone()); + let response = self.rt.block_on(async { client .packet_commitments(tonic_request) @@ -1946,9 +1952,14 @@ impl ChainEndpoint for CosmosSdkChain { Ok((commitment_sequences, height)) } else { - let request = tonic::Request::new(request.into()); + let mut tonic_request = tonic::Request::new(request.clone().into()); + + tonic_request + .metadata_mut() + .insert("x-cosmos-block-height", height_param); + let response = self - .block_on(client.packet_commitments(request)) + .block_on(client.packet_commitments(tonic_request)) .map_err(|e| Error::grpc_status(e, "query_packet_commitments".to_owned()))? .into_inner(); diff --git a/crates/relayer/src/chain/counterparty.rs b/crates/relayer/src/chain/counterparty.rs index ffd4a42c9c..118c118a62 100644 --- a/crates/relayer/src/chain/counterparty.rs +++ b/crates/relayer/src/chain/counterparty.rs @@ -379,6 +379,7 @@ pub fn check_channel_counterparty( /// - received on counterparty chain but not yet acknowledged by this chain, pub fn commitments_on_chain( chain: &impl ChainHandle, + query_height: &QueryHeight, port_id: &PortId, channel_id: &ChannelId, paginate: Paginate, @@ -386,6 +387,7 @@ pub fn commitments_on_chain( // get the packet commitments on the counterparty/ source chain let (mut commit_sequences, response_height) = chain .query_packet_commitments(QueryPacketCommitmentsRequest { + query_height: *query_height, port_id: port_id.clone(), channel_id: channel_id.clone(), pagination: paginate, @@ -506,6 +508,7 @@ pub fn unreceived_packets( ) -> Result<(Vec, Height), Error> { let (commit_sequences, h) = commitments_on_chain( counterparty_chain, + &QueryHeight::Latest, &path.counterparty_port_id, &path.counterparty_channel_id, paginate, @@ -543,6 +546,7 @@ pub fn acknowledgements_on_chain( let (commitments_on_counterparty, _) = commitments_on_chain( counterparty_chain, + &QueryHeight::Latest, &counterparty.port_id, counterparty_channel_id, Paginate::All, @@ -594,8 +598,13 @@ pub fn unreceived_acknowledgements( path: &PathIdentifiers, pagination: Paginate, ) -> Result, Height)>, Error> { - let (commitments_on_src, _) = - commitments_on_chain(chain, &path.port_id, &path.channel_id, pagination)?; + let (commitments_on_src, _) = commitments_on_chain( + chain, + &QueryHeight::Latest, + &path.port_id, + &path.channel_id, + pagination, + )?; let acks_and_height_on_counterparty = packet_acknowledgements( counterparty_chain, @@ -642,8 +651,13 @@ pub fn pending_packet_summary( .as_ref() .ok_or_else(Error::missing_counterparty_channel_id)?; - let (commitments_on_src, _) = - commitments_on_chain(chain, &channel.port_id, &channel.channel_id, pagination)?; + let (commitments_on_src, _) = commitments_on_chain( + chain, + &QueryHeight::Latest, + &channel.port_id, + &channel.channel_id, + pagination, + )?; let unreceived = unreceived_packets_sequences( counterparty_chain, diff --git a/crates/relayer/src/chain/requests.rs b/crates/relayer/src/chain/requests.rs index d86770e7f7..80162ee6e8 100644 --- a/crates/relayer/src/chain/requests.rs +++ b/crates/relayer/src/chain/requests.rs @@ -338,6 +338,7 @@ pub struct QueryPacketCommitmentRequest { /// gRPC query to fetch the packet commitment hashes associated with the specified channel. #[derive(Clone, Debug, Serialize, Deserialize)] pub struct QueryPacketCommitmentsRequest { + pub query_height: QueryHeight, pub port_id: PortId, pub channel_id: ChannelId, pub pagination: Paginate, diff --git a/guide/src/templates/commands/hermes/query/packet/commitments_1.md b/guide/src/templates/commands/hermes/query/packet/commitments_1.md index 57b807de52..32d0ca5476 100644 --- a/guide/src/templates/commands/hermes/query/packet/commitments_1.md +++ b/guide/src/templates/commands/hermes/query/packet/commitments_1.md @@ -1 +1 @@ -[[#BINARY hermes]][[#GLOBALOPTIONS]] query packet commitments --chain [[#CHAIN_ID]] --port [[#PORT_ID]] --channel [[#CHANNEL_ID]] +[[#BINARY hermes]][[#GLOBALOPTIONS]] query packet commitments[[#OPTIONS]] --chain [[#CHAIN_ID]] --port [[#PORT_ID]] --channel [[#CHANNEL_ID]] diff --git a/guide/src/templates/help_templates/query/packet/commitments.md b/guide/src/templates/help_templates/query/packet/commitments.md index b12e02d44f..33d211e2bf 100644 --- a/guide/src/templates/help_templates/query/packet/commitments.md +++ b/guide/src/templates/help_templates/query/packet/commitments.md @@ -2,10 +2,11 @@ DESCRIPTION: Query packet commitments USAGE: - hermes query packet commitments --chain --port --channel + hermes query packet commitments [OPTIONS] --chain --port --channel OPTIONS: - -h, --help Print help information + -h, --help Print help information + --height Height of the state to query. Leave unspecified for latest height. REQUIRED: --chain Identifier of the chain to query From deb1a8b1c6f1e094dc218a75d2cfe334cf362056 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Thu, 3 Oct 2024 17:47:34 +0200 Subject: [PATCH 186/224] Update `simd` versions running in CI (#4205) * Update Nix flake * Add changelog entry * Codespell fix --- .../4202-update-simd-versions.md | 7 +++ flake.lock | 50 +++++++++---------- 2 files changed, 32 insertions(+), 25 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4202-update-simd-versions.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4202-update-simd-versions.md b/.changelog/unreleased/improvements/ibc-integration-test/4202-update-simd-versions.md new file mode 100644 index 0000000000..c35847633e --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4202-update-simd-versions.md @@ -0,0 +1,7 @@ +- Update the versions of the following `simd` running the integration tests in the CI: + * From `v6.3.0` to `v6.3.1` + * From `v7.4.0` to `v7.8.0` + * From `v8.3.1` to `v8.5.1` + * From `v9.0.0-beta.1` to `v9.0.0-rc.0` + + ([\#4202](https://github.com/informalsystems/hermes/issues/4202)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index ae1418f0a4..d78d62da6b 100644 --- a/flake.lock +++ b/flake.lock @@ -225,11 +225,11 @@ "wasmvm_2_1_2-src": "wasmvm_2_1_2-src" }, "locked": { - "lastModified": 1725007328, - "narHash": "sha256-DMRDFFpXIJyKRNhiVhXaIoOJkmVyKbt6DO6M5F8CCec=", + "lastModified": 1727709426, + "narHash": "sha256-Q+uchaRWUNGOksfHY8x6HAz7nADkRtLHUl11A0mBc7Y=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "d87f011075da3ee1afbbe3443ca25461af7d49fd", + "rev": "706d3206feb0c816765768dd164790874c221bd3", "type": "github" }, "original": { @@ -497,11 +497,11 @@ "systems": "systems_6" }, "locked": { - "lastModified": 1710146030, - "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "type": "github" }, "original": { @@ -964,16 +964,16 @@ "ibc-go-v6-src": { "flake": false, "locked": { - "lastModified": 1712318519, - "narHash": "sha256-roRXZEOJIFJiXEQ+a71QdMmqoVJKVk2wvPgHJ9r/mQ8=", + "lastModified": 1713970631, + "narHash": "sha256-MpBZ/V8agG3/GFJXEY3kSp+FnUw8rX5C613l5D8HXs4=", "owner": "cosmos", "repo": "ibc-go", - "rev": "8e31269c692d87ac65bfe70cf609925975a57203", + "rev": "8cd96f4169ebee21d50ef69417203b21cf4238ab", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v6.3.0", + "ref": "v6.3.1", "repo": "ibc-go", "type": "github" } @@ -981,16 +981,16 @@ "ibc-go-v7-src": { "flake": false, "locked": { - "lastModified": 1712318559, - "narHash": "sha256-uYiUNXLD48v3vRGK6/aQ7z7Ed5hY8VnEBGG/3Uv87Nc=", + "lastModified": 1725009574, + "narHash": "sha256-6Wpxu4mQaSrQKOLSb3kUpzRrr0aIHVMVEHVwpGJw3sM=", "owner": "cosmos", "repo": "ibc-go", - "rev": "802ca265dba74a293747e1ccb8b7999aa985af19", + "rev": "a5dde80a4ba1c4601aa055a311bf46779104627f", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v7.4.0", + "ref": "v7.8.0", "repo": "ibc-go", "type": "github" } @@ -1015,16 +1015,16 @@ "ibc-go-v8-src": { "flake": false, "locked": { - "lastModified": 1716359952, - "narHash": "sha256-KTjyHwmXA/jgppDKRe85XfRmh8O7AHFKhDyyOb9VROU=", + "lastModified": 1726232417, + "narHash": "sha256-oIfVmXIOkRqDF4NGmHsh5BELCIzPydAqiz+7urnZ7A4=", "owner": "cosmos", "repo": "ibc-go", - "rev": "9b6567bf818198ded336490d5f2d89c9d42fd87b", + "rev": "6b2554360c0e3f0bbaa59da5b16b29fc05675c57", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v8.3.1", + "ref": "v8.5.1", "repo": "ibc-go", "type": "github" } @@ -1049,16 +1049,16 @@ "ibc-go-v9-src": { "flake": false, "locked": { - "lastModified": 1723037346, - "narHash": "sha256-ba8gbJ0l4l8ZRT9XVN3hTcnxZSb5Fn20p1xiEG4/54c=", + "lastModified": 1725262239, + "narHash": "sha256-F2p/lIs2/ropKdm0Pebz1kjhRlgwYK0BmDGe/sYec3Y=", "owner": "cosmos", "repo": "ibc-go", - "rev": "66ebf864d7bfe2193a96c972a9e74196b2ddf104", + "rev": "8983f91e519fb1c43d9c9481ba60f11e4ae2b2b0", "type": "github" }, "original": { "owner": "cosmos", - "ref": "v9.0.0-beta.1", + "ref": "v9.0.0-rc.0", "repo": "ibc-go", "type": "github" } @@ -1444,11 +1444,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1725194671, - "narHash": "sha256-tLGCFEFTB5TaOKkpfw3iYT9dnk4awTP/q4w+ROpMfuw=", + "lastModified": 1727648392, + "narHash": "sha256-VTlVv1nSxImFxY6RPQpNZxvEOQ0u5s1wBFDgixySNDo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "b833ff01a0d694b910daca6e2ff4a3f26dee478c", + "rev": "4e0c36e4dd53f35d5a6385bdae88895ec5832f70", "type": "github" }, "original": { From 0a95bb2fe9de02e3691aa667cc00376c17defe87 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 09:52:25 +0200 Subject: [PATCH 187/224] Bump bytes from 1.7.1 to 1.7.2 (#4195) Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.7.1 to 1.7.2. - [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.7.1...v1.7.2) --- 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 bc73115080..52349bc0c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -478,9 +478,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", ] diff --git a/Cargo.toml b/Cargo.toml index 196b0277af..6803629ff4 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.7.1" +bytes = "1.7.2" clap = "3.2" clap_complete = "3.2" color-eyre = "0.6" From 50a32aa730c4132bc463076c14136c625dfe559b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 09:53:04 +0200 Subject: [PATCH 188/224] Bump thiserror from 1.0.63 to 1.0.64 (#4196) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.63 to 1.0.64. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.63...1.0.64) --- 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 52349bc0c7..cfa6f94f40 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3532,18 +3532,18 @@ 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", "quote", diff --git a/Cargo.toml b/Cargo.toml index 6803629ff4..1897cc9507 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -103,7 +103,7 @@ signature = "2.1.0" strum = "0.25" subtle-encoding = "0.5.1" test-log = "0.2.14" -thiserror = "1.0.63" +thiserror = "1.0.64" time = "0.3" tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } From 8cf2294ac213a4c67e0d6c65e618b36140574104 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 07:53:34 +0000 Subject: [PATCH 189/224] Bump serde_json from 1.0.127 to 1.0.128 (#4197) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.127 to 1.0.128. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/1.0.127...1.0.128) --- 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 cfa6f94f40..6078d77ad4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2948,9 +2948,9 @@ dependencies = [ [[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", diff --git a/Cargo.toml b/Cargo.toml index 1897cc9507..bc6802ecd4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ secp256k1 = "0.28.2" semver = "1.0.21" serde = "1.0.209" serde_derive = "1.0.104" -serde_json = "1.0.127" +serde_json = "1.0.128" serde_yaml = "0.9.34" serial_test = "3.1.1" sha2 = "0.10.6" From dab8be5a9f03bd5ab8471152fd1dc7c58d907b49 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 09:54:56 +0200 Subject: [PATCH 190/224] Bump anyhow from 1.0.86 to 1.0.89 (#4198) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.86 to 1.0.89. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.86...1.0.89) --- 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 6078d77ad4..f3c39ceeab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,9 +116,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" From 4a411fbc23fac4cde8496387f053a7631ab2bfc4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:00:39 +0200 Subject: [PATCH 191/224] Bump regex from 1.10.6 to 1.11.0 (#4217) Bumps [regex](https://github.com/rust-lang/regex) from 1.10.6 to 1.11.0. - [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.6...1.11.0) --- updated-dependencies: - dependency-name: regex 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 | 18 +++++++++--------- Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3c39ceeab..cea9920c8b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2500,14 +2500,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]] @@ -2521,13 +2521,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]] @@ -2538,9 +2538,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" diff --git a/Cargo.toml b/Cargo.toml index bc6802ecd4..0cdf9b6932 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.6" +regex = "1.11.0" reqwest = { version = "0.11.27", default-features = false } retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" From 98bee4d6d11cbba78d7ba82f512a633755bd63c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:01:13 +0200 Subject: [PATCH 192/224] Bump async-trait from 0.1.82 to 0.1.83 (#4218) Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.82 to 0.1.83. - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.82...0.1.83) --- 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 cea9920c8b..2684f0bdbe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,9 +162,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 0cdf9b6932..2585d72ee4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ tendermint-testgen = { version = "0.38.1" } abscissa_core = "=0.6.0" anyhow = "1.0" async-stream = "0.3.5" -async-trait = "0.1.82" +async-trait = "0.1.83" axum = "0.6.18" bech32 = "0.9.1" bitcoin = "0.31.2" From a737bf06d4c563c77ed68723940ba79ef166ed2c Mon Sep 17 00:00:00 2001 From: Wong Heung Sang <35202375+whs-dot-hk@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:23:40 +0000 Subject: [PATCH 193/224] Put clone() to where it is needed (#4209) * Put clone() to where it is needed * Fmt --------- Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> --- crates/chain-registry/src/querier.rs | 2 +- crates/relayer/src/chain/cosmos.rs | 32 +++++++++---------- .../relayer/src/chain/cosmos/query/account.rs | 2 +- .../relayer/src/chain/cosmos/query/balance.rs | 4 +-- .../src/chain/cosmos/query/connection.rs | 2 +- .../src/chain/cosmos/query/consensus_state.rs | 4 +-- .../src/chain/cosmos/query/denom_trace.rs | 2 +- crates/relayer/src/chain/cosmos/query/fee.rs | 6 ++-- crates/relayer/src/chain/cosmos/simulate.rs | 2 +- crates/relayer/src/util.rs | 4 +-- 10 files changed, 29 insertions(+), 31 deletions(-) diff --git a/crates/chain-registry/src/querier.rs b/crates/chain-registry/src/querier.rs index 3a3f1e02f6..146f9226fa 100644 --- a/crates/chain-registry/src/querier.rs +++ b/crates/chain-registry/src/querier.rs @@ -160,7 +160,7 @@ impl QueryContext for GrpcHealthCheckQuerier { info!("Querying gRPC server at {tendermint_url}"); - create_grpc_client(uri, QueryClient::new) + 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 5e53f57fdf..e7729c7382 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -377,7 +377,7 @@ impl CosmosSdkChain { crate::telemetry!(query, self.id(), "query_ccv_consumer_chain_params"); let mut client = self.block_on(create_grpc_client( - self.grpc_addr.clone(), + &self.grpc_addr, ibc_proto::interchain_security::ccv::consumer::v1::query_client::QueryClient::new, ))?; @@ -1228,7 +1228,7 @@ impl ChainEndpoint for CosmosSdkChain { crate::telemetry!(query, self.id(), "query_clients"); let mut client = self.block_on(create_grpc_client( - self.grpc_addr.clone(), + &self.grpc_addr, ibc_proto::ibc::core::client::v1::query_client::QueryClient::new, ))?; @@ -1416,7 +1416,7 @@ impl ChainEndpoint for CosmosSdkChain { crate::telemetry!(query, self.id(), "query_client_connections"); let mut client = self.block_on(create_grpc_client( - self.grpc_addr.clone(), + &self.grpc_addr, ibc_proto::ibc::core::connection::v1::query_client::QueryClient::new, ))?; @@ -1459,7 +1459,7 @@ impl ChainEndpoint for CosmosSdkChain { crate::telemetry!(query, self.id(), "query_connections"); let mut client = self.block_on(create_grpc_client( - self.grpc_addr.clone(), + &self.grpc_addr, ibc_proto::ibc::core::connection::v1::query_client::QueryClient::new, ))?; @@ -1513,11 +1513,9 @@ impl ChainEndpoint for CosmosSdkChain { use ibc_proto::ibc::core::connection::v1 as connection; use tonic::IntoRequest; - let mut client = create_grpc_client( - chain.grpc_addr.clone(), - connection::query_client::QueryClient::new, - ) - .await?; + let mut client = + create_grpc_client(&chain.grpc_addr, connection::query_client::QueryClient::new) + .await?; client = client.max_decoding_message_size( chain.config().max_grpc_decoding_size.get_bytes() as usize, @@ -1596,7 +1594,7 @@ impl ChainEndpoint for CosmosSdkChain { crate::telemetry!(query, self.id(), "query_connection_channels"); let mut client = self.block_on(create_grpc_client( - self.grpc_addr.clone(), + &self.grpc_addr, ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, ))?; @@ -1665,7 +1663,7 @@ impl ChainEndpoint for CosmosSdkChain { crate::telemetry!(query, self.id(), "query_channels"); let mut client = self.block_on(create_grpc_client( - self.grpc_addr.clone(), + &self.grpc_addr, ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, ))?; @@ -1786,7 +1784,7 @@ impl ChainEndpoint for CosmosSdkChain { crate::telemetry!(query, self.id(), "query_channel_client_state"); let mut client = self.block_on(create_grpc_client( - self.grpc_addr.clone(), + &self.grpc_addr, ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, ))?; @@ -1854,7 +1852,7 @@ impl ChainEndpoint for CosmosSdkChain { let mut client = self .block_on(create_grpc_client( - self.grpc_addr.clone(), + &self.grpc_addr, ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, )) .map(|client| { @@ -2025,7 +2023,7 @@ impl ChainEndpoint for CosmosSdkChain { crate::telemetry!(query, self.id(), "query_unreceived_packets"); let mut client = self.block_on(create_grpc_client( - self.grpc_addr.clone(), + &self.grpc_addr, ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, ))?; @@ -2098,7 +2096,7 @@ impl ChainEndpoint for CosmosSdkChain { let mut client = self .block_on(create_grpc_client( - self.grpc_addr.clone(), + &self.grpc_addr, ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, )) .map(|client| { @@ -2216,7 +2214,7 @@ impl ChainEndpoint for CosmosSdkChain { crate::telemetry!(query, self.id(), "query_unreceived_acknowledgements"); let mut client = self.block_on(create_grpc_client( - self.grpc_addr.clone(), + &self.grpc_addr, ibc_proto::ibc::core::channel::v1::query_client::QueryClient::new, ))?; @@ -2554,7 +2552,7 @@ impl ChainEndpoint for CosmosSdkChain { crate::telemetry!(query, self.id(), "query_consumer_chains"); let mut client = self.block_on(create_grpc_client( - self.grpc_addr.clone(), + &self.grpc_addr, ibc_proto::interchain_security::ccv::provider::v1::query_client::QueryClient::new, ))?; diff --git a/crates/relayer/src/chain/cosmos/query/account.rs b/crates/relayer/src/chain/cosmos/query/account.rs index aeafea7529..19d9ac5b34 100644 --- a/crates/relayer/src/chain/cosmos/query/account.rs +++ b/crates/relayer/src/chain/cosmos/query/account.rs @@ -55,7 +55,7 @@ pub async fn query_account( grpc_address: &Uri, account_address: &str, ) -> Result { - let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; + let mut client = create_grpc_client(grpc_address, 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 c197b94331..2b8a93e6de 100644 --- a/crates/relayer/src/chain/cosmos/query/balance.rs +++ b/crates/relayer/src/chain/cosmos/query/balance.rs @@ -15,7 +15,7 @@ pub async fn query_balance( account_address: &str, denom: &str, ) -> Result { - let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; + let mut client = create_grpc_client(grpc_address, QueryClient::new).await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); @@ -46,7 +46,7 @@ pub async fn query_all_balances( grpc_address: &Uri, account_address: &str, ) -> Result, Error> { - let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; + let mut client = create_grpc_client(grpc_address, 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 2fbfe29650..7ae553f31e 100644 --- a/crates/relayer/src/chain/cosmos/query/connection.rs +++ b/crates/relayer/src/chain/cosmos/query/connection.rs @@ -10,7 +10,7 @@ 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 = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; + let mut client = create_grpc_client(grpc_address, 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 3f95b47013..f844082ec0 100644 --- a/crates/relayer/src/chain/cosmos/query/consensus_state.rs +++ b/crates/relayer/src/chain/cosmos/query/consensus_state.rs @@ -38,7 +38,7 @@ pub async fn query_consensus_state_heights( } let mut client = create_grpc_client( - grpc_addr.clone(), + grpc_addr, ibc_proto::ibc::core::client::v1::query_client::QueryClient::new, ) .await?; @@ -108,7 +108,7 @@ pub async fn query_consensus_states( ); let mut client = create_grpc_client( - grpc_addr.clone(), + grpc_addr, ibc_proto::ibc::core::client::v1::query_client::QueryClient::new, ) .await?; diff --git a/crates/relayer/src/chain/cosmos/query/denom_trace.rs b/crates/relayer/src/chain/cosmos/query/denom_trace.rs index 050aea8c48..27f9c7ca58 100644 --- a/crates/relayer/src/chain/cosmos/query/denom_trace.rs +++ b/crates/relayer/src/chain/cosmos/query/denom_trace.rs @@ -11,7 +11,7 @@ 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 = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; + let mut client = create_grpc_client(grpc_address, 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 e59e70bc41..79e9d8175b 100644 --- a/crates/relayer/src/chain/cosmos/query/fee.rs +++ b/crates/relayer/src/chain/cosmos/query/fee.rs @@ -20,7 +20,7 @@ pub async fn query_counterparty_payee( channel_id: &ChannelId, address: &Signer, ) -> Result, Error> { - let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; + let mut client = create_grpc_client(grpc_address, QueryClient::new).await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); @@ -52,7 +52,7 @@ pub async fn query_incentivized_packets( channel_id: &ChannelId, port_id: &PortId, ) -> Result, Error> { - let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; + let mut client = create_grpc_client(grpc_address, QueryClient::new).await?; client = client.max_decoding_message_size(max_grpc_decoding_size().get_bytes() as usize); @@ -84,7 +84,7 @@ pub async fn query_incentivized_packet( grpc_address: &Uri, request: QueryIncentivizedPacketRequest, ) -> Result { - let mut client = create_grpc_client(grpc_address.clone(), QueryClient::new).await?; + let mut client = create_grpc_client(grpc_address, 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 c48d3027a3..6b2661363f 100644 --- a/crates/relayer/src/chain/cosmos/simulate.rs +++ b/crates/relayer/src/chain/cosmos/simulate.rs @@ -16,7 +16,7 @@ pub async fn send_tx_simulate(grpc_address: &Uri, tx: Tx) -> Result( - grpc_addr: tonic::transport::Uri, + 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) + let channel = tonic::transport::Channel::builder(grpc_addr.clone()) .tls_config(tls_config) .map_err(crate::error::Error::grpc_transport)? .connect() From f0fdea5b56c0a7f0055a78fd7f6a95c77215e938 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 15 Oct 2024 12:55:46 +0200 Subject: [PATCH 194/224] Update PR template (#4213) * Add point to checklist if guide has been updated * Update .github/PULL_REQUEST_TEMPLATE.md 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 --- .github/PULL_REQUEST_TEMPLATE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index dc9bf1d7b8..90985e2118 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -25,6 +25,7 @@ ______ - [ ] Added tests: integration (for Hermes) or unit/mock tests (for modules). - [ ] Linked to GitHub issue. - [ ] Updated code comments and documentation (e.g., `docs/`). + - [ ] If guide has been updated, tag GitHub user `mircea-c` - [ ] Tagged *one* reviewer who will be the one responsible for shepherding this PR. ### Reviewer checklist: From 789cecc30c36b1eecdcca94b68408b6a4f59a8b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 13:09:41 +0200 Subject: [PATCH 195/224] Bump serde from 1.0.209 to 1.0.210 (#4215) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.209 to 1.0.210. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.209...v1.0.210) --- 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 2684f0bdbe..68c3ac756f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2909,9 +2909,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", ] @@ -2937,9 +2937,9 @@ 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", "quote", diff --git a/Cargo.toml b/Cargo.toml index 2585d72ee4..6a4913f61c 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.209" +serde = "1.0.210" serde_derive = "1.0.104" serde_json = "1.0.128" serde_yaml = "0.9.34" From 841638a9809e8f51b09c6631b39225e727e9dec7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 10:28:39 +0200 Subject: [PATCH 196/224] Bump uuid from 1.10.0 to 1.11.0 (#4222) Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.10.0 to 1.11.0. - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/1.10.0...1.11.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 68c3ac756f..639e969ea5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4055,9 +4055,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ "getrandom", ] diff --git a/Cargo.toml b/Cargo.toml index 6a4913f61c..edfcf88a1b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -114,7 +114,7 @@ tonic = "0.12" tracing = { version = "0.1.36", default-features = false } tracing-subscriber = "0.3.14" uint = "0.9" -uuid = "1.10.0" +uuid = "1.11.0" [profile.release] overflow-checks = true From 9c6d319dea9ac1abda11478d3f02046656e66353 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 08:29:00 +0000 Subject: [PATCH 197/224] Bump anyhow from 1.0.89 to 1.0.90 (#4221) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.89 to 1.0.90. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.89...1.0.90) --- 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 639e969ea5..a8ac67a51c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,9 +116,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" [[package]] name = "arc-swap" From 1936f5ecd646644ed6b7eab9a0b23beecbc96817 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 08:29:26 +0000 Subject: [PATCH 198/224] Bump async-stream from 0.3.5 to 0.3.6 (#4219) Bumps [async-stream](https://github.com/tokio-rs/async-stream) from 0.3.5 to 0.3.6. - [Release notes](https://github.com/tokio-rs/async-stream/releases) - [Commits](https://github.com/tokio-rs/async-stream/compare/v0.3.5...v0.3.6) --- updated-dependencies: - dependency-name: async-stream 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 a8ac67a51c..f2c2335954 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,9 +140,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[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", @@ -151,9 +151,9 @@ 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", "quote", diff --git a/Cargo.toml b/Cargo.toml index edfcf88a1b..14b8245c59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ tendermint-testgen = { version = "0.38.1" } # Other dependencies abscissa_core = "=0.6.0" anyhow = "1.0" -async-stream = "0.3.5" +async-stream = "0.3.6" async-trait = "0.1.83" axum = "0.6.18" bech32 = "0.9.1" From cdbb3738c603458c22037170ed7d7750e55365f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 10:30:07 +0200 Subject: [PATCH 199/224] Bump serde_json from 1.0.128 to 1.0.132 (#4220) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.128 to 1.0.132. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/1.0.128...1.0.132) --- 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 f2c2335954..e2ce18f2fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2948,9 +2948,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 14b8245c59..97e40befb7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,7 @@ secp256k1 = "0.28.2" semver = "1.0.21" serde = "1.0.210" serde_derive = "1.0.104" -serde_json = "1.0.128" +serde_json = "1.0.132" serde_yaml = "0.9.34" serial_test = "3.1.1" sha2 = "0.10.6" From 3ac1e2f291d8765337baa526a3d7f2e65514d150 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:10:36 +0100 Subject: [PATCH 200/224] Disable TLS configuration when using IPv6 for the gRPC endpoint (#4223) * Do not configure TLS when using IPv6 * Add option to run test using IPv6 gRPC endpoint * Add github workflow to run the transfer test using IPv6 for the gRPC endpoint * 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 --- .../4153-add-ipv6-test.md | 2 + .github/workflows/integration.yaml | 43 +++++++++++++++++++ crates/relayer/src/util.rs | 22 ++++++++-- tools/test-framework/src/bootstrap/init.rs | 6 +++ tools/test-framework/src/bootstrap/single.rs | 6 ++- tools/test-framework/src/chain/builder.rs | 6 +++ tools/test-framework/src/chain/config.rs | 11 +++++ tools/test-framework/src/chain/driver.rs | 23 ++++++++-- tools/test-framework/src/types/config.rs | 2 + 9 files changed, 114 insertions(+), 7 deletions(-) create mode 100644 .changelog/unreleased/features/ibc-integration-test/4153-add-ipv6-test.md diff --git a/.changelog/unreleased/features/ibc-integration-test/4153-add-ipv6-test.md b/.changelog/unreleased/features/ibc-integration-test/4153-add-ipv6-test.md new file mode 100644 index 0000000000..8c7c3b98a7 --- /dev/null +++ b/.changelog/unreleased/features/ibc-integration-test/4153-add-ipv6-test.md @@ -0,0 +1,2 @@ +- Disable TLS configuration when using IPv6 for the gRPC endpoint. + ([\#4224](https://github.com/informalsystems/hermes/issues/4224)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 59f90f2caf..528ea08c6c 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -301,3 +301,46 @@ 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 + + # Run the transfer test using IPv6 for gRPC endpoint + ipv6-grpc-endpoint: + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + chain: + - package: .#gaia18 + command: gaiad + account_prefix: cosmos + 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 --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: info + RUST_BACKTRACE: 1 + NO_COLOR_LOG: 1 + CHAIN_COMMAND_PATHS: ${{ matrix.chain.command }} + ACCOUNT_PREFIXES: ${{ matrix.chain.account_prefix }} + IPV6_GRPC: true + run: | + nix shell ${{ matrix.chain.package }} -c \ + cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=2 \ + tests::transfer::test_ibc_transfer diff --git a/crates/relayer/src/util.rs b/crates/relayer/src/util.rs index 01304856d2..497999af6f 100644 --- a/crates/relayer/src/util.rs +++ b/crates/relayer/src/util.rs @@ -22,11 +22,27 @@ pub async fn create_grpc_client( 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.clone()) - .tls_config(tls_config) - .map_err(crate::error::Error::grpc_transport)? + let builder = tonic::transport::Channel::builder(grpc_addr.clone()); + + // Don't configures TLS for the endpoint if using IPv6 + let builder = if is_ipv6(grpc_addr) { + builder + } else { + builder + .tls_config(tls_config) + .map_err(crate::error::Error::grpc_transport)? + }; + let channel = builder .connect() .await .map_err(crate::error::Error::grpc_transport)?; Ok(client_constructor(channel)) } + +fn is_ipv6(uri: &tonic::transport::Uri) -> bool { + if let Some(host) = uri.host() { + host.starts_with('[') && host.ends_with(']') + } else { + false + } +} diff --git a/tools/test-framework/src/bootstrap/init.rs b/tools/test-framework/src/bootstrap/init.rs index 795f19787c..07e653771f 100644 --- a/tools/test-framework/src/bootstrap/init.rs +++ b/tools/test-framework/src/bootstrap/init.rs @@ -50,6 +50,11 @@ pub fn init_test() -> Result { let compat_modes = env::var("COMPAT_MODES").ok().map(parse_chain_command_paths); + let ipv6_grpc = env::var("IPV6_GRPC") + .ok() + .map(|val| val == "true") + .unwrap_or(false); + let account_prefixes = parse_chain_command_paths(account_prefix); let native_tokens = parse_chain_command_paths(native_token); @@ -72,6 +77,7 @@ pub fn init_test() -> Result { hang_on_fail, bootstrap_with_random_ids: false, native_tokens, + ipv6_grpc, compat_modes, }) } diff --git a/tools/test-framework/src/bootstrap/single.rs b/tools/test-framework/src/bootstrap/single.rs index 508d0b28ba..c7570ad0c3 100644 --- a/tools/test-framework/src/bootstrap/single.rs +++ b/tools/test-framework/src/bootstrap/single.rs @@ -112,7 +112,11 @@ pub fn bootstrap_single_node( let minimum_gas = format!("0{}", native_token); chain_driver.update_chain_config("app.toml", |config| { - config::set_grpc_port(config, chain_driver.grpc_port)?; + if builder.ipv6_grpc { + config::set_grpc_port_ipv6(config, chain_driver.grpc_port)?; + } else { + config::set_grpc_port(config, chain_driver.grpc_port)?; + } config::enable_grpc(config)?; config::disable_grpc_web(config)?; config::disable_api(config)?; diff --git a/tools/test-framework/src/chain/builder.rs b/tools/test-framework/src/chain/builder.rs index ff23be521f..89895dd274 100644 --- a/tools/test-framework/src/chain/builder.rs +++ b/tools/test-framework/src/chain/builder.rs @@ -45,6 +45,8 @@ pub struct ChainBuilder { pub compat_modes: Option>, + pub ipv6_grpc: bool, + pub runtime: Arc, } @@ -58,6 +60,7 @@ impl ChainBuilder { account_prefixes: Vec, native_tokens: Vec, compat_modes: Option>, + ipv6_grpc: bool, runtime: Arc, ) -> Self { Self { @@ -66,6 +69,7 @@ impl ChainBuilder { account_prefixes, native_tokens, compat_modes, + ipv6_grpc, runtime, } } @@ -80,6 +84,7 @@ impl ChainBuilder { config.account_prefixes.clone(), config.native_tokens.clone(), config.compat_modes.clone(), + config.ipv6_grpc, runtime, ) } @@ -146,6 +151,7 @@ impl ChainBuilder { self.runtime.clone(), self.native_tokens[native_token_number].clone(), compat_mode, + self.ipv6_grpc, )?; Ok(driver) diff --git a/tools/test-framework/src/chain/config.rs b/tools/test-framework/src/chain/config.rs index 9d98f9702d..3cdf1c3877 100644 --- a/tools/test-framework/src/chain/config.rs +++ b/tools/test-framework/src/chain/config.rs @@ -45,6 +45,17 @@ pub fn set_grpc_port(config: &mut Value, port: u16) -> Result<(), Error> { Ok(()) } +pub fn set_grpc_port_ipv6(config: &mut Value, port: u16) -> Result<(), Error> { + config + .get_mut("grpc") + .ok_or_else(|| eyre!("expect grpc section"))? + .as_table_mut() + .ok_or_else(|| eyre!("expect object"))? + .insert("address".to_string(), format!("[::]:{port}").into()); + + Ok(()) +} + pub fn disable_grpc_web(config: &mut Value) -> Result<(), Error> { if let Some(field) = config.get_mut("grpc-web") { field diff --git a/tools/test-framework/src/chain/driver.rs b/tools/test-framework/src/chain/driver.rs index 85830caf5e..ace13e8f5f 100644 --- a/tools/test-framework/src/chain/driver.rs +++ b/tools/test-framework/src/chain/driver.rs @@ -98,6 +98,8 @@ pub struct ChainDriver { pub runtime: Arc, pub compat_mode: Option, + + pub ipv6_grpc: bool, } impl ExportEnv for ChainDriver { @@ -125,12 +127,18 @@ impl ChainDriver { runtime: Arc, native_token: String, compat_mode: Option, + ipv6_grpc: bool, ) -> Result { + let grpc_address = if ipv6_grpc { + format!("http://[::1]:{grpc_port}") + } else { + format!("http://localhost:{grpc_port}") + }; let tx_config = new_tx_config_for_test( chain_id.clone(), chain_type.clone(), format!("http://localhost:{rpc_port}"), - format!("http://localhost:{grpc_port}"), + grpc_address, chain_type.address_type(), native_token, )?; @@ -149,6 +157,7 @@ impl ChainDriver { tx_config, runtime, compat_mode, + ipv6_grpc, }) } @@ -164,7 +173,11 @@ impl ChainDriver { /// Returns the full URL for the GRPC address. pub fn grpc_address(&self) -> String { - format!("http://localhost:{}", self.grpc_port) + if self.ipv6_grpc { + format!("http://[::1]:{}", self.grpc_port) + } else { + format!("http://127.0.0.1:{}", self.grpc_port) + } } /** @@ -186,7 +199,11 @@ impl ChainDriver { as it requires no scheme to be specified. */ pub fn grpc_listen_address(&self) -> String { - format!("localhost:{}", self.grpc_port) + if self.ipv6_grpc { + format!("[::1]:{}", self.grpc_port) + } else { + format!("127.0.0.1:{}", self.grpc_port) + } } /** diff --git a/tools/test-framework/src/types/config.rs b/tools/test-framework/src/types/config.rs index a586c46e84..ff0889465b 100644 --- a/tools/test-framework/src/types/config.rs +++ b/tools/test-framework/src/types/config.rs @@ -34,6 +34,8 @@ pub struct TestConfig { pub compat_modes: Option>, + pub ipv6_grpc: bool, + /** The directory path for storing the chain and relayer files. Defaults to `"data"`. This can be overridden with the `$CHAIN_STORE_DIR` From dfb98dd97f2f0bbdffacbe379ef643613294515a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:11:16 +0100 Subject: [PATCH 201/224] Bump regex from 1.11.0 to 1.11.1 (#4225) Bumps [regex](https://github.com/rust-lang/regex) from 1.11.0 to 1.11.1. - [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.11.0...1.11.1) --- 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 e2ce18f2fc..fc207c5cef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2500,9 +2500,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 97e40befb7..072de19099 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.11.0" +regex = "1.11.1" reqwest = { version = "0.11.27", default-features = false } retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" From 1041b68fc2173295f1dddb5775f0377a837383d3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:11:50 +0100 Subject: [PATCH 202/224] Bump bytes from 1.7.2 to 1.8.0 (#4226) Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.7.2 to 1.8.0. - [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.7.2...v1.8.0) --- 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 fc207c5cef..6c0bf9726d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -478,9 +478,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" dependencies = [ "serde", ] diff --git a/Cargo.toml b/Cargo.toml index 072de19099..801e8f52e0 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.7.2" +bytes = "1.8.0" clap = "3.2" clap_complete = "3.2" color-eyre = "0.6" From 332bc3a212e8f21bcf2e8445f0c31c69be27689e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 09:12:24 +0100 Subject: [PATCH 203/224] Bump thiserror from 1.0.64 to 1.0.65 (#4227) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.64 to 1.0.65. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.64...1.0.65) --- 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 6c0bf9726d..2b065f6b33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3532,18 +3532,18 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 801e8f52e0..d6bafb96dd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -103,7 +103,7 @@ signature = "2.1.0" strum = "0.25" subtle-encoding = "0.5.1" test-log = "0.2.14" -thiserror = "1.0.64" +thiserror = "1.0.65" time = "0.3" tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } From 48a13a4bdebb6a40ad2f38c22dafdb2adbec0c0e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Oct 2024 11:01:44 +0100 Subject: [PATCH 204/224] Bump anyhow from 1.0.90 to 1.0.91 (#4228) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.90 to 1.0.91. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.90...1.0.91) --- 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> Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2b065f6b33..b4254a2b20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,9 +116,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.90" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "arc-swap" From ef36b6a9c925a306a4b14be25408f190c0e4a394 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:03:03 +0100 Subject: [PATCH 205/224] Bump once_cell from 1.19.0 to 1.20.2 (#4236) Bumps [once_cell](https://github.com/matklad/once_cell) from 1.19.0 to 1.20.2. - [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md) - [Commits](https://github.com/matklad/once_cell/compare/v1.19.0...v1.20.2) --- updated-dependencies: - dependency-name: once_cell 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 b4254a2b20..657309e62b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2090,9 +2090,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" diff --git a/Cargo.toml b/Cargo.toml index d6bafb96dd..5b8f2a9308 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -78,7 +78,7 @@ itertools = "0.13.0" moka = "0.12.8" num-bigint = "0.4" num-rational = "0.4.1" -once_cell = "1.19.0" +once_cell = "1.20.2" oneline-eyre = "0.1" opentelemetry = "0.19.0" opentelemetry-prometheus = "0.12.0" From 0df6d6331a0f05d7206acc3acb209f113cc97563 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:04:16 +0100 Subject: [PATCH 206/224] Bump serde from 1.0.210 to 1.0.214 (#4235) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.210 to 1.0.214. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.210...v1.0.214) --- 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 | 50 +++++++++++++++++++++++++------------------------- Cargo.toml | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 657309e62b..55af528b70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -157,7 +157,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -168,7 +168,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -724,7 +724,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -792,7 +792,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -1125,7 +1125,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -2278,7 +2278,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -2397,7 +2397,7 @@ dependencies = [ "itertools", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -2909,9 +2909,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] @@ -2937,13 +2937,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -2976,7 +2976,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -3035,7 +3035,7 @@ checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -3211,7 +3211,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -3248,9 +3248,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.76" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -3521,7 +3521,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -3547,7 +3547,7 @@ checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -3659,7 +3659,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -3846,7 +3846,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -4130,7 +4130,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -4164,7 +4164,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4401,7 +4401,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] [[package]] @@ -4421,5 +4421,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.76", + "syn 2.0.87", ] diff --git a/Cargo.toml b/Cargo.toml index 5b8f2a9308..7e6089a72e 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.210" +serde = "1.0.214" serde_derive = "1.0.104" serde_json = "1.0.132" serde_yaml = "0.9.34" From 42531c5da766a4c7d55d3354102b543dbbde8fef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:05:20 +0100 Subject: [PATCH 207/224] Bump anyhow from 1.0.91 to 1.0.92 (#4233) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.91 to 1.0.92. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.91...1.0.92) --- 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 55af528b70..8850ba14ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -116,9 +116,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.91" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +checksum = "74f37166d7d48a0284b99dd824694c26119c700b53bf0d1540cdb147dbdaaf13" [[package]] name = "arc-swap" From c53a316952497469433793bed3bfc968ab5bb14c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:15:12 +0100 Subject: [PATCH 208/224] Bump thiserror from 1.0.65 to 1.0.68 (#4234) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.65 to 1.0.68. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.65...1.0.68) --- 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> Co-authored-by: Luca Joss <43531661+ljoss17@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 8850ba14ce..3b69c2fe11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3532,18 +3532,18 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 7e6089a72e..95c0b27bde 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -103,7 +103,7 @@ signature = "2.1.0" strum = "0.25" subtle-encoding = "0.5.1" test-log = "0.2.14" -thiserror = "1.0.65" +thiserror = "1.0.68" time = "0.3" tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } From c3105e928892414e359285f9d802bca3e9f5b1b0 Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Wed, 6 Nov 2024 10:45:38 +0100 Subject: [PATCH 209/224] Submit misbehaviour messages using the CCV consumer id (Permissionless ICS) (#4182) * Submit misbehaviour messages using the CCV consumer id (Permissionless ICS) * Use Gaia v20 for ICS light client attack integration test * Fix new clippy warnings * Update flake.nix * Update expedited voting period as well * wip * wip * Integrate with tendermint-rs fix for evidence reporting * Update tendermint-rs * Update cosmos.nix * Update tendermint-rs * Fix evidence submission * Fix build * Update double sign test on CI * Skip localhost clients * Codespell fix * Fix error post merge * Update light client attack test scripts with permissionless ics * Use pull mode for light client attack test * Add RPC debug when running Hermes in evidence mode in light client attack test * Nix flake update * Bump ibc-proto to v0.49.1 * Fix governance proposal submission with SDK v0.50 * Use Cosmos Nix main branch * Use tendermint-rs v0.40.0 and ibc-proto-rs v0.51.0 * Fix cargo doc hyper link warning * nit * Nix flake update * Add changelog entry * Fix compatibility with interchain-security v6.3.0 * Refactor submit_light_client_attack_evidence * Update crates/relayer/src/chain/cosmos.rs Co-authored-by: Anca Zamfir Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> * Use fetch_ccv_consumer_id in submit_duplicate_vote_evidence to verify if chain is consumer * Move query_ccv_consumer_id to Chain Handle trait --------- Signed-off-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Luca Joss Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Anca Zamfir --- ...3-update-misbehaviour-to-permissionless.md | 2 + .github/workflows/misbehaviour.yml | 20 +- Cargo.lock | 80 +-- Cargo.toml | 21 +- ci/misbehaviour-ics/double_sign_test.sh | 500 +++++++++++------- .../light_client_attack_freeze_test.sh | 199 ++++++- .../light_client_attack_test.sh | 201 ++++++- crates/relayer-cli/src/commands/evidence.rs | 106 ++-- .../ics28_ccv/msgs/ccv_double_voting.rs | 4 + .../ics28_ccv/msgs/ccv_misbehaviour.rs | 4 + .../src/applications/ics28_ccv/msgs/mod.rs | 49 ++ .../src/applications/ics31_icq/response.rs | 4 +- .../src/applications/transfer/error.rs | 3 +- .../src/applications/transfer/msgs/send.rs | 6 +- .../clients/ics07_tendermint/client_state.rs | 6 +- .../src/core/ics02_client/error.rs | 17 +- .../src/core/ics02_client/events.rs | 5 +- .../src/core/ics26_routing/error.rs | 2 +- crates/relayer/src/chain/cosmos.rs | 55 +- crates/relayer/src/chain/cosmos/encode.rs | 1 + .../relayer/src/chain/cosmos/query/account.rs | 15 +- .../relayer/src/chain/cosmos/query/balance.rs | 1 + crates/relayer/src/chain/endpoint.rs | 5 +- crates/relayer/src/chain/handle.rs | 12 +- crates/relayer/src/chain/handle/base.rs | 26 +- crates/relayer/src/chain/handle/cache.rs | 12 +- crates/relayer/src/chain/handle/counting.rs | 12 +- crates/relayer/src/chain/runtime.rs | 30 +- crates/relayer/src/config/compat_mode.rs | 96 +--- crates/relayer/src/error.rs | 5 + crates/relayer/src/foreign_client.rs | 56 +- crates/relayer/src/upgrade_chain.rs | 1 + crates/relayer/src/util/compat_mode.rs | 17 +- flake.lock | 70 ++- flake.nix | 7 +- tools/test-framework/src/chain/driver.rs | 2 +- tools/test-framework/src/chain/tagged.rs | 2 +- tools/test-framework/src/relayer/chain.rs | 7 +- 38 files changed, 1100 insertions(+), 561 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/4153-update-misbehaviour-to-permissionless.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4153-update-misbehaviour-to-permissionless.md b/.changelog/unreleased/improvements/ibc-relayer/4153-update-misbehaviour-to-permissionless.md new file mode 100644 index 0000000000..65bbfe1c77 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/4153-update-misbehaviour-to-permissionless.md @@ -0,0 +1,2 @@ +- Use CCV consumer ID to submit misbehaviour messages + ([\#4153](https://github.com/informalsystems/hermes/issues/4153)) \ No newline at end of file diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index 43dfc6635d..135ef7c9a1 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -43,20 +43,20 @@ jobs: fail-fast: false matrix: chain: - - package: gaia18 + - package: gaia20 command: gaiad account_prefix: cosmos steps: - uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - with: + 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: + with: name: cosmos-nix - name: Install sconfig uses: jaxxstorm/action-install-gh-release@v1.12.0 @@ -102,13 +102,13 @@ jobs: - uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - with: + 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: + with: name: cosmos-nix - name: Install sconfig uses: jaxxstorm/action-install-gh-release@v1.12.0 @@ -154,13 +154,13 @@ jobs: - uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - with: + 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: + with: name: cosmos-nix - name: Install sconfig uses: jaxxstorm/action-install-gh-release@v1.12.0 @@ -193,7 +193,6 @@ jobs: run: | nix shell .#${{ matrix.chain.package }} -c bash light_client_attack_freeze_test.sh - ics-double-sign: runs-on: ubuntu-20.04 timeout-minutes: 20 @@ -207,13 +206,13 @@ jobs: - uses: actions/checkout@v4 - name: Install Nix uses: DeterminateSystems/nix-installer-action@main - with: + 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: + with: name: cosmos-nix - name: Install sconfig uses: jaxxstorm/action-install-gh-release@v1.12.0 @@ -245,4 +244,3 @@ jobs: working-directory: ci/misbehaviour-ics run: | nix shell .#${{ matrix.chain.package }} -c bash double_sign_test.sh - diff --git a/Cargo.lock b/Cargo.lock index 3b69c2fe11..72866405bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -639,6 +639,19 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "cosmos-sdk-proto" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c1a5856db92cd90dddc955bce308703d3519fb33ae3d0b8f3658e9cfd05c3f" +dependencies = [ + "informalsystems-pbjson", + "prost", + "serde", + "tendermint-proto", + "tonic", +] + [[package]] name = "cpufeatures" version = "0.2.13" @@ -1549,12 +1562,13 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.47.1" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c852d22b782d2d793f4a646f968de419be635e02bc8798d5d74a6e44eef27733" +checksum = "07b9db9a33cb15d6eb56105cd9b70db016e56bcae74a8adaa1627e5b24d1f1d2" dependencies = [ "base64 0.22.1", "bytes", + "cosmos-sdk-proto", "flex-error", "ics23", "informalsystems-pbjson", @@ -2400,15 +2414,6 @@ dependencies = [ "syn 2.0.87", ] -[[package]] -name = "prost-types" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee5168b05f49d4b0ca581206eb14a7b22fafd963efe729ac48eb03266e25cc2" -dependencies = [ - "prost", -] - [[package]] name = "protobuf" version = "2.28.0" @@ -2723,6 +2728,19 @@ dependencies = [ "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.1.3", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -3323,9 +3341,9 @@ dependencies = [ [[package]] name = "tendermint" -version = "0.38.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "505d9d6ffeb83b1de47c307c6e0d2dff56c6256989299010ad03cd80a8491e97" +checksum = "37d513ce7f9e41c67ab2dd3d554ef65f36fbcc61745af1e1f93eafdeefa1ce37" dependencies = [ "bytes", "digest 0.10.7", @@ -3337,7 +3355,6 @@ dependencies = [ "num-traits", "once_cell", "prost", - "prost-types", "ripemd", "serde", "serde_bytes", @@ -3354,9 +3371,9 @@ dependencies = [ [[package]] name = "tendermint-config" -version = "0.38.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de111ea653b2adaef627ac2452b463c77aa615c256eaaddf279ec5a1cf9775f" +checksum = "4de4e66e78c6bfb768993e69c4fc5333dbc863f6d54ebd7a5d08d91556768087" dependencies = [ "flex-error", "serde", @@ -3368,9 +3385,9 @@ dependencies = [ [[package]] name = "tendermint-light-client" -version = "0.38.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91e5abb448c65e8abdfe0e17a3a189e005a71b4169b89f36aaa2053ff239577" +checksum = "3e88c08a112db05101396a79f71c017d7dbf548dc21614f82251f17ecbe5d5e8" dependencies = [ "contracts", "crossbeam-channel", @@ -3393,9 +3410,9 @@ dependencies = [ [[package]] name = "tendermint-light-client-detector" -version = "0.38.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1ac1607eb7a3393313558b339c36eebeba15aa7f2d101d1d47299e65825152" +checksum = "d48a431ea923182c37ca9f3cc8333490ac6746a64520d1c4a3dd18c08b0806ac" dependencies = [ "crossbeam-channel", "derive_more", @@ -3416,9 +3433,9 @@ dependencies = [ [[package]] name = "tendermint-light-client-verifier" -version = "0.38.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2674adbf0dc51aa0c8eaf8462c7d6692ec79502713e50ed5432a442002be90" +checksum = "7affc5fffe9df158185e15bce3e47fc3a0c901e6708f3b7d33f0867d7aef8ce1" dependencies = [ "derive_more", "flex-error", @@ -3429,14 +3446,13 @@ dependencies = [ [[package]] name = "tendermint-proto" -version = "0.38.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ed14abe3b0502a3afe21ca74ca5cdd6c7e8d326d982c26f98a394445eb31d6e" +checksum = "c81ba1b023ec00763c3bc4f4376c67c0047f185cccf95c416c7a2f16272c4cbb" dependencies = [ "bytes", "flex-error", "prost", - "prost-types", "serde", "serde_bytes", "subtle-encoding", @@ -3445,9 +3461,9 @@ dependencies = [ [[package]] name = "tendermint-rpc" -version = "0.38.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f96a2b8a0d3d0b59e4024b1a6bdc1589efc6af4709d08a480a20cc4ba90f63" +checksum = "4d3ec9d6a266cb079a44272189b5a033227d058ab28659722557c1f7fed6b83c" dependencies = [ "async-trait", "async-tungstenite", @@ -3479,9 +3495,9 @@ dependencies = [ [[package]] name = "tendermint-testgen" -version = "0.38.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae007e2918414ae96e4835426aace7538d23b8ddf96d71e23d241f58f386e877" +checksum = "7d97c36f54bf8754292166604e0c1a16cdbac3c7a2b59cb866f068b25fb0c811" dependencies = [ "ed25519-consensus", "gumdrop", @@ -3763,9 +3779,9 @@ 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", @@ -3782,7 +3798,7 @@ dependencies = [ "percent-encoding", "pin-project", "prost", - "rustls-native-certs 0.7.3", + "rustls-native-certs 0.8.0", "rustls-pemfile 2.1.3", "socket2", "tokio", diff --git a/Cargo.toml b/Cargo.toml index 95c0b27bde..b69d6c052e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,14 +29,19 @@ 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" } +# IBC dependencies +ibc-proto = "0.51.0" +ics23 = "0.12.0" + # Tendermint dependencies -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" } +tendermint = { version = "0.40.0", default-features = false } +tendermint-light-client = { version = "0.40.0", default-features = false } +tendermint-light-client-detector = { version = "0.40.0", default-features = false } +tendermint-light-client-verifier = { version = "0.40.0", default-features = false } +tendermint-proto = { version = "0.40.0" } +tendermint-rpc = { version = "0.40.0" } +tendermint-testgen = { version = "0.40.0" } + # Other dependencies abscissa_core = "=0.6.0" @@ -72,8 +77,6 @@ hex = "0.4.3" http = "1.0.0" humantime = "2.1.0" humantime-serde = "1.1.1" -ibc-proto = "0.47.1" -ics23 = "0.12.0" itertools = "0.13.0" moka = "0.12.8" num-bigint = "0.4" diff --git a/ci/misbehaviour-ics/double_sign_test.sh b/ci/misbehaviour-ics/double_sign_test.sh index 3685868433..4829f59c0f 100644 --- a/ci/misbehaviour-ics/double_sign_test.sh +++ b/ci/misbehaviour-ics/double_sign_test.sh @@ -1,6 +1,10 @@ #!/bin/bash # shellcheck disable=2086,2004 +## Prerequisites: +# * ICS v6.x +# * Hermes v1.10.3+45a29cc00 + set -eu DEBUG=${DEBUG:-false} @@ -9,13 +13,6 @@ if [ "$DEBUG" = true ]; then set -x fi -# User balance of stake tokens -USER_COINS="100000000000stake" -# Amount of stake tokens staked -STAKE="100000000stake" -# Node IP address -NODE_IP="127.0.0.1" - # Home directory HOME_DIR="/tmp/hermes-ics-double-sign" @@ -25,11 +22,19 @@ if [ "$DEBUG" = true ]; then else HERMES_DEBUG="" fi + # Hermes config HERMES_CONFIG="$HOME_DIR/hermes.toml" # Hermes binary HERMES_BIN="cargo run -q --bin hermes -- $HERMES_DEBUG --config $HERMES_CONFIG" +# User balance of stake tokens +USER_COINS="100000000000stake" +# Amount of stake tokens staked +STAKE="100000000stake" +# Node IP address +NODE_IP="127.0.0.1" + # Validator moniker MONIKERS=("coordinator" "alice" "bob") LEAD_VALIDATOR_MONIKER="coordinator" @@ -51,13 +56,8 @@ CLIENT_BASEPORT=29220 # Clean start pkill -f interchain-security-pd &> /dev/null || true -pkill -f interchain-security-cd &> /dev/null || true -pkill -f hermes &> /dev/null || true sleep 1 - -mkdir -p "${HOME_DIR}" -rm -rf "${PROV_NODES_ROOT_DIR}" -rm -rf "${CONS_NODES_ROOT_DIR}" +rm -rf ${PROV_NODES_ROOT_DIR} # Let lead validator create genesis file LEAD_VALIDATOR_PROV_DIR=${PROV_NODES_ROOT_DIR}/provider-${LEAD_VALIDATOR_MONIKER} @@ -70,7 +70,6 @@ do MONIKER=${MONIKERS[$index]} # validator key PROV_KEY=${MONIKER}-key - PROV_KEY2=${MONIKER}-key2 # home directory of this validator on provider PROV_NODE_DIR=${PROV_NODES_ROOT_DIR}/provider-${MONIKER} @@ -80,16 +79,17 @@ do # Build genesis file and node directory structure interchain-security-pd init $MONIKER --chain-id provider --home ${PROV_NODE_DIR} - jq ".app_state.gov.params.voting_period = \"5s\" | .app_state.staking.params.unbonding_time = \"86400s\"" \ + jq ".app_state.gov.params.voting_period = \"10s\" \ + | .app_state.gov.params.expedited_voting_period = \"9s\" \ + | .app_state.staking.params.unbonding_time = \"86400s\" \ + | .app_state.provider.params.blocks_per_epoch = \"5\"" \ ${PROV_NODE_DIR}/config/genesis.json > \ ${PROV_NODE_DIR}/edited_genesis.json && mv ${PROV_NODE_DIR}/edited_genesis.json ${PROV_NODE_DIR}/config/genesis.json - sleep 1 # Create account keypair - interchain-security-pd keys add $PROV_KEY --home ${PROV_NODE_DIR} --keyring-backend test --output json > ${PROV_NODE_DIR}/${PROV_KEY}.json 2>&1 - interchain-security-pd keys add $PROV_KEY2 --home ${PROV_NODE_DIR} --keyring-backend test --output json > ${PROV_NODE_DIR}/${PROV_KEY2}.json 2>&1 + interchain-security-pd keys add $PROV_KEY --home ${PROV_NODE_DIR} --keyring-backend test --output json > ${PROV_NODE_DIR}/${PROV_KEY}.json 2>&1 sleep 1 # copy genesis in, unless this validator is the lead validator @@ -100,9 +100,6 @@ do # Add stake to user PROV_ACCOUNT_ADDR=$(jq -r '.address' ${PROV_NODE_DIR}/${PROV_KEY}.json) interchain-security-pd genesis add-genesis-account $PROV_ACCOUNT_ADDR $USER_COINS --home ${PROV_NODE_DIR} --keyring-backend test - - PROV_ACCOUNT_ADDR2=$(jq -r '.address' ${PROV_NODE_DIR}/${PROV_KEY2}.json) - interchain-security-pd genesis add-genesis-account $PROV_ACCOUNT_ADDR2 $USER_COINS --home ${PROV_NODE_DIR} --keyring-backend test sleep 1 # copy genesis out, unless this validator is the lead validator @@ -141,10 +138,10 @@ do fi # Stake 1/1000 user's coins - interchain-security-pd genesis gentx $PROV_KEY $STAKE --chain-id provider --home ${PROV_NODE_DIR} --keyring-backend test --moniker $MONIKER + interchain-security-pd genesis gentx $PROV_KEY $STAKE --chain-id provider --home ${PROV_NODE_DIR} --keyring-backend test --moniker $MONIKER sleep 1 - # Copy gentxs to the lead validator for possible future collection. + # Copy gentxs to the lead validator for possible future collection. # Obviously we don't need to copy the first validator's gentx to itself if [ $MONIKER != $LEAD_VALIDATOR_MONIKER ]; then cp ${PROV_NODE_DIR}/config/gentx/* ${LEAD_VALIDATOR_PROV_DIR}/config/gentx/ @@ -183,7 +180,6 @@ do # validator key PROV_KEY=${MONIKER}-key - PROV_KEY2=${MONIKER}-key2 # home directory of this validator on provider PROV_NODE_DIR=${PROV_NODES_ROOT_DIR}/provider-${MONIKER} @@ -219,89 +215,217 @@ do done # Build consumer chain proposal file -tee ${LEAD_VALIDATOR_PROV_DIR}/consumer-proposal.json< /dev/null || true +sleep 1 +rm -rf ${CONS_NODES_ROOT_DIR} + for index in "${!MONIKERS[@]}" do MONIKER=${MONIKERS[$index]} # validator key PROV_KEY=${MONIKER}-key - PROV_KEY2=${MONIKER}-key2 PROV_NODE_DIR=${PROV_NODES_ROOT_DIR}/provider-${MONIKER} @@ -314,8 +438,7 @@ do sleep 1 # Create account keypair - interchain-security-cd keys add $PROV_KEY --home ${CONS_NODE_DIR} --keyring-backend test --output json > ${CONS_NODE_DIR}/${PROV_KEY}.json 2>&1 - interchain-security-cd keys add $PROV_KEY2 --home ${CONS_NODE_DIR} --keyring-backend test --output json > ${CONS_NODE_DIR}/${PROV_KEY2}.json 2>&1 + interchain-security-cd keys add $PROV_KEY --home ${CONS_NODE_DIR} --keyring-backend test --output json > ${CONS_NODE_DIR}/${PROV_KEY}.json 2>&1 sleep 1 # copy genesis in, unless this validator is the lead validator @@ -326,15 +449,15 @@ do # Add stake to user CONS_ACCOUNT_ADDR=$(jq -r '.address' ${CONS_NODE_DIR}/${PROV_KEY}.json) interchain-security-cd genesis add-genesis-account $CONS_ACCOUNT_ADDR $USER_COINS --home ${CONS_NODE_DIR} - CONS_ACCOUNT_ADDR2=$(jq -r '.address' ${CONS_NODE_DIR}/${PROV_KEY2}.json) - interchain-security-cd genesis add-genesis-account $CONS_ACCOUNT_ADDR2 $USER_COINS --home ${CONS_NODE_DIR} - sleep 10 ### this probably does not have to be done for each node # Add consumer genesis states to genesis file RPC_LADDR_PORT=$(($RPC_LADDR_BASEPORT + $index)) RPC_LADDR=tcp://${NODE_IP}:${RPC_LADDR_PORT} - interchain-security-pd query provider consumer-genesis consumer --home ${PROV_NODE_DIR} --node ${RPC_LADDR} -o json > consumer_gen.json + interchain-security-pd query provider consumer-genesis $CONSUMER_ID \ + --home ${PROV_NODE_DIR} \ + --node ${RPC_LADDR} -o json > consumer_gen.json + jq -s '.[0].app_state.ccvconsumer = .[1] | .[0]' ${CONS_NODE_DIR}/config/genesis.json consumer_gen.json > ${CONS_NODE_DIR}/edited_genesis.json \ && mv ${CONS_NODE_DIR}/edited_genesis.json ${CONS_NODE_DIR}/config/genesis.json rm consumer_gen.json @@ -376,7 +499,6 @@ done sleep 1 - for index in "${!MONIKERS[@]}" do MONIKER=${MONIKERS[$index]} @@ -437,42 +559,13 @@ do sleep 6 done -## Cause double signing - -# create directory for double signing node -mkdir $CONS_NODES_ROOT_DIR/consumer-bob-sybil/ -cp -r $CONS_NODES_ROOT_DIR/consumer-bob/* $CONS_NODES_ROOT_DIR/consumer-bob-sybil - -# clear state in consumer-bob-sybil -echo '{"height": "0","round": 0,"step": 0,"signature":"","signbytes":""}' > $CONS_NODES_ROOT_DIR/consumer-bob-sybil/data/priv_validator_state.json - -# add new node key to sybil -# key was generated using gaiad init -# if the node key is not unique, double signing cannot be achieved -# and errors such as this can be seen in the terminal -# 5:54PM ERR found conflicting vote from ourselves; did you unsafe_reset a validator? height=1961 module=consensus round=0 type=2 -# 5:54PM ERR failed to process message err="conflicting votes from validator C888306A908A217B9A943D1DAD8790044D0947A4" -echo '{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"tj55by/yYwruSz4NxsOG9y9k2WrPvKLXKQdz/9jL9Uptmi647OYpcisjwf92TyA+wCUYVDOgW7D53Q+638l9/w=="}}' > $CONS_NODES_ROOT_DIR/consumer-bob-sybil/config/node_key.json - -# does not use persistent peers; will do a lookup in genesis.json to find peers -#ARGS="--address tcp://$CHAIN_PREFIX.252:26655 --rpc.laddr tcp://$CHAIN_PREFIX.252:26658 --grpc.address $CHAIN_PREFIX.252:9091 --log_level trace --p2p.laddr tcp://$CHAIN_PREFIX.252:26656 --grpc-web.enable=false" - -# start double signing node - it should not talk to the node with the same key -#ip netns exec $HOME/nodes/consumer/consumer-bob-sybil $BIN $ARGS --home $HOME/nodes/consumer/consumer-bob-sybil start &> $HOME/nodes/consumer/consumer-bob-sybil/logs & - -# Start gaia -interchain-security-cd start \ - --home $CONS_NODES_ROOT_DIR/consumer-bob-sybil \ - --p2p.persistent_peers ${PERSISTENT_PEERS} \ - --rpc.laddr tcp://${NODE_IP}:29179 \ - --grpc.address ${NODE_IP}:29199 \ - --address tcp://${NODE_IP}:29209 \ - --p2p.laddr tcp://${NODE_IP}:29189 \ - --grpc-web.enable=false &> $CONS_NODES_ROOT_DIR/consumer-bob-sybil/logs & +## Setup Hermes -# Setup Hermes config file +HERMES_PROV_NODE_DIR=${PROV_NODES_ROOT_DIR}/provider-${HERMES_VALIDATOR_MONIKER} +HERMES_KEY=${HERMES_VALIDATOR_MONIKER}-key +HERMES_CONS_NODE_DIR=${CONS_NODES_ROOT_DIR}/consumer-${HERMES_VALIDATOR_MONIKER} -tee $HERMES_CONFIG< $HOME_DIR/hermes-start-logs.txt & +sleep 5 + +## Cause double signing + +CONS_NODE_SYBIL_DIR=${CONS_NODES_ROOT_DIR}/consumer-${MONIKER}-sybil + +# create directory for double signing node +mkdir $CONS_NODE_SYBIL_DIR +cp -r $CONS_NODE_DIR/* $CONS_NODE_SYBIL_DIR + +# clear state in sybil node directory +echo '{"height": "0","round": 0,"step": 0,"signature":"","signbytes":""}' \ + > $CONS_NODE_SYBIL_DIR/data/priv_validator_state.json + +# add new node key to sybil +# key was generated using gaiad init +# if the node key is not unique, double signing cannot be achieved +# and errors such as this can be seen in the terminal +# 5:54PM ERR found conflicting vote from ourselves; did you unsafe_reset a validator? height=1961 module=consensus round=0 type=2 +# 5:54PM ERR failed to process message err="conflicting votes from validator C888306A908A217B9A943D1DAD8790044D0947A4" +echo '{"priv_key":{"type":"tendermint/PrivKeyEd25519","value":"tj55by/yYwruSz4NxsOG9y9k2WrPvKLXKQdz/9jL9Uptmi647OYpcisjwf92TyA+wCUYVDOgW7D53Q+638l9/w=="}}' \ + > $CONS_NODE_SYBIL_DIR/config/node_key.json + +# does not use persistent peers; will do a lookup in genesis.json to find peers +# start double signing node - it should not talk to the node with the same key + +# Start gaia +interchain-security-cd start \ + --home ${CONS_NODE_SYBIL_DIR} \ + --rpc.laddr tcp://${NODE_IP}:$((RPC_LADDR_PORT+1)) \ + --grpc.address ${NODE_IP}:$((GRPC_LADDR_PORT+1)) \ + --address tcp://${NODE_IP}:$((NODE_ADDRESS_PORT+1)) \ + --p2p.laddr tcp://${NODE_IP}:$((P2P_LADDR_PORT+1)) \ + --grpc-web.enable=false &> ${CONS_NODE_SYBIL_DIR}/logs & + +sleep 5 + +## start Hermes in evidence mode +$HERMES_BIN evidence --chain consumer --check-past-blocks 0 &> $HOME_DIR/hermes-evidence-logs.txt & -$HERMES_BIN evidence --chain consumer --key-name evidence &> $HOME_DIR/hermes-evidence-logs.txt & +sleep 1 + +# Wait for Hermes to submit double signing evidence +$HERMES_BIN update client --host-chain consumer --client 07-tendermint-0 for _ in $(seq 1 10) do sleep 5 MSG="successfully submitted double voting evidence to chain" - + if grep -c "$MSG" $HOME_DIR/hermes-evidence-logs.txt; then echo "[SUCCESS] Successfully submitted double voting evidence to provider chain" exit 0 @@ -600,9 +717,6 @@ done echo "[ERROR] Failed to submit double voting evidence to provider chain" echo "" echo "---------------------------------------------------------------" -echo "Hermes start logs:" -cat $HOME_DIR/hermes-start-logs.txt -echo "---------------------------------------------------------------" echo "Hermes evidence logs:" cat $HOME_DIR/hermes-evidence-logs.txt echo "---------------------------------------------------------------" diff --git a/ci/misbehaviour-ics/light_client_attack_freeze_test.sh b/ci/misbehaviour-ics/light_client_attack_freeze_test.sh index 24661ace22..2cd1b50f58 100644 --- a/ci/misbehaviour-ics/light_client_attack_freeze_test.sh +++ b/ci/misbehaviour-ics/light_client_attack_freeze_test.sh @@ -85,7 +85,10 @@ rm -rf "${CONS_FORK_NODE_DIR}" # Build genesis file and node directory structure interchain-security-pd init $MONIKER --chain-id provider --home ${PROV_NODE_DIR} -jq ".app_state.gov.params.voting_period = \"5s\" | .app_state.staking.params.unbonding_time = \"86400s\"" \ +jq ".app_state.gov.params.voting_period = \"5s\" \ +| .app_state.gov.params.expedited_voting_period = \"4s\" \ +| .app_state.staking.params.unbonding_time = \"86400s\" \ +| .app_state.provider.params.blocks_per_epoch = \"5\"" \ ${PROV_NODE_DIR}/config/genesis.json > \ ${PROV_NODE_DIR}/edited_genesis.json && mv ${PROV_NODE_DIR}/edited_genesis.json ${PROV_NODE_DIR}/config/genesis.json @@ -160,31 +163,171 @@ interchain-security-pd start \ waiting 10 "for provider sub-node to start" # Build consumer chain proposal file -tee ${PROV_NODE_DIR}/consumer-proposal.json< consumer_gen.json +interchain-security-pd query provider consumer-genesis $CONSUMER_ID --home ${PROV_NODE_DIR} -o json > consumer_gen.json jq -s '.[0].app_state.ccvconsumer = .[1] | .[0]' ${CONS_NODE_DIR}/config/genesis.json consumer_gen.json > ${CONS_NODE_DIR}/edited_genesis.json \ && mv ${CONS_NODE_DIR}/edited_genesis.json ${CONS_NODE_DIR}/config/genesis.json rm consumer_gen.json @@ -296,7 +439,7 @@ rpc_addr = "http://${NODE_IP}:26648" rpc_timeout = "10s" store_prefix = "ibc" trusting_period = "2days" -event_source = { mode = 'push', url = 'ws://${NODE_IP}:26648/websocket' , batch_delay = '50ms' } +event_source = { mode = 'pull', interval = '500ms', max_retries = 4 } [chains.gas_price] denom = "stake" @@ -319,7 +462,7 @@ rpc_addr = "http://${NODE_IP}:26658" rpc_timeout = "10s" store_prefix = "ibc" trusting_period = "2days" -event_source = { mode = 'push', url = 'ws://${NODE_IP}:26658/websocket' , batch_delay = '50ms' } +event_source = { mode = 'pull', interval = '500ms', max_retries = 4 } [chains.gas_price] denom = "stake" @@ -419,7 +562,7 @@ rpc_addr = "http://${NODE_IP}:26638" rpc_timeout = "10s" store_prefix = "ibc" trusting_period = "2days" -event_source = { mode = 'push', url = 'ws://${NODE_IP}:26638/websocket' , batch_delay = '50ms' } +event_source = { mode = 'pull', interval = '500ms', max_retries = 4 } [chains.gas_price] denom = "stake" @@ -442,7 +585,7 @@ rpc_addr = "http://${NODE_IP}:26658" rpc_timeout = "10s" store_prefix = "ibc" trusting_period = "2days" -event_source = { mode = 'push', url = 'ws://${NODE_IP}:26658/websocket' , batch_delay = '50ms' } +event_source = { mode = 'pull', interval = '500ms', max_retries = 4 } [chains.gas_price] denom = "stake" @@ -506,6 +649,7 @@ if [ "$FROZEN_HEIGHT" != "null" ]; then diag "Client is frozen, as expected." else diag "Client is not frozen, aborting." + ${HOME_DIR}/hermes-evidence-logs.txt exit 1 fi @@ -513,6 +657,7 @@ if grep -q "found light client attack evidence" ${HOME_DIR}/hermes-evidence-logs diag "Evidence found, proceeding." else diag "Evidence not found, aborting." + cat ${HOME_DIR}/hermes-evidence-logs.txt exit 1 fi diff --git a/ci/misbehaviour-ics/light_client_attack_test.sh b/ci/misbehaviour-ics/light_client_attack_test.sh index f42982c353..9d5d93c472 100644 --- a/ci/misbehaviour-ics/light_client_attack_test.sh +++ b/ci/misbehaviour-ics/light_client_attack_test.sh @@ -85,7 +85,10 @@ rm -rf "${CONS_FORK_NODE_DIR}" # Build genesis file and node directory structure interchain-security-pd init $MONIKER --chain-id provider --home ${PROV_NODE_DIR} -jq ".app_state.gov.params.voting_period = \"5s\" | .app_state.staking.params.unbonding_time = \"86400s\"" \ +jq ".app_state.gov.params.voting_period = \"5s\" \ +| .app_state.gov.params.expedited_voting_period = \"4s\" \ +| .app_state.staking.params.unbonding_time = \"86400s\" \ +| .app_state.provider.params.blocks_per_epoch = \"5\"" \ ${PROV_NODE_DIR}/config/genesis.json > \ ${PROV_NODE_DIR}/edited_genesis.json && mv ${PROV_NODE_DIR}/edited_genesis.json ${PROV_NODE_DIR}/config/genesis.json @@ -169,33 +172,173 @@ interchain-security-pd start \ waiting 5 "for provider sub-node to start" # Build consumer chain proposal file -tee ${PROV_NODE_DIR}/consumer-proposal.json< consumer_gen.json +interchain-security-pd query provider consumer-genesis $CONSUMER_ID --home ${PROV_NODE_DIR} -o json > consumer_gen.json jq -s '.[0].app_state.ccvconsumer = .[1] | .[0]' ${CONS_NODE_DIR}/config/genesis.json consumer_gen.json > ${CONS_NODE_DIR}/edited_genesis.json \ && mv ${CONS_NODE_DIR}/edited_genesis.json ${CONS_NODE_DIR}/config/genesis.json rm consumer_gen.json @@ -305,7 +448,7 @@ rpc_addr = "http://${NODE_IP}:26648" rpc_timeout = "10s" store_prefix = "ibc" trusting_period = "2days" -event_source = { mode = 'push', url = 'ws://${NODE_IP}:26648/websocket' , batch_delay = '50ms' } +event_source = { mode = 'pull', interval = '500ms', max_retries = 4 } [chains.gas_price] denom = "stake" @@ -328,7 +471,7 @@ rpc_addr = "http://${NODE_IP}:26658" rpc_timeout = "10s" store_prefix = "ibc" trusting_period = "2days" -event_source = { mode = 'push', url = 'ws://${NODE_IP}:26658/websocket' , batch_delay = '50ms' } +event_source = { mode = 'pull', interval = '500ms', max_retries = 4 } [chains.gas_price] denom = "stake" @@ -445,7 +588,7 @@ rpc_addr = "http://${NODE_IP}:26638" rpc_timeout = "10s" store_prefix = "ibc" trusting_period = "2days" -event_source = { mode = 'push', url = 'ws://${NODE_IP}:26638/websocket' , batch_delay = '50ms' } +event_source = { mode = 'pull', interval = '500ms', max_retries = 4 } [chains.gas_price] denom = "stake" @@ -467,7 +610,7 @@ rpc_addr = "http://${NODE_IP}:26658" rpc_timeout = "10s" store_prefix = "ibc" trusting_period = "2days" -event_source = { mode = 'push', url = 'ws://${NODE_IP}:26658/websocket' , batch_delay = '50ms' } +event_source = { mode = 'pull', interval = '500ms', max_retries = 4 } [chains.gas_price] denom = "stake" @@ -479,6 +622,7 @@ event_source = { mode = 'push', url = 'ws://${NODE_IP}:26658/websocket' , batch_ EOF waiting 10 "for a couple blocks" +sleep 5 read -r height hash < <( curl -s "localhost:26648"/commit \ @@ -512,7 +656,7 @@ waiting 10 "for Hermes relayer to start" diag "Running Hermes relayer evidence command" # Run hermes in evidence mode -$HERMES_BIN evidence --chain consumer &> ${HOME_DIR}/hermes-evidence-logs.txt & +$HERMES_BIN --debug=rpc evidence --chain consumer &> ${HOME_DIR}/hermes-evidence-logs.txt & # If we sleep 5 here and above, we end up on the forked block later waiting 10 "for Hermes evidence monitor to start" @@ -555,6 +699,7 @@ if grep -q "found light client attack evidence" ${HOME_DIR}/hermes-evidence-logs diag "Evidence found, proceeding!" else diag "Evidence not found, aborting." + cat ${HOME_DIR}/hermes-evidence-logs.txt exit 1 fi diff --git a/crates/relayer-cli/src/commands/evidence.rs b/crates/relayer-cli/src/commands/evidence.rs index fa54be707b..c74c1286e3 100644 --- a/crates/relayer-cli/src/commands/evidence.rs +++ b/crates/relayer-cli/src/commands/evidence.rs @@ -18,7 +18,7 @@ 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::foreign_client::{fetch_ccv_consumer_id, 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; @@ -318,10 +318,15 @@ fn submit_duplicate_vote_evidence( let signer = counterparty_chain_handle.get_signer()?; - if !is_counterparty_provider(chain, counterparty_chain_handle, counterparty_client_id) { - debug!("counterparty client `{counterparty_client_id}` on chain `{counterparty_chain_id}` is not a CCV client, skipping..."); - return Ok(ControlFlow::Continue(())); - } + let consumer_id = match fetch_ccv_consumer_id(counterparty_chain_handle, counterparty_client_id) + { + Ok(consumer_id) => consumer_id, + Err(e) => { + info!("Failed to query Consumer ID: {e}. \ + Counterparty client `{counterparty_client_id}` on chain `{counterparty_chain_id}` might not be a CCV client, skipping..."); + return Ok(ControlFlow::Continue(())); + } + }; let infraction_height = evidence.vote_a.height; @@ -359,6 +364,7 @@ fn submit_duplicate_vote_evidence( submitter: signer.clone(), duplicate_vote_evidence: evidence.clone(), infraction_block_header, + consumer_id, } .to_any(); @@ -507,42 +513,14 @@ fn submit_light_client_attack_evidence( counterparty.id(), ); - let counterparty_is_provider = - is_counterparty_provider(chain, counterparty, &counterparty_client_id); - let counterparty_client_is_frozen = counterparty_client.is_frozen(); - if !counterparty_is_provider && counterparty_client_is_frozen { - warn!( - "cannot submit light client attack evidence to client `{}` on counterparty chain `{}`", - counterparty_client_id, - counterparty.id() - ); - warn!("reason: client is frozen and chain is not a CCV provider chain"); - - return Ok(()); - } - let signer = counterparty.get_signer()?; let common_height = Height::from_tm(evidence.common_height, chain.id()); let counterparty_has_common_consensus_state = has_consensus_state(counterparty, &counterparty_client_id, common_height); - if counterparty_is_provider - && counterparty_client_is_frozen - && !counterparty_has_common_consensus_state - { - warn!( - "cannot submit light client attack evidence to client `{}` on provider chain `{}`", - counterparty_client_id, - counterparty.id() - ); - warn!("reason: client is frozen and does not have a consensus state at height {common_height}"); - - return Ok(()); - } - let mut msgs = if counterparty_has_common_consensus_state { info!( "skip building update client message for client `{}` on counterparty chain `{}`", @@ -550,8 +528,8 @@ fn submit_light_client_attack_evidence( counterparty.id() ); info!( - "reason: counterparty chain already has consensus state at common height {common_height}" - ); + "reason: counterparty chain already has consensus state at common height {common_height}" + ); Vec::new() } else { @@ -571,21 +549,31 @@ fn submit_light_client_attack_evidence( } }; - if counterparty_is_provider { + if let Ok(consumer_id) = fetch_ccv_consumer_id(counterparty, &counterparty_client_id) { + if counterparty_client_is_frozen && !counterparty_has_common_consensus_state { + warn!( + "cannot submit light client attack evidence to client `{}` on provider chain `{}`", + counterparty_client_id, + counterparty.id() + ); + warn!("reason: client is frozen and does not have a consensus state at height {common_height}"); + + return Ok(()); + } info!( "will submit consumer light client attack evidence to client `{}` on provider chain `{}`", counterparty_client_id, counterparty.id(), ); - - let msg = MsgSubmitIcsConsumerMisbehaviour { - submitter: signer.clone(), - misbehaviour: misbehaviour.clone(), - } - .to_any(); - - msgs.push(msg); - }; + msgs.push( + MsgSubmitIcsConsumerMisbehaviour { + submitter: signer.clone(), + misbehaviour: misbehaviour.clone(), + consumer_id, + } + .to_any(), + ); + } // We do not need to submit the misbehaviour if the client is already frozen. if !counterparty_client_is_frozen { @@ -662,29 +650,6 @@ fn has_consensus_state( res.is_ok() } -/// If the misbehaving chain is a CCV consumer chain, -/// then try fetch the consumer chains of the counterparty chains. -/// If that fails, then the counterparty chain is not a provider chain. -/// Otherwise, check if the misbehaving chain is a consumer of the counterparty chain, -/// which is then definitely a provider. -fn is_counterparty_provider( - chain: &CosmosSdkChain, - counterparty_chain_handle: &BaseChainHandle, - counterparty_client_id: &ClientId, -) -> bool { - if chain.config().ccv_consumer_chain { - let consumer_chains = counterparty_chain_handle - .query_consumer_chains() - .unwrap_or_default(); // If the query fails, use an empty list of consumers - - consumer_chains.iter().any(|(chain_id, client_id)| { - chain_id == chain.id() && client_id == counterparty_client_id - }) - } else { - false - } -} - /// Fetch all the counterparty clients of the given chain. /// A counterparty client is a client that has a connection with that chain. /// @@ -716,6 +681,11 @@ fn fetch_all_counterparty_clients( connection.connection_id ); + if client_id.as_str() == "09-localhost" { + debug!("skipping localhost client `{client_id}`..."); + continue; + } + debug!( "fetching client state for client `{client_id}` on connection `{}`", connection.connection_id 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 a1ce4291d9..9f07f31539 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 @@ -9,6 +9,7 @@ use crate::signer::Signer; use crate::tx_msg::Msg; use super::error::Error; +use super::ConsumerId; pub const ICS_DOUBLE_VOTING_TYPE_URL: &str = "/interchain_security.ccv.provider.v1.MsgSubmitConsumerDoubleVoting"; @@ -18,6 +19,7 @@ pub struct MsgSubmitIcsConsumerDoubleVoting { pub submitter: Signer, pub duplicate_vote_evidence: DuplicateVoteEvidence, pub infraction_block_header: Header, + pub consumer_id: ConsumerId, } impl Msg for MsgSubmitIcsConsumerDoubleVoting { @@ -57,6 +59,7 @@ impl TryFrom for MsgSubmitIcsConsumerDoubleVoting { .map_err(|e| { Error::invalid_raw_double_voting(format!("cannot convert header: {e}")) })?, + consumer_id: ConsumerId::new(raw.consumer_id), }) } } @@ -67,6 +70,7 @@ impl From for RawIcsDoubleVoting { submitter: value.submitter.to_string(), duplicate_vote_evidence: Some(value.duplicate_vote_evidence.into()), infraction_block_header: Some(value.infraction_block_header.into()), + consumer_id: value.consumer_id.to_string(), } } } 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 8b5c6c2750..67a7d20102 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 @@ -10,6 +10,7 @@ use crate::signer::Signer; use crate::tx_msg::Msg; use super::error::Error; +use super::ConsumerId; pub const ICS_MISBEHAVIOR_TYPE_URL: &str = "/interchain_security.ccv.provider.v1.MsgSubmitConsumerMisbehaviour"; @@ -18,6 +19,7 @@ pub const ICS_MISBEHAVIOR_TYPE_URL: &str = pub struct MsgSubmitIcsConsumerMisbehaviour { pub submitter: Signer, pub misbehaviour: Misbehaviour, + pub consumer_id: ConsumerId, } impl Msg for MsgSubmitIcsConsumerMisbehaviour { @@ -48,6 +50,7 @@ impl TryFrom for MsgSubmitIcsConsumerMisbehaviour { .map_err(|_e| { Error::invalid_raw_misbehaviour("cannot convert misbehaviour".into()) })?, + consumer_id: ConsumerId::new(raw.consumer_id), }) } } @@ -57,6 +60,7 @@ impl From for RawIcsMisbehaviour { RawIcsMisbehaviour { submitter: value.submitter.to_string(), misbehaviour: Some(value.misbehaviour.into()), + consumer_id: value.consumer_id.to_string(), } } } diff --git a/crates/relayer-types/src/applications/ics28_ccv/msgs/mod.rs b/crates/relayer-types/src/applications/ics28_ccv/msgs/mod.rs index df28e4a73a..6f992ae0f7 100644 --- a/crates/relayer-types/src/applications/ics28_ccv/msgs/mod.rs +++ b/crates/relayer-types/src/applications/ics28_ccv/msgs/mod.rs @@ -1,3 +1,52 @@ pub mod ccv_double_voting; pub mod ccv_misbehaviour; pub mod error; + +use std::convert::Infallible; + +use derive_more::Display; +use ibc_proto::interchain_security::ccv::provider::v1::Chain; +use serde::{Deserialize, Serialize}; + +use crate::core::ics24_host; +use crate::core::ics24_host::identifier::{ChainId, ClientId}; + +#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Display, Serialize, Deserialize)] +pub struct ConsumerId(String); + +impl ConsumerId { + pub const fn new(id: String) -> Self { + Self(id) + } + + pub fn as_str(&self) -> &str { + &self.0 + } +} + +impl std::str::FromStr for ConsumerId { + type Err = Infallible; + + fn from_str(s: &str) -> Result { + Ok(Self(s.to_string())) + } +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct ConsumerChain { + pub chain_id: ChainId, + pub consumer_id: ConsumerId, + pub client_id: ClientId, +} + +impl TryFrom for ConsumerChain { + type Error = ics24_host::error::ValidationError; + + fn try_from(value: Chain) -> Result { + Ok(Self { + chain_id: ChainId::from_string(&value.chain_id), + consumer_id: ConsumerId::new(value.consumer_id), + client_id: value.client_id.parse()?, + }) + } +} diff --git a/crates/relayer-types/src/applications/ics31_icq/response.rs b/crates/relayer-types/src/applications/ics31_icq/response.rs index 98b45acf06..7a5c9bb638 100644 --- a/crates/relayer-types/src/applications/ics31_icq/response.rs +++ b/crates/relayer-types/src/applications/ics31_icq/response.rs @@ -52,11 +52,13 @@ impl CrossChainQueryResponse { pub fn try_to_any(&self, signer: Signer) -> Result { let mut encoded = vec![]; + let proof_ops = into_proof_ops(self.proof.clone()); + let msg_submit_cross_chain_query_result = MsgSubmitQueryResponse { chain_id: self.chain_id.to_string(), query_id: self.query_id.to_string(), result: self.result.clone(), - proof_ops: Some(into_proof_ops(self.proof.clone())), + proof_ops: Some(proof_ops), height: self.height, from_address: signer.as_ref().to_string(), }; diff --git a/crates/relayer-types/src/applications/transfer/error.rs b/crates/relayer-types/src/applications/transfer/error.rs index f0e52d946d..71c8d04b0f 100644 --- a/crates/relayer-types/src/applications/transfer/error.rs +++ b/crates/relayer-types/src/applications/transfer/error.rs @@ -4,7 +4,6 @@ use std::string::FromUtf8Error; 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; @@ -127,7 +126,7 @@ define_error! { | _ | { "no trace associated with specified hash" }, DecodeRawMsg - [ TraceError ] + [ TraceError ] | _ | { "error decoding raw msg" }, UnknownMsgType diff --git a/crates/relayer-types/src/applications/transfer/msgs/send.rs b/crates/relayer-types/src/applications/transfer/msgs/send.rs index 36e71dc66b..fcbb34a6bb 100644 --- a/crates/relayer-types/src/applications/transfer/msgs/send.rs +++ b/crates/relayer-types/src/applications/transfer/msgs/send.rs @@ -43,11 +43,11 @@ where type Error = Error; fn try_from(value: RawMsgSend) -> Result { - let amount: Vec> = value + let amount = value .amount .into_iter() - .map(Coin::try_from) - .collect::>, _>>()?; + .map(Coin::::try_from) + .collect::, _>>()?; Ok(MsgSend { from_address: value.from_address, to_address: value.to_address, 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 818cf13347..44888d8afa 100644 --- a/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs +++ b/crates/relayer-types/src/clients/ics07_tendermint/client_state.rs @@ -305,9 +305,9 @@ impl From for RawTmClientState { Self { chain_id: value.chain_id.to_string(), trust_level: Some(value.trust_threshold.into()), - trusting_period: Some(value.trusting_period.into()), - unbonding_period: Some(value.unbonding_period.into()), - max_clock_drift: Some(value.max_clock_drift.into()), + trusting_period: Some(value.trusting_period.try_into().unwrap()), + unbonding_period: Some(value.unbonding_period.try_into().unwrap()), + max_clock_drift: Some(value.max_clock_drift.try_into().unwrap()), frozen_height: Some(value.frozen_height.map(|height| height.into()).unwrap_or( RawHeight { revision_number: 0, diff --git a/crates/relayer-types/src/core/ics02_client/error.rs b/crates/relayer-types/src/core/ics02_client/error.rs index a560a499f1..27316e2747 100644 --- a/crates/relayer-types/src/core/ics02_client/error.rs +++ b/crates/relayer-types/src/core/ics02_client/error.rs @@ -1,5 +1,4 @@ use flex_error::{define_error, TraceError}; -use tendermint_proto::Error as TendermintProtoError; use crate::core::ics02_client::client_type::ClientType; use crate::core::ics02_client::height::HeightError; @@ -109,14 +108,14 @@ define_error! { }, DecodeRawClientState - [ TraceError ] + [ TraceError ] | _ | { "error decoding raw client state" }, MissingRawClientState | _ | { "missing raw client state" }, InvalidRawConsensusState - [ TraceError ] + [ TraceError ] | _ | { "invalid raw client consensus state" }, MissingRawConsensusState @@ -138,7 +137,7 @@ define_error! { | _ | { "invalid client identifier" }, InvalidRawHeader - [ TraceError ] + [ TraceError ] | _ | { "invalid raw header" }, MalformedHeader @@ -148,7 +147,7 @@ define_error! { | _ | { "missing raw header" }, DecodeRawMisbehaviour - [ TraceError ] + [ TraceError ] | _ | { "invalid raw misbehaviour" }, InvalidRawMisbehaviour @@ -254,19 +253,19 @@ define_error! { | e | { format_args!("the local consensus state could not be retrieved for height {}", e.height) }, InvalidConnectionEnd - [ TraceError] + [ TraceError] | _ | { "invalid connection end" }, InvalidChannelEnd - [ TraceError] + [ TraceError] | _ | { "invalid channel end" }, InvalidAnyClientState - [ TraceError] + [ TraceError] | _ | { "invalid any client state" }, InvalidAnyConsensusState - [ TraceError ] + [ TraceError ] | _ | { "invalid any client consensus state" }, Signer diff --git a/crates/relayer-types/src/core/ics02_client/events.rs b/crates/relayer-types/src/core/ics02_client/events.rs index 3abe9b7b8d..da295833ef 100644 --- a/crates/relayer-types/src/core/ics02_client/events.rs +++ b/crates/relayer-types/src/core/ics02_client/events.rs @@ -1,9 +1,10 @@ //! Types for the IBC events emitted from Tendermint Websocket by the client module. -use serde_derive::{Deserialize, Serialize}; use std::fmt::{Display, Error as FmtError, Formatter}; + +use ibc_proto::Protobuf; +use serde_derive::{Deserialize, Serialize}; use tendermint::abci; -use tendermint_proto::Protobuf; use super::header::AnyHeader; use crate::core::ics02_client::client_type::ClientType; diff --git a/crates/relayer-types/src/core/ics26_routing/error.rs b/crates/relayer-types/src/core/ics26_routing/error.rs index f51581b6e0..5a4773e5af 100644 --- a/crates/relayer-types/src/core/ics26_routing/error.rs +++ b/crates/relayer-types/src/core/ics26_routing/error.rs @@ -29,7 +29,7 @@ define_error! { | e | { format_args!("unknown type URL {0}", e.url) }, MalformedMessageBytes - [ TraceError ] + [ TraceError ] | _ | { "the message is malformed and cannot be decoded" }, } } diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index e7729c7382..1dc99d6923 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -4,6 +4,7 @@ use bytes::Bytes; use config::CosmosSdkConfig; use core::{future::Future, str::FromStr, time::Duration}; use futures::future::join_all; +use ibc_proto::interchain_security::ccv::provider::v1::QueryConsumerIdFromClientIdRequest; use itertools::Itertools; use num_bigint::BigInt; use prost::Message; @@ -22,6 +23,7 @@ use ibc_proto::ibc::apps::fee::v1::{ 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::ics28_ccv::msgs::{ConsumerChain, ConsumerId}; use ibc_relayer_types::applications::ics31_icq::response::CrossChainQueryResponse; use ibc_relayer_types::clients::ics07_tendermint::client_state::{ AllowUpdate, ClientState as TmClientState, @@ -367,6 +369,7 @@ impl CosmosSdkChain { } /// Performs a gRPC query to fetch CCV Consumer chain staking parameters. + /// Assumes we are the consumer chain. pub fn query_ccv_consumer_chain_params(&self) -> Result { crate::time!( "query_ccv_consumer_chain_params", @@ -2542,7 +2545,10 @@ impl ChainEndpoint for CosmosSdkChain { Ok(incentivized_response) } - fn query_consumer_chains(&self) -> Result, Error> { + fn query_consumer_chains(&self) -> Result, Error> { + use ibc_proto::interchain_security::ccv::provider::v1::ConsumerPhase; + use ibc_proto::interchain_security::ccv::provider::v1::QueryConsumerChainsRequest; + crate::time!( "query_consumer_chains", { @@ -2556,9 +2562,10 @@ impl ChainEndpoint for CosmosSdkChain { ibc_proto::interchain_security::ccv::provider::v1::query_client::QueryClient::new, ))?; - let request = tonic::Request::new( - ibc_proto::interchain_security::ccv::provider::v1::QueryConsumerChainsRequest {}, - ); + let request = tonic::Request::new(QueryConsumerChainsRequest { + phase: ConsumerPhase::Launched as i32, + pagination: Some(PageRequest::all().into()), + }); let response = self .block_on(client.query_consumer_chains(request)) @@ -2568,8 +2575,8 @@ impl ChainEndpoint for CosmosSdkChain { let result = response .chains .into_iter() - .map(|c| (c.chain_id.parse().unwrap(), c.client_id.parse().unwrap())) - .collect(); + .map(|c| ConsumerChain::try_from(c).map_err(Error::ics24_host_validation_error)) + .collect::, _>>()?; Ok(result) } @@ -2631,6 +2638,40 @@ impl ChainEndpoint for CosmosSdkChain { IncludeProof::No => Ok((error_receipt, None)), } } + + /// Performs a gRPC query to fetch the CCV ConsumerID corresponding + /// to the given ClientID. + /// + /// Assumes we are the provider chain. + fn query_ccv_consumer_id(&self, client_id: ClientId) -> Result { + use ibc_proto::interchain_security::ccv::provider::v1::query_client::QueryClient; + + crate::telemetry!(query, &self.config.id, "query_ccv_consumer_id"); + crate::time!( + "query_ccv_consumer_id", + { + "src_chain": &self.config.id, + } + ); + + let grpc_addr = Uri::from_str(&self.config.grpc_addr.to_string()) + .map_err(|e| Error::invalid_uri(self.config.grpc_addr.to_string(), e))?; + + let mut client = self + .block_on(create_grpc_client(&grpc_addr, QueryClient::new))? + .max_decoding_message_size(self.config.max_grpc_decoding_size.get_bytes() as usize); + + let request = tonic::Request::new(QueryConsumerIdFromClientIdRequest { + client_id: client_id.to_string(), + }); + + let response = self + .block_on(client.query_consumer_id_from_client_id(request)) + .map_err(|e| Error::grpc_status(e, "query_ccv_consumer_id".to_owned()))?; + + let consumer_id = response.into_inner().consumer_id; + Ok(ConsumerId::new(consumer_id)) + } } fn sort_events_by_sequence(events: &mut [IbcEventWithHeight]) { @@ -2814,7 +2855,7 @@ pub async fn fetch_compat_mode( } }?; - Ok(compat_mode.into()) + Ok(compat_mode) } #[cfg(test)] diff --git a/crates/relayer/src/chain/cosmos/encode.rs b/crates/relayer/src/chain/cosmos/encode.rs index 447785f97e..a64ebd51e8 100644 --- a/crates/relayer/src/chain/cosmos/encode.rs +++ b/crates/relayer/src/chain/cosmos/encode.rs @@ -185,6 +185,7 @@ pub fn encode_to_bech32(address: &str, account_prefix: &str) -> Result Result<(AuthInfo, Vec), Error> { + #[allow(deprecated)] let auth_info = AuthInfo { signer_infos: vec![signer_info], fee: Some(fee), diff --git a/crates/relayer/src/chain/cosmos/query/account.rs b/crates/relayer/src/chain/cosmos/query/account.rs index 19d9ac5b34..eb8e1dc8b8 100644 --- a/crates/relayer/src/chain/cosmos/query/account.rs +++ b/crates/relayer/src/chain/cosmos/query/account.rs @@ -1,6 +1,6 @@ use http::uri::Uri; use ibc_proto::cosmos::auth::v1beta1::query_client::QueryClient; -use ibc_proto::cosmos::auth::v1beta1::{BaseAccount, EthAccount, QueryAccountRequest}; +use ibc_proto::cosmos::auth::v1beta1::{BaseAccount, QueryAccountRequest}; use prost::Message; use tracing::info; @@ -9,6 +9,19 @@ use crate::config::default::max_grpc_decoding_size; use crate::error::Error; use crate::util::create_grpc_client; +/// EthAccount defines an Ethermint account. +/// TODO: remove when/if a canonical `EthAccount` +/// lands in the next Cosmos SDK release +/// (note +/// only adds the PubKey type) +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EthAccount { + #[prost(message, optional, tag = "1")] + pub base_account: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + pub code_hash: ::prost::alloc::vec::Vec, +} + /// Get a `&mut Account` from an `&mut Option` if it is `Some(Account)`. /// Otherwise query for the account information, update the `Option` to `Some`, /// and return the underlying `&mut` reference. diff --git a/crates/relayer/src/chain/cosmos/query/balance.rs b/crates/relayer/src/chain/cosmos/query/balance.rs index 2b8a93e6de..23053fd807 100644 --- a/crates/relayer/src/chain/cosmos/query/balance.rs +++ b/crates/relayer/src/chain/cosmos/query/balance.rs @@ -53,6 +53,7 @@ pub async fn query_all_balances( let request = tonic::Request::new(QueryAllBalancesRequest { address: account_address.to_string(), pagination: None, + resolve_denom: false, // TODO: Correctly handle resolve_denom argument }); let response = client diff --git a/crates/relayer/src/chain/endpoint.rs b/crates/relayer/src/chain/endpoint.rs index 0a12e73341..387ff0b8d6 100644 --- a/crates/relayer/src/chain/endpoint.rs +++ b/crates/relayer/src/chain/endpoint.rs @@ -1,6 +1,7 @@ use alloc::sync::Arc; use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; +use ibc_relayer_types::applications::ics28_ccv::msgs::{ConsumerChain, ConsumerId}; use ibc_relayer_types::core::ics02_client::height::Height; use tokio::runtime::Runtime as TokioRuntime; @@ -688,7 +689,7 @@ pub trait ChainEndpoint: Sized { request: QueryIncentivizedPacketRequest, ) -> Result; - fn query_consumer_chains(&self) -> Result, Error>; + fn query_consumer_chains(&self) -> Result, Error>; fn query_upgrade( &self, @@ -703,4 +704,6 @@ pub trait ChainEndpoint: Sized { height: Height, include_proof: IncludeProof, ) -> Result<(ErrorReceipt, Option), Error>; + + fn query_ccv_consumer_id(&self, client_id: ClientId) -> Result; } diff --git a/crates/relayer/src/chain/handle.rs b/crates/relayer/src/chain/handle.rs index 2137821e61..b4aae48916 100644 --- a/crates/relayer/src/chain/handle.rs +++ b/crates/relayer/src/chain/handle.rs @@ -8,6 +8,7 @@ use ibc_proto::ibc::apps::fee::v1::{ QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, }; use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; +use ibc_relayer_types::applications::ics28_ccv::msgs::{ConsumerChain, ConsumerId}; use ibc_relayer_types::{ applications::ics31_icq::response::CrossChainQueryResponse, core::{ @@ -371,7 +372,7 @@ pub enum ChainRequest { }, QueryConsumerChains { - reply_to: ReplyTo>, + reply_to: ReplyTo>, }, QueryUpgrade { @@ -387,6 +388,11 @@ pub enum ChainRequest { include_proof: IncludeProof, reply_to: ReplyTo<(ErrorReceipt, Option)>, }, + + QueryConsumerId { + client_id: ClientId, + reply_to: ReplyTo, + }, } pub trait ChainHandle: Clone + Display + Send + Sync + Debug + 'static { @@ -699,7 +705,7 @@ pub trait ChainHandle: Clone + Display + Send + Sync + Debug + 'static { request: QueryIncentivizedPacketRequest, ) -> Result; - fn query_consumer_chains(&self) -> Result, Error>; + fn query_consumer_chains(&self) -> Result, Error>; fn query_upgrade( &self, @@ -714,4 +720,6 @@ pub trait ChainHandle: Clone + Display + Send + Sync + Debug + 'static { height: Height, include_proof: IncludeProof, ) -> Result<(ErrorReceipt, Option), Error>; + + fn query_ccv_consumer_id(&self, client_id: &ClientId) -> Result; } diff --git a/crates/relayer/src/chain/handle/base.rs b/crates/relayer/src/chain/handle/base.rs index 0898269281..64d7d7d30e 100644 --- a/crates/relayer/src/chain/handle/base.rs +++ b/crates/relayer/src/chain/handle/base.rs @@ -8,20 +8,23 @@ use ibc_proto::ibc::{ core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}, }; use ibc_relayer_types::{ - applications::ics31_icq::response::CrossChainQueryResponse, + applications::{ + ics28_ccv::msgs::{ConsumerChain, ConsumerId}, + ics31_icq::response::CrossChainQueryResponse, + }, core::{ ics02_client::{events::UpdateClient, header::AnyHeader}, - ics03_connection::connection::{ConnectionEnd, IdentifiedConnectionEnd}, - ics03_connection::version::Version, - ics04_channel::channel::{ChannelEnd, IdentifiedChannelEnd}, + ics03_connection::{ + connection::{ConnectionEnd, IdentifiedConnectionEnd}, + version::Version, + }, ics04_channel::{ + channel::{ChannelEnd, IdentifiedChannelEnd}, packet::{PacketMsgType, Sequence}, upgrade::{ErrorReceipt, Upgrade}, }, ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, - ics24_host::identifier::ChainId, - ics24_host::identifier::ChannelId, - ics24_host::identifier::{ClientId, ConnectionId, PortId}, + ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, }, proofs::Proofs, signer::Signer, @@ -522,7 +525,7 @@ impl ChainHandle for BaseChainHandle { self.send(|reply_to| ChainRequest::QueryIncentivizedPacket { request, reply_to }) } - fn query_consumer_chains(&self) -> Result, Error> { + fn query_consumer_chains(&self) -> Result, Error> { self.send(|reply_to| ChainRequest::QueryConsumerChains { reply_to }) } @@ -553,4 +556,11 @@ impl ChainHandle for BaseChainHandle { reply_to, }) } + + fn query_ccv_consumer_id(&self, client_id: &ClientId) -> Result { + self.send(|reply_to| ChainRequest::QueryConsumerId { + client_id: client_id.clone(), + reply_to, + }) + } } diff --git a/crates/relayer/src/chain/handle/cache.rs b/crates/relayer/src/chain/handle/cache.rs index 6a1731f903..403fee0bb2 100644 --- a/crates/relayer/src/chain/handle/cache.rs +++ b/crates/relayer/src/chain/handle/cache.rs @@ -1,20 +1,22 @@ 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 ibc_relayer_types::applications::ics28_ccv::msgs::ConsumerId; 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::ics28_ccv::msgs::ConsumerChain; use ibc_relayer_types::applications::ics31_icq::response::CrossChainQueryResponse; use ibc_relayer_types::core::ics02_client::events::UpdateClient; +use ibc_relayer_types::core::ics02_client::header::AnyHeader; use ibc_relayer_types::core::ics03_connection::connection::ConnectionEnd; use ibc_relayer_types::core::ics03_connection::connection::IdentifiedConnectionEnd; 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::ErrorReceipt; 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; @@ -515,7 +517,7 @@ impl ChainHandle for CachingChainHandle { self.inner.query_incentivized_packet(request) } - fn query_consumer_chains(&self) -> Result, Error> { + fn query_consumer_chains(&self) -> Result, Error> { self.inner.query_consumer_chains() } @@ -537,4 +539,8 @@ impl ChainHandle for CachingChainHandle { self.inner .query_upgrade_error(request, height, include_proof) } + + fn query_ccv_consumer_id(&self, client_id: &ClientId) -> Result { + self.inner.query_ccv_consumer_id(client_id) + } } diff --git a/crates/relayer/src/chain/handle/counting.rs b/crates/relayer/src/chain/handle/counting.rs index 1096e1b0bf..4fe7685a9e 100644 --- a/crates/relayer/src/chain/handle/counting.rs +++ b/crates/relayer/src/chain/handle/counting.rs @@ -3,13 +3,13 @@ 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::{ QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, }; +use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; +use ibc_relayer_types::applications::ics28_ccv::msgs::{ConsumerChain, ConsumerId}; use ibc_relayer_types::applications::ics31_icq::response::CrossChainQueryResponse; use ibc_relayer_types::core::ics02_client::events::UpdateClient; use ibc_relayer_types::core::ics02_client::header::AnyHeader; @@ -19,6 +19,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::{ErrorReceipt, 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::{ @@ -507,7 +508,7 @@ impl ChainHandle for CountingChainHandle { self.inner.query_incentivized_packet(request) } - fn query_consumer_chains(&self) -> Result, Error> { + fn query_consumer_chains(&self) -> Result, Error> { self.inc_metric("query_consumer_chains"); self.inner.query_consumer_chains() } @@ -532,4 +533,9 @@ impl ChainHandle for CountingChainHandle { self.inner .query_upgrade_error(request, height, include_proof) } + + fn query_ccv_consumer_id(&self, client_id: &ClientId) -> Result { + self.inc_metric("query_ccv_consumer_id"); + self.inner.query_ccv_consumer_id(client_id) + } } diff --git a/crates/relayer/src/chain/runtime.rs b/crates/relayer/src/chain/runtime.rs index 1422f386b3..0aff1cb248 100644 --- a/crates/relayer/src/chain/runtime.rs +++ b/crates/relayer/src/chain/runtime.rs @@ -10,10 +10,12 @@ use ibc_proto::ibc::{ core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}, }; use ibc_relayer_types::{ - applications::ics31_icq::response::CrossChainQueryResponse, + applications::{ + ics28_ccv::msgs::{ConsumerChain, ConsumerId}, + ics31_icq::response::CrossChainQueryResponse, + }, core::{ - ics02_client::events::UpdateClient, - ics02_client::header::AnyHeader, + ics02_client::{events::UpdateClient, header::AnyHeader}, ics03_connection::{ connection::{ConnectionEnd, IdentifiedConnectionEnd}, version::Version, @@ -24,7 +26,7 @@ use ibc_relayer_types::{ upgrade::{ErrorReceipt, Upgrade}, }, ics23_commitment::{commitment::CommitmentPrefix, merkle::MerkleProof}, - ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId}, + ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId}, }, proofs::Proofs, signer::Signer, @@ -363,6 +365,10 @@ where ChainRequest::QueryUpgradeError { request, height, include_proof, reply_to } => { self.query_upgrade_error(request, height, include_proof, reply_to)? }, + + ChainRequest::QueryConsumerId { client_id, reply_to } => { + self.query_ccv_consumer_id(client_id, reply_to)? + }, } }, } @@ -865,10 +871,7 @@ where Ok(()) } - fn query_consumer_chains( - &self, - reply_to: ReplyTo>, - ) -> Result<(), Error> { + fn query_consumer_chains(&self, reply_to: ReplyTo>) -> Result<(), Error> { let result = self.chain.query_consumer_chains(); reply_to.send(result).map_err(Error::send)?; @@ -902,4 +905,15 @@ where Ok(()) } + + fn query_ccv_consumer_id( + &self, + client_id: ClientId, + reply_to: ReplyTo, + ) -> Result<(), Error> { + let result = self.chain.query_ccv_consumer_id(client_id); + reply_to.send(result).map_err(Error::send)?; + + Ok(()) + } } diff --git a/crates/relayer/src/config/compat_mode.rs b/crates/relayer/src/config/compat_mode.rs index cb2a035855..795081ea6f 100644 --- a/crates/relayer/src/config/compat_mode.rs +++ b/crates/relayer/src/config/compat_mode.rs @@ -1,95 +1 @@ -use core::fmt::{Display, Error as FmtError, Formatter}; -use core::str::FromStr; -use serde::Deserialize; -use serde::Deserializer; -use serde::Serialize; -use serde::Serializer; - -use tendermint_rpc::client::CompatMode as TmCompatMode; - -use crate::config::Error; - -/// CometBFT RPC compatibility mode -#[derive(Clone, Debug, Eq, PartialEq)] -pub enum CompatMode { - /// Use version 0.34 of the protocol. - V0_34, - /// Use version 0.37+ of the protocol. - V0_37, -} - -impl Display for CompatMode { - fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { - match self { - Self::V0_34 => write!(f, "v0.34"), - Self::V0_37 => write!(f, "v0.37"), - } - } -} - -impl FromStr for CompatMode { - type Err = Error; - - fn from_str(s: &str) -> Result { - const VALID_COMPAT_MODES: &str = "0.34, 0.37, 0.38"; - - // Trim leading 'v', if present - match s.trim_start_matches('v') { - "0.34" => Ok(CompatMode::V0_34), - "0.37" => Ok(CompatMode::V0_37), - "0.38" => Ok(CompatMode::V0_37), // v0.38 is compatible with v0.37 - _ => Err(Error::invalid_compat_mode( - s.to_string(), - VALID_COMPAT_MODES, - )), - } - } -} - -impl<'de> Deserialize<'de> for CompatMode { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - use serde::de; - - let s = String::deserialize(deserializer)?; - FromStr::from_str(&s).map_err(de::Error::custom) - } -} - -impl Serialize for CompatMode { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - self.to_string().serialize(serializer) - } -} - -impl From for CompatMode { - fn from(value: TmCompatMode) -> Self { - match value { - TmCompatMode::V0_34 => Self::V0_34, - TmCompatMode::V0_37 => Self::V0_37, - } - } -} - -impl From for TmCompatMode { - fn from(value: CompatMode) -> Self { - match value { - CompatMode::V0_34 => Self::V0_34, - CompatMode::V0_37 => Self::V0_37, - } - } -} - -impl CompatMode { - pub fn equal_to_tm_compat_mode(&self, tm_compat_mode: TmCompatMode) -> bool { - match self { - Self::V0_34 => tm_compat_mode == TmCompatMode::V0_34, - Self::V0_37 => tm_compat_mode == TmCompatMode::V0_37, - } - } -} +pub use tendermint_rpc::client::CompatMode; diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index 6d46f90fe0..8fa5bd4847 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -30,6 +30,7 @@ use ibc_relayer_types::clients::ics07_tendermint::error as tendermint_error; use ibc_relayer_types::core::ics02_client::{client_type::ClientType, error as client_error}; use ibc_relayer_types::core::ics03_connection::error as connection_error; use ibc_relayer_types::core::ics23_commitment::error as commitment_error; +use ibc_relayer_types::core::ics24_host::error::ValidationError; use ibc_relayer_types::core::ics24_host::identifier::{ChainId, ChannelId, ConnectionId}; use ibc_relayer_types::proofs::ProofError; @@ -633,6 +634,10 @@ define_error! { InvalidChannelString { channel: String } |e| { format!("invalid channel string {}", e.channel) }, + + Ics24HostValidationError + [ ValidationError ] + |_| { "ICS24 host validation error" }, } } diff --git a/crates/relayer/src/foreign_client.rs b/crates/relayer/src/foreign_client.rs index c05a5739f4..1120ee2dda 100644 --- a/crates/relayer/src/foreign_client.rs +++ b/crates/relayer/src/foreign_client.rs @@ -9,6 +9,7 @@ use std::thread; use std::time::Instant; use ibc_proto::google::protobuf::Any; +use ibc_relayer_types::applications::ics28_ccv::msgs::ConsumerId; use itertools::Itertools; use tracing::{debug, error, info, instrument, trace, warn}; @@ -365,7 +366,7 @@ pub enum ConsensusStateTrusted { NotTrusted { elapsed: Duration, network_timestamp: Timestamp, - consensus_state_timestmap: Timestamp, + consensus_state_timestamp: Timestamp, }, Trusted { elapsed: Duration, @@ -767,12 +768,12 @@ impl ForeignClient { error!( latest_height = %client_state.latest_height(), - network_timestmap = %network_timestamp, - consensus_state_timestamp = %consensus_state_timestmap, + network_timestamp = %network_timestamp, + consensus_state_timestamp = %consensus_state_timestamp, elapsed = ?elapsed, "client state is not valid: latest height is outside of trusting period!", ); @@ -829,7 +830,7 @@ impl ForeignClient ForeignClient ForeignClient { + msgs.push( + MsgSubmitIcsConsumerMisbehaviour { + submitter: signer.clone(), + misbehaviour: tm_misbehaviour, + consumer_id, + } + .to_any(), + ); } - .to_any(), - ); + Err(e) => { + error!( + "cannot build CCV misbehaviour evidence: failed to fetch CCV consumer id for client {}: {}", + self.id, e + ); + } + } } msgs.push( @@ -1931,3 +1943,21 @@ pub fn extract_client_id(event: &IbcEvent) -> Result<&ClientId, ForeignClientErr )), } } + +pub fn fetch_ccv_consumer_id( + provider: &impl ChainHandle, + client_id: &ClientId, +) -> Result { + let consumer_id = provider.query_ccv_consumer_id(client_id).map_err(|e| { + ForeignClientError::misbehaviour( + format!( + "failed to query CCV consumer id corresponding to client {} from provider {}", + client_id, + provider.id() + ), + e, + ) + })?; + + Ok(consumer_id) +} diff --git a/crates/relayer/src/upgrade_chain.rs b/crates/relayer/src/upgrade_chain.rs index 2889d7ab62..318f35130b 100644 --- a/crates/relayer/src/upgrade_chain.rs +++ b/crates/relayer/src/upgrade_chain.rs @@ -296,6 +296,7 @@ fn build_upgrade_proposal( metadata: "".to_string(), title: "proposal 0".to_string(), summary: "upgrade the chain software and unbonding period".to_string(), + expedited: false, }; let mut buf_msg = Vec::new(); diff --git a/crates/relayer/src/util/compat_mode.rs b/crates/relayer/src/util/compat_mode.rs index 716534bb95..c637d5a247 100644 --- a/crates/relayer/src/util/compat_mode.rs +++ b/crates/relayer/src/util/compat_mode.rs @@ -1,7 +1,6 @@ use tracing::warn; use tendermint::Version; -use tendermint_rpc::client::CompatMode as TmCompatMode; use crate::chain::cosmos::version::ConsensusVersion; use crate::config::compat_mode::CompatMode; @@ -11,21 +10,21 @@ pub fn compat_mode_from_node_version( configured_version: &Option, version: Version, ) -> Result { - let queried_version = TmCompatMode::from_version(version); + let queried_version = CompatMode::from_version(version); // This will prioritize the use of the CompatMode specified in Hermes configuration file match (configured_version, queried_version) { - (Some(configured), Ok(queried)) if !configured.equal_to_tm_compat_mode(queried) => { + (Some(configured), Ok(queried)) if configured != &queried => { warn!( "potential `compat_mode` misconfiguration! Configured version '{configured}' does not match chain version '{queried}'. \ Hermes will use the configured `compat_mode` version '{configured}'. \ If this configuration is done on purpose this message can be ignored.", ); - Ok(configured.clone()) + Ok(*configured) } - (Some(configured), _) => Ok(configured.clone()), - (_, Ok(queried)) => Ok(queried.into()), + (Some(configured), _) => Ok(*configured), + (_, Ok(queried)) => Ok(queried), (_, Err(e)) => Err(Error::invalid_compat_mode(e)), } } @@ -50,7 +49,7 @@ pub fn compat_mode_from_version_specs( If this configuration is done on purpose this message can be ignored." ); - Ok(configured.clone()) + Ok(*configured) } (Some(configured), None) => { warn!( @@ -58,7 +57,7 @@ pub fn compat_mode_from_version_specs( and will use the configured `compat_mode` version `{configured}`." ); - Ok(configured.clone()) + Ok(*configured) } (None, Some(queried)) => Ok(queried), (None, None) => { @@ -77,7 +76,7 @@ fn compat_mode_from_semver(v: semver::Version) -> Option { match (v.major, v.minor) { (0, 34) => Some(CompatMode::V0_34), (0, 37) => Some(CompatMode::V0_37), - (0, 38) => Some(CompatMode::V0_37), + (0, 38) => Some(CompatMode::V0_38), _ => None, } } diff --git a/flake.lock b/flake.lock index d78d62da6b..6b423bbc94 100644 --- a/flake.lock +++ b/flake.lock @@ -101,15 +101,16 @@ "cometbft-src": { "flake": false, "locked": { - "narHash": "sha256-G5gchJMn/BFzwYx8/ikPDL5fS/TuFIBF4DKJbkalp/M=", + "lastModified": 1723450629, + "narHash": "sha256-2QO4KeEUX4HHT1AKhEdPplJHjBhalfM11Dn3/urIVig=", "owner": "cometbft", "repo": "cometbft", - "rev": "66a5a9da9f7a3306f382eb9142ccb9c9f7997d3f", + "rev": "e1b4453baf0af6487ad187c7f17dc50517126673", "type": "github" }, "original": { "owner": "cometbft", - "ref": "v0.38.0", + "ref": "v0.38.11", "repo": "cometbft", "type": "github" } @@ -158,6 +159,7 @@ "gaia17-src": "gaia17-src", "gaia18-src": "gaia18-src", "gaia19-src": "gaia19-src", + "gaia20-src": "gaia20-src", "gaia5-src": "gaia5-src", "gaia6-ordered-src": "gaia6-ordered-src", "gaia6-src": "gaia6-src", @@ -218,6 +220,7 @@ "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_5_5-src": "wasmvm_1_5_5-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", @@ -225,11 +228,11 @@ "wasmvm_2_1_2-src": "wasmvm_2_1_2-src" }, "locked": { - "lastModified": 1727709426, - "narHash": "sha256-Q+uchaRWUNGOksfHY8x6HAz7nADkRtLHUl11A0mBc7Y=", + "lastModified": 1729681912, + "narHash": "sha256-Ym4WfC/Iogqft2KOoHEv2FlWlgsxOAA5CZCbGXPf65o=", "owner": "informalsystems", "repo": "cosmos.nix", - "rev": "706d3206feb0c816765768dd164790874c221bd3", + "rev": "04a2efd0e01206b5df601b205d7662db79a765f0", "type": "github" }, "original": { @@ -673,6 +676,23 @@ "type": "github" } }, + "gaia20-src": { + "flake": false, + "locked": { + "lastModified": 1726853009, + "narHash": "sha256-N7x3k56AtPbIbbJjqKmlEJIytKElALJwj14lZ2pewZg=", + "owner": "cosmos", + "repo": "gaia", + "rev": "2dba9d471ef73b0a99e844bf55a44ddae700ea06", + "type": "github" + }, + "original": { + "owner": "cosmos", + "ref": "v20.0.0", + "repo": "gaia", + "type": "github" + } + }, "gaia5-src": { "flake": false, "locked": { @@ -1131,15 +1151,16 @@ "interchain-security-src": { "flake": false, "locked": { - "narHash": "sha256-adBzn51PKoRsCL9gIzC5Tcqmu7u3GjxTcDj2jpZ/da8=", + "lastModified": 1726849313, + "narHash": "sha256-1WEvV3LoXfGvZC9fXOb8mBLKVGCVBiXZcwUewSPit+8=", "owner": "cosmos", "repo": "interchain-security", - "rev": "03aada4af3243dbf739a12adfacc7b37232df694", + "rev": "1e60637f9d8f3505208282416abfbb87fabc4795", "type": "github" }, "original": { "owner": "cosmos", - "ref": "feat/ics-misbehaviour-handling", + "ref": "v6.1.0", "repo": "interchain-security", "type": "github" } @@ -1179,16 +1200,16 @@ "juno-src": { "flake": false, "locked": { - "lastModified": 1724278445, - "narHash": "sha256-XvJqp36HSYqm6OMLQqJPX5sCT52GxSLFDMO+fJovh+0=", + "lastModified": 1727102451, + "narHash": "sha256-UaTCcK+I6Wl4yCpbNckx+lRi55kTSucJxzw5irJOVh4=", "owner": "CosmosContracts", "repo": "juno", - "rev": "2f119adacca3a1668ff150c225a3f423501e748c", + "rev": "de3c4d145c7a96c31e3fca6fe8850ce4ab559e33", "type": "github" }, "original": { "owner": "CosmosContracts", - "ref": "v24.0.0", + "ref": "v25.0.0", "repo": "juno", "type": "github" } @@ -1444,11 +1465,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1727648392, - "narHash": "sha256-VTlVv1nSxImFxY6RPQpNZxvEOQ0u5s1wBFDgixySNDo=", + "lastModified": 1729788628, + "narHash": "sha256-3suayUinicnvE/4shMZwp9FHT5izUM8gMpdEO/NHBTo=", "owner": "nixos", "repo": "nixpkgs", - "rev": "4e0c36e4dd53f35d5a6385bdae88895ec5832f70", + "rev": "63487b2f26fa065cfeeaa47dddb08e2856ba53e8", "type": "github" }, "original": { @@ -2010,6 +2031,23 @@ "type": "github" } }, + "wasmvm_1_5_5-src": { + "flake": false, + "locked": { + "lastModified": 1727088523, + "narHash": "sha256-ysS2pMMm+s1JsHVv9RhiMHt5g4UGcE5jqOI5YKdC4vU=", + "owner": "CosmWasm", + "repo": "wasmvm", + "rev": "0c5b9ce8446189f07d2bf65fbb902817cf57a563", + "type": "github" + }, + "original": { + "owner": "CosmWasm", + "ref": "v1.5.5", + "repo": "wasmvm", + "type": "github" + } + }, "wasmvm_1_beta7-src": { "flake": false, "locked": { diff --git a/flake.nix b/flake.nix index 1a9ae4229a..ce0e9b787d 100644 --- a/flake.nix +++ b/flake.nix @@ -2,9 +2,9 @@ description = "Nix development dependencies for ibc-rs"; inputs = { - nixpkgs.url = github:nixos/nixpkgs/nixpkgs-unstable; - flake-utils.url = github:numtide/flake-utils; - cosmos-nix.url = github:informalsystems/cosmos.nix; + nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + cosmos-nix.url = "github:informalsystems/cosmos.nix"; }; outputs = inputs: let @@ -33,6 +33,7 @@ evmos gaia6-ordered gaia18 + gaia20 ibc-go-v2-simapp ibc-go-v3-simapp ibc-go-v4-simapp diff --git a/tools/test-framework/src/chain/driver.rs b/tools/test-framework/src/chain/driver.rs index ace13e8f5f..bd4aba6543 100644 --- a/tools/test-framework/src/chain/driver.rs +++ b/tools/test-framework/src/chain/driver.rs @@ -5,11 +5,11 @@ 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; +use ibc_relayer::config::compat_mode::CompatMode; use ibc_relayer_types::applications::transfer::amount::Amount; use ibc_relayer_types::core::ics24_host::identifier::ChainId; diff --git a/tools/test-framework/src/chain/tagged.rs b/tools/test-framework/src/chain/tagged.rs index b574c6eef1..af7a73c06a 100644 --- a/tools/test-framework/src/chain/tagged.rs +++ b/tools/test-framework/src/chain/tagged.rs @@ -132,7 +132,7 @@ impl<'a, Chain: Send> TaggedChainDriverExt for MonoTagged Result, Error> { + fn query_consumer_chains(&self) -> Result, Error> { self.value().query_consumer_chains() } @@ -456,4 +457,8 @@ where self.value() .query_upgrade_error(request, height, include_proof) } + + fn query_ccv_consumer_id(&self, client_id: &ClientId) -> Result { + self.value().query_ccv_consumer_id(client_id) + } } From 0e45fc896ad2bb65dc6163bc51ae0663fb1bca55 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Fri, 8 Nov 2024 09:24:26 +0100 Subject: [PATCH 210/224] Add Gaia v20.0.0 to chains running tests in CI (#4210) * Update bootstrapping of consumer chain * Add Gaia v20 to CI and update Gaia used in CI tests * Correctly create consumer chain and opt-in validator * WIP: Fix CCQs between Stride and Gaia * Add metrics for ICS31 cross chain queries * Remove unnecessary code * Fix clippy * Disable CCQ test * Improve error and metric recording for ICS31 cross chain queries * Use Gaia v20 in CI jobs * Add changelog entry --- .../4204-update-gaia-to-v20.md | 2 + .github/workflows/integration.yaml | 13 +- .github/workflows/multi-chains.yaml | 2 +- Cargo.lock | 66 ++++- .../relayer/src/worker/cross_chain_query.rs | 47 +++- crates/relayer/src/worker/error.rs | 18 +- crates/telemetry/src/state.rs | 59 +++++ flake.lock | 6 +- tools/test-framework/Cargo.toml | 2 + .../test-framework/src/bootstrap/consumer.rs | 18 +- tools/test-framework/src/bootstrap/single.rs | 1 + .../test-framework/src/chain/cli/provider.rs | 235 +++++++++++++++++- tools/test-framework/src/chain/config.rs | 10 + .../test-framework/src/chain/ext/bootstrap.rs | 189 +++++++++++--- .../src/framework/binary/ics.rs | 41 +-- 15 files changed, 620 insertions(+), 89 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4204-update-gaia-to-v20.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4204-update-gaia-to-v20.md b/.changelog/unreleased/improvements/ibc-integration-test/4204-update-gaia-to-v20.md new file mode 100644 index 0000000000..2fcbe90beb --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4204-update-gaia-to-v20.md @@ -0,0 +1,2 @@ +- Update the version of Gaia running the integration tests in the CI from `v18.1.0` + to `v20.0.0` ([\#4204](https://github.com/informalsystems/hermes/issues/4204)) \ No newline at end of file diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 528ea08c6c..fb98841907 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -45,7 +45,7 @@ jobs: fail-fast: false matrix: chain: - - package: gaia18 + - package: gaia20 command: gaiad account_prefix: cosmos native_token: stake @@ -178,10 +178,10 @@ jobs: fail-fast: false matrix: chain: - - package: .#gaia18 .#stride + - package: .#gaia20 .#stride command: gaiad,strided account_prefix: cosmos,stride - - package: .#gaia18 .#neutron + - package: .#gaia20 .#neutron command: gaiad,neutrond account_prefix: cosmos,neutron steps: @@ -218,12 +218,13 @@ jobs: --features interchain-security,ica interchain_security:: interchain-security-icq: + if: false # Disable CCQ test runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: chain: - - package: .#gaia18 .#stride-no-admin + - package: .#gaia20 .#stride-no-admin command: gaiad,strided account_prefix: cosmos,stride steps: @@ -264,7 +265,7 @@ jobs: fail-fast: false matrix: chain: - - package: .#celestia .#gaia18 + - package: .#celestia .#gaia20 command: celestia-appd,gaiad account_prefix: celestia,cosmos native_token: utia,stake @@ -309,7 +310,7 @@ jobs: fail-fast: false matrix: chain: - - package: .#gaia18 + - package: .#gaia20 command: gaiad account_prefix: cosmos steps: diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index 43846c1347..9aeb907848 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: gaia18 + - package: gaia20 command: gaiad account_prefix: cosmos - package: ibc-go-v7-simapp diff --git a/Cargo.lock b/Cargo.lock index 72866405bc..a2a7a87a97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,6 +65,21 @@ dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anstream" version = "0.6.15" @@ -116,9 +131,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.92" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f37166d7d48a0284b99dd824694c26119c700b53bf0d1540cdb147dbdaaf13" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arc-swap" @@ -506,6 +521,20 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.52.6", +] + [[package]] name = "clap" version = "3.2.25" @@ -1521,6 +1550,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "ibc-chain-registry" version = "0.29.3" @@ -1758,6 +1810,7 @@ dependencies = [ name = "ibc-test-framework" version = "0.29.3" dependencies = [ + "chrono", "color-eyre", "crossbeam-channel", "eyre", @@ -4232,6 +4285,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-sys" version = "0.48.0" diff --git a/crates/relayer/src/worker/cross_chain_query.rs b/crates/relayer/src/worker/cross_chain_query.rs index 811bb14b36..29f1f69db6 100644 --- a/crates/relayer/src/worker/cross_chain_query.rs +++ b/crates/relayer/src/worker/cross_chain_query.rs @@ -8,6 +8,7 @@ use crate::error::Error; use crate::event::IbcEventWithHeight; use crate::foreign_client::ForeignClient; use crate::object::CrossChainQuery; +use crate::telemetry; use crate::util::task::{spawn_background_task, Next, TaskError, TaskHandle}; use crate::worker::WorkerCmd; @@ -74,6 +75,12 @@ fn handle_cross_chain_query( // Handle of queried chain has to query data from it's RPC info!("request: {}", cross_chain_query.short_name()); + telemetry!( + cross_chain_queries, + &cross_chain_query.src_chain_id, + &cross_chain_query.dst_chain_id, + queries.len() + ); let response = chain_b_handle.cross_chain_query(queries); if let Ok(cross_chain_query_responses) = response { // Run only when cross chain query response is not empty @@ -87,7 +94,7 @@ fn handle_cross_chain_query( }, IncludeProof::No, ) - .map_err(|_| TaskError::Fatal(RunError::query()))? + .map_err(|e| TaskError::Fatal(RunError::relayer(e)))? .0; // Retrieve client based on client id @@ -96,19 +103,21 @@ fn handle_cross_chain_query( chain_a_handle.clone(), connection_end.client_id(), ) - .map_err(|_| TaskError::Fatal(RunError::query()))?; + .map_err(|e| TaskError::Fatal(RunError::foreign_client(e)))?; let target_height = Height::new( chain_b_handle.id().version(), cross_chain_query_responses.first().unwrap().height as u64, ) - .map_err(|_| TaskError::Fatal(RunError::query()))? + .map_err(|e| TaskError::Fatal(RunError::ics02(e)))? .increment(); // Push update client msg let mut chain_a_msgs = client_a .wait_and_build_update_client(target_height) - .map_err(|_| TaskError::Fatal(RunError::query()))?; + .map_err(|e| TaskError::Fatal(RunError::foreign_client(e)))?; + + let num_cross_chain_query_responses = cross_chain_query_responses.len(); for response in cross_chain_query_responses { info!("response arrived: query_id: {}", response.query_id); @@ -118,18 +127,40 @@ fn handle_cross_chain_query( .try_to_any( chain_a_handle .get_signer() - .map_err(|_| TaskError::Fatal(RunError::query()))?, + .map_err(|e| TaskError::Fatal(RunError::relayer(e)))?, ) - .map_err(|_| TaskError::Fatal(RunError::query()))?, + .map_err(|e| TaskError::Fatal(RunError::ics31(e)))?, ); } - chain_a_handle + let ccq_responses = chain_a_handle .send_messages_and_wait_check_tx(TrackedMsgs::new_uuid( chain_a_msgs, Uuid::new_v4(), )) - .map_err(|_| TaskError::Ignore(RunError::query()))?; + .map_err(|e| { + // Since all the CCQs failed, generate a failure code for the telemetry + let failed_codes = + vec![tendermint::abci::Code::from(1); num_cross_chain_query_responses]; + telemetry!( + cross_chain_query_responses, + &cross_chain_query.dst_chain_id, + &cross_chain_query.src_chain_id, + failed_codes + ); + + TaskError::Ignore(RunError::relayer(e)) + })?; + + telemetry!( + cross_chain_query_responses, + &cross_chain_query.dst_chain_id, + &cross_chain_query.src_chain_id, + ccq_responses + .iter() + .map(|ccq_response| ccq_response.code) + .collect() + ); } } } diff --git a/crates/relayer/src/worker/error.rs b/crates/relayer/src/worker/error.rs index a694678539..e95b2290ed 100644 --- a/crates/relayer/src/worker/error.rs +++ b/crates/relayer/src/worker/error.rs @@ -1,9 +1,12 @@ use crossbeam_channel::RecvError; use flex_error::{define_error, DisplayOnly}; +use ibc_relayer_types::applications::ics31_icq::error::Error as Ics31Error; use ibc_relayer_types::core::ics02_client::error::Error as Ics02Error; use crate::channel::ChannelError; use crate::connection::ConnectionError; +use crate::error::Error as RelayerError; +use crate::foreign_client::ForeignClientError; use crate::link::error::LinkError; define_error! { @@ -12,6 +15,10 @@ define_error! { [ Ics02Error ] | _ | { "client error" }, + Ics31 + [ Ics31Error ] + | _ | { "cross chain query error" }, + Connection [ ConnectionError ] | _ | { "connection error" }, @@ -20,10 +27,18 @@ define_error! { [ ChannelError ] | _ | { "channel error" }, + ForeignClient + [ ForeignClientError ] + | _ | { "foreign client error" }, + Link [ LinkError ] | _ | { "link error" }, + Relayer + [ RelayerError ] + | _ | { "relayer error" }, + Retry { retries: retry::Error } | e | { format_args!("worker failed after {} retries", e.retries) }, @@ -31,8 +46,5 @@ define_error! { Recv [ DisplayOnly ] | _ | { "error receiving from channel: sender end has been closed" }, - - Query - | _ | { "error occurred during querying" } } } diff --git a/crates/telemetry/src/state.rs b/crates/telemetry/src/state.rs index e5a9c9cf96..136b414077 100644 --- a/crates/telemetry/src/state.rs +++ b/crates/telemetry/src/state.rs @@ -215,6 +215,15 @@ pub struct TelemetryState { /// Number of ICS-20 packets filtered because the memo and/or the receiver fields were exceeding the configured limits filtered_packets: Counter, + + /// Observed ICS31 CrossChainQueries + cross_chain_queries: Counter, + + /// Observed ICS31 CrossChainQuery successful Responses + cross_chain_query_responses: Counter, + + /// Observed ICS31 CrossChainQuery error Responses + cross_chain_query_error_responses: Counter, } impl TelemetryState { @@ -423,6 +432,21 @@ impl TelemetryState { .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(), + + cross_chain_queries: meter + .u64_counter("cross_chain_queries") + .with_description("Number of ICS-31 queries received") + .init(), + + cross_chain_query_responses: meter + .u64_counter("cross_chain_query_responses") + .with_description("Number of ICS-31 successful query responses") + .init(), + + cross_chain_query_error_responses: meter + .u64_counter("cross_chain_query_error_responses") + .with_description("Number of ICS-31 error query responses") + .init(), } } @@ -1236,6 +1260,41 @@ impl TelemetryState { self.filtered_packets.add(&cx, count, labels); } } + + pub fn cross_chain_queries(&self, src_chain: &ChainId, dst_chain: &ChainId, count: usize) { + 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()), + ]; + + self.cross_chain_queries.add(&cx, count as u64, labels); + } + } + + pub fn cross_chain_query_responses( + &self, + src_chain: &ChainId, + dst_chain: &ChainId, + ccq_responses_codes: Vec, + ) { + let cx = Context::current(); + + let labels = &[ + KeyValue::new("src_chain", src_chain.to_string()), + KeyValue::new("dst_chain", dst_chain.to_string()), + ]; + + for code in ccq_responses_codes.iter() { + if code.is_ok() { + self.cross_chain_query_responses.add(&cx, 1, labels); + } else { + self.cross_chain_query_error_responses.add(&cx, 1, labels); + } + } + } } use std::sync::Arc; diff --git a/flake.lock b/flake.lock index 6b423bbc94..279a3e3895 100644 --- a/flake.lock +++ b/flake.lock @@ -1465,11 +1465,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1729788628, - "narHash": "sha256-3suayUinicnvE/4shMZwp9FHT5izUM8gMpdEO/NHBTo=", + "lastModified": 1730831018, + "narHash": "sha256-2S0HwIFRxYp+afuoFORcZA9TjryAf512GmE0MTfEOPU=", "owner": "nixos", "repo": "nixpkgs", - "rev": "63487b2f26fa065cfeeaa47dddb08e2856ba53e8", + "rev": "8c4dc69b9732f6bbe826b5fbb32184987520ff26", "type": "github" }, "original": { diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 34f5a08182..5c71770833 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -42,3 +42,5 @@ toml = { workspace = true } tonic = { workspace = true, features = ["tls", "tls-roots"] } tracing = { workspace = true } tracing-subscriber = { workspace = true } + +chrono = "0.4.38" diff --git a/tools/test-framework/src/bootstrap/consumer.rs b/tools/test-framework/src/bootstrap/consumer.rs index 6c85595331..c473ab6c28 100644 --- a/tools/test-framework/src/bootstrap/consumer.rs +++ b/tools/test-framework/src/bootstrap/consumer.rs @@ -8,6 +8,7 @@ use std::time::Duration; use tracing::info; use crate::chain::builder::ChainBuilder; +use crate::chain::cli::provider::validator_opt_in; use crate::chain::config; use crate::chain::ext::bootstrap::ChainBootstrapMethodsExt; use crate::error::Error; @@ -22,6 +23,7 @@ pub fn bootstrap_consumer_node( genesis_modifier: impl FnOnce(&mut serde_json::Value) -> Result<(), Error>, chain_number: usize, provider_chain_driver: &ChainDriver, + provider_fee: &String, ) -> Result { let stake_denom = Denom::base("stake"); @@ -38,7 +40,7 @@ pub fn bootstrap_consumer_node( )))?; let initial_coin = Token::new(denom.clone(), initial_amount); - let chain_driver = builder.new_chain(prefix, false, chain_number)?; + let chain_driver = builder.new_chain("consumer", false, chain_number)?; chain_driver.initialize()?; @@ -53,11 +55,23 @@ pub fn bootstrap_consumer_node( chain_driver.add_genesis_account(&user2.address, &[&initial_stake, &initial_coin])?; // Wait for the consumer chain to be initialized before querying the genesis + thread::sleep(Duration::from_secs(5)); + + validator_opt_in( + provider_chain_driver.chain_id.as_str(), + &provider_chain_driver.command_path, + &provider_chain_driver.home_path, + &provider_chain_driver.rpc_listen_address(), + provider_fee, + prefix, + )?; + + // Wait enough time so that the spawn_time passed thread::sleep(Duration::from_secs(30)); node_a .chain_driver - .query_consumer_genesis(&chain_driver, chain_driver.chain_id.as_str())?; + .query_consumer_genesis(&chain_driver, prefix)?; chain_driver.replace_genesis_state()?; diff --git a/tools/test-framework/src/bootstrap/single.rs b/tools/test-framework/src/bootstrap/single.rs index c7570ad0c3..df87589b35 100644 --- a/tools/test-framework/src/bootstrap/single.rs +++ b/tools/test-framework/src/bootstrap/single.rs @@ -100,6 +100,7 @@ pub fn bootstrap_single_node( config::set_rpc_port(config, chain_driver.rpc_port)?; config::set_p2p_port(config, chain_driver.p2p_port)?; config::set_pprof_port(config, chain_driver.pprof_port)?; + config::set_block_sync(config, true)?; config::set_timeout_commit(config, Duration::from_secs(1))?; config::set_timeout_propose(config, Duration::from_secs(1))?; config::set_mode(config, "validator")?; diff --git a/tools/test-framework/src/chain/cli/provider.rs b/tools/test-framework/src/chain/cli/provider.rs index 2c5dc6f8cd..76310a2a6d 100644 --- a/tools/test-framework/src/chain/cli/provider.rs +++ b/tools/test-framework/src/chain/cli/provider.rs @@ -1,6 +1,6 @@ use eyre::eyre; use std::collections::HashMap; -use std::str; +use std::{str, thread}; use crate::chain::exec::{simple_exec, ExecOutput}; use crate::error::{handle_generic_error, Error}; @@ -12,7 +12,8 @@ pub fn submit_consumer_chain_proposal( rpc_listen_address: &str, fees: &str, ) -> Result<(), Error> { - let proposal_file = format!("{}/consumer_proposal.json", home_path); + let proposal_file = format!("{}/consumer_proposal_topn.json", home_path); + thread::sleep(std::time::Duration::from_secs(3)); // The submission might fail silently if there is not enough gas let raw_output = simple_exec( @@ -21,8 +22,234 @@ pub fn submit_consumer_chain_proposal( &[ "tx", "gov", - "submit-legacy-proposal", - "consumer-addition", + "submit-proposal", + &proposal_file, + "--chain-id", + chain_id, + "--from", + "validator", + "--home", + home_path, + "--node", + rpc_listen_address, + "--keyring-backend", + "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")))?; + + // Proposal submission might fail due to account sequence error. + // Wait a bit and resubmit if the first submission fails + if output_code != 0 { + thread::sleep(std::time::Duration::from_secs(3)); + simple_exec( + chain_id, + command_path, + &[ + "tx", + "gov", + "submit-proposal", + &proposal_file, + "--chain-id", + chain_id, + "--from", + "validator", + "--home", + home_path, + "--node", + rpc_listen_address, + "--keyring-backend", + "test", + "--gas", + "2000000", + "--fees", + fees, + "--output", + "json", + "--yes", + ], + )?; + } + + Ok(()) +} + +pub fn create_consumer( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + fees: &str, +) -> Result { + let proposal_file = format!("{}/consumer_proposal.json", home_path); + + // The submission might fail silently if there is not enough gas + let raw_output = simple_exec( + chain_id, + command_path, + &[ + "tx", + "provider", + "create-consumer", + &proposal_file, + "--chain-id", + chain_id, + "--from", + "validator", + "--home", + home_path, + "--node", + rpc_listen_address, + "--keyring-backend", + "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 hash = output.get("txhash").and_then(|code| code.as_str()).unwrap(); + + thread::sleep(std::time::Duration::from_secs(3)); + + let hash_output = simple_exec( + chain_id, + command_path, + &[ + "query", + "tx", + hash, + "--chain-id", + chain_id, + "--home", + home_path, + "--node", + rpc_listen_address, + "--output", + "json", + ], + )?; + + let hash_output_json: serde_json::Value = + serde_json::from_str(&hash_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 provider create-consumer' should be 0, but is instead '{output_code}'. Detail: {output_logs}", ))); + } + + let events = hash_output_json + .get("events") + .and_then(|code| code.as_array()) + .ok_or_else(|| { + Error::generic(eyre!( + "failed to extract 'events' from the output of `create-consumer` CLI" + )) + })?; + + let create_consumer_event = events + .iter() + .find(|v| v.get("type").and_then(|v| v.as_str()) == Some("create_consumer")) + .ok_or_else(|| Error::generic(eyre!("failed to extract create_consumer event")))?; + + let attributes = create_consumer_event + .get("attributes") + .and_then(|v| v.as_array()) + .ok_or_else(|| { + Error::generic(eyre!( + "failed to extract attributes from create_consumer event" + )) + })?; + + let consumer_id_attribute = attributes + .iter() + .find(|v| v.get("key").and_then(|v| v.as_str()) == Some("consumer_id")) + .ok_or_else(|| Error::generic(eyre!("failed to extract consumer_id attribute")))?; + + let consumer_id = consumer_id_attribute + .get("value") + .and_then(|v| v.as_str()) + .ok_or_else(|| Error::generic(eyre!("failed to extract consumer_id")))?; + + Ok(consumer_id.to_owned()) +} + +pub fn validator_opt_in( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + fees: &str, + consumer_id: &str, +) -> Result<(), Error> { + simple_exec( + chain_id, + command_path, + &[ + "tx", + "provider", + "opt-in", + consumer_id, + "--chain-id", + chain_id, + "--from", + "validator", + "--home", + home_path, + "--node", + rpc_listen_address, + "--keyring-backend", + "test", + "--gas", + "2000000", + "--fees", + fees, + "--output", + "json", + "--yes", + ], + )?; + + Ok(()) +} + +pub fn update_consumer( + chain_id: &str, + command_path: &str, + home_path: &str, + rpc_listen_address: &str, + fees: &str, +) -> Result<(), Error> { + let proposal_file = format!("{}/consumer_update_proposal.json", home_path); + + // The submission might fail silently if there is not enough gas + let raw_output = simple_exec( + chain_id, + command_path, + &[ + "tx", + "provider", + "update-consumer", &proposal_file, "--chain-id", chain_id, diff --git a/tools/test-framework/src/chain/config.rs b/tools/test-framework/src/chain/config.rs index 3cdf1c3877..4d76a1cf43 100644 --- a/tools/test-framework/src/chain/config.rs +++ b/tools/test-framework/src/chain/config.rs @@ -103,6 +103,16 @@ pub fn set_pprof_port(config: &mut Value, port: u16) -> Result<(), Error> { Ok(()) } +/// Set the `pprof_laddr` field in the full node config. +pub fn set_block_sync(config: &mut Value, value: bool) -> Result<(), Error> { + config + .as_table_mut() + .ok_or_else(|| eyre!("expect object"))? + .insert("block_sync".to_string(), value.into()); + + Ok(()) +} + pub fn set_mempool_version(config: &mut Value, version: &str) -> Result<(), Error> { config .get_mut("mempool") diff --git a/tools/test-framework/src/chain/ext/bootstrap.rs b/tools/test-framework/src/chain/ext/bootstrap.rs index 4fef50083d..07103fcd05 100644 --- a/tools/test-framework/src/chain/ext/bootstrap.rs +++ b/tools/test-framework/src/chain/ext/bootstrap.rs @@ -1,3 +1,6 @@ +use chrono::DateTime; +use chrono::Duration as ChronoDuration; +use chrono::Utc; use core::str::FromStr; use eyre::eyre; use hdpath::StandardHDPath; @@ -14,10 +17,12 @@ use crate::chain::cli::bootstrap::{ add_genesis_account, add_genesis_validator, add_wallet, collect_gen_txs, initialize, start_chain, }; +use crate::chain::cli::provider::submit_consumer_chain_proposal; use crate::chain::cli::provider::{ - copy_validator_key_pair, query_consumer_genesis, query_gov_proposal, replace_genesis_state, - submit_consumer_chain_proposal, + copy_validator_key_pair, create_consumer, query_consumer_genesis, query_gov_proposal, + replace_genesis_state, update_consumer, validator_opt_in, }; +use crate::chain::cli::query::query_auth_module; use crate::chain::driver::ChainDriver; use crate::chain::exec::simple_exec; use crate::error::{handle_generic_error, Error}; @@ -107,7 +112,21 @@ pub trait ChainBootstrapMethodsExt { &self, consumer_chain_id: &str, fees: &str, - spawn_time: &str, + ) -> Result<(), Error>; + + fn create_permisionless_consumer( + &self, + consumer_chain_id: &str, + fees: &str, + ) -> Result; + + fn validator_opt_in(&self, consumer_chain_id: &str, fees: &str) -> Result<(), Error>; + + fn update_consumer( + &self, + consumer_chain_id: &str, + fees: &str, + validator: &str, ) -> Result<(), Error>; /** @@ -278,8 +297,132 @@ impl ChainBootstrapMethodsExt for ChainDriver { &self, consumer_chain_id: &str, fees: &str, - _spawn_time: &str, ) -> Result<(), Error> { + let raw_proposal = r#" + { + "chain_id": "{consumer_chain_id}", + "initialization_parameters": { + "initial_height": { + "revision_number": 0, + "revision_height": 1 + }, + "genesis_hash": "Z2VuX2hhc2g=", + "binary_hash": "YmluX2hhc2g=", + "spawn_time": "{spawn_time}", + "unbonding_period": 100000000000, + "ccv_timeout_period": 100000000000, + "transfer_timeout_period": 100000000000, + "consumer_redistribution_fraction": "0.75", + "blocks_per_distribution_transmission": 10, + "historical_entries": 10000, + "distribution_transmission_channel": "" + }, + "power_shaping_parameters": { + "top_N": 100, + "validators_power_cap": 0, + "validator_set_cap": 0, + "allowlist": [], + "denylist": [], + "min_stake": 0, + "allow_inactive_vals": false + }, + "metadata": "ipfs://CID", + "deposit": "10000000stake", + "title": "\"update consumer 0 to top N\"", + "summary": "\"update consumer 0 to top N\"", + "expedited": false + }"#; + + let current_time: DateTime = Utc::now(); + let future_time = current_time + ChronoDuration::seconds(30); + let spawn_time = future_time.to_rfc3339(); + + let proposal = raw_proposal.replace("{consumer_chain_id}", consumer_chain_id); + let proposal = proposal.replace("{spawn_time}", &spawn_time); + + self.write_file("consumer_proposal_topn.json", &proposal)?; + + submit_consumer_chain_proposal( + self.chain_id.as_str(), + &self.command_path, + &self.home_path, + &self.rpc_listen_address(), + fees, + ) + } + + fn create_permisionless_consumer( + &self, + consumer_chain_id: &str, + fees: &str, + ) -> Result { + let raw_proposal = r#" + { + "chain_id": "{consumer_chain_id}", + "metadata": { + "name": "consumer-1-metadata-name", + "description":"consumer-1-metadata-description", + "metadata": "consumer-1-metadata-metadata" + }, + "initialization_parameters": { + "initial_height": { + "revision_number": 0, + "revision_height": 1 + }, + "genesis_hash": "Z2VuX2hhc2g=", + "binary_hash": "YmluX2hhc2g=", + "spawn_time": "{spawn_time}", + "unbonding_period": 100000000000, + "ccv_timeout_period": 100000000000, + "transfer_timeout_period": 100000000000, + "consumer_redistribution_fraction": "0.75", + "blocks_per_distribution_transmission": 10, + "historical_entries": 10000, + "distribution_transmission_channel": "" + } + }"#; + let current_time: DateTime = Utc::now(); + let future_time = current_time + ChronoDuration::seconds(30); + let spawn_time = future_time.to_rfc3339(); + + let proposal = raw_proposal.replace("{consumer_chain_id}", consumer_chain_id); + let proposal = proposal.replace("{spawn_time}", &spawn_time); + + self.write_file("consumer_proposal.json", &proposal)?; + + create_consumer( + self.chain_id.as_str(), + &self.command_path, + &self.home_path, + &self.rpc_listen_address(), + fees, + ) + } + + fn validator_opt_in(&self, consumer_chain_id: &str, fees: &str) -> Result<(), Error> { + validator_opt_in( + self.chain_id.as_str(), + &self.command_path, + &self.home_path, + &self.rpc_listen_address(), + fees, + consumer_chain_id, + ) + } + + fn update_consumer( + &self, + consumer_chain_id: &str, + fees: &str, + validator: &str, + ) -> Result<(), Error> { + let gov_address = query_auth_module( + self.chain_id.as_str(), + &self.command_path, + &self.home_path, + &self.rpc_listen_address(), + "gov", + )?; let res = simple_exec( self.chain_id.as_str(), "jq", @@ -294,37 +437,23 @@ impl ChainBootstrapMethodsExt for ChainDriver { spawn_time.pop(); let raw_proposal = r#" { - "title": "Create consumer chain", - "summary": "First consumer chain", - "chain_id": "{consumer_chain_id}", - "initial_height": { - "revision_number": 1, - "revision_height": 1 - }, - "genesis_hash": "Z2VuX2hhc2g=", - "binary_hash": "YmluX2hhc2g=", - "spawn_time": "{spawn_time}", - "blocks_per_distribution_transmission": 10, - "consumer_redistribution_fraction": "0.75", - "distribution_transmission_channel": "", - "historical_entries": 10000, - "transfer_timeout_period": 100000000000, - "ccv_timeout_period": 100000000000, - "unbonding_period": 100000000000, - "deposit": "10000001stake", - "top_N": 95, - "validators_power_cap": 0, - "validator_set_cap": 0, - "allowlist": [], - "denylist": [] + "consumer_id": "{consumer_chain_id}", + "owner_address": "{validator}", + "new_owner_address": "{gov_address}", + "metadata": { + "name": "consumer-1-metadata-name", + "description":"consumer-1-metadata-description", + "metadata": "consumer-1-metadata-metadata" + } }"#; let proposal = raw_proposal.replace("{consumer_chain_id}", consumer_chain_id); - let proposal = proposal.replace("{spawn_time}", &spawn_time); + let proposal = proposal.replace("{gov_address}", &gov_address); + let proposal = proposal.replace("{validator}", validator); - self.write_file("consumer_proposal.json", &proposal)?; + self.write_file("consumer_update_proposal.json", &proposal)?; - submit_consumer_chain_proposal( + update_consumer( self.chain_id.as_str(), &self.command_path, &self.home_path, diff --git a/tools/test-framework/src/framework/binary/ics.rs b/tools/test-framework/src/framework/binary/ics.rs index 24086eff6c..e620ccfedc 100644 --- a/tools/test-framework/src/framework/binary/ics.rs +++ b/tools/test-framework/src/framework/binary/ics.rs @@ -1,17 +1,16 @@ use std::str::FromStr; +use std::thread; use crate::bootstrap::consumer::bootstrap_consumer_node; use crate::bootstrap::single::bootstrap_single_node; use crate::chain::builder::ChainBuilder; use crate::chain::chain_type::ChainType; -use crate::chain::cli::upgrade::vote_proposal; use crate::chain::ext::bootstrap::ChainBootstrapMethodsExt; use crate::error::Error; use crate::framework::base::{run_basic_test, BasicTest, HasOverrides, TestConfigOverride}; use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; use crate::prelude::FullNode; use crate::types::config::TestConfig; -use crate::util::proposal_status::ProposalStatus; /** Runs a test case that implements [`InterchainSecurityChainTest`]. @@ -71,47 +70,29 @@ where 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(), - &provider_fee, - "2023-05-31T12:09:47.048227Z", - )?; + let consumer_id = node_a + .chain_driver + .create_permisionless_consumer(chain_id.as_str(), &provider_fee)?; - node_a.chain_driver.assert_proposal_status( - node_a.chain_driver.chain_id.as_str(), - &node_a.chain_driver.command_path, - &node_a.chain_driver.home_path, - &node_a.chain_driver.rpc_listen_address(), - ProposalStatus::VotingPeriod, - "1", - )?; + thread::sleep(std::time::Duration::from_secs(3)); - vote_proposal( - node_a.chain_driver.chain_id.as_str(), - &node_a.chain_driver.command_path, - &node_a.chain_driver.home_path, - &node_a.chain_driver.rpc_listen_address(), + node_a.chain_driver.update_consumer( + &consumer_id, &provider_fee, - "1", + node_a.wallets.validator.address.as_str(), )?; - node_a.chain_driver.assert_proposal_status( - node_a.chain_driver.chain_id.as_str(), - &node_a.chain_driver.command_path, - &node_a.chain_driver.home_path, - &node_a.chain_driver.rpc_listen_address(), - ProposalStatus::Passed, - "1", - )?; + thread::sleep(std::time::Duration::from_secs(3)); let node_b = bootstrap_consumer_node( builder, - "consumer", + &consumer_id, &node_a, |config| self.test.get_overrides().modify_node_config(config), |genesis| self.test.get_overrides().modify_genesis_file(genesis), 1, &node_a.chain_driver, + &provider_fee, )?; let _node_process_a = node_a.process.clone(); From c4153d65b659d12a188bc8150f53ad943adbfe94 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Fri, 8 Nov 2024 09:26:21 +0100 Subject: [PATCH 211/224] Fix gRPC over IPv6 (#4231) * Improve TLS configuration to only configure if required * Add changelog entry * Move and improve changelog --- .../4237-improve-tls-configuration.md | 3 +++ crates/relayer/src/error.rs | 4 ++++ crates/relayer/src/util.rs | 23 +++++++++---------- 3 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer/4237-improve-tls-configuration.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/4237-improve-tls-configuration.md b/.changelog/unreleased/bug-fixes/ibc-relayer/4237-improve-tls-configuration.md new file mode 100644 index 0000000000..1c246d6aef --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer/4237-improve-tls-configuration.md @@ -0,0 +1,3 @@ +- Fix an issue where Hermes would fail to connect to gRPC servers + with an IPv6 address. + ([\#4237](https://github.com/informalsystems/hermes/issues/4237)) \ No newline at end of file diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index 8fa5bd4847..c8ac6d656d 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -607,6 +607,10 @@ define_error! { [ TraceError ] |_| { "HTTP response body error" }, + InvalidHttpHost + { endpoint: String } + |e| { format!("HTTP host is invalid for the endpoint `{}`", e.endpoint) }, + JsonDeserialize [ TraceError ] |_| { "JSON deserialization error" }, diff --git a/crates/relayer/src/util.rs b/crates/relayer/src/util.rs index 497999af6f..9799e6cc4e 100644 --- a/crates/relayer/src/util.rs +++ b/crates/relayer/src/util.rs @@ -21,28 +21,27 @@ 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 builder = tonic::transport::Channel::builder(grpc_addr.clone()); // Don't configures TLS for the endpoint if using IPv6 - let builder = if is_ipv6(grpc_addr) { - builder - } else { + let builder = if grpc_addr.scheme() == Some(&http::uri::Scheme::HTTPS) { + let domain = grpc_addr + .host() + .map(|d| d.replace(['[', ']'], "")) + .ok_or_else(|| crate::error::Error::invalid_http_host(grpc_addr.to_string()))?; + let tls_config = tonic::transport::ClientTlsConfig::new() + .with_native_roots() + .domain_name(domain); builder .tls_config(tls_config) .map_err(crate::error::Error::grpc_transport)? + } else { + builder }; + let channel = builder .connect() .await .map_err(crate::error::Error::grpc_transport)?; Ok(client_constructor(channel)) } - -fn is_ipv6(uri: &tonic::transport::Uri) -> bool { - if let Some(host) = uri.host() { - host.starts_with('[') && host.ends_with(']') - } else { - false - } -} From 10f75c2a5ae27b124a1cde366d7fc50dc8833765 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Nov 2024 11:15:36 +0100 Subject: [PATCH 212/224] Bump prost from 0.13.2 to 0.13.3 (#4216) Bumps [prost](https://github.com/tokio-rs/prost) from 0.13.2 to 0.13.3. - [Release notes](https://github.com/tokio-rs/prost/releases) - [Changelog](https://github.com/tokio-rs/prost/blob/master/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/prost/compare/v0.13.2...v0.13.3) --- 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 a2a7a87a97..16ca4d6b81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2446,9 +2446,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2ecbe40f08db5c006b5764a2645f7f3f141ce756412ac9e1dd6087e6d32995" +checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", "prost-derive", @@ -2456,9 +2456,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf0c195eebb4af52c752bec4f52f645da98b6e92077a04110c7f349477ae5ac" +checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", "itertools", From 93c4b7ae1a9a347b345faa2611f9bdcffcf6b44e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:21:11 +0100 Subject: [PATCH 213/224] Bump serial_test from 3.1.1 to 3.2.0 (#4242) Bumps [serial_test](https://github.com/palfrey/serial_test) from 3.1.1 to 3.2.0. - [Release notes](https://github.com/palfrey/serial_test/releases) - [Commits](https://github.com/palfrey/serial_test/compare/v3.1.1...v3.2.0) --- updated-dependencies: - dependency-name: serial_test 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 16ca4d6b81..9fd0e53a28 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3086,9 +3086,9 @@ dependencies = [ [[package]] name = "serial_test" -version = "3.1.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b4b487fe2acf240a021cf57c6b2b4903b1e78ca0ecd862a71b71d2a51fed77d" +checksum = "1b258109f244e1d6891bf1053a55d63a5cd4f8f4c30cf9a1280989f80e7a1fa9" dependencies = [ "futures", "log", @@ -3100,9 +3100,9 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "3.1.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82fe9db325bcef1fbcde82e078a5cc4efdf787e96b3b9cf45b50b529f2083d67" +checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index b69d6c052e..64146f58c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -99,7 +99,7 @@ serde = "1.0.214" serde_derive = "1.0.104" serde_json = "1.0.132" serde_yaml = "0.9.34" -serial_test = "3.1.1" +serial_test = "3.2.0" sha2 = "0.10.6" signal-hook = "0.3.17" signature = "2.1.0" From 11b9c5b753a6b284479f53bba4575a040633e629 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:21:50 +0100 Subject: [PATCH 214/224] Bump thiserror from 1.0.68 to 1.0.69 (#4244) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.68 to 1.0.69. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.68...1.0.69) --- 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 9fd0e53a28..d971a972a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3601,18 +3601,18 @@ checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" [[package]] name = "thiserror" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 64146f58c9..47f9d39fe2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -106,7 +106,7 @@ signature = "2.1.0" strum = "0.25" subtle-encoding = "0.5.1" test-log = "0.2.14" -thiserror = "1.0.68" +thiserror = "1.0.69" time = "0.3" tiny-bip39 = "1.0.0" tiny-keccak = { version = "2.0.2", default-features = false } From b2799827d9d217ddb126adcd3dbe803d8d8d1b9e Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Thu, 14 Nov 2024 10:26:23 +0100 Subject: [PATCH 215/224] Use correct endpoint when logging query error (#4249) * Use correct endpoint when logging query error * Add changelog entry --- .../unreleased/bug-fixes/ibc-relayer/4204-fix-errors-logs.md | 3 +++ crates/relayer/src/link/relay_path.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer/4204-fix-errors-logs.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/4204-fix-errors-logs.md b/.changelog/unreleased/bug-fixes/ibc-relayer/4204-fix-errors-logs.md new file mode 100644 index 0000000000..539ae153ef --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer/4204-fix-errors-logs.md @@ -0,0 +1,3 @@ +- Fix error messages in logs to accurately display the RPC endpoint + that failed. + ([\#4250](https://github.com/informalsystems/hermes/issues/4250)) \ 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 8038f03995..ff16acd086 100644 --- a/crates/relayer/src/link/relay_path.rs +++ b/crates/relayer/src/link/relay_path.rs @@ -557,7 +557,7 @@ impl RelayPath { let dst_latest_info = self .dst_chain() .query_application_status() - .map_err(|e| LinkError::query(self.src_chain().id(), e))?; + .map_err(|e| LinkError::query(self.dst_chain().id(), e))?; let dst_latest_height = dst_latest_info.height; @@ -1672,7 +1672,7 @@ impl RelayPath { let dst_status = self .dst_chain() .query_application_status() - .map_err(|e| LinkError::query(self.src_chain().id(), e))?; + .map_err(|e| LinkError::query(self.dst_chain().id(), e))?; let dst_current_height = dst_status.height; From ea66dcde12f6c0f53f708401a4f55d282e866b03 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:51:18 +0100 Subject: [PATCH 216/224] Bump anyhow from 1.0.86 to 1.0.93 (#4245) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.86 to 1.0.93. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.86...1.0.93) --- 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 d971a972a2..f78d7adbe6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -131,9 +131,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "arc-swap" From f5b58dbce3b1d2763037d3017b485e613128f6dc Mon Sep 17 00:00:00 2001 From: Leo Pang <34628052+allthatjazzleo@users.noreply.github.com> Date: Mon, 18 Nov 2024 18:03:24 +0800 Subject: [PATCH 217/224] Allow osmosis testnet to use `dynamic_gas_price` (#4248) * allow osmosis testnet to use dynamic_gas_price * Fix method to retrieve a chain name * Split changelog entry * Apply GitHub suggestions --------- Co-authored-by: Luca Joss Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> --- .../4247-fix-chain-name-extraction.md | 3 + .../src/core/ics24_host/identifier.rs | 95 ++++++++++++++++++- 2 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 .changelog/unreleased/bug-fixes/ibc-relayer/4247-fix-chain-name-extraction.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/4247-fix-chain-name-extraction.md b/.changelog/unreleased/bug-fixes/ibc-relayer/4247-fix-chain-name-extraction.md new file mode 100644 index 0000000000..6f538ac1d9 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/ibc-relayer/4247-fix-chain-name-extraction.md @@ -0,0 +1,3 @@ +- Fix the extraction of the chain name from the chain ID to ensure + accurate identification. + ([\#4247](https://github.com/informalsystems/hermes/issues/4247)) \ No newline at end of file diff --git a/crates/relayer-types/src/core/ics24_host/identifier.rs b/crates/relayer-types/src/core/ics24_host/identifier.rs index 8c472d8947..dbe60ea337 100644 --- a/crates/relayer-types/src/core/ics24_host/identifier.rs +++ b/crates/relayer-types/src/core/ics24_host/identifier.rs @@ -68,8 +68,20 @@ impl ChainId { /// Extract the chain name from this chain identifier. The chain name /// consists of the first part of the identifier, before the dash. - pub fn name(&self) -> String { - self.id.split('-').take(1).collect::>().join("") + /// If the value following the dash is not an integer, or if there are no + /// dashes, the entire chain ID will be returned. + pub fn name(&self) -> &str { + self.id + .rsplit_once('-') + .and_then(|(chain_name, rev_number_str)| { + // Parses the revision number string into a `u64` and checks its validity. + if rev_number_str.parse::().is_ok() { + Some(chain_name) + } else { + None + } + }) + .unwrap_or_else(|| &self.id) } /// Extract the version from the given chain identifier. @@ -442,3 +454,82 @@ impl Display for PortChannelId { write!(f, "{}/{}", self.port_id, self.channel_id) } } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_chain_id_name() { + let chain_id = ChainId::from_str("ibc-5").unwrap(); + assert_eq!(chain_id.name(), "ibc".to_owned()); + } + + #[test] + fn test_chain_id_name_with_test() { + let chain_id = ChainId::from_str("ibc-test-5").unwrap(); + assert_eq!(chain_id.name(), "ibc-test".to_owned()); + } + + #[test] + fn test_chain_id_name_no_dash() { + let chain_id = ChainId::from_str("ibc5").unwrap(); + assert_eq!(chain_id.name(), "ibc5".to_owned()); + } + + #[test] + fn standard_chain_names() { + let test_cases = [ + ("ibc-0", "ibc"), + ("osmosis-1", "osmosis"), + ("cosmoshub-4", "cosmoshub"), + ("juno-mainnet-1", "juno-mainnet"), + ("akash-testnet-2", "akash-testnet"), + ("stargaze-123", "stargaze"), + ("crypto-org-chain-0", "crypto-org-chain"), + ("mars-hub-1", "mars-hub"), + ("evmos-9000-1", "evmos-9000"), + ]; + + for (input, expected) in test_cases { + let chain_id = ChainId::from_str(input).unwrap(); + assert_eq!(chain_id.name(), expected); + } + } + + #[test] + fn missing_or_invalid_revision_numbers() { + let test_cases = [ + ("osmosis", "osmosis"), + ("ibc-test", "ibc-test"), + ("cosmos-hub", "cosmos-hub"), + ("juno-", "juno-"), + ("akash-testnet-x", "akash-testnet-x"), + ("stargaze-abc", "stargaze-abc"), + ("chain-123-xyz", "chain-123-xyz"), + ]; + + for (input, expected) in test_cases { + let chain_id = ChainId::from_str(input).unwrap(); + assert_eq!(chain_id.name(), expected); + } + } + + #[test] + fn edge_cases() { + let test_cases = [ + ("", ""), + ("-", "-"), + ("chain-", "chain-"), + ( + "chain-9999999999999999999999", + "chain-9999999999999999999999", + ), // number too large for u64 + ]; + + for (input, expected) in test_cases { + let chain_id = ChainId::from_str(input).unwrap(); + assert_eq!(chain_id.name(), expected); + } + } +} From 282b943dab7d6142719f8a9dd0f4e40f45131721 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Mon, 18 Nov 2024 19:27:54 +0100 Subject: [PATCH 218/224] Improve redundant packet logs (#4254) * Output an info log if the broadcasted packet is redundant instead of an error * Fix redundant packet log * Add additional information in redundant packet log * Add changelog entry --- .../4252-improve-redundant-packet-log.md | 3 +++ crates/relayer/src/chain/cosmos/retry.rs | 13 ++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/4252-improve-redundant-packet-log.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4252-improve-redundant-packet-log.md b/.changelog/unreleased/improvements/ibc-relayer/4252-improve-redundant-packet-log.md new file mode 100644 index 0000000000..8bf8a29a8d --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/4252-improve-redundant-packet-log.md @@ -0,0 +1,3 @@ +- Improve log message when broadcasting redundant packet and set it + to `INFO` instead of `ERROR`. + ([\#4252](https://github.com/informalsystems/hermes/issues/4252)) \ No newline at end of file diff --git a/crates/relayer/src/chain/cosmos/retry.rs b/crates/relayer/src/chain/cosmos/retry.rs index 725af8e14a..45c4074ba3 100644 --- a/crates/relayer/src/chain/cosmos/retry.rs +++ b/crates/relayer/src/chain/cosmos/retry.rs @@ -1,7 +1,7 @@ use core::time::Duration; use std::thread; -use tracing::{debug, error, instrument, warn}; +use tracing::{debug, error, info, instrument, warn}; use ibc_proto::google::protobuf::Any; use tendermint::abci::Code; @@ -149,6 +149,17 @@ async fn do_send_tx_with_account_sequence_retry( Ok(response) } + Code::Err(code) if response.log.contains("packet messages are redundant") => { + info!( + ?response, + diagnostic = response.log, + ?code, + "broadcast tx was not completed, all packets in tx have been relayed already, no fees were consumed" + ); + + Ok(response) + } + // Gas estimation succeeded, but broadcast_tx_sync failed with unrecoverable error. Code::Err(code) => { // Do not increase the account s.n. since CheckTx step of broadcast_tx_sync has failed. From 542e14f02346bea41cbeff42b51d3823819a1b77 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:38:27 +0100 Subject: [PATCH 219/224] Release Hermes v1.10.4 (#4258) * Update changelog for release * Bump versions * Cargo update * Corrected guide by removing grpc from http basic authentication compatibility --- .../ibc-relayer/4204-fix-errors-logs.md | 0 .../4237-improve-tls-configuration.md | 0 .../4247-fix-chain-name-extraction.md | 0 .../4153-add-ipv6-test.md | 0 .../improvements/4178-compat-mode-infer.md | 0 .../4202-update-simd-versions.md | 0 .../4204-update-gaia-to-v20.md | 0 ...3-update-misbehaviour-to-permissionless.md | 0 .../4252-improve-redundant-packet-log.md | 0 .changelog/v1.10.4/summary.md | 3 + CHANGELOG.md | 48 ++ Cargo.lock | 664 +++++++++++++----- 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 +- .../configuration/configure-hermes.md | 3 +- guide/src/templates/hermes-version.md | 2 +- tools/integration-test/Cargo.toml | 2 +- tools/test-framework/Cargo.toml | 2 +- 27 files changed, 544 insertions(+), 218 deletions(-) rename .changelog/{unreleased => v1.10.4}/bug-fixes/ibc-relayer/4204-fix-errors-logs.md (100%) rename .changelog/{unreleased => v1.10.4}/bug-fixes/ibc-relayer/4237-improve-tls-configuration.md (100%) rename .changelog/{unreleased => v1.10.4}/bug-fixes/ibc-relayer/4247-fix-chain-name-extraction.md (100%) rename .changelog/{unreleased => v1.10.4}/features/ibc-integration-test/4153-add-ipv6-test.md (100%) rename .changelog/{unreleased => v1.10.4}/improvements/4178-compat-mode-infer.md (100%) rename .changelog/{unreleased => v1.10.4}/improvements/ibc-integration-test/4202-update-simd-versions.md (100%) rename .changelog/{unreleased => v1.10.4}/improvements/ibc-integration-test/4204-update-gaia-to-v20.md (100%) rename .changelog/{unreleased => v1.10.4}/improvements/ibc-relayer/4153-update-misbehaviour-to-permissionless.md (100%) rename .changelog/{unreleased => v1.10.4}/improvements/ibc-relayer/4252-improve-redundant-packet-log.md (100%) create mode 100644 .changelog/v1.10.4/summary.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/4204-fix-errors-logs.md b/.changelog/v1.10.4/bug-fixes/ibc-relayer/4204-fix-errors-logs.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer/4204-fix-errors-logs.md rename to .changelog/v1.10.4/bug-fixes/ibc-relayer/4204-fix-errors-logs.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/4237-improve-tls-configuration.md b/.changelog/v1.10.4/bug-fixes/ibc-relayer/4237-improve-tls-configuration.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer/4237-improve-tls-configuration.md rename to .changelog/v1.10.4/bug-fixes/ibc-relayer/4237-improve-tls-configuration.md diff --git a/.changelog/unreleased/bug-fixes/ibc-relayer/4247-fix-chain-name-extraction.md b/.changelog/v1.10.4/bug-fixes/ibc-relayer/4247-fix-chain-name-extraction.md similarity index 100% rename from .changelog/unreleased/bug-fixes/ibc-relayer/4247-fix-chain-name-extraction.md rename to .changelog/v1.10.4/bug-fixes/ibc-relayer/4247-fix-chain-name-extraction.md diff --git a/.changelog/unreleased/features/ibc-integration-test/4153-add-ipv6-test.md b/.changelog/v1.10.4/features/ibc-integration-test/4153-add-ipv6-test.md similarity index 100% rename from .changelog/unreleased/features/ibc-integration-test/4153-add-ipv6-test.md rename to .changelog/v1.10.4/features/ibc-integration-test/4153-add-ipv6-test.md diff --git a/.changelog/unreleased/improvements/4178-compat-mode-infer.md b/.changelog/v1.10.4/improvements/4178-compat-mode-infer.md similarity index 100% rename from .changelog/unreleased/improvements/4178-compat-mode-infer.md rename to .changelog/v1.10.4/improvements/4178-compat-mode-infer.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4202-update-simd-versions.md b/.changelog/v1.10.4/improvements/ibc-integration-test/4202-update-simd-versions.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4202-update-simd-versions.md rename to .changelog/v1.10.4/improvements/ibc-integration-test/4202-update-simd-versions.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4204-update-gaia-to-v20.md b/.changelog/v1.10.4/improvements/ibc-integration-test/4204-update-gaia-to-v20.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4204-update-gaia-to-v20.md rename to .changelog/v1.10.4/improvements/ibc-integration-test/4204-update-gaia-to-v20.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4153-update-misbehaviour-to-permissionless.md b/.changelog/v1.10.4/improvements/ibc-relayer/4153-update-misbehaviour-to-permissionless.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/4153-update-misbehaviour-to-permissionless.md rename to .changelog/v1.10.4/improvements/ibc-relayer/4153-update-misbehaviour-to-permissionless.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4252-improve-redundant-packet-log.md b/.changelog/v1.10.4/improvements/ibc-relayer/4252-improve-redundant-packet-log.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/4252-improve-redundant-packet-log.md rename to .changelog/v1.10.4/improvements/ibc-relayer/4252-improve-redundant-packet-log.md diff --git a/.changelog/v1.10.4/summary.md b/.changelog/v1.10.4/summary.md new file mode 100644 index 0000000000..52fb5319d0 --- /dev/null +++ b/.changelog/v1.10.4/summary.md @@ -0,0 +1,3 @@ +*November 19th, 2024* + +This release introduces compatibility with the new Consumer ID for Permissionless ICS, improves detection of Tendermint/CometBFT versions for non-standard chains, and enhances IPv6 support for gRPC connections. Log messages have been refined for better clarity, including adjusting redundant packet broadcasts to INFO. diff --git a/CHANGELOG.md b/CHANGELOG.md index f901697dd4..6733c3d778 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,53 @@ # CHANGELOG +## v1.10.4 + +*November 19th, 2024* + +This release introduces compatibility with the new Consumer ID for Permissionless ICS, improves detection of Tendermint/CometBFT versions for non-standard chains, and enhances IPv6 support for gRPC connections. Log messages have been refined for better clarity, including adjusting redundant packet broadcasts to INFO. + +### BUG FIXES + +- [Relayer Library](relayer) + - Fix error messages in logs to accurately display the RPC endpoint + that failed. + ([\#4250](https://github.com/informalsystems/hermes/issues/4250)) + - Fix an issue where Hermes would fail to connect to gRPC servers + with an IPv6 address. + ([\#4237](https://github.com/informalsystems/hermes/issues/4237)) + - Fix the extraction of the chain name from the chain ID to ensure + accurate identification. + ([\#4247](https://github.com/informalsystems/hermes/issues/4247)) + +### FEATURES + +- [Integration Test Framework](tools/test-framework) + - Disable TLS configuration when using IPv6 for the gRPC endpoint. + ([\#4224](https://github.com/informalsystems/hermes/issues/4224)) + +### IMPROVEMENTS + +- General + - Improve detection of Tendermint/CometBFT compatibility + mode when a chain runs a non-standard version + ([\#4178](https://github.com/informalsystems/hermes/issues/4178)) +- [Relayer Library](relayer) + - Use CCV consumer ID to submit misbehaviour messages + ([\#4153](https://github.com/informalsystems/hermes/issues/4153)) + - Improve log message when broadcasting redundant packet and set it + to `INFO` instead of `ERROR`. + ([\#4252](https://github.com/informalsystems/hermes/issues/4252)) +- [Integration Test Framework](tools/test-framework) + - Update the versions of the following `simd` running the integration tests in the CI: + * From `v6.3.0` to `v6.3.1` + * From `v7.4.0` to `v7.8.0` + * From `v8.3.1` to `v8.5.1` + * From `v9.0.0-beta.1` to `v9.0.0-rc.0` + + ([\#4202](https://github.com/informalsystems/hermes/issues/4202)) + - Update the version of Gaia running the integration tests in the CI from `v18.1.0` + to `v20.0.0` ([\#4204](https://github.com/informalsystems/hermes/issues/4204)) + ## v1.10.3 *September 2nd, 2024* diff --git a/Cargo.lock b/Cargo.lock index f78d7adbe6..55cd5f92ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,7 +38,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -82,9 +82,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -97,36 +97,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -143,9 +143,9 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[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" @@ -222,9 +222,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" @@ -239,7 +239,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "itoa", "matchit", "memchr", @@ -253,19 +253,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.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", - "axum-core 0.4.3", + "axum-core 0.4.5", "bytes", "futures-util", "http 1.1.0", @@ -280,7 +280,7 @@ dependencies = [ "rustversion", "serde", "sync_wrapper 1.0.1", - "tower", + "tower 0.5.1", "tower-layer", "tower-service", ] @@ -304,9 +304,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", @@ -317,7 +317,7 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 0.1.2", + "sync_wrapper 1.0.1", "tower-layer", "tower-service", ] @@ -508,9 +508,9 @@ checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" [[package]] name = "cc" -version = "1.1.15" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ "shlex", ] @@ -612,9 +612,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "console" @@ -670,9 +670,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cosmos-sdk-proto" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c1a5856db92cd90dddc955bce308703d3519fb33ae3d0b8f3658e9cfd05c3f" +checksum = "462e1f6a8e005acc8835d32d60cbd7973ed65ea2a8d8473830e675f050956427" dependencies = [ "informalsystems-pbjson", "prost", @@ -683,9 +683,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" dependencies = [ "libc", ] @@ -892,6 +892,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "ecdsa" version = "0.16.9" @@ -990,9 +1001,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -1048,9 +1059,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "ff" @@ -1113,9 +1124,9 @@ dependencies = [ [[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", @@ -1128,9 +1139,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", @@ -1138,15 +1149,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", @@ -1155,15 +1166,15 @@ 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", "quote", @@ -1172,21 +1183,21 @@ dependencies = [ [[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", @@ -1273,7 +1284,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.4.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -1292,7 +1303,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.4.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -1317,6 +1328,12 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "hashbrown" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" + [[package]] name = "hdpath" version = "0.6.3" @@ -1432,9 +1449,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" @@ -1460,9 +1477,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -1484,9 +1501,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -1511,7 +1528,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", @@ -1519,11 +1536,11 @@ dependencies = [ [[package]] name = "hyper-timeout" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3203a961e5c83b6f5498933e78b6b263e208c197b63e9c6c53cc82ffd3f63793" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" dependencies = [ - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "pin-project-lite", "tokio", @@ -1532,20 +1549,19 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.0", "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] @@ -1575,7 +1591,7 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.29.3" +version = "0.29.4" dependencies = [ "async-trait", "flex-error", @@ -1595,7 +1611,7 @@ dependencies = [ [[package]] name = "ibc-integration-test" -version = "0.29.3" +version = "0.29.4" dependencies = [ "byte-unit", "http 1.1.0", @@ -1614,9 +1630,9 @@ dependencies = [ [[package]] name = "ibc-proto" -version = "0.51.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b9db9a33cb15d6eb56105cd9b70db016e56bcae74a8adaa1627e5b24d1f1d2" +checksum = "9b70f517162e74e2d35875b8b94bf4d1e45f2c69ef3de452dc855944455d33ca" dependencies = [ "base64 0.22.1", "bytes", @@ -1633,7 +1649,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.29.3" +version = "0.29.4" dependencies = [ "anyhow", "async-stream", @@ -1702,7 +1718,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "1.10.3" +version = "1.10.4" dependencies = [ "abscissa_core", "clap", @@ -1743,7 +1759,7 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.29.3" +version = "0.29.4" dependencies = [ "axum 0.6.20", "crossbeam-channel", @@ -1758,7 +1774,7 @@ dependencies = [ [[package]] name = "ibc-relayer-types" -version = "0.29.3" +version = "0.29.4" dependencies = [ "bytes", "derive_more", @@ -1789,7 +1805,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.29.3" +version = "0.29.4" dependencies = [ "axum 0.6.20", "dashmap", @@ -1808,7 +1824,7 @@ dependencies = [ [[package]] name = "ibc-test-framework" -version = "0.29.3" +version = "0.29.4" dependencies = [ "chrono", "color-eyre", @@ -1859,6 +1875,124 @@ dependencies = [ "sha3", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1867,12 +2001,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1902,12 +2047,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", + "hashbrown 0.15.1", ] [[package]] @@ -1922,9 +2067,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" @@ -1949,18 +2094,18 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] [[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", @@ -1985,9 +2130,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.158" +version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "libredox" @@ -2005,6 +2150,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -2330,18 +2481,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", @@ -2350,9 +2501,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2422,9 +2573,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -2529,18 +2680,18 @@ 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", ] [[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", ] @@ -2564,7 +2715,7 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.8", + "regex-automata 0.4.9", "regex-syntax 0.8.5", ] @@ -2579,9 +2730,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -2614,7 +2765,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls", "ipnet", "js-sys", @@ -2704,9 +2855,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.35" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", @@ -2736,22 +2887,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.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" dependencies = [ "log", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.7", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -2775,7 +2926,7 @@ 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", @@ -2788,7 +2939,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", "security-framework", @@ -2805,19 +2956,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.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -2831,9 +2981,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", @@ -2842,9 +2992,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -2863,20 +3013,20 @@ dependencies = [ [[package]] name = "scc" -version = "2.1.16" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeb7ac86243095b70a7920639507b71d51a63390d1ba26c4f60a552fbb914a37" +checksum = "66b202022bb57c049555430e11fc22fea12909276a80a4c3d368da36ac1d88ed" dependencies = [ "sdd", ] [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2897,9 +3047,9 @@ dependencies = [ [[package]] name = "sdd" -version = "3.0.2" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0495e4577c672de8254beb68d01a9b62d0e8a13c099edecdbedccce3223cd29f" +checksum = "49c1eeaf4b6a87c7479688c6d52b9f1153cedd3c489300564f932b065c6eab95" [[package]] name = "sec1" @@ -2961,9 +3111,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -2980,9 +3130,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -3008,9 +3158,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -3019,9 +3169,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -3052,9 +3202,9 @@ dependencies = [ [[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", ] @@ -3077,7 +3227,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", @@ -3251,6 +3401,12 @@ dependencies = [ "der", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3352,6 +3508,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -3381,9 +3548,9 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", @@ -3687,6 +3854,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -3704,9 +3881,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", @@ -3758,7 +3935,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.12", + "rustls 0.23.17", "rustls-pki-types", "tokio", ] @@ -3776,9 +3953,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", @@ -3819,11 +3996,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", @@ -3838,26 +4015,26 @@ checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", - "axum 0.7.5", + "axum 0.7.9", "base64 0.22.1", "bytes", "h2 0.4.6", "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-timeout", "hyper-util", "percent-encoding", "pin-project", "prost", "rustls-native-certs 0.8.0", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "socket2", "tokio", "tokio-rustls 0.26.0", "tokio-stream", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -3883,6 +4060,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" @@ -4042,38 +4233,32 @@ dependencies = [ "static_assertions", ] -[[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" +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" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229730647fbc343e3a80e463c1db7f78f3855d3f3739bee0dda773c9a037c90a" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "unsafe-libyaml" @@ -4089,9 +4274,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", "idna", @@ -4110,12 +4295,24 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + [[package]] name = "utf8-width" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86bd8d4e895da8537e5315b8254664e6b769c4ff3db18321b297a1e7004392e3" +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -4179,9 +4376,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -4190,9 +4387,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -4205,9 +4402,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -4217,9 +4414,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4227,9 +4424,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -4240,15 +4437,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -4444,9 +4641,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", ] @@ -4461,6 +4658,42 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure 0.13.1", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -4482,6 +4715,27 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure 0.13.1", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -4501,3 +4755,25 @@ dependencies = [ "quote", "syn 2.0.87", ] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] diff --git a/Cargo.toml b/Cargo.toml index 47f9d39fe2..c7be1ceaaf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,14 +20,14 @@ exclude = [ [workspace.dependencies] # Hermes dependencies -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" } +ibc-relayer-cli = { version = "1.10.4", path = "crates/relayer-cli" } +ibc-relayer = { version = "0.29.4", path = "crates/relayer" } +ibc-relayer-rest = { version = "0.29.4", path = "crates/relayer-rest" } +ibc-relayer-types = { version = "0.29.4", path = "crates/relayer-types" } +ibc-chain-registry = { version = "0.29.4", path = "crates/chain-registry" } +ibc-telemetry = { version = "0.29.4", path = "crates/telemetry" } +ibc-test-framework = { version = "0.29.4", path = "tools/test-framework" } +ibc-integration-test = { version = "0.29.4", path = "tools/integration-test" } # IBC dependencies ibc-proto = "0.51.0" diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index 967fbdc54e..5968134be3 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.3" +version = "0.29.4" 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 c2f947ad0b..fbdcd20d0d 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.3" +version = "1.10.4" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index 7b406f4443..cf44344abf 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.3" +version = "0.29.4" 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 c5c3df0dbc..301cce7c5a 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.3".to_string(), + version: "0.29.4".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 b9ae3c2f9b..7b0f1d1c28 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.3" +version = "0.29.4" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 12e14792e8..a5560a766c 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer" -version = "0.29.3" +version = "0.29.4" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index 3ceac0c335..42d08089d9 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.3/ +//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.10.4/ extern crate alloc; @@ -48,4 +48,4 @@ pub mod upgrade_chain; pub mod util; pub mod worker; -pub const HERMES_VERSION: &str = "1.10.3"; +pub const HERMES_VERSION: &str = "1.10.4"; diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index b6ab30faf6..eb22530255 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-telemetry" -version = "0.29.3" +version = "0.29.4" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/guide/README.md b/guide/README.md index 37a44860ba..683e3133fc 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.3`. +Current version: `v1.10.4`. 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 1813766c20..8d8617b1d7 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -1,6 +1,6 @@ # Summary -# Hermes v1.10.3 +# Hermes v1.10.4 --- - [Introduction](./index.md) diff --git a/guide/src/documentation/configuration/configure-hermes.md b/guide/src/documentation/configuration/configure-hermes.md index c63fab7200..c5cb5ec0ee 100644 --- a/guide/src/documentation/configuration/configure-hermes.md +++ b/guide/src/documentation/configuration/configure-hermes.md @@ -136,7 +136,7 @@ needs in order to relay on behalf of consumer chains. ## Connecting to a full node protected by HTTP Basic Authentication To connect to a full node protected by [HTTP Basic Authentication][http-basic-auth], -specify the username and password in the `rpc_addr`, `grpc_addr` and `event_source` settings +specify the username and password in the `rpc_addr` and `event_source` settings under the chain configuration in `config.toml`. Here is an example with username `hello` and password `world`, assuming the RPC, WebSocket and gRPC servers @@ -149,7 +149,6 @@ id = 'my-chain-0' # ... rpc_addr = 'https://hello:world@mydomain.com:26657' -grpc_addr = 'https://hello:world@mydomain.com:9090' event_source = { mode = 'push', url = 'wss://hello:world@mydomain.com:26657/websocket', batch_delay = '500ms' } # ... diff --git a/guide/src/templates/hermes-version.md b/guide/src/templates/hermes-version.md index d9c8fd4074..66acda7a30 100644 --- a/guide/src/templates/hermes-version.md +++ b/guide/src/templates/hermes-version.md @@ -1 +1 @@ -v1.10.3 +v1.10.4 diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 8d896cdab1..77b9d86c61 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.3" +version = "0.29.4" 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 5c71770833..50839dfd63 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.3" +version = "0.29.4" edition = "2021" license = "Apache-2.0" readme = "README.md" From c90b69c0ff20ca3a04cf2452e15b8a8419d197d3 Mon Sep 17 00:00:00 2001 From: Luca Joss <43531661+ljoss17@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:17:13 +0100 Subject: [PATCH 220/224] Update Juno Chain version used in CI to `v25.0.0` (#4206) * Use Cosmos Nix branch with Juno v25.0.0 * Add changelog entry * Use main branch of Cosmos Nix --- .../ibc-integration-test/4203-update-juno-to-v25.md | 2 ++ flake.lock | 12 ++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 .changelog/unreleased/improvements/ibc-integration-test/4203-update-juno-to-v25.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4203-update-juno-to-v25.md b/.changelog/unreleased/improvements/ibc-integration-test/4203-update-juno-to-v25.md new file mode 100644 index 0000000000..6d4407a557 --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-integration-test/4203-update-juno-to-v25.md @@ -0,0 +1,2 @@ +- Update the version of Juno running the integration tests in the CI from `v24.0.0` + to `v25.0.0` ([\#4203](https://github.com/informalsystems/hermes/issues/4203)) \ No newline at end of file diff --git a/flake.lock b/flake.lock index 279a3e3895..5081f49548 100644 --- a/flake.lock +++ b/flake.lock @@ -500,11 +500,11 @@ "systems": "systems_6" }, "locked": { - "lastModified": 1726560853, - "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "owner": "numtide", "repo": "flake-utils", - "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "type": "github" }, "original": { @@ -1465,11 +1465,11 @@ }, "nixpkgs_5": { "locked": { - "lastModified": 1730831018, - "narHash": "sha256-2S0HwIFRxYp+afuoFORcZA9TjryAf512GmE0MTfEOPU=", + "lastModified": 1731531548, + "narHash": "sha256-sz8/v17enkYmfpgeeuyzniGJU0QQBfmAjlemAUYhfy8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "8c4dc69b9732f6bbe826b5fbb32184987520ff26", + "rev": "24f0d4acd634792badd6470134c387a3b039dace", "type": "github" }, "original": { From 00a0cf504fb094ac02148583679983169e87111d Mon Sep 17 00:00:00 2001 From: Yuji Ito Date: Tue, 3 Dec 2024 11:23:33 +0100 Subject: [PATCH 221/224] Add support for Namada (#3705) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add support for relaying between Namada and Cosmos-base chains. - Add Namada to `ChainConfig` - Reuse `CosmosSdkConfig` for generating Tendermint light clients - Add `NamadaChain` as `ChainEndpoint` implementation - See `crates/relayer/src/chain/namada.rs` and files under `crates/relayer/src/chain/namada` - To submit Namada transactions and query - Store Namada key to KeyRing --------- Signed-off-by: Yuji Ito Co-authored-by: Luca Joss Co-authored-by: Luca Joss <43531661+ljoss17@users.noreply.github.com> Co-authored-by: Gianmarco Fraccaroli Co-authored-by: Tomáš Zemanovič Co-authored-by: Romain Ruetschi --- .../features/3705-support-namada.md | 2 + .github/codespell/words.txt | 3 + .github/workflows/cargo-doc.yaml | 7 +- .github/workflows/guide-templates.yaml | 10 +- .github/workflows/integration.yaml | 30 + .github/workflows/misbehaviour.yml | 20 + .github/workflows/multi-chains.yaml | 5 + .github/workflows/namada.yaml | 199 + .github/workflows/publish.yml | 5 + .github/workflows/release.yml | 5 + .github/workflows/rust.yml | 24 +- Cargo.lock | 4592 ++++++++++++++++- Cargo.toml | 7 + ci/release/hermes.Dockerfile | 30 +- clippy.toml | 2 +- config.toml | 2 +- crates/chain-registry/Cargo.toml | 2 +- crates/relayer-cli/Cargo.toml | 2 +- crates/relayer-cli/src/commands/keys/add.rs | 39 +- .../relayer-cli/src/commands/keys/balance.rs | 8 +- .../relayer-cli/src/commands/keys/delete.rs | 13 + crates/relayer-cli/src/commands/listen.rs | 8 +- crates/relayer-cli/src/commands/tx/client.rs | 4 +- crates/relayer-cli/src/commands/tx/upgrade.rs | 4 +- crates/relayer-rest/Cargo.toml | 7 +- crates/relayer-rest/tests/mock.rs | 5 +- crates/relayer-types/Cargo.toml | 2 +- .../src/core/ics02_client/trust_threshold.rs | 2 +- .../src/core/ics03_connection/events.rs | 25 + .../src/core/ics04_channel/packet.rs | 2 +- crates/relayer-types/src/events.rs | 2 +- crates/relayer-types/src/utils/pretty.rs | 4 +- crates/relayer/Cargo.toml | 7 +- crates/relayer/src/chain.rs | 2 + crates/relayer/src/chain/client.rs | 7 +- crates/relayer/src/chain/cosmos.rs | 5 +- crates/relayer/src/chain/cosmos/batch.rs | 2 +- crates/relayer/src/chain/cosmos/config.rs | 2 +- crates/relayer/src/chain/cosmos/gas.rs | 10 +- .../src/chain/cosmos/types/events/channel.rs | 44 +- .../chain/cosmos/types/events/connection.rs | 68 + .../src/chain/cosmos/types/events/mod.rs | 2 + .../chain/cosmos/types/events/raw_object.rs | 42 + crates/relayer/src/chain/cosmos/types/gas.rs | 5 + crates/relayer/src/chain/cosmos/version.rs | 11 +- crates/relayer/src/chain/cosmos/wait.rs | 2 +- crates/relayer/src/chain/endpoint.rs | 2 +- crates/relayer/src/chain/handle.rs | 2 +- crates/relayer/src/chain/handle/base.rs | 4 +- crates/relayer/src/chain/handle/cache.rs | 2 +- crates/relayer/src/chain/handle/counting.rs | 2 +- crates/relayer/src/chain/namada.rs | 1408 +++++ crates/relayer/src/chain/namada/error.rs | 71 + crates/relayer/src/chain/namada/key.rs | 47 + crates/relayer/src/chain/namada/query.rs | 346 ++ crates/relayer/src/chain/namada/tx.rs | 384 ++ crates/relayer/src/chain/namada/version.rs | 27 + crates/relayer/src/chain/namada/wallet.rs | 65 + crates/relayer/src/chain/runtime.rs | 2 +- crates/relayer/src/chain/version.rs | 27 + crates/relayer/src/config.rs | 45 +- crates/relayer/src/config/filter.rs | 6 +- crates/relayer/src/config/proof_specs.rs | 2 +- crates/relayer/src/error.rs | 5 + crates/relayer/src/event.rs | 2 +- .../src/event/source/websocket/extract.rs | 38 +- crates/relayer/src/foreign_client.rs | 8 +- crates/relayer/src/keyring.rs | 12 +- .../src/keyring/any_signing_key_pair.rs | 12 +- crates/relayer/src/light_client/tendermint.rs | 8 +- crates/relayer/src/spawn.rs | 5 +- crates/relayer/src/upgrade_chain.rs | 23 +- crates/relayer/src/util/compat_mode.rs | 2 +- crates/relayer/src/util/pretty.rs | 8 +- crates/telemetry/Cargo.toml | 2 +- tools/integration-test/Cargo.toml | 3 +- .../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 +- .../src/tests/async_icq/simple_query.rs | 10 +- tools/integration-test/src/tests/authz.rs | 6 +- .../src/tests/channel_upgrade/flushing.rs | 5 +- .../src/tests/channel_upgrade/ica.rs | 12 +- .../src/tests/channel_upgrade/ics29.rs | 3 +- .../src/tests/channel_upgrade/timeout.rs | 3 +- .../channel_upgrade/upgrade_handshake.rs | 2 +- .../upgrade_handshake_steps.rs | 2 +- .../src/tests/clear_packet.rs | 33 +- .../src/tests/client_expiration.rs | 16 +- .../src/tests/client_refresh.rs | 23 +- .../src/tests/client_settings.rs | 4 +- .../src/tests/client_upgrade.rs | 26 +- .../src/tests/connection_delay.rs | 1 + .../src/tests/consensus_states.rs | 67 +- .../integration-test/src/tests/denom_trace.rs | 4 +- .../src/tests/dynamic_gas_fee.rs | 30 +- .../src/tests/error_events.rs | 41 +- .../src/tests/fee/auto_forward_relayer.rs | 1 + .../src/tests/fee/filter_fees.rs | 9 +- .../src/tests/fee/forward_relayer.rs | 1 + .../src/tests/fee/no_forward_relayer.rs | 2 + .../src/tests/fee/non_fee_channel.rs | 1 + .../src/tests/fee/pay_fee_async.rs | 1 + .../src/tests/fee/register_payee.rs | 1 + tools/integration-test/src/tests/fee_grant.rs | 28 +- .../src/tests/forward/forward_hop_transfer.rs | 8 + .../src/tests/forward/forward_transfer.rs | 9 + tools/integration-test/src/tests/ica.rs | 14 +- .../src/tests/ics20_filter/memo.rs | 1 + tools/integration-test/src/tests/ics31.rs | 3 +- .../interchain_security/dynamic_gas_fee.rs | 12 +- .../ica_ordered_channel.rs | 6 +- .../tests/interchain_security/ica_transfer.rs | 6 +- .../src/tests/interchain_security/icq.rs | 5 +- .../interchain_security/simple_transfer.rs | 1 + .../src/tests/manual/simulation.rs | 2 +- tools/integration-test/src/tests/memo.rs | 62 +- tools/integration-test/src/tests/mod.rs | 7 +- .../src/tests/ordered_channel.rs | 1 + .../src/tests/ordered_channel_clear.rs | 9 +- tools/integration-test/src/tests/python.rs | 2 +- .../src/tests/sequence_filter.rs | 6 +- .../integration-test/src/tests/supervisor.rs | 17 +- .../src/tests/tendermint/sequential.rs | 121 +- .../src/tests/ternary_transfer.rs | 3 + tools/integration-test/src/tests/transfer.rs | 16 +- tools/test-framework/Cargo.toml | 6 + .../src/bootstrap/binary/chain.rs | 5 +- .../test-framework/src/bootstrap/consumer.rs | 39 +- tools/test-framework/src/bootstrap/mod.rs | 1 + tools/test-framework/src/bootstrap/namada.rs | 328 ++ tools/test-framework/src/bootstrap/single.rs | 41 +- tools/test-framework/src/chain/chain_type.rs | 16 +- tools/test-framework/src/chain/cli/query.rs | 53 + .../src/chain/{config.rs => config/cosmos.rs} | 0 tools/test-framework/src/chain/config/mod.rs | 2 + .../test-framework/src/chain/config/namada.rs | 144 + tools/test-framework/src/chain/driver.rs | 32 +- tools/test-framework/src/chain/exec.rs | 51 + .../test-framework/src/chain/ext/async_icq.rs | 2 +- tools/test-framework/src/chain/ext/authz.rs | 2 +- .../test-framework/src/chain/ext/bootstrap.rs | 12 +- .../src/chain/ext/crosschainquery.rs | 2 +- tools/test-framework/src/chain/ext/fee.rs | 2 +- .../test-framework/src/chain/ext/fee_grant.rs | 2 +- tools/test-framework/src/chain/ext/ica.rs | 68 +- .../test-framework/src/chain/ext/proposal.rs | 2 +- .../test-framework/src/chain/ext/transfer.rs | 231 +- tools/test-framework/src/chain/ext/version.rs | 2 +- .../src/chain/ext/wasm_client.rs | 2 +- tools/test-framework/src/chain/tagged.rs | 13 +- .../src/docs/walkthroughs/memo.rs | 8 +- .../src/docs/walkthroughs/ordered_channel.rs | 1 + tools/test-framework/src/framework/base.rs | 2 +- .../src/framework/binary/chain.rs | 25 +- .../src/framework/binary/channel.rs | 18 +- .../src/framework/binary/connection.rs | 20 +- .../src/framework/binary/ics.rs | 4 +- .../src/framework/binary/node.rs | 128 +- .../src/framework/nary/chain.rs | 20 +- .../src/framework/nary/channel.rs | 18 +- .../src/framework/nary/connection.rs | 18 +- .../test-framework/src/framework/nary/node.rs | 48 +- .../test-framework/src/framework/overrides.rs | 14 +- .../src/framework/supervisor.rs | 2 +- tools/test-framework/src/ibc/denom.rs | 129 +- tools/test-framework/src/ibc/token.rs | 31 +- tools/test-framework/src/relayer/chain.rs | 2 +- tools/test-framework/src/relayer/fee.rs | 61 +- tools/test-framework/src/relayer/transfer.rs | 118 +- tools/test-framework/src/types/env.rs | 2 +- tools/test-framework/src/types/single/node.rs | 171 +- tools/test-framework/src/types/tagged/dual.rs | 4 +- tools/test-framework/src/types/tagged/mono.rs | 4 +- tools/test-framework/src/types/wallet.rs | 26 +- .../src/util/interchain_security.rs | 4 +- tools/test-framework/src/util/mod.rs | 1 + tools/test-framework/src/util/namada.rs | 176 + 178 files changed, 9662 insertions(+), 951 deletions(-) create mode 100644 .changelog/unreleased/features/3705-support-namada.md create mode 100644 .github/workflows/namada.yaml create mode 100644 crates/relayer/src/chain/cosmos/types/events/connection.rs create mode 100644 crates/relayer/src/chain/cosmos/types/events/raw_object.rs create mode 100644 crates/relayer/src/chain/namada.rs create mode 100644 crates/relayer/src/chain/namada/error.rs create mode 100644 crates/relayer/src/chain/namada/key.rs create mode 100644 crates/relayer/src/chain/namada/query.rs create mode 100644 crates/relayer/src/chain/namada/tx.rs create mode 100644 crates/relayer/src/chain/namada/version.rs create mode 100644 crates/relayer/src/chain/namada/wallet.rs create mode 100644 crates/relayer/src/chain/version.rs create mode 100644 tools/test-framework/src/bootstrap/namada.rs rename tools/test-framework/src/chain/{config.rs => config/cosmos.rs} (100%) create mode 100644 tools/test-framework/src/chain/config/mod.rs create mode 100644 tools/test-framework/src/chain/config/namada.rs create mode 100644 tools/test-framework/src/util/namada.rs diff --git a/.changelog/unreleased/features/3705-support-namada.md b/.changelog/unreleased/features/3705-support-namada.md new file mode 100644 index 0000000000..9e7e7a7eb6 --- /dev/null +++ b/.changelog/unreleased/features/3705-support-namada.md @@ -0,0 +1,2 @@ +- Add support for relaying between Namada and CosmosSDK-based chains. + ([\#3705](https://github.com/informalsystems/hermes/issues/3705)) \ No newline at end of file diff --git a/.github/codespell/words.txt b/.github/codespell/words.txt index d15ff15549..eed2287f50 100644 --- a/.github/codespell/words.txt +++ b/.github/codespell/words.txt @@ -2,3 +2,6 @@ crate shs ser numer +nam +inout +wast diff --git a/.github/workflows/cargo-doc.yaml b/.github/workflows/cargo-doc.yaml index 9682a8456f..564d51c810 100644 --- a/.github/workflows/cargo-doc.yaml +++ b/.github/workflows/cargo-doc.yaml @@ -28,7 +28,12 @@ jobs: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-04-21 + toolchain: nightly-2024-10-15 + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - 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 9eefc0d3fc..76152d6513 100644 --- a/.github/workflows/guide-templates.yaml +++ b/.github/workflows/guide-templates.yaml @@ -31,13 +31,13 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Check templates run: bash scripts/auto_gen_templates.sh --mode "check" - - uses: actions-rs/cargo@v1 - name: Update lockfile - with: - command: generate-lockfile - args: --manifest-path tools/check-guide/Cargo.toml - uses: actions-rs/cargo@v1 name: Check guide with: diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index fb98841907..137a63cafb 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -118,6 +118,11 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test @@ -156,6 +161,11 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test @@ -199,6 +209,11 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test @@ -242,6 +257,11 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test @@ -284,6 +304,11 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test @@ -328,6 +353,11 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index 135ef7c9a1..37e5b75986 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -80,6 +80,11 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Build Hermes uses: actions-rs/cargo@v1 with: @@ -132,6 +137,11 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Build Hermes uses: actions-rs/cargo@v1 with: @@ -184,6 +194,11 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Build Hermes uses: actions-rs/cargo@v1 with: @@ -236,6 +251,11 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Build Hermes uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index 9aeb907848..2e902ce8a0 100644 --- a/.github/workflows/multi-chains.yaml +++ b/.github/workflows/multi-chains.yaml @@ -99,6 +99,11 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test diff --git a/.github/workflows/namada.yaml b/.github/workflows/namada.yaml new file mode 100644 index 0000000000..ded8f201b4 --- /dev/null +++ b/.github/workflows/namada.yaml @@ -0,0 +1,199 @@ +name: Namada Integration + +on: + workflow_dispatch: + pull_request: + paths: + - .github/workflows/namada.yaml + - Cargo.toml + - Cargo.lock + - flake.nix + - flake.lock + - ci/** + - e2e/** + - crates/** + - tools/** + +env: + CARGO_INCREMENTAL: 0 + CARGO_PROFILE_DEV_DEBUG: 1 + CARGO_PROFILE_RELEASE_DEBUG: 1 + RUST_BACKTRACE: short + CARGO_NET_RETRY: 10 + RUSTUP_MAX_RETRIES: 10 + +# Cancel previous runs of this workflow when a new commit is added to the PR, branch or tag +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + cosmos-namada: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + chain: + - package: .#gaia20 + command: gaiad,namada + account_prefix: cosmos,'' + native_token: stake,nam + - package: .#osmosis + command: osmosisd,namada + account_prefix: osmo,'' + native_token: stake,nam + steps: + - uses: actions/checkout@v4 + - name: Clone Namada + uses: actions/checkout@v4 + with: + repository: anoma/namada + ref: v0.46.1 + path: namada + - name: Retrieve Namada repository path + id: namada-repo-path + run: | + echo "NAMADA_REPO_PATH=$(pwd)/namada" >> "$GITHUB_ENV" + - 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 + - name: Install libudev + run: sudo apt-get update && sudo apt-get -y install libudev-dev + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions-rs/cargo@v1 + with: + command: test + args: -p ibc-integration-test --features namada --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 + - name: Download CometBFT + run: | + curl -o cometbft.tar.gz -LO https://github.com/cometbft/cometbft/releases/download/v0.37.11/cometbft_0.37.11_linux_amd64.tar.gz + tar -xvzf cometbft.tar.gz + chmod +x cometbft + mkdir -p $HOME/local/bin + mv cometbft ~/local/bin + - name: Download Namada binaries + env: + OPERATING_SYSTEM: Linux + run: | + release_url=$(curl -s "https://api.github.com/repos/anoma/namada/releases/188247367" | grep "browser_download_url" | cut -d '"' -f 4 | grep "$OPERATING_SYSTEM") + wget "$release_url" + tar -xzvf namada*.tar.gz + cp ./namada*/namadac ~/local/bin/namadac + cp ./namada*/namadan ~/local/bin/namadan + cp ./namada*/namadaw ~/local/bin/namadaw + cp ./namada*/namada ~/local/bin/namada + cp ./namada*/wasm/checksums.json $NAMADA_REPO_PATH/wasm + cp ./namada*/wasm/*.wasm $NAMADA_REPO_PATH/wasm + - name: Update environment path + run: | + echo "${HOME}/local/bin" >> $GITHUB_PATH + - name: Download MASP parameters + run: | + echo $HOME + mkdir -p $HOME/.masp-params + curl -o $HOME/.masp-params/masp-spend.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-spend.params\?raw\=true + curl -o $HOME/.masp-params/masp-output.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-output.params?raw=true + curl -o $HOME/.masp-params/masp-convert.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-convert.params?raw=true + - env: + RUST_LOG: info + RUST_BACKTRACE: 1 + NO_COLOR_LOG: 1 + NEXTEST_RETRIES: 2 + CHAIN_COMMAND_PATHS: ${{ matrix.chain.command }} + ACCOUNT_PREFIXES: ${{ matrix.chain.account_prefix }} + NATIVE_TOKENS: ${{ matrix.chain.native_token }} + run: | + nix shell ${{ matrix.chain.package }} -c \ + cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=1 \ + --features namada + + namada: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v4 + - name: Clone Namada + uses: actions/checkout@v4 + with: + repository: anoma/namada + ref: v0.46.1 + path: namada + - name: Retrieve Namada repository path + id: namada-repo-path + run: | + echo "NAMADA_REPO_PATH=$(pwd)/namada" >> "$GITHUB_ENV" + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + - name: Install libudev + run: sudo apt-get update && sudo apt-get -y install libudev-dev + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: actions-rs/cargo@v1 + with: + command: test + args: -p ibc-integration-test --features namada --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 + - name: Download CometBFT + run: | + curl -o cometbft.tar.gz -LO https://github.com/cometbft/cometbft/releases/download/v0.37.11/cometbft_0.37.11_linux_amd64.tar.gz + tar -xvzf cometbft.tar.gz + mkdir -p ~/local/bin + chmod +x cometbft + mv cometbft ~/local/bin + - name: Download Namada binaries + env: + OPERATING_SYSTEM: Linux + run: | + release_url=$(curl -s "https://api.github.com/repos/anoma/namada/releases/188247367" | grep "browser_download_url" | cut -d '"' -f 4 | grep "$OPERATING_SYSTEM") + wget "$release_url" + tar -xzvf namada*.tar.gz + cp ./namada*/namadac ~/local/bin/namadac + cp ./namada*/namadan ~/local/bin/namadan + cp ./namada*/namadaw ~/local/bin/namadaw + cp ./namada*/namada ~/local/bin/namada + cp ./namada*/wasm/checksums.json $NAMADA_REPO_PATH/wasm + cp ./namada*/wasm/*.wasm $NAMADA_REPO_PATH/wasm + - name: Update environment path + run: | + echo "${HOME}/local/bin" >> $GITHUB_PATH + - name: Download MASP parameters + run: | + echo $HOME + mkdir -p $HOME/.masp-params + curl -o $HOME/.masp-params/masp-spend.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-spend.params\?raw\=true + curl -o $HOME/.masp-params/masp-output.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-output.params?raw=true + curl -o $HOME/.masp-params/masp-convert.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-convert.params?raw=true + - env: + RUST_LOG: info + RUST_BACKTRACE: 1 + NO_COLOR_LOG: 1 + NEXTEST_RETRIES: 2 + CHAIN_COMMAND_PATHS: namada + ACCOUNT_PREFIXES: '' + NATIVE_TOKENS: nam + run: | + cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=1 \ + --features namada + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 42106466c5..34e99fd9f6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,6 +14,11 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: katyo/publish-crates@v2 with: registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b1f7b3a39c..20dd2d8ab2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,6 +31,11 @@ jobs: runs-on: ${{ matrix.config.os }} steps: - uses: actions/checkout@v4 + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: taiki-e/upload-rust-binary-action@v1 with: # (required) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bc19b03142..12271bbfe6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,6 +54,11 @@ jobs: with: toolchain: stable components: clippy + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/clippy-check@v1 with: name: clippy-all-features @@ -68,6 +73,11 @@ jobs: with: toolchain: stable components: clippy + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/clippy-check@v1 with: name: clippy-no-default-features @@ -82,6 +92,11 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - 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,12 +115,17 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable + - name: Install Protoc + uses: heliaxdev/setup-protoc@v2 + with: + version: "25.0" + repo-token: ${{ secrets.GITHUB_TOKEN }} - 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 + run: cargo binstall --no-confirm --force cargo-msrv@0.17.1 - name: Check MSRV - run: cargo msrv verify --output-format minimal --manifest-path crates/relayer-cli/Cargo.toml -- 'cargo check --all-features' + run: cargo msrv verify --output-format json --manifest-path crates/relayer-cli/Cargo.toml # test-coverage: # runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index 55cd5f92ec..0178acb0fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,16 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + [[package]] name = "abscissa_core" version = "0.6.0" @@ -12,13 +22,13 @@ dependencies = [ "arc-swap", "backtrace", "canonical-path", - "clap", + "clap 3.2.25", "color-eyre", "fs-err", "once_cell", "regex", "secrecy", - "semver", + "semver 1.0.23", "serde", "termcolor", "toml 0.5.11", @@ -56,6 +66,33 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "aho-corasick" version = "1.1.3" @@ -141,6 +178,91 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" +[[package]] +name = "ark-bls12-381" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65be532f9dd1e98ad0150b037276cde464c6f371059e6dd02c0222395761f6aa" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dea978406c4b1ca13c2db2373b05cc55429c3575b8b21f1b9ee859aa5b03dd42" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "num-bigint", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "paste", + "rustc_version 0.3.3", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" +dependencies = [ + "num-bigint", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" +dependencies = [ + "ark-std", + "digest 0.9.0", +] + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.8.5", +] + [[package]] name = "arrayref" version = "0.3.9" @@ -153,6 +275,15 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" +[[package]] +name = "ascii-canvas" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" +dependencies = [ + "term", +] + [[package]] name = "async-stream" version = "0.3.6" @@ -172,7 +303,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -183,7 +314,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -200,7 +331,18 @@ dependencies = [ "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", - "tungstenite", + "tungstenite 0.21.0", +] + +[[package]] +name = "async_io_stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" +dependencies = [ + "futures", + "pharos", + "rustc_version 0.4.1", ] [[package]] @@ -220,6 +362,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "auto_impl" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "autocfg" version = "1.4.0" @@ -332,7 +485,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.7.4", "object", "rustc-demangle", ] @@ -343,6 +496,18 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + +[[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" @@ -361,6 +526,12 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "bech32" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b" + [[package]] name = "bech32" version = "0.9.1" @@ -373,6 +544,60 @@ version = "0.10.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98f7eed2b2781a6f0b5c903471d48e15f56fb4e1165df8a9a2337fd1a59d45ea" +[[package]] +name = "bellman" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9afceed28bac7f9f5a508bca8aeeff51cdfa4770c0b967ac55c621e2ddfd6171" +dependencies = [ + "bitvec", + "blake2s_simd", + "byteorder", + "ff", + "group", + "pairing", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "bimap" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" +dependencies = [ + "serde", +] + +[[package]] +name = "bip0039" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "568b6890865156d9043af490d4c4081c385dd68ea10acd6ca15733d511e6b51c" +dependencies = [ + "hmac 0.12.1", + "pbkdf2 0.12.2", + "rand 0.8.5", + "sha2 0.10.8", + "unicode-normalization", + "zeroize", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + [[package]] name = "bitcoin" version = "0.31.2" @@ -419,6 +644,21 @@ name = "bitflags" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +dependencies = [ + "serde", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] [[package]] name = "blake2" @@ -429,6 +669,28 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "blake2b_simd" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq 0.3.1", +] + +[[package]] +name = "blake2s_simd" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq 0.3.1", +] + [[package]] name = "blake3" version = "1.5.4" @@ -439,7 +701,7 @@ dependencies = [ "arrayvec", "cc", "cfg-if", - "constant_time_eq", + "constant_time_eq 0.3.1", ] [[package]] @@ -460,12 +722,67 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bls12_381" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7bc6d6292be3a19e6379786dac800f551e5865a5bb51ebbe3064ab80433f403" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "bls12_381" +version = "0.8.0" +source = "git+https://github.com/heliaxdev/bls12_381.git?rev=d3ebe9dd6488fac1923db120a7498079e55dd838#d3ebe9dd6488fac1923db120a7498079e55dd838" +dependencies = [ + "ff", + "group", + "pairing", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "borsh" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03" +dependencies = [ + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2593a3b8b938bd68373196c9832f516be11fa487ef4ae745eb282e6a56a7244" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "borsh-ext" +version = "1.2.0" +source = "git+https://github.com/heliaxdev/borsh-ext?tag=v1.2.0#a62fee3e847e512cad9ac0f1fd5a900e5db9ba37" +dependencies = [ + "borsh", +] + [[package]] name = "bs58" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ + "sha2 0.10.8", "tinyvec", ] @@ -475,6 +792,12 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + [[package]] name = "byte-unit" version = "4.0.19" @@ -500,18 +823,82 @@ dependencies = [ "serde", ] +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "camino" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +dependencies = [ + "serde", +] + [[package]] name = "canonical-path" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" +[[package]] +name = "cargo-platform" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.23", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] + [[package]] name = "cc" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ + "jobserver", + "libc", "shlex", ] @@ -522,19 +909,69 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "chrono" -version = "0.4.38" +name = "cfg_aliases" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" -dependencies = [ +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chacha20" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "chacha20poly1305" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", - "num-traits", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "wasm-bindgen", "windows-targets 0.52.6", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] + +[[package]] +name = "circular-queue" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d34327ead1c743a10db339de35fb58957564b99d248a67985c55638b22c59b5" +dependencies = [ + "version_check", +] + [[package]] name = "clap" version = "3.2.25" @@ -544,7 +981,7 @@ dependencies = [ "atty", "bitflags 1.3.2", "clap_derive", - "clap_lex", + "clap_lex 0.2.4", "indexmap 1.9.3", "once_cell", "strsim", @@ -552,13 +989,32 @@ dependencies = [ "textwrap", ] +[[package]] +name = "clap" +version = "4.5.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +dependencies = [ + "anstyle", + "clap_lex 0.7.3", +] + [[package]] name = "clap_complete" version = "3.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f7a2e0a962c45ce25afce14220bc24f9dade0a1787f185cecf96bfba7847cd8" dependencies = [ - "clap", + "clap 3.2.25", ] [[package]] @@ -567,7 +1023,7 @@ 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", "quote", @@ -583,6 +1039,69 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "clap_lex" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" + +[[package]] +name = "clru" +version = "0.5.0" +source = "git+https://github.com/marmeladema/clru-rs.git?rev=71ca566#71ca566915f21f3c308091ca7756a91b0f8b5afc" + +[[package]] +name = "coins-bip32" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" +dependencies = [ + "bs58", + "coins-core", + "digest 0.10.7", + "hmac 0.12.1", + "k256", + "serde", + "sha2 0.10.8", + "thiserror", +] + +[[package]] +name = "coins-bip39" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" +dependencies = [ + "bitvec", + "coins-bip32", + "hmac 0.12.1", + "once_cell", + "pbkdf2 0.12.2", + "rand 0.8.5", + "sha2 0.10.8", + "thiserror", +] + +[[package]] +name = "coins-core" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" +dependencies = [ + "base64 0.21.7", + "bech32 0.9.1", + "bs58", + "digest 0.10.7", + "generic-array", + "hex", + "ripemd", + "serde", + "serde_derive", + "sha2 0.10.8", + "sha3", + "thiserror", +] + [[package]] name = "color-eyre" version = "0.6.3" @@ -629,12 +1148,37 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "const-hex" +version = "1.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487981fa1af147182687064d0a2c336586d337a606595ced9ffb0c685c250c73" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + [[package]] name = "const-oid" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const_panic" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "013b6c2c3a14d678f38cd23994b02da3a1a1b6a5d1eedddfe63a5a5f11b13a81" + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "constant_time_eq" version = "0.3.1" @@ -675,9 +1219,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "462e1f6a8e005acc8835d32d60cbd7973ed65ea2a8d8473830e675f050956427" dependencies = [ "informalsystems-pbjson", - "prost", + "prost 0.13.3", "serde", - "tendermint-proto", + "tendermint-proto 0.40.0", "tonic", ] @@ -690,6 +1234,15 @@ dependencies = [ "libc", ] +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + [[package]] name = "crossbeam-channel" version = "0.5.13" @@ -699,6 +1252,16 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + [[package]] name = "crossbeam-epoch" version = "0.9.18" @@ -727,7 +1290,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -742,6 +1305,31 @@ dependencies = [ "typenum", ] +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ct-codecs" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "026ac6ceace6298d2c557ef5ed798894962296469ec7842288ea64674201a2d1" + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -753,7 +1341,7 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "rustc_version", + "rustc_version 0.4.1", "subtle", "zeroize", ] @@ -766,7 +1354,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -777,7 +1365,7 @@ checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" dependencies = [ "byteorder", "digest 0.9.0", - "rand_core", + "rand_core 0.6.4", "subtle-ng", "zeroize", ] @@ -826,6 +1414,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.18" @@ -834,7 +1433,27 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] @@ -871,6 +1490,24 @@ dependencies = [ "subtle", ] +[[package]] +name = "directories" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" +dependencies = [ + "dirs-sys 0.3.7", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys 0.4.1", +] + [[package]] name = "dirs-next" version = "2.0.0" @@ -881,6 +1518,29 @@ dependencies = [ "dirs-sys-next", ] +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -900,9 +1560,35 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", +] + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "duration-str" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c1a2e028bbf7921549873b291ddc0cfe08b673d9489da81ac28898cd5a0e6e0" +dependencies = [ + "chrono", + "rust_decimal", + "serde", + "thiserror", + "time", + "winnow", ] +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + [[package]] name = "ecdsa" version = "0.16.9" @@ -913,6 +1599,7 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", + "serdect", "signature", "spki", ] @@ -936,8 +1623,10 @@ checksum = "3c8465edc8ee7436ffea81d21a019b16676ee3db267aa8d5a8d729581ecf998b" dependencies = [ "curve25519-dalek-ng", "hex", - "rand_core", + "rand_core 0.6.4", + "serde", "sha2 0.9.9", + "thiserror", "zeroize", ] @@ -949,7 +1638,7 @@ checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", - "rand_core", + "rand_core 0.6.4", "serde", "sha2 0.10.8", "subtle", @@ -964,7 +1653,7 @@ checksum = "6b49a684b133c4980d7ee783936af771516011c8cd15f429dbda77245e282f03" dependencies = [ "derivation-path", "ed25519-dalek", - "hmac", + "hmac 0.12.1", "sha2 0.10.8", ] @@ -987,12 +1676,22 @@ dependencies = [ "generic-array", "group", "pkcs8", - "rand_core", + "rand_core 0.6.4", "sec1", + "serdect", "subtle", "zeroize", ] +[[package]] +name = "ena" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" +dependencies = [ + "log", +] + [[package]] name = "encode_unicode" version = "0.3.6" @@ -1008,6 +1707,24 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enr" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" +dependencies = [ + "base64 0.21.7", + "bytes", + "hex", + "k256", + "log", + "rand 0.8.5", + "rlp", + "serde", + "sha3", + "zeroize", +] + [[package]] name = "env_filter" version = "0.1.2" @@ -1048,28 +1765,390 @@ dependencies = [ ] [[package]] -name = "eyre" -version = "0.6.12" +name = "eth-keystore" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" dependencies = [ - "indenter", - "once_cell", + "aes", + "ctr", + "digest 0.10.7", + "hex", + "hmac 0.12.1", + "pbkdf2 0.11.0", + "rand 0.8.5", + "scrypt", + "serde", + "serde_json", + "sha2 0.10.8", + "sha3", + "thiserror", + "uuid 0.8.2", ] [[package]] -name = "fastrand" -version = "2.2.0" +name = "ethabi" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" - -[[package]] -name = "ff" +checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" +dependencies = [ + "ethereum-types", + "hex", + "once_cell", + "regex", + "serde", + "serde_json", + "sha3", + "thiserror", + "uint", +] + +[[package]] +name = "ethbloom" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "scale-info", + "tiny-keccak", +] + +[[package]] +name = "ethbridge-bridge-contract" +version = "0.24.0" +source = "git+https://github.com/heliaxdev/ethbridge-rs?tag=v0.24.0#d66708bb8a734111988b9eaf08c7473bd7020c00" +dependencies = [ + "ethbridge-bridge-events", + "ethbridge-structs", + "ethers", + "ethers-contract", +] + +[[package]] +name = "ethbridge-bridge-events" +version = "0.24.0" +source = "git+https://github.com/heliaxdev/ethbridge-rs?tag=v0.24.0#d66708bb8a734111988b9eaf08c7473bd7020c00" +dependencies = [ + "ethabi", + "ethbridge-structs", + "ethers", + "ethers-contract", +] + +[[package]] +name = "ethbridge-structs" +version = "0.24.0" +source = "git+https://github.com/heliaxdev/ethbridge-rs?tag=v0.24.0#d66708bb8a734111988b9eaf08c7473bd7020c00" +dependencies = [ + "ethabi", + "ethers", + "ethers-contract", +] + +[[package]] +name = "ethereum-types" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +dependencies = [ + "ethbloom", + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "primitive-types", + "scale-info", + "uint", +] + +[[package]] +name = "ethers" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" +dependencies = [ + "ethers-addressbook", + "ethers-contract", + "ethers-core", + "ethers-etherscan", + "ethers-middleware", + "ethers-providers", + "ethers-signers", + "ethers-solc", +] + +[[package]] +name = "ethers-addressbook" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" +dependencies = [ + "ethers-core", + "once_cell", + "serde", + "serde_json", +] + +[[package]] +name = "ethers-contract" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" +dependencies = [ + "const-hex", + "ethers-contract-abigen", + "ethers-contract-derive", + "ethers-core", + "ethers-providers", + "futures-util", + "once_cell", + "pin-project", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "ethers-contract-abigen" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" +dependencies = [ + "Inflector", + "const-hex", + "dunce", + "ethers-core", + "ethers-etherscan", + "eyre", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "reqwest", + "serde", + "serde_json", + "syn 2.0.89", + "toml 0.8.19", + "walkdir", +] + +[[package]] +name = "ethers-contract-derive" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" +dependencies = [ + "Inflector", + "const-hex", + "ethers-contract-abigen", + "ethers-core", + "proc-macro2", + "quote", + "serde_json", + "syn 2.0.89", +] + +[[package]] +name = "ethers-core" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" +dependencies = [ + "arrayvec", + "bytes", + "cargo_metadata", + "chrono", + "const-hex", + "elliptic-curve", + "ethabi", + "generic-array", + "k256", + "num_enum", + "once_cell", + "open-fastrlp", + "rand 0.8.5", + "rlp", + "serde", + "serde_json", + "strum 0.26.3", + "syn 2.0.89", + "tempfile", + "thiserror", + "tiny-keccak", + "unicode-xid", +] + +[[package]] +name = "ethers-etherscan" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" +dependencies = [ + "chrono", + "ethers-core", + "reqwest", + "semver 1.0.23", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "ethers-middleware" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" +dependencies = [ + "async-trait", + "auto_impl", + "ethers-contract", + "ethers-core", + "ethers-etherscan", + "ethers-providers", + "ethers-signers", + "futures-channel", + "futures-locks", + "futures-util", + "instant", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-futures", + "url", +] + +[[package]] +name = "ethers-providers" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" +dependencies = [ + "async-trait", + "auto_impl", + "base64 0.21.7", + "bytes", + "const-hex", + "enr", + "ethers-core", + "futures-core", + "futures-timer", + "futures-util", + "hashers", + "http 0.2.12", + "instant", + "jsonwebtoken", + "once_cell", + "pin-project", + "reqwest", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-tungstenite", + "tracing", + "tracing-futures", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "ws_stream_wasm", +] + +[[package]] +name = "ethers-signers" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" +dependencies = [ + "async-trait", + "coins-bip32", + "coins-bip39", + "const-hex", + "elliptic-curve", + "eth-keystore", + "ethers-core", + "rand 0.8.5", + "sha2 0.10.8", + "thiserror", + "tracing", +] + +[[package]] +name = "ethers-solc" +version = "2.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" +dependencies = [ + "cfg-if", + "const-hex", + "dirs", + "dunce", + "ethers-core", + "glob", + "home", + "md-5", + "num_cpus", + "once_cell", + "path-slash", + "rayon", + "regex", + "semver 1.0.23", + "serde", + "serde_json", + "solang-parser", + "svm-rs", + "thiserror", + "tiny-keccak", + "tokio", + "tracing", + "walkdir", + "yansi", +] + +[[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 = "fastrand" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" + +[[package]] +name = "fd-lock" +version = "3.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5" +dependencies = [ + "cfg-if", + "rustix", + "windows-sys 0.48.0", +] + +[[package]] +name = "ff" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core", + "bitvec", + "rand_core 0.6.4", "subtle", ] @@ -1085,9 +2164,28 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ + "byteorder", + "rand 0.8.5", + "rustc-hex", "static_assertions", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + +[[package]] +name = "flate2" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +dependencies = [ + "crc32fast", + "miniz_oxide 0.8.0", +] + [[package]] name = "flex-error" version = "0.4.4" @@ -1098,12 +2196,39 @@ dependencies = [ "paste", ] +[[package]] +name = "flume" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "spin 0.9.8", +] + [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1113,6 +2238,20 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fpe" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26c4b37de5ae15812a764c958297cfc50f5c010438f60c6ce75d11b802abd404" +dependencies = [ + "cbc", + "cipher", + "libm", + "num-bigint", + "num-integer", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "fs-err" version = "2.11.0" @@ -1122,6 +2261,22 @@ dependencies = [ "autocfg", ] +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "futures" version = "0.3.31" @@ -1171,14 +2326,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] -name = "futures-macro" -version = "0.3.31" +name = "futures-locks" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45ec6fe3675af967e67c5536c0b9d44e34e6c52f86bedc4ea49c5317b8e94d06" +dependencies = [ + "futures-channel", + "futures-task", +] + +[[package]] +name = "futures-macro" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -1193,6 +2358,16 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +[[package]] +name = "futures-timer" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" +dependencies = [ + "gloo-timers", + "send_wrapper 0.4.0", +] + [[package]] name = "futures-util" version = "0.3.31" @@ -1211,6 +2386,15 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1222,6 +2406,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + [[package]] name = "getrandom" version = "0.2.15" @@ -1231,7 +2428,7 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] @@ -1241,6 +2438,24 @@ 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 = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + [[package]] name = "group" version = "0.13.0" @@ -1248,7 +2463,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "memuse", + "rand_core 0.6.4", "subtle", ] @@ -1334,6 +2550,15 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +[[package]] +name = "hashers" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" +dependencies = [ + "fxhash", +] + [[package]] name = "hdpath" version = "0.6.3" @@ -1349,6 +2574,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" @@ -1382,6 +2613,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + [[package]] name = "hmac" version = "0.12.1" @@ -1391,6 +2632,21 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "hmac-sha512" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77e806677ce663d0a199541030c816847b36e8dc095f70dae4a4f4ad63da5383" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "http" version = "0.2.12" @@ -1547,6 +2803,19 @@ dependencies = [ "tower-service", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper 0.14.31", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "hyper-util" version = "0.1.10" @@ -1589,6 +2858,87 @@ dependencies = [ "cc", ] +[[package]] +name = "ibc" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "ibc-apps", + "ibc-clients", + "ibc-core", + "ibc-core-host-cosmos", + "ibc-derive", + "ibc-primitives", +] + +[[package]] +name = "ibc-app-nft-transfer" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "ibc-app-nft-transfer-types", + "ibc-core", + "serde-json-wasm", +] + +[[package]] +name = "ibc-app-nft-transfer-types" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "base64 0.22.1", + "borsh", + "derive_more 0.99.18", + "displaydoc", + "http 1.1.0", + "ibc-app-transfer-types", + "ibc-core", + "ibc-proto 0.47.1", + "mime", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", + "serde-json-wasm", +] + +[[package]] +name = "ibc-app-transfer" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "ibc-app-transfer-types", + "ibc-core", + "serde-json-wasm", +] + +[[package]] +name = "ibc-app-transfer-types" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "borsh", + "derive_more 0.99.18", + "displaydoc", + "ibc-core", + "ibc-proto 0.47.1", + "parity-scale-codec", + "primitive-types", + "scale-info", + "schemars", + "serde", + "uint", +] + +[[package]] +name = "ibc-apps" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "ibc-app-nft-transfer", + "ibc-app-transfer", +] + [[package]] name = "ibc-chain-registry" version = "0.29.4" @@ -1597,18 +2947,370 @@ dependencies = [ "flex-error", "futures", "http 1.1.0", - "ibc-proto", + "ibc-proto 0.51.1", "ibc-relayer", "ibc-relayer-types", - "itertools", + "itertools 0.13.0", "reqwest", "serde", "serde_json", - "tendermint-rpc", + "tendermint-rpc 0.40.0", "tokio", "tracing", ] +[[package]] +name = "ibc-client-tendermint" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "derive_more 0.99.18", + "ibc-client-tendermint-types", + "ibc-core-client", + "ibc-core-commitment-types", + "ibc-core-handler-types", + "ibc-core-host", + "ibc-primitives", + "serde", + "tendermint 0.38.1", + "tendermint-light-client-verifier 0.38.1", +] + +[[package]] +name = "ibc-client-tendermint-types" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "displaydoc", + "ibc-core-client-types", + "ibc-core-commitment-types", + "ibc-core-host-types", + "ibc-primitives", + "ibc-proto 0.47.1", + "serde", + "tendermint 0.38.1", + "tendermint-light-client-verifier 0.38.1", + "tendermint-proto 0.38.1", +] + +[[package]] +name = "ibc-client-wasm-types" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "base64 0.22.1", + "displaydoc", + "ibc-core-client", + "ibc-core-host-types", + "ibc-primitives", + "ibc-proto 0.47.1", + "serde", +] + +[[package]] +name = "ibc-clients" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "ibc-client-tendermint", + "ibc-client-wasm-types", +] + +[[package]] +name = "ibc-core" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "ibc-core-channel", + "ibc-core-client", + "ibc-core-commitment-types", + "ibc-core-connection", + "ibc-core-handler", + "ibc-core-host", + "ibc-core-router", + "ibc-derive", + "ibc-primitives", +] + +[[package]] +name = "ibc-core-channel" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "ibc-core-channel-types", + "ibc-core-client", + "ibc-core-commitment-types", + "ibc-core-connection", + "ibc-core-handler-types", + "ibc-core-host", + "ibc-core-router", + "ibc-primitives", +] + +[[package]] +name = "ibc-core-channel-types" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "borsh", + "derive_more 0.99.18", + "displaydoc", + "ibc-core-client-types", + "ibc-core-commitment-types", + "ibc-core-connection-types", + "ibc-core-host-types", + "ibc-primitives", + "ibc-proto 0.47.1", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", + "sha2 0.10.8", + "subtle-encoding", + "tendermint 0.38.1", +] + +[[package]] +name = "ibc-core-client" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "ibc-core-client-context", + "ibc-core-client-types", + "ibc-core-commitment-types", + "ibc-core-handler-types", + "ibc-core-host", + "ibc-primitives", +] + +[[package]] +name = "ibc-core-client-context" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "derive_more 0.99.18", + "displaydoc", + "ibc-core-client-types", + "ibc-core-commitment-types", + "ibc-core-handler-types", + "ibc-core-host-types", + "ibc-primitives", + "subtle-encoding", + "tendermint 0.38.1", +] + +[[package]] +name = "ibc-core-client-types" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "borsh", + "derive_more 0.99.18", + "displaydoc", + "ibc-core-commitment-types", + "ibc-core-host-types", + "ibc-primitives", + "ibc-proto 0.47.1", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", + "subtle-encoding", + "tendermint 0.38.1", +] + +[[package]] +name = "ibc-core-commitment-types" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "borsh", + "derive_more 0.99.18", + "displaydoc", + "ibc-core-host-types", + "ibc-primitives", + "ibc-proto 0.47.1", + "ics23", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", + "subtle-encoding", +] + +[[package]] +name = "ibc-core-connection" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "ibc-client-wasm-types", + "ibc-core-client", + "ibc-core-connection-types", + "ibc-core-handler-types", + "ibc-core-host", + "ibc-primitives", + "prost 0.13.3", +] + +[[package]] +name = "ibc-core-connection-types" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "borsh", + "derive_more 0.99.18", + "displaydoc", + "ibc-core-client-types", + "ibc-core-commitment-types", + "ibc-core-host-types", + "ibc-primitives", + "ibc-proto 0.47.1", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", + "subtle-encoding", + "tendermint 0.38.1", +] + +[[package]] +name = "ibc-core-handler" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "ibc-core-channel", + "ibc-core-client", + "ibc-core-commitment-types", + "ibc-core-connection", + "ibc-core-handler-types", + "ibc-core-host", + "ibc-core-router", + "ibc-primitives", +] + +[[package]] +name = "ibc-core-handler-types" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "borsh", + "derive_more 0.99.18", + "displaydoc", + "ibc-core-channel-types", + "ibc-core-client-types", + "ibc-core-commitment-types", + "ibc-core-connection-types", + "ibc-core-host-types", + "ibc-core-router-types", + "ibc-primitives", + "ibc-proto 0.47.1", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", + "subtle-encoding", + "tendermint 0.38.1", +] + +[[package]] +name = "ibc-core-host" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "derive_more 0.99.18", + "displaydoc", + "ibc-core-channel-types", + "ibc-core-client-context", + "ibc-core-client-types", + "ibc-core-commitment-types", + "ibc-core-connection-types", + "ibc-core-handler-types", + "ibc-core-host-types", + "ibc-primitives", + "subtle-encoding", +] + +[[package]] +name = "ibc-core-host-cosmos" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "derive_more 0.99.18", + "displaydoc", + "ibc-app-transfer-types", + "ibc-client-tendermint", + "ibc-core-client-context", + "ibc-core-client-types", + "ibc-core-commitment-types", + "ibc-core-connection-types", + "ibc-core-handler-types", + "ibc-core-host-types", + "ibc-primitives", + "ibc-proto 0.47.1", + "serde", + "sha2 0.10.8", + "subtle-encoding", + "tendermint 0.38.1", +] + +[[package]] +name = "ibc-core-host-types" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "borsh", + "derive_more 0.99.18", + "displaydoc", + "ibc-primitives", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", +] + +[[package]] +name = "ibc-core-router" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "derive_more 0.99.18", + "displaydoc", + "ibc-core-channel-types", + "ibc-core-host-types", + "ibc-core-router-types", + "ibc-primitives", + "subtle-encoding", +] + +[[package]] +name = "ibc-core-router-types" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "borsh", + "derive_more 0.99.18", + "displaydoc", + "ibc-core-host-types", + "ibc-primitives", + "ibc-proto 0.47.1", + "parity-scale-codec", + "scale-info", + "schemars", + "serde", + "subtle-encoding", + "tendermint 0.38.1", +] + +[[package]] +name = "ibc-derive" +version = "0.8.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "ibc-integration-test" version = "0.29.4" @@ -1618,38 +3320,77 @@ dependencies = [ "ibc-relayer", "ibc-relayer-types", "ibc-test-framework", - "prost", + "prost 0.13.3", "serde", "serde_json", - "tendermint", - "tendermint-rpc", + "tendermint 0.40.0", + "tendermint-rpc 0.40.0", "time", "toml 0.8.19", "tonic", ] +[[package]] +name = "ibc-primitives" +version = "0.54.0" +source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +dependencies = [ + "borsh", + "derive_more 0.99.18", + "displaydoc", + "ibc-proto 0.47.1", + "parity-scale-codec", + "prost 0.13.3", + "scale-info", + "schemars", + "serde", + "tendermint 0.38.1", + "time", +] + [[package]] name = "ibc-proto" -version = "0.51.1" +version = "0.47.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b70f517162e74e2d35875b8b94bf4d1e45f2c69ef3de452dc855944455d33ca" +checksum = "c852d22b782d2d793f4a646f968de419be635e02bc8798d5d74a6e44eef27733" dependencies = [ "base64 0.22.1", + "borsh", "bytes", - "cosmos-sdk-proto", "flex-error", "ics23", "informalsystems-pbjson", - "prost", + "parity-scale-codec", + "prost 0.13.3", + "scale-info", + "schemars", "serde", "subtle-encoding", - "tendermint-proto", - "tonic", + "tendermint-proto 0.38.1", ] [[package]] -name = "ibc-relayer" -version = "0.29.4" +name = "ibc-proto" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b70f517162e74e2d35875b8b94bf4d1e45f2c69ef3de452dc855944455d33ca" +dependencies = [ + "base64 0.22.1", + "bytes", + "cosmos-sdk-proto", + "flex-error", + "ics23", + "informalsystems-pbjson", + "prost 0.13.3", + "serde", + "subtle-encoding", + "tendermint-proto 0.40.0", + "tonic", +] + +[[package]] +name = "ibc-relayer" +version = "0.29.4" dependencies = [ "anyhow", "async-stream", @@ -1673,39 +3414,44 @@ dependencies = [ "http 1.1.0", "humantime", "humantime-serde", - "ibc-proto", + "ibc-proto 0.51.1", "ibc-relayer-types", "ibc-telemetry", - "itertools", + "itertools 0.13.0", "moka", + "namada_sdk", "num-bigint", "num-rational", "once_cell", - "prost", + "prost 0.13.3", "regex", "reqwest", "retry", "ripemd", + "rpassword", "secp256k1", - "semver", + "semver 1.0.23", "serde", "serde_derive", "serde_json", "serial_test", "sha2 0.10.8", "signature", - "strum", + "strum 0.25.0", "subtle-encoding", - "tendermint", + "tendermint 0.38.1", + "tendermint 0.40.0", "tendermint-light-client", "tendermint-light-client-detector", - "tendermint-light-client-verifier", - "tendermint-proto", - "tendermint-rpc", + "tendermint-light-client-verifier 0.40.0", + "tendermint-proto 0.38.1", + "tendermint-proto 0.40.0", + "tendermint-rpc 0.38.1", + "tendermint-rpc 0.40.0", "tendermint-testgen", "test-log", "thiserror", - "tiny-bip39", + "tiny-bip39 1.0.0", "tiny-keccak", "tokio", "tokio-stream", @@ -1713,7 +3459,7 @@ dependencies = [ "tonic", "tracing", "tracing-subscriber", - "uuid", + "uuid 1.11.0", ] [[package]] @@ -1721,7 +3467,7 @@ name = "ibc-relayer-cli" version = "1.10.4" dependencies = [ "abscissa_core", - "clap", + "clap 3.2.25", "clap_complete", "color-eyre", "console", @@ -1739,7 +3485,7 @@ dependencies = [ "ibc-relayer-rest", "ibc-relayer-types", "ibc-telemetry", - "itertools", + "itertools 0.13.0", "once_cell", "oneline-eyre", "regex", @@ -1748,9 +3494,9 @@ dependencies = [ "serial_test", "signal-hook", "subtle-encoding", - "tendermint", - "tendermint-light-client-verifier", - "tendermint-rpc", + "tendermint 0.40.0", + "tendermint-light-client-verifier 0.40.0", + "tendermint-rpc 0.40.0", "time", "tokio", "tracing", @@ -1767,6 +3513,7 @@ dependencies = [ "ibc-relayer-types", "reqwest", "serde", + "serde_json", "tokio", "toml 0.8.19", "tracing", @@ -1777,24 +3524,24 @@ name = "ibc-relayer-types" version = "0.29.4" dependencies = [ "bytes", - "derive_more", + "derive_more 0.99.18", "env_logger", "flex-error", - "ibc-proto", + "ibc-proto 0.51.1", "ics23", - "itertools", + "itertools 0.13.0", "num-rational", "primitive-types", - "prost", + "prost 0.13.3", "regex", "serde", "serde_derive", "serde_json", "subtle-encoding", - "tendermint", - "tendermint-light-client-verifier", - "tendermint-proto", - "tendermint-rpc", + "tendermint 0.40.0", + "tendermint-light-client-verifier 0.40.0", + "tendermint-proto 0.40.0", + "tendermint-rpc 0.40.0", "tendermint-testgen", "test-log", "time", @@ -1817,7 +3564,7 @@ dependencies = [ "prometheus", "serde", "serde_json", - "tendermint", + "tendermint 0.40.0", "tokio", "tracing", ] @@ -1834,21 +3581,25 @@ dependencies = [ "hdpath", "hex", "http 1.1.0", - "ibc-proto", + "ibc-proto 0.51.1", "ibc-relayer", "ibc-relayer-cli", "ibc-relayer-types", - "itertools", + "itertools 0.13.0", + "namada_sdk", "once_cell", - "prost", - "rand", - "semver", + "prost 0.13.3", + "rand 0.8.5", + "semver 1.0.23", "serde", "serde_json", "serde_yaml", "sha2 0.10.8", "subtle-encoding", - "tendermint-rpc", + "tendermint 0.38.1", + "tendermint 0.40.0", + "tendermint-rpc 0.38.1", + "tendermint-rpc 0.40.0", "tokio", "toml 0.8.19", "tonic", @@ -1868,7 +3619,7 @@ dependencies = [ "bytes", "hex", "informalsystems-pbjson", - "prost", + "prost 0.13.3", "ripemd", "serde", "sha2 0.10.8", @@ -1990,7 +3741,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -2020,6 +3771,35 @@ dependencies = [ "icu_properties", ] +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-num-traits" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "951641f13f873bff03d4bf19ae8bec531935ac0ac2cc775f84d7edfdcfed3f17" +dependencies = [ + "integer-sqrt", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "uint", +] + +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", +] + [[package]] name = "impl-serde" version = "0.4.0" @@ -2029,12 +3809,41 @@ dependencies = [ "serde", ] +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "incrementalmerkletree" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5ad43a3f5795945459d577f6589cf62a476e92c79b75e70cd954364e14ce17b" +dependencies = [ + "serde", +] + [[package]] name = "indenter" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" +[[package]] +name = "index-set" +version = "0.8.0" +source = "git+https://github.com/heliaxdev/index-set?tag=v0.8.1#b0d928f83cf0d465ccda299d131e8df2859b5184" +dependencies = [ + "borsh", + "serde", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -2045,6 +3854,17 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "indexmap" +version = "2.2.4" +source = "git+https://github.com/heliaxdev/indexmap?tag=2.2.4-heliax-1#b5b5b547bd6ab04bbb16e060326a50ddaeb6c909" +dependencies = [ + "borsh", + "equivalent", + "hashbrown 0.14.5", + "serde", +] + [[package]] name = "indexmap" version = "2.6.0" @@ -2065,6 +3885,42 @@ dependencies = [ "serde", ] +[[package]] +name = "init-once" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0863329819ed5ecf33446da6cb9104d2f8943ff8530d2b6c51adbc6be4f0632" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + +[[package]] +name = "instant" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "integer-sqrt" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" +dependencies = [ + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ipnet" version = "2.10.1" @@ -2077,6 +3933,24 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.13.0" @@ -2092,6 +3966,15 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jobserver" +version = "0.1.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +dependencies = [ + "libc", +] + [[package]] name = "js-sys" version = "0.3.72" @@ -2101,6 +3984,47 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jsonwebtoken" +version = "8.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" +dependencies = [ + "base64 0.21.7", + "pem", + "ring 0.16.20", + "serde", + "serde_json", + "simple_asn1", +] + +[[package]] +name = "jubjub" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8499f7a74008aafbecb2a2e608a3e13e4dd3e84df198b604451efe93f2de6e61" +dependencies = [ + "bitvec", + "bls12_381 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "ff", + "group", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "jubjub" +version = "0.10.0" +source = "git+https://github.com/heliaxdev/jubjub.git?rev=a373686962f4e9d0edb3b4716f86ff6bbd9aa86c#a373686962f4e9d0edb3b4716f86ff6bbd9aa86c" +dependencies = [ + "bitvec", + "bls12_381 0.8.0 (git+https://github.com/heliaxdev/bls12_381.git?rev=d3ebe9dd6488fac1923db120a7498079e55dd838)", + "ff", + "group", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "k256" version = "0.13.4" @@ -2110,7 +4034,20 @@ dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", + "once_cell", + "serdect", "sha2 0.10.8", + "signature", +] + +[[package]] +name = "kdam" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "526586ea01a9a132b5f8d3a60f6d6b41b411550236f5ee057795f20b37316957" +dependencies = [ + "terminal_size", + "windows-sys 0.52.0", ] [[package]] @@ -2122,6 +4059,56 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "konst" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0964faf44d2c3e528ade7bd49c3544687cadcdee7641643469d43bd7259a5d88" +dependencies = [ + "const_panic", + "konst_kernel", + "typewit", +] + +[[package]] +name = "konst_kernel" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "722062725c1fc0d83cc017e873aac6a2a5ff16a88edfa190bdeb8bd393fcfd97" +dependencies = [ + "typewit", +] + +[[package]] +name = "lalrpop" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" +dependencies = [ + "ascii-canvas", + "bit-set", + "ena", + "itertools 0.11.0", + "lalrpop-util", + "petgraph", + "regex", + "regex-syntax 0.8.5", + "string_cache", + "term", + "tiny-keccak", + "unicode-xid", + "walkdir", +] + +[[package]] +name = "lalrpop-util" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" +dependencies = [ + "regex-automata 0.4.9", +] + [[package]] name = "lazy_static" version = "1.5.0" @@ -2134,6 +4121,12 @@ version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + [[package]] name = "libredox" version = "0.1.3" @@ -2172,6 +4165,71 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "masp_note_encryption" +version = "1.0.0" +source = "git+https://github.com/anoma/masp?rev=12ed8b060b295c06502a2ff8468e4a941cb7cca4#12ed8b060b295c06502a2ff8468e4a941cb7cca4" +dependencies = [ + "borsh", + "chacha20", + "chacha20poly1305", + "cipher", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "masp_primitives" +version = "1.0.0" +source = "git+https://github.com/anoma/masp?rev=12ed8b060b295c06502a2ff8468e4a941cb7cca4#12ed8b060b295c06502a2ff8468e4a941cb7cca4" +dependencies = [ + "aes", + "bip0039", + "bitvec", + "blake2b_simd", + "blake2s_simd", + "bls12_381 0.8.0 (git+https://github.com/heliaxdev/bls12_381.git?rev=d3ebe9dd6488fac1923db120a7498079e55dd838)", + "borsh", + "byteorder", + "ff", + "fpe", + "group", + "hex", + "incrementalmerkletree", + "jubjub 0.10.0 (git+https://github.com/heliaxdev/jubjub.git?rev=a373686962f4e9d0edb3b4716f86ff6bbd9aa86c)", + "lazy_static", + "masp_note_encryption", + "memuse", + "nonempty", + "num-traits 0.2.19 (git+https://github.com/heliaxdev/num-traits?rev=3f3657caa34b8e116fdf3f8a3519c4ac29f012fe)", + "rand 0.8.5", + "rand_core 0.6.4", + "sha2 0.10.8", + "subtle", + "zcash_encoding", +] + +[[package]] +name = "masp_proofs" +version = "1.0.0" +source = "git+https://github.com/anoma/masp?rev=12ed8b060b295c06502a2ff8468e4a941cb7cca4#12ed8b060b295c06502a2ff8468e4a941cb7cca4" +dependencies = [ + "bellman", + "blake2b_simd", + "bls12_381 0.8.0 (git+https://github.com/heliaxdev/bls12_381.git?rev=d3ebe9dd6488fac1923db120a7498079e55dd838)", + "directories", + "getrandom 0.2.15", + "group", + "itertools 0.11.0", + "jubjub 0.10.0 (git+https://github.com/heliaxdev/jubjub.git?rev=a373686962f4e9d0edb3b4716f86ff6bbd9aa86c)", + "lazy_static", + "masp_primitives", + "minreq", + "rand_core 0.6.4", + "redjubjub", + "tracing", +] + [[package]] name = "matchers" version = "0.1.0" @@ -2187,6 +4245,16 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest 0.10.7", +] + [[package]] name = "memchr" version = "2.7.4" @@ -2194,51 +4262,727 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +name = "memuse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2145869435ace5ea6ea3d35f59be559317ec9a0d04e1812d5f185a87b6d36f1a" + +[[package]] +name = "memzero" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93c0d11ac30a033511ae414355d80f70d9f29a44a49140face477117a1ee90db" + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", +] + +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + +[[package]] +name = "minreq" +version = "2.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "763d142cdff44aaadd9268bebddb156ef6c65a0e13486bb81673cf2d8739f9b0" +dependencies = [ + "log", + "once_cell", + "rustls 0.21.12", + "rustls-webpki 0.101.7", + "webpki-roots", +] + +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "moka" +version = "0.12.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f" +dependencies = [ + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "once_cell", + "parking_lot", + "quanta", + "rustc_version 0.4.1", + "smallvec", + "tagptr", + "thiserror", + "triomphe", + "uuid 1.11.0", +] + +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + +[[package]] +name = "namada_account" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "namada_core", + "namada_macros", + "namada_storage", + "serde", +] + +[[package]] +name = "namada_controller" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "namada_core", + "smooth-operator", + "thiserror", +] + +[[package]] +name = "namada_core" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "bech32 0.8.1", + "borsh", + "borsh-ext", + "chrono", + "data-encoding", + "ed25519-consensus", + "ethabi", + "ethbridge-structs", + "eyre", + "ibc", + "ics23", + "impl-num-traits", + "index-set", + "indexmap 2.2.4", + "k256", + "lazy_static", + "masp_primitives", + "namada_macros", + "num-integer", + "num-rational", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "num256", + "num_enum", + "primitive-types", + "prost-types 0.13.3", + "rand 0.8.5", + "rand_core 0.6.4", + "rayon", + "ripemd", + "serde", + "serde_json", + "sha2 0.9.9", + "smooth-operator", + "sparse-merkle-tree", + "tendermint 0.38.1", + "tendermint-proto 0.38.1", + "thiserror", + "tiny-keccak", + "tokio", + "tracing", + "uint", + "wasmtimer", + "zeroize", +] + +[[package]] +name = "namada_ethereum_bridge" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "ethers", + "eyre", + "itertools 0.12.1", + "konst", + "namada_core", + "namada_events", + "namada_macros", + "namada_parameters", + "namada_proof_of_stake", + "namada_state", + "namada_storage", + "namada_systems", + "namada_trans_token", + "namada_tx", + "namada_vote_ext", + "namada_vp_env", + "serde", + "smooth-operator", + "thiserror", + "tracing", +] + +[[package]] +name = "namada_events" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "namada_core", + "namada_macros", + "serde", + "serde_json", + "thiserror", + "tracing", +] + +[[package]] +name = "namada_gas" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "namada_core", + "namada_events", + "namada_macros", + "serde", + "thiserror", +] + +[[package]] +name = "namada_governance" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "itertools 0.12.1", + "konst", + "namada_account", + "namada_core", + "namada_events", + "namada_macros", + "namada_state", + "namada_systems", + "namada_tx", + "namada_vp_env", + "serde", + "serde_json", + "smooth-operator", + "thiserror", + "tracing", +] + +[[package]] +name = "namada_ibc" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "data-encoding", + "ibc", + "ibc-derive", + "ics23", + "konst", + "masp_primitives", + "namada_core", + "namada_events", + "namada_gas", + "namada_macros", + "namada_state", + "namada_systems", + "namada_tx", + "namada_vp", + "primitive-types", + "prost 0.13.3", + "serde", + "serde_json", + "sha2 0.9.9", + "smooth-operator", + "thiserror", + "tracing", +] + +[[package]] +name = "namada_io" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "async-trait", + "kdam", + "namada_core", + "tendermint-rpc 0.38.1", + "thiserror", + "tokio", +] + +[[package]] +name = "namada_macros" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "data-encoding", + "proc-macro2", + "quote", + "sha2 0.9.9", + "syn 1.0.109", +] + +[[package]] +name = "namada_merkle_tree" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "eyre", + "ics23", + "namada_core", + "namada_macros", + "prost 0.13.3", + "sparse-merkle-tree", + "thiserror", +] + +[[package]] +name = "namada_parameters" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "namada_core", + "namada_macros", + "namada_state", + "namada_systems", + "namada_tx", + "namada_vp_env", + "smooth-operator", + "thiserror", +] + +[[package]] +name = "namada_proof_of_stake" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "itertools 0.12.1", + "konst", + "namada_account", + "namada_controller", + "namada_core", + "namada_events", + "namada_macros", + "namada_state", + "namada_systems", + "namada_tx", + "namada_vp_env", + "once_cell", + "serde", + "smooth-operator", + "thiserror", + "tracing", +] + +[[package]] +name = "namada_replay_protection" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "namada_core", +] + +[[package]] +name = "namada_sdk" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "async-trait", + "bimap", + "borsh", + "borsh-ext", + "circular-queue", + "clap 4.5.21", + "data-encoding", + "duration-str", + "either", + "ethbridge-bridge-contract", + "ethers", + "eyre", + "fd-lock", + "futures", + "init-once", + "itertools 0.12.1", + "lazy_static", + "masp_primitives", + "masp_proofs", + "namada_account", + "namada_core", + "namada_ethereum_bridge", + "namada_events", + "namada_gas", + "namada_governance", + "namada_ibc", + "namada_io", + "namada_macros", + "namada_parameters", + "namada_proof_of_stake", + "namada_state", + "namada_storage", + "namada_token", + "namada_tx", + "namada_vm", + "namada_vote_ext", + "namada_vp", + "namada_wallet", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "num256", + "owo-colors", + "paste", + "patricia_tree", + "prost 0.13.3", + "rand 0.8.5", + "rand_core 0.6.4", + "rayon", + "regex", + "reqwest", + "rustversion", + "serde", + "serde_json", + "sha2 0.9.9", + "smooth-operator", + "tempfile", + "tendermint-rpc 0.38.1", + "thiserror", + "tiny-bip39 0.8.2", + "tokio", + "toml 0.5.11", + "tracing", + "xorf", + "zeroize", +] + +[[package]] +name = "namada_shielded_token" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "async-trait", + "borsh", + "eyre", + "flume", + "futures", + "itertools 0.12.1", + "lazy_static", + "masp_primitives", + "masp_proofs", + "namada_account", + "namada_controller", + "namada_core", + "namada_events", + "namada_gas", + "namada_io", + "namada_macros", + "namada_state", + "namada_systems", + "namada_tx", + "namada_vp_env", + "namada_wallet", + "rand 0.8.5", + "rand_core 0.6.4", + "rayon", + "ripemd", + "serde", + "serde_json", + "sha2 0.9.9", + "smooth-operator", + "tempfile", + "thiserror", + "tracing", + "typed-builder", + "xorf", +] + +[[package]] +name = "namada_state" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "clru", + "itertools 0.12.1", + "namada_core", + "namada_events", + "namada_gas", + "namada_macros", + "namada_merkle_tree", + "namada_replay_protection", + "namada_storage", + "namada_systems", + "namada_tx", + "patricia_tree", + "smooth-operator", + "thiserror", + "tracing", +] + +[[package]] +name = "namada_storage" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "itertools 0.12.1", + "namada_core", + "namada_gas", + "namada_macros", + "namada_merkle_tree", + "namada_replay_protection", + "regex", + "serde", + "smooth-operator", + "thiserror", + "tracing", +] + +[[package]] +name = "namada_systems" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "namada_core", + "namada_events", + "namada_storage", +] + +[[package]] +name = "namada_token" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "namada_core", + "namada_events", + "namada_macros", + "namada_shielded_token", + "namada_storage", + "namada_systems", + "namada_trans_token", + "namada_tx", + "namada_tx_env", + "serde", +] + +[[package]] +name = "namada_trans_token" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "konst", + "namada_core", + "namada_events", + "namada_state", + "namada_systems", + "namada_tx", + "namada_tx_env", + "namada_vp_env", + "thiserror", + "tracing", +] + +[[package]] +name = "namada_tx" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "ark-bls12-381", + "bitflags 2.6.0", + "borsh", + "data-encoding", + "either", + "konst", + "masp_primitives", + "namada_account", + "namada_core", + "namada_events", + "namada_gas", + "namada_macros", + "num-derive 0.4.2", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "prost 0.13.3", + "prost-types 0.13.3", + "rand_core 0.6.4", + "serde", + "serde_json", + "sha2 0.9.9", + "thiserror", + "tonic-build", +] + +[[package]] +name = "namada_tx_env" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "namada_core", + "namada_events", + "namada_storage", +] + +[[package]] +name = "namada_vm" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "clru", + "namada_account", + "namada_core", + "namada_events", + "namada_gas", + "namada_parameters", + "namada_state", + "namada_token", + "namada_tx", + "namada_vp", + "smooth-operator", + "thiserror", + "tracing", + "wasmparser", +] + +[[package]] +name = "namada_vote_ext" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "borsh", + "namada_core", + "namada_macros", + "namada_tx", + "serde", +] + +[[package]] +name = "namada_vp" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "namada_core", + "namada_events", + "namada_gas", + "namada_state", + "namada_tx", + "namada_vp_env", + "smooth-operator", + "thiserror", + "tracing", +] + +[[package]] +name = "namada_vp_env" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "derivative", + "masp_primitives", + "namada_core", + "namada_events", + "namada_gas", + "namada_storage", + "namada_tx", + "smooth-operator", +] + +[[package]] +name = "namada_wallet" +version = "0.46.1" +source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +dependencies = [ + "bimap", + "borsh", + "borsh-ext", + "data-encoding", + "derivation-path", + "fd-lock", + "itertools 0.12.1", + "masp_primitives", + "namada_core", + "namada_ibc", + "namada_macros", + "orion", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "slip10_ed25519", + "smooth-operator", + "thiserror", + "tiny-bip39 0.8.2", + "tiny-hderive", + "toml 0.5.11", + "zeroize", +] [[package]] -name = "miniz_oxide" -version = "0.7.4" +name = "nanorand" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "adler", + "getrandom 0.2.15", ] [[package]] -name = "mio" -version = "1.0.2" +name = "native-tls" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "hermit-abi 0.3.9", "libc", - "wasi", - "windows-sys 0.52.0", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", ] [[package]] -name = "moka" -version = "0.12.8" +name = "new_debug_unreachable" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f" -dependencies = [ - "crossbeam-channel", - "crossbeam-epoch", - "crossbeam-utils", - "once_cell", - "parking_lot", - "quanta", - "rustc_version", - "smallvec", - "tagptr", - "thiserror", - "triomphe", - "uuid", -] +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[package]] +name = "nonempty" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" [[package]] name = "nu-ansi-term" @@ -2250,6 +4994,20 @@ dependencies = [ "winapi", ] +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -2257,23 +5015,65 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", - "num-traits", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "serde", ] +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[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-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "num-integer" version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "num-traits", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2284,7 +5084,7 @@ checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ "num-bigint", "num-integer", - "num-traits", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "serde", ] @@ -2295,6 +5095,60 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", + "libm", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "git+https://github.com/heliaxdev/num-traits?rev=3f3657caa34b8e116fdf3f8a3519c4ac29f012fe#3f3657caa34b8e116fdf3f8a3519c4ac29f012fe" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num256" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9b5179e82f0867b23e0b9b822493821f9345561f271364f409c8e4a058367d" +dependencies = [ + "lazy_static", + "num", + "num-derive 0.3.3", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "serde_derive", +] + +[[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 = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] @@ -2327,12 +5181,75 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +[[package]] +name = "open-fastrlp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", + "ethereum-types", + "open-fastrlp-derive", +] + +[[package]] +name = "open-fastrlp-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" +dependencies = [ + "bytes", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "openssl" +version = "0.10.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-sys" +version = "0.9.104" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "opentelemetry" version = "0.19.0" @@ -2386,10 +5303,28 @@ dependencies = [ "once_cell", "opentelemetry_api", "percent-encoding", - "rand", + "rand 0.8.5", "thiserror", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "orion" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6624905ddd92e460ff0685567539ed1ac985b2dee4c92c7edcd64fce905b00c" +dependencies = [ + "ct-codecs", + "getrandom 0.2.15", + "subtle", + "zeroize", +] + [[package]] name = "os_str_bytes" version = "6.6.1" @@ -2408,6 +5343,42 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +[[package]] +name = "pairing" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" +dependencies = [ + "group", +] + +[[package]] +name = "parity-scale-codec" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be4817d39f3272f69c59fe05d0535ae6456c2dc2fa1ba02910296c7e0a5c590" +dependencies = [ + "arrayvec", + "bitvec", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "rustversion", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8781a75c6205af67215f382092b6e0a4ff3734798523e69073d4bcd294ec767b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "parking_lot" version = "0.12.3" @@ -2431,19 +5402,92 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "pasta_curves" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" +dependencies = [ + "ff", + "group", + "rand 0.8.5", + "static_assertions", + "subtle", +] + [[package]] name = "paste" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "path-slash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" + +[[package]] +name = "patricia_tree" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f2f4539bffe53fc4b4da301df49d114b845b077bd5727b7fe2bd9d8df2ae68" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", + "hmac 0.12.1", + "password-hash 0.4.2", + "sha2 0.10.8", +] + [[package]] name = "pbkdf2" -version = "0.11.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", + "hmac 0.12.1", + "password-hash 0.5.0", ] [[package]] @@ -2473,12 +5517,103 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3aeb8f54c078314c2065ee649a7241f46b9d8e418e1a9581ba0546657d7aa3a" +[[package]] +name = "pem" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" +dependencies = [ + "base64 0.13.1", +] + [[package]] name = "percent-encoding" version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "pest" +version = "2.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.6.0", +] + +[[package]] +name = "pharos" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" +dependencies = [ + "futures", + "rustc_version 0.4.1", +] + +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_macros", + "phf_shared 0.11.2", +] + +[[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 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +dependencies = [ + "phf_generator", + "phf_shared 0.11.2", + "proc-macro2", + "quote", + "syn 2.0.89", +] + +[[package]] +name = "phf_shared" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" +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.7" @@ -2496,7 +5631,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -2521,6 +5656,29 @@ dependencies = [ "spki", ] +[[package]] +name = "pkg-config" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" + +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "portable-atomic" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" + [[package]] name = "powerfmt" version = "0.2.0" @@ -2536,6 +5694,22 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "prettyplease" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" +dependencies = [ + "proc-macro2", + "syn 2.0.89", +] + [[package]] name = "primitive-types" version = "0.12.2" @@ -2543,10 +5717,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", + "impl-codec", + "impl-rlp", "impl-serde", + "scale-info", "uint", ] +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -2573,9 +5759,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -2595,6 +5781,32 @@ dependencies = [ "thiserror", ] +[[package]] +name = "proptest" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +dependencies = [ + "bitflags 2.6.0", + "lazy_static", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rand_xorshift", + "regex-syntax 0.8.5", + "unarray", +] + +[[package]] +name = "prost" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +dependencies = [ + "bytes", + "prost-derive 0.12.6", +] + [[package]] name = "prost" version = "0.13.3" @@ -2602,7 +5814,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.13.3", +] + +[[package]] +name = "prost-build" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +dependencies = [ + "bytes", + "heck 0.4.1", + "itertools 0.12.1", + "log", + "multimap", + "once_cell", + "petgraph", + "prettyplease", + "prost 0.12.6", + "prost-types 0.12.6", + "regex", + "syn 2.0.89", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +dependencies = [ + "anyhow", + "itertools 0.12.1", + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] @@ -2612,10 +5858,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", - "itertools", + "itertools 0.13.0", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", +] + +[[package]] +name = "prost-types" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +dependencies = [ + "prost 0.12.6", +] + +[[package]] +name = "prost-types" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" +dependencies = [ + "prost 0.13.3", ] [[package]] @@ -2634,7 +5898,7 @@ dependencies = [ "libc", "once_cell", "raw-cpuid", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "web-sys", "winapi", ] @@ -2648,6 +5912,25 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + [[package]] name = "rand" version = "0.8.5" @@ -2655,8 +5938,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", ] [[package]] @@ -2666,7 +5959,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", ] [[package]] @@ -2675,7 +5977,25 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core 0.6.4", ] [[package]] @@ -2687,6 +6007,57 @@ dependencies = [ "bitflags 2.6.0", ] +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "reddsa" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78a5191930e84973293aa5f532b513404460cd2216c1cfb76d08748c15b40b02" +dependencies = [ + "blake2b_simd", + "byteorder", + "group", + "hex", + "jubjub 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pasta_curves", + "rand_core 0.6.4", + "serde", + "thiserror", + "zeroize", +] + +[[package]] +name = "redjubjub" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a60db2c3bc9c6fd1e8631fee75abc008841d27144be744951d6b9b75f9b569c" +dependencies = [ + "rand_core 0.6.4", + "reddsa", + "serde", + "thiserror", + "zeroize", +] + [[package]] name = "redox_syscall" version = "0.5.7" @@ -2702,7 +6073,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom", + "getrandom 0.2.15", "libredox", "thiserror", ] @@ -2767,10 +6138,12 @@ dependencies = [ "http-body 0.4.6", "hyper 0.14.31", "hyper-rustls", + "hyper-tls", "ipnet", "js-sys", "log", "mime", + "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -2783,12 +6156,14 @@ dependencies = [ "sync_wrapper 0.1.2", "system-configuration", "tokio", + "tokio-native-tls", "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", + "webpki-roots", "winreg", ] @@ -2804,10 +6179,25 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hmac", + "hmac 0.12.1", "subtle", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + [[package]] name = "ring" version = "0.17.8" @@ -2816,10 +6206,10 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", - "spin", - "untrusted", + "spin 0.9.8", + "untrusted 0.9.0", "windows-sys 0.52.0", ] @@ -2827,9 +6217,51 @@ dependencies = [ name = "ripemd" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rlp-derive", + "rustc-hex", +] + +[[package]] +name = "rlp-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rpassword" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "rust_decimal" +version = "1.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" dependencies = [ - "digest 0.10.7", + "arrayvec", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2844,13 +6276,28 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver 0.11.0", +] + [[package]] name = "rustc_version" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver", + "semver 1.0.23", ] [[package]] @@ -2873,7 +6320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring", + "ring 0.17.8", "rustls-webpki 0.101.7", "sct", ] @@ -2885,7 +6332,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", - "ring", + "ring 0.17.8", "rustls-pki-types", "rustls-webpki 0.102.8", "subtle", @@ -2900,7 +6347,7 @@ checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" dependencies = [ "log", "once_cell", - "ring", + "ring 0.17.8", "rustls-pki-types", "rustls-webpki 0.102.8", "subtle", @@ -2975,8 +6422,8 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -2985,9 +6432,9 @@ version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ - "ring", + "ring 0.17.8", "rustls-pki-types", - "untrusted", + "untrusted 0.9.0", ] [[package]] @@ -3002,6 +6449,15 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + [[package]] name = "same-file" version = "1.0.6" @@ -3011,6 +6467,30 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scale-info" +version = "2.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" +dependencies = [ + "cfg-if", + "derive_more 1.0.0", + "parity-scale-codec", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "scc" version = "2.2.5" @@ -3029,20 +6509,56 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.89", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scrypt" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" +dependencies = [ + "hmac 0.12.1", + "pbkdf2 0.11.0", + "salsa20", + "sha2 0.10.8", +] + [[package]] name = "sct" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -3061,6 +6577,7 @@ dependencies = [ "der", "generic-array", "pkcs8", + "serdect", "subtle", "zeroize", ] @@ -3072,7 +6589,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ "bitcoin_hashes", - "rand", + "rand 0.8.5", "secp256k1-sys", "serde", ] @@ -3119,6 +6636,15 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.23" @@ -3128,6 +6654,27 @@ dependencies = [ "serde", ] +[[package]] +name = "semver-parser" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" +dependencies = [ + "pest", +] + +[[package]] +name = "send_wrapper" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" + +[[package]] +name = "send_wrapper" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" + [[package]] name = "serde" version = "1.0.215" @@ -3137,6 +6684,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-json-wasm" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05da0d153dd4595bdffd5099dc0e9ce425b205ee648eb93437ff7302af8c9a5" +dependencies = [ + "serde", +] + [[package]] name = "serde_bytes" version = "0.11.15" @@ -3164,7 +6720,18 @@ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] @@ -3197,7 +6764,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -3234,6 +6801,16 @@ dependencies = [ "unsafe-libyaml", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "serial_test" version = "3.2.0" @@ -3256,7 +6833,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -3351,7 +6928,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -3360,6 +6937,24 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e2accd2c41a0e920d2abd91b2badcfa1da784662f54fbc47e0e3a51f1e2e1cf" +[[package]] +name = "simple_asn1" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +dependencies = [ + "num-bigint", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror", + "time", +] + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" @@ -3369,12 +6964,39 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slip10_ed25519" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be0ff28bf14f9610a342169084e87a4f435ad798ec528dc7579a3678fa9dc9a" +dependencies = [ + "hmac-sha512", +] + [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "smooth-operator" +version = "0.7.0" +source = "git+https://github.com/heliaxdev/smooth-operator?tag=v0.7.0#0e182707f5e5bb9c6e0efa2d235dc9efd715d0a1" +dependencies = [ + "smooth-operator-impl", +] + +[[package]] +name = "smooth-operator-impl" +version = "0.7.0" +source = "git+https://github.com/heliaxdev/smooth-operator?tag=v0.7.0#0e182707f5e5bb9c6e0efa2d235dc9efd715d0a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "socket2" version = "0.5.7" @@ -3385,11 +7007,46 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "solang-parser" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c425ce1c59f4b154717592f0bdf4715c3a1d55058883622d3157e1f0908a5b26" +dependencies = [ + "itertools 0.11.0", + "lalrpop", + "lalrpop-util", + "phf", + "thiserror", + "unicode-xid", +] + +[[package]] +name = "sparse-merkle-tree" +version = "0.3.1-pre" +source = "git+https://github.com/heliaxdev/sparse-merkle-tree?rev=a93c55ccd47840ee0967eee237e47d9245478594#a93c55ccd47840ee0967eee237e47d9245478594" +dependencies = [ + "borsh", + "cfg-if", + "ics23", + "itertools 0.12.1", + "sha2 0.9.9", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + [[package]] name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] [[package]] name = "spki" @@ -3413,6 +7070,19 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" +[[package]] +name = "string_cache" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" +dependencies = [ + "new_debug_unreachable", + "once_cell", + "parking_lot", + "phf_shared 0.10.0", + "precomputed-hash", +] + [[package]] name = "strsim" version = "0.10.0" @@ -3425,7 +7095,16 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" dependencies = [ - "strum_macros", + "strum_macros 0.25.3", +] + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +dependencies = [ + "strum_macros 0.26.4", ] [[package]] @@ -3434,11 +7113,24 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "heck", + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.89", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", "proc-macro2", "quote", "rustversion", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -3462,6 +7154,26 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" +[[package]] +name = "svm-rs" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11297baafe5fa0c99d5722458eac6a5e25c01eb1b8e5cd137f54079093daa7a4" +dependencies = [ + "dirs", + "fs2", + "hex", + "once_cell", + "reqwest", + "semver 1.0.23", + "serde", + "serde_json", + "sha2 0.10.8", + "thiserror", + "url", + "zip", +] + [[package]] name = "syn" version = "1.0.109" @@ -3475,9 +7187,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -3516,7 +7228,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -3546,6 +7258,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + [[package]] name = "tempfile" version = "3.14.0" @@ -3559,6 +7277,37 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "tendermint" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d9d6ffeb83b1de47c307c6e0d2dff56c6256989299010ad03cd80a8491e97" +dependencies = [ + "bytes", + "digest 0.10.7", + "ed25519", + "ed25519-consensus", + "flex-error", + "futures", + "k256", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "once_cell", + "prost 0.13.3", + "prost-types 0.13.3", + "ripemd", + "serde", + "serde_bytes", + "serde_json", + "serde_repr", + "sha2 0.10.8", + "signature", + "subtle", + "subtle-encoding", + "tendermint-proto 0.38.1", + "time", + "zeroize", +] + [[package]] name = "tendermint" version = "0.40.0" @@ -3572,9 +7321,9 @@ dependencies = [ "flex-error", "futures", "k256", - "num-traits", + "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell", - "prost", + "prost 0.13.3", "ripemd", "serde", "serde_bytes", @@ -3584,11 +7333,25 @@ dependencies = [ "signature", "subtle", "subtle-encoding", - "tendermint-proto", + "tendermint-proto 0.40.0", "time", "zeroize", ] +[[package]] +name = "tendermint-config" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9de111ea653b2adaef627ac2452b463c77aa615c256eaaddf279ec5a1cf9775f" +dependencies = [ + "flex-error", + "serde", + "serde_json", + "tendermint 0.38.1", + "toml 0.8.19", + "url", +] + [[package]] name = "tendermint-config" version = "0.40.0" @@ -3598,7 +7361,7 @@ dependencies = [ "flex-error", "serde", "serde_json", - "tendermint", + "tendermint 0.40.0", "toml 0.8.19", "url", ] @@ -3611,7 +7374,7 @@ checksum = "3e88c08a112db05101396a79f71c017d7dbf548dc21614f82251f17ecbe5d5e8" dependencies = [ "contracts", "crossbeam-channel", - "derive_more", + "derive_more 0.99.18", "flex-error", "futures", "regex", @@ -3620,9 +7383,9 @@ dependencies = [ "serde_derive", "serde_json", "static_assertions", - "tendermint", - "tendermint-light-client-verifier", - "tendermint-rpc", + "tendermint 0.40.0", + "tendermint-light-client-verifier 0.40.0", + "tendermint-rpc 0.40.0", "time", "tokio", "tracing", @@ -3635,7 +7398,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48a431ea923182c37ca9f3cc8333490ac6746a64520d1c4a3dd18c08b0806ac" dependencies = [ "crossbeam-channel", - "derive_more", + "derive_more 0.99.18", "flex-error", "futures", "serde", @@ -3643,40 +7406,103 @@ dependencies = [ "serde_derive", "serde_json", "static_assertions", - "tendermint", + "tendermint 0.40.0", "tendermint-light-client", - "tendermint-proto", - "tendermint-rpc", + "tendermint-proto 0.40.0", + "tendermint-rpc 0.40.0", + "time", + "tracing", +] + +[[package]] +name = "tendermint-light-client-verifier" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2674adbf0dc51aa0c8eaf8462c7d6692ec79502713e50ed5432a442002be90" +dependencies = [ + "derive_more 0.99.18", + "flex-error", + "serde", + "tendermint 0.38.1", + "time", +] + +[[package]] +name = "tendermint-light-client-verifier" +version = "0.40.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7affc5fffe9df158185e15bce3e47fc3a0c901e6708f3b7d33f0867d7aef8ce1" +dependencies = [ + "derive_more 0.99.18", + "flex-error", + "serde", + "tendermint 0.40.0", + "time", +] + +[[package]] +name = "tendermint-proto" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed14abe3b0502a3afe21ca74ca5cdd6c7e8d326d982c26f98a394445eb31d6e" +dependencies = [ + "bytes", + "flex-error", + "prost 0.13.3", + "prost-types 0.13.3", + "serde", + "serde_bytes", + "subtle-encoding", "time", - "tracing", ] [[package]] -name = "tendermint-light-client-verifier" +name = "tendermint-proto" version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7affc5fffe9df158185e15bce3e47fc3a0c901e6708f3b7d33f0867d7aef8ce1" +checksum = "c81ba1b023ec00763c3bc4f4376c67c0047f185cccf95c416c7a2f16272c4cbb" dependencies = [ - "derive_more", + "bytes", "flex-error", + "prost 0.13.3", "serde", - "tendermint", + "serde_bytes", + "subtle-encoding", "time", ] [[package]] -name = "tendermint-proto" -version = "0.40.0" +name = "tendermint-rpc" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c81ba1b023ec00763c3bc4f4376c67c0047f185cccf95c416c7a2f16272c4cbb" +checksum = "02f96a2b8a0d3d0b59e4024b1a6bdc1589efc6af4709d08a480a20cc4ba90f63" dependencies = [ + "async-trait", + "async-tungstenite", "bytes", "flex-error", - "prost", + "futures", + "getrandom 0.2.15", + "peg", + "pin-project", + "rand 0.8.5", + "reqwest", + "semver 1.0.23", "serde", "serde_bytes", + "serde_json", + "subtle", "subtle-encoding", + "tendermint 0.38.1", + "tendermint-config 0.38.1", + "tendermint-proto 0.38.1", + "thiserror", "time", + "tokio", + "tracing", + "url", + "uuid 1.11.0", + "walkdir", ] [[package]] @@ -3690,26 +7516,26 @@ dependencies = [ "bytes", "flex-error", "futures", - "getrandom", + "getrandom 0.2.15", "peg", "pin-project", - "rand", + "rand 0.8.5", "reqwest", - "semver", + "semver 1.0.23", "serde", "serde_bytes", "serde_json", "subtle", "subtle-encoding", - "tendermint", - "tendermint-config", - "tendermint-proto", + "tendermint 0.40.0", + "tendermint-config 0.40.0", + "tendermint-proto 0.40.0", "thiserror", "time", "tokio", "tracing", "url", - "uuid", + "uuid 1.11.0", "walkdir", ] @@ -3725,10 +7551,21 @@ dependencies = [ "serde_json", "simple-error", "tempfile", - "tendermint", + "tendermint 0.40.0", "time", ] +[[package]] +name = "term" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" +dependencies = [ + "dirs-next", + "rustversion", + "winapi", +] + [[package]] name = "termcolor" version = "1.4.1" @@ -3738,6 +7575,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +dependencies = [ + "rustix", + "windows-sys 0.48.0", +] + [[package]] name = "test-log" version = "0.2.16" @@ -3757,7 +7604,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -3783,7 +7630,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -3803,6 +7650,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", + "itoa", "num-conv", "powerfmt", "serde", @@ -3826,6 +7674,24 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "git+https://github.com/anoma/tiny-bip39.git?rev=bf0f6d8713589b83af7a917366ec31f5275c0e57#bf0f6d8713589b83af7a917366ec31f5275c0e57" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2 0.4.0", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + [[package]] name = "tiny-bip39" version = "1.0.0" @@ -3833,10 +7699,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" dependencies = [ "anyhow", - "hmac", + "hmac 0.12.1", "once_cell", - "pbkdf2", - "rand", + "pbkdf2 0.11.0", + "rand 0.8.5", "rustc-hash", "sha2 0.10.8", "thiserror", @@ -3845,6 +7711,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "tiny-hderive" +version = "0.3.0" +source = "git+https://github.com/heliaxdev/tiny-hderive.git?rev=173ae03abed0cd25d88a5a13efac00af96b75b87#173ae03abed0cd25d88a5a13efac00af96b75b87" +dependencies = [ + "base58", + "hmac 0.12.1", + "k256", + "memzero", + "sha2 0.10.8", +] + [[package]] name = "tiny-keccak" version = "2.0.2" @@ -3905,7 +7783,17 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", ] [[package]] @@ -3951,6 +7839,21 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +dependencies = [ + "futures-util", + "log", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", + "tungstenite 0.20.1", + "webpki-roots", +] + [[package]] name = "tokio-util" version = "0.7.12" @@ -4027,7 +7930,7 @@ dependencies = [ "hyper-util", "percent-encoding", "pin-project", - "prost", + "prost 0.13.3", "rustls-native-certs 0.8.0", "rustls-pemfile 2.2.0", "socket2", @@ -4040,6 +7943,19 @@ dependencies = [ "tracing", ] +[[package]] +name = "tonic-build" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "quote", + "syn 2.0.89", +] + [[package]] name = "tower" version = "0.4.13" @@ -4051,7 +7967,7 @@ dependencies = [ "indexmap 1.9.3", "pin-project", "pin-project-lite", - "rand", + "rand 0.8.5", "slab", "tokio", "tokio-util", @@ -4106,7 +8022,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -4129,6 +8045,16 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-log" version = "0.1.4" @@ -4194,6 +8120,26 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 0.2.12", + "httparse", + "log", + "rand 0.8.5", + "rustls 0.21.12", + "sha1", + "thiserror", + "url", + "utf-8", +] + [[package]] name = "tungstenite" version = "0.21.0" @@ -4206,7 +8152,7 @@ dependencies = [ "http 1.1.0", "httparse", "log", - "rand", + "rand 0.8.5", "rustls 0.22.4", "rustls-pki-types", "sha1", @@ -4215,12 +8161,53 @@ dependencies = [ "utf-8", ] +[[package]] +name = "typed-builder" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06fbd5b8de54c5f7c91f6fe4cebb949be2125d7758e630bb58b1d831dbce600" +dependencies = [ + "typed-builder-macro", +] + +[[package]] +name = "typed-builder-macro" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9534daa9fd3ed0bd911d462a37f172228077e7abf18c18a5f67199d959205f8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "typewit" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fb9ae6a3cafaf0a5d14c2302ca525f9ae8e07a0f0e6949de88d882c37a6e24" +dependencies = [ + "typewit_proc_macros", +] + +[[package]] +name = "typewit_proc_macros" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e36a83ea2b3c704935a01b4642946aadd445cea40b10935e3f8bd8052b8193d6" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + [[package]] name = "uint" version = "0.9.5" @@ -4233,6 +8220,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unicode-ident" version = "1.0.13" @@ -4260,12 +8253,28 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + [[package]] name = "unsafe-libyaml" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "untrusted" version = "0.9.0" @@ -4319,13 +8328,23 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom 0.2.15", + "serde", +] + [[package]] name = "uuid" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] @@ -4334,6 +8353,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.5" @@ -4368,6 +8393,12 @@ dependencies = [ "try-lock", ] +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -4396,7 +8427,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", "wasm-bindgen-shared", ] @@ -4430,7 +8461,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4441,6 +8472,30 @@ version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +[[package]] +name = "wasmparser" +version = "0.107.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" +dependencies = [ + "indexmap 1.9.3", + "semver 1.0.23", +] + +[[package]] +name = "wasmtimer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ed9d8b15c7fb594d72bfb4b5a276f3d2029333cd93a932f376f5937f6f80ee" +dependencies = [ + "futures", + "js-sys", + "parking_lot", + "pin-utils", + "slab", + "wasm-bindgen", +] + [[package]] name = "web-sys" version = "0.3.72" @@ -4451,6 +8506,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + [[package]] name = "winapi" version = "0.3.9" @@ -4670,6 +8731,51 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +[[package]] +name = "ws_stream_wasm" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" +dependencies = [ + "async_io_stream", + "futures", + "js-sys", + "log", + "pharos", + "rustc_version 0.4.1", + "send_wrapper 0.6.0", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "xorf" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf24c008fe464f5d8f58b8d16a1ab7e930bd73b2a6933ff8704c414b2bed7f92" +dependencies = [ + "libm", + "rand 0.8.5", + "serde", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + [[package]] name = "yoke" version = "0.7.4" @@ -4690,10 +8796,19 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", "synstructure 0.13.1", ] +[[package]] +name = "zcash_encoding" +version = "0.2.0" +source = "git+https://github.com/zcash/librustzcash?rev=bd7f9d7#bd7f9d7c3ce5cfd14af169ffe0e1c5c903162f46" +dependencies = [ + "byteorder", + "nonempty", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -4712,7 +8827,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -4732,7 +8847,7 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", "synstructure 0.13.1", ] @@ -4753,7 +8868,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", ] [[package]] @@ -4775,5 +8890,54 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.89", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq 0.1.5", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac 0.12.1", + "pbkdf2 0.11.0", + "sha1", + "time", + "zstd", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.13+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +dependencies = [ + "cc", + "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index c7be1ceaaf..0bb6fd2ecb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,6 +42,12 @@ tendermint-proto = { version = "0.40.0" } tendermint-rpc = { version = "0.40.0" } tendermint-testgen = { version = "0.40.0" } +# Namada dependencies +namada_sdk = { git = "https://github.com/anoma/namada", tag = "v0.46.1" } +# Different tendermint-rs version for Namada +namada-tendermint = { package = "tendermint", version = "0.38.0", default-features = false } +namada-tendermint-proto = { package = "tendermint-proto", version = "0.38.0" } +namada-tendermint-rpc = { package = "tendermint-rpc", version = "0.38.0" } # Other dependencies abscissa_core = "=0.6.0" @@ -93,6 +99,7 @@ regex = "1.11.1" reqwest = { version = "0.11.27", default-features = false } retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" +rpassword = "5.0.1" secp256k1 = "0.28.2" semver = "1.0.21" serde = "1.0.214" diff --git a/ci/release/hermes.Dockerfile b/ci/release/hermes.Dockerfile index 8540b2446b..105b9b2dd8 100644 --- a/ci/release/hermes.Dockerfile +++ b/ci/release/hermes.Dockerfile @@ -6,9 +6,23 @@ FROM rust:1-buster AS build-env ARG TAG +ARG PROTOC_VERSION=28.3 WORKDIR /root +# Install protoc +RUN ARCH=$(uname -m) && \ + if [ "$ARCH" = "x86_64" ]; then \ + ARCH=x86_64; \ + elif [ "$ARCH" = "aarch64" ]; then \ + ARCH=aarch_64;\ + else \ + echo "Unsupported architecture: $ARCH"; exit 1; \ + fi && \ + wget https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-$ARCH.zip -O /tmp/protoc.zip && \ + unzip /tmp/protoc.zip -d /usr/local && \ + rm -rf /tmp/protoc.zip + COPY . . RUN cargo build --release @@ -17,12 +31,24 @@ LABEL maintainer="hello@informal.systems" ARG UID=2000 ARG GID=2000 -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget RUN update-ca-certificates RUN groupadd -g ${GID} hermes && useradd -l -m hermes -s /bin/bash -u ${UID} -g ${GID} WORKDIR /home/hermes + +RUN ARCH=$(uname -m) && \ + if [ "$ARCH" = "x86_64" ]; then \ + DEB_URL=http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb; \ + elif [ "$ARCH" = "aarch64" ]; then \ + DEB_URL=http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb; \ + else \ + echo "Unsupported architecture: $ARCH"; exit 1; \ + fi && \ + wget $DEB_URL -O /tmp/libssl1.1.deb && \ + dpkg -i /tmp/libssl1.1.deb && \ + rm -rf /tmp/libssl1.1.deb + USER hermes:hermes ENTRYPOINT ["/usr/bin/hermes"] - COPY --chown=hermes:hermes --from=build-env /root/target/release/hermes /usr/bin/hermes diff --git a/clippy.toml b/clippy.toml index 7372c60ff2..4233c8791a 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.76.0" +msrv = "1.79.0" diff --git a/config.toml b/config.toml index aeb2eff924..224d49af7c 100644 --- a/config.toml +++ b/config.toml @@ -158,7 +158,7 @@ port = 5555 # Specify the chain ID. Required id = 'ibc-0' -# Specify the chain type, currently only `CosmosSdk` is supported. +# Specify the chain type, currently `CosmosSdk` and `Namada` are supported. # Default: CosmosSdk type = "CosmosSdk" diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index 5968134be3..ad48d001ee 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.76.0" +rust-version = "1.79.0" description = """ Service to fetch data from the chain-registry """ diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index fbdcd20d0d..4de0cdf166 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.76.0" +rust-version = "1.79.0" description = """ Hermes is an IBC Relayer written in Rust """ diff --git a/crates/relayer-cli/src/commands/keys/add.rs b/crates/relayer-cli/src/commands/keys/add.rs index b24514d00a..30f7c4d055 100644 --- a/crates/relayer-cli/src/commands/keys/add.rs +++ b/crates/relayer-cli/src/commands/keys/add.rs @@ -10,9 +10,11 @@ use abscissa_core::{Command, Runnable}; use eyre::eyre; use hdpath::StandardHDPath; use ibc_relayer::{ + chain::namada::wallet::CliWalletUtils, config::{ChainConfig, Config}, keyring::{ - AnySigningKeyPair, KeyRing, Secp256k1KeyPair, SigningKeyPair, SigningKeyPairSized, Store, + AnySigningKeyPair, KeyRing, NamadaKeyPair, Secp256k1KeyPair, SigningKeyPair, + SigningKeyPairSized, Store, }, }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; @@ -220,6 +222,36 @@ pub fn add_key( keyring.add_key(key_name, key_pair.clone())?; key_pair.into() } + ChainConfig::Namada(config) => { + let mut keyring = + KeyRing::new_namada(Store::Test, &config.id, &config.key_store_folder)?; + + check_key_exists(&keyring, key_name, overwrite); + + let path = if file.is_file() { + file.parent().ok_or(eyre!("invalid Namada wallet path"))? + } else { + file + }; + let mut wallet = CliWalletUtils::new(path.to_path_buf()); + wallet + .load() + .map_err(|e| eyre!("error loading Namada wallet: {e}"))?; + + let secret_key = wallet + .find_secret_key(key_name, None) + .map_err(|e| eyre!("error loading the key from Namada wallet: {e}"))?; + let address = wallet + .find_address(key_name) + .ok_or_else(|| eyre!("error loading the address from Namada wallet"))?; + let namada_key = NamadaKeyPair { + alias: key_name.to_string(), + address: address.into_owned(), + secret_key: secret_key.clone(), + }; + keyring.add_key(key_name, namada_key.clone())?; + namada_key.into() + } }; Ok(key_pair) @@ -256,6 +288,11 @@ pub fn restore_key( keyring.add_key(key_name, key_pair.clone())?; key_pair.into() } + ChainConfig::Namada(_) => { + return Err(eyre!( + "Namada key can't be restored here. Use Namada wallet." + )); + } }; Ok(key_pair) diff --git a/crates/relayer-cli/src/commands/keys/balance.rs b/crates/relayer-cli/src/commands/keys/balance.rs index b3c1edd90d..b3c9851bb9 100644 --- a/crates/relayer-cli/src/commands/keys/balance.rs +++ b/crates/relayer-cli/src/commands/keys/balance.rs @@ -77,7 +77,9 @@ fn get_balance(chain: impl ChainHandle, key_name: Option, denom: Option< let key_name = key_name.unwrap_or_else(|| { let chain_config = chain.config().unwrap_or_else(exit_with_unrecoverable_error); match chain_config { - ChainConfig::CosmosSdk(chain_config) => chain_config.key_name, + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + chain_config.key_name + } } }); @@ -99,7 +101,9 @@ fn get_balances(chain: impl ChainHandle, key_name: Option) { let key_name = key_name.unwrap_or_else(|| { let chain_config = chain.config().unwrap_or_else(exit_with_unrecoverable_error); match chain_config { - ChainConfig::CosmosSdk(chain_config) => chain_config.key_name, + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + chain_config.key_name + } } }); diff --git a/crates/relayer-cli/src/commands/keys/delete.rs b/crates/relayer-cli/src/commands/keys/delete.rs index fe25e8a056..aef00748d0 100644 --- a/crates/relayer-cli/src/commands/keys/delete.rs +++ b/crates/relayer-cli/src/commands/keys/delete.rs @@ -123,6 +123,11 @@ pub fn delete_key(config: &ChainConfig, key_name: &str) -> eyre::Result<()> { )?; keyring.remove_key(key_name)?; } + ChainConfig::Namada(config) => { + let mut keyring = + KeyRing::new_namada(Store::Test, &config.id, &config.key_store_folder)?; + keyring.remove_key(key_name)?; + } } Ok(()) } @@ -141,6 +146,14 @@ pub fn delete_all_keys(config: &ChainConfig) -> eyre::Result<()> { keyring.remove_key(&key_name)?; } } + ChainConfig::Namada(config) => { + let mut keyring = + KeyRing::new_namada(Store::Test, &config.id, &config.key_store_folder)?; + let keys = keyring.keys()?; + for (key_name, _) in keys { + keyring.remove_key(&key_name)?; + } + } } Ok(()) } diff --git a/crates/relayer-cli/src/commands/listen.rs b/crates/relayer-cli/src/commands/listen.rs index ea8bd979cb..f922aa562c 100644 --- a/crates/relayer-cli/src/commands/listen.rs +++ b/crates/relayer-cli/src/commands/listen.rs @@ -146,7 +146,7 @@ fn subscribe( // Q: Should this be restricted only to backends that support it, // or are all backends expected to support subscriptions? match chain_config { - ChainConfig::CosmosSdk(config) => { + ChainConfig::CosmosSdk(config) | ChainConfig::Namada(config) => { let (event_source, monitor_tx) = match &config.event_source { EventSourceMode::Push { url, batch_delay } => EventSource::websocket( chain_config.id().clone(), @@ -189,7 +189,7 @@ fn detect_compatibility_mode( ) -> eyre::Result { // TODO(erwan): move this to the cosmos sdk endpoint implementation let rpc_addr = match config { - ChainConfig::CosmosSdk(config) => config.rpc_addr.clone(), + ChainConfig::CosmosSdk(config) | ChainConfig::Namada(config) => config.rpc_addr.clone(), }; let client = HttpClient::builder(rpc_addr.try_into()?) @@ -197,7 +197,9 @@ fn detect_compatibility_mode( .build()?; let compat_mode = match config { - ChainConfig::CosmosSdk(config) => rt.block_on(fetch_compat_mode(&client, config))?, + ChainConfig::CosmosSdk(config) | ChainConfig::Namada(config) => { + rt.block_on(fetch_compat_mode(&client, config))? + } }; Ok(compat_mode) diff --git a/crates/relayer-cli/src/commands/tx/client.rs b/crates/relayer-cli/src/commands/tx/client.rs index 827d1c5cc1..9f7edc9556 100644 --- a/crates/relayer-cli/src/commands/tx/client.rs +++ b/crates/relayer-cli/src/commands/tx/client.rs @@ -206,7 +206,7 @@ impl Runnable for TxUpdateClientCmd { if let Some(restart_params) = self.genesis_restart_params() { match config.find_chain_mut(&reference_chain_id) { Some(chain_config) => match chain_config { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.genesis_restart = Some(restart_params) } }, @@ -341,7 +341,7 @@ impl Runnable for TxUpgradeClientCmd { reference_application_latest_height ); - while reference_application_latest_height != target_reference_application_height { + while reference_application_latest_height < target_reference_application_height { thread::sleep(Duration::from_millis(500)); reference_application_latest_height = match client.src_chain().query_latest_height() { diff --git a/crates/relayer-cli/src/commands/tx/upgrade.rs b/crates/relayer-cli/src/commands/tx/upgrade.rs index d41bf6ce1e..5c0773a82b 100644 --- a/crates/relayer-cli/src/commands/tx/upgrade.rs +++ b/crates/relayer-cli/src/commands/tx/upgrade.rs @@ -127,7 +127,9 @@ impl Runnable for TxIbcUpgradeChainCmd { let reference_chain = spawn_chain_runtime(&config, &self.reference_chain_id) .unwrap_or_else(exit_with_unrecoverable_error); - let gov_account = if requires_legacy_upgrade_proposal(reference_chain.clone()) { + let gov_account = if requires_legacy_upgrade_proposal(reference_chain.clone()) + .unwrap_or_else(exit_with_unrecoverable_error) + { "".to_string() } else if let Some(gov_account) = &self.gov_account { gov_account.clone() diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index cf44344abf..1b7649bd94 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.76.0" +rust-version = "1.79.0" description = """ Rust implementation of a RESTful API server for Hermes """ @@ -24,5 +24,6 @@ tokio = { workspace = true } tracing = { workspace = true } [dev-dependencies] -reqwest = { workspace = true, features = ["json"] } -toml = { workspace = true } +reqwest = { workspace = true, features = ["json"] } +serde_json = { workspace = true } +toml = { workspace = true } diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index 301cce7c5a..349f58e30d 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -46,9 +46,12 @@ where let response = reqwest::get(&format!("http://127.0.0.1:{port}{path}")) .await .unwrap() - .json::() + .json() .await .unwrap(); + // Workaround for serde_json deserialization failure + // from_str/from_slice() failed for ChainConfig + let response = serde_json::from_value::(response).unwrap(); assert_eq!(response, expected); diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 7b0f1d1c28..2decce2fb7 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.76.0" +rust-version = "1.79.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-types/src/core/ics02_client/trust_threshold.rs b/crates/relayer-types/src/core/ics02_client/trust_threshold.rs index 55f095c4f7..96795cea2d 100644 --- a/crates/relayer-types/src/core/ics02_client/trust_threshold.rs +++ b/crates/relayer-types/src/core/ics02_client/trust_threshold.rs @@ -217,7 +217,7 @@ where struct StringOrInt; - impl<'de> Visitor<'de> for StringOrInt { + impl Visitor<'_> for StringOrInt { type Value = u64; fn expecting(&self, formatter: &mut Formatter<'_>) -> fmt::Result { diff --git a/crates/relayer-types/src/core/ics03_connection/events.rs b/crates/relayer-types/src/core/ics03_connection/events.rs index 5fddc6cfad..e91b7e7ed6 100644 --- a/crates/relayer-types/src/core/ics03_connection/events.rs +++ b/crates/relayer-types/src/core/ics03_connection/events.rs @@ -4,6 +4,7 @@ use serde_derive::{Deserialize, Serialize}; use std::fmt::{Display, Error as FmtError, Formatter}; use tendermint::abci; +use crate::core::ics04_channel::events::EventType; use crate::core::ics24_host::identifier::{ClientId, ConnectionId}; use crate::events::{IbcEvent, IbcEventType}; @@ -68,6 +69,12 @@ impl OpenInit { } } +impl EventType for OpenInit { + fn event_type() -> IbcEventType { + IbcEventType::OpenInitConnection + } +} + impl Display for OpenInit { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "OpenInit {{ {} }}", self.0) @@ -107,6 +114,12 @@ impl OpenTry { } } +impl EventType for OpenTry { + fn event_type() -> IbcEventType { + IbcEventType::OpenTryConnection + } +} + impl Display for OpenTry { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "OpenTry {{ {} }}", self.0) @@ -146,6 +159,12 @@ impl OpenAck { } } +impl EventType for OpenAck { + fn event_type() -> IbcEventType { + IbcEventType::OpenAckConnection + } +} + impl Display for OpenAck { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "OpenAck {{ {} }}", self.0) @@ -185,6 +204,12 @@ impl OpenConfirm { } } +impl EventType for OpenConfirm { + fn event_type() -> IbcEventType { + IbcEventType::OpenConfirmConnection + } +} + impl Display for OpenConfirm { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "OpenConfirm {{ {} }}", self.0) diff --git a/crates/relayer-types/src/core/ics04_channel/packet.rs b/crates/relayer-types/src/core/ics04_channel/packet.rs index 316227c08f..28babd7d43 100644 --- a/crates/relayer-types/src/core/ics04_channel/packet.rs +++ b/crates/relayer-types/src/core/ics04_channel/packet.rs @@ -129,7 +129,7 @@ pub struct Packet { struct PacketData<'a>(&'a [u8]); -impl<'a> core::fmt::Debug for PacketData<'a> { +impl core::fmt::Debug for PacketData<'_> { fn fmt(&self, formatter: &mut core::fmt::Formatter<'_>) -> Result<(), core::fmt::Error> { write!(formatter, "{:?}", self.0) } diff --git a/crates/relayer-types/src/events.rs b/crates/relayer-types/src/events.rs index 7ceb45d5c2..1d27cc337a 100644 --- a/crates/relayer-types/src/events.rs +++ b/crates/relayer-types/src/events.rs @@ -282,7 +282,7 @@ impl FromStr for IbcEventType { } /// Events created by the IBC component of a chain, destined for a relayer. -#[derive(Debug, Clone, Serialize)] +#[derive(Debug, Clone, Serialize, PartialEq)] pub enum IbcEvent { NewBlock(NewBlock), diff --git a/crates/relayer-types/src/utils/pretty.rs b/crates/relayer-types/src/utils/pretty.rs index d44745b956..895d0e1958 100644 --- a/crates/relayer-types/src/utils/pretty.rs +++ b/crates/relayer-types/src/utils/pretty.rs @@ -13,7 +13,7 @@ impl Display for PrettyDuration<'_> { pub struct PrettyOption<'a, T>(pub &'a Option); -impl<'a, T: Display> Display for PrettyOption<'a, T> { +impl Display for PrettyOption<'_, T> { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match &self.0 { Some(v) => write!(f, "{v}"), @@ -62,7 +62,7 @@ impl Display for PrettyValidatorSet<'_> { pub struct PrettySlice<'a, T>(pub &'a [T]); -impl<'a, T: Display> Display for PrettySlice<'a, T> { +impl Display for PrettySlice<'_, T> { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "[ ")?; let mut vec_iterator = self.0.iter().peekable(); diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index a5560a766c..3538f8fbe1 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.76.0" +rust-version = "1.79.0" description = """ Implementation of an IBC Relayer in Rust, as a library """ @@ -46,6 +46,10 @@ humantime = { workspace = true } humantime-serde = { workspace = true } itertools = { workspace = true } moka = { workspace = true, features = ["sync"] } +namada_sdk = { workspace = true } +namada-tendermint = { workspace = true } +namada-tendermint-proto = { workspace = true } +namada-tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } num-bigint = { workspace = true, features = ["serde"] } num-rational = { workspace = true, features = ["num-bigint", "serde"] } once_cell = { workspace = true } @@ -54,6 +58,7 @@ regex = { workspace = true } reqwest = { workspace = true, features = ["rustls-tls-native-roots", "json"] } retry = { workspace = true } ripemd = { workspace = true } +rpassword = { workspace = true } secp256k1 = { workspace = true, features = ["rand-std"] } semver = { workspace = true } serde = { workspace = true } diff --git a/crates/relayer/src/chain.rs b/crates/relayer/src/chain.rs index bcca34e85f..9512e3865e 100644 --- a/crates/relayer/src/chain.rs +++ b/crates/relayer/src/chain.rs @@ -3,6 +3,8 @@ pub mod cosmos; pub mod counterparty; pub mod endpoint; pub mod handle; +pub mod namada; pub mod requests; pub mod runtime; pub mod tracking; +pub mod version; diff --git a/crates/relayer/src/chain/client.rs b/crates/relayer/src/chain/client.rs index 6f00ec8df9..54341c525d 100644 --- a/crates/relayer/src/chain/client.rs +++ b/crates/relayer/src/chain/client.rs @@ -27,9 +27,12 @@ impl ClientSettings { // // TODO: extract Tendermint-related configs into a separate substructure // that can be used both by CosmosSdkConfig and configs for nonSDK chains. - use ChainConfig::CosmosSdk as Csdk; + use ChainConfig::{CosmosSdk as Csdk, Namada}; match (src_chain_config, dst_chain_config) { - (Csdk(src_chain_config), Csdk(dst_chain_config)) => { + (Csdk(src_chain_config), Csdk(dst_chain_config)) + | (Namada(src_chain_config), Namada(dst_chain_config)) + | (Csdk(src_chain_config), Namada(dst_chain_config)) + | (Namada(src_chain_config), Csdk(dst_chain_config)) => { ClientSettings::Tendermint(cosmos::client::Settings::for_create_command( options, src_chain_config, diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index 1dc99d6923..f6e00232bd 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -98,6 +98,7 @@ use crate::chain::endpoint::{ChainEndpoint, ChainStatus, HealthCheck}; use crate::chain::handle::Subscription; use crate::chain::requests::*; use crate::chain::tracking::TrackedMsgs; +use crate::chain::version::Specs; use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; use crate::config::Error as ConfigError; use crate::config::{parse_gas_prices, ChainConfig, GasPrice}; @@ -119,7 +120,6 @@ use crate::HERMES_VERSION; use self::gas::dynamic_gas_price; use self::types::gas::GasConfig; -use self::version::Specs; pub mod batch; pub mod client; @@ -1119,8 +1119,7 @@ impl ChainEndpoint for CosmosSdkChain { &self.rpc_client, &self.config.rpc_addr, ))?; - - Ok(version_specs) + Ok(Specs::Cosmos(version_specs)) } fn query_balance(&self, key_name: Option<&str>, denom: Option<&str>) -> Result { diff --git a/crates/relayer/src/chain/cosmos/batch.rs b/crates/relayer/src/chain/cosmos/batch.rs index 3e52f52aec..bf55a4ec27 100644 --- a/crates/relayer/src/chain/cosmos/batch.rs +++ b/crates/relayer/src/chain/cosmos/batch.rs @@ -209,7 +209,7 @@ async fn sequential_send_messages_as_batches( Ok(tx_sync_results) } -fn response_to_tx_sync_result( +pub fn response_to_tx_sync_result( chain_id: &ChainId, message_count: usize, response: Response, diff --git a/crates/relayer/src/chain/cosmos/config.rs b/crates/relayer/src/chain/cosmos/config.rs index 911e147f32..1a58cc27ac 100644 --- a/crates/relayer/src/chain/cosmos/config.rs +++ b/crates/relayer/src/chain/cosmos/config.rs @@ -167,7 +167,7 @@ impl CosmosSdkConfig { /// a) non-zero /// b) greater or equal to 1/3 /// c) strictly less than 1 -fn validate_trust_threshold( +pub fn validate_trust_threshold( id: &ChainId, trust_threshold: TrustThreshold, ) -> Result<(), Diagnostic> { diff --git a/crates/relayer/src/chain/cosmos/gas.rs b/crates/relayer/src/chain/cosmos/gas.rs index 2106da3375..76ad0adcb3 100644 --- a/crates/relayer/src/chain/cosmos/gas.rs +++ b/crates/relayer/src/chain/cosmos/gas.rs @@ -117,16 +117,16 @@ pub fn mul_floor(a: u64, f: f64) -> BigInt { (f * a).floor().to_integer() } -struct AdjustGas { - gas_multiplier: f64, - max_gas: u64, - gas_amount: u64, +pub struct AdjustGas { + pub gas_multiplier: f64, + pub max_gas: u64, + pub gas_amount: u64, } /// Adjusts the fee based on the configured `gas_multiplier` to prevent out of gas errors. /// The actual gas cost, when a transaction is executed, may be slightly higher than the /// one returned by the simulation. -fn adjust_estimated_gas( +pub fn adjust_estimated_gas( AdjustGas { gas_multiplier, max_gas, diff --git a/crates/relayer/src/chain/cosmos/types/events/channel.rs b/crates/relayer/src/chain/cosmos/types/events/channel.rs index 7a1313ae00..5c3279987a 100644 --- a/crates/relayer/src/chain/cosmos/types/events/channel.rs +++ b/crates/relayer/src/chain/cosmos/types/events/channel.rs @@ -1,5 +1,3 @@ -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; @@ -18,6 +16,10 @@ use ibc_relayer_types::core::ics24_host::identifier::ChainId; use ibc_relayer_types::events::Error as EventError; use ibc_relayer_types::Height; +use crate::chain::cosmos::types::events::raw_object::extract_attribute; +use crate::chain::cosmos::types::events::raw_object::maybe_extract_attribute; +use crate::chain::cosmos::types::events::raw_object::RawObject; + fn extract_attributes(object: &RawObject<'_>, namespace: &str) -> Result { Ok(Attributes { port_id: extract_attribute(object, &format!("{namespace}.port_id"))? @@ -248,41 +250,3 @@ impl TryFrom> for CrossChainQueryPacket { }) } } - -#[derive(Debug, Clone)] -pub struct RawObject<'a> { - pub height: Height, - pub action: String, - pub idx: usize, - pub events: &'a HashMap>, -} - -impl<'a> RawObject<'a> { - pub fn new( - height: Height, - action: String, - idx: usize, - events: &'a HashMap>, - ) -> RawObject<'a> { - RawObject { - height, - action, - idx, - events, - } - } -} - -pub fn extract_attribute(object: &RawObject<'_>, key: &str) -> Result { - let value = object - .events - .get(key) - .ok_or_else(|| EventError::missing_key(key.to_string()))?[object.idx] - .clone(); - - Ok(value) -} - -pub fn maybe_extract_attribute(object: &RawObject<'_>, key: &str) -> Option { - object.events.get(key).map(|tags| tags[object.idx].clone()) -} diff --git a/crates/relayer/src/chain/cosmos/types/events/connection.rs b/crates/relayer/src/chain/cosmos/types/events/connection.rs new file mode 100644 index 0000000000..d629ec5506 --- /dev/null +++ b/crates/relayer/src/chain/cosmos/types/events/connection.rs @@ -0,0 +1,68 @@ +use ibc_relayer_types::core::ics03_connection::events::Attributes; +use ibc_relayer_types::core::ics03_connection::events::OpenAck; +use ibc_relayer_types::core::ics03_connection::events::OpenConfirm; +use ibc_relayer_types::core::ics03_connection::events::OpenInit; +use ibc_relayer_types::core::ics03_connection::events::OpenTry; +use ibc_relayer_types::core::ics04_channel::events::EventType; +use ibc_relayer_types::events::Error as EventError; + +use crate::chain::cosmos::types::events::raw_object::extract_attribute; +use crate::chain::cosmos::types::events::raw_object::maybe_extract_attribute; +use crate::chain::cosmos::types::events::raw_object::RawObject; + +fn extract_attributes(object: &RawObject<'_>, namespace: &str) -> Result { + Ok(Attributes { + client_id: extract_attribute(object, &format!("{namespace}.client_id"))? + .parse() + .map_err(EventError::parse)?, + counterparty_connection_id: maybe_extract_attribute( + object, + &format!("{namespace}.counterparty_connection_id"), + ) + .and_then(|v| v.parse().ok()), + counterparty_client_id: extract_attribute( + object, + &format!("{namespace}.counterparty_client_id"), + )? + .parse() + .map_err(EventError::parse)?, + connection_id: maybe_extract_attribute(object, &format!("{namespace}.connection_id")) + .and_then(|v| v.parse().ok()), + }) +} + +impl TryFrom> for OpenInit { + type Error = EventError; + + fn try_from(value: RawObject<'_>) -> Result { + let attributes = extract_attributes(&value, Self::event_type().as_str())?; + Ok(OpenInit(attributes)) + } +} + +impl TryFrom> for OpenTry { + type Error = EventError; + + fn try_from(value: RawObject<'_>) -> Result { + let attributes = extract_attributes(&value, Self::event_type().as_str())?; + Ok(OpenTry(attributes)) + } +} + +impl TryFrom> for OpenAck { + type Error = EventError; + + fn try_from(value: RawObject<'_>) -> Result { + let attributes = extract_attributes(&value, Self::event_type().as_str())?; + Ok(OpenAck(attributes)) + } +} + +impl TryFrom> for OpenConfirm { + type Error = EventError; + + fn try_from(value: RawObject<'_>) -> Result { + let attributes = extract_attributes(&value, Self::event_type().as_str())?; + Ok(OpenConfirm(attributes)) + } +} diff --git a/crates/relayer/src/chain/cosmos/types/events/mod.rs b/crates/relayer/src/chain/cosmos/types/events/mod.rs index e96cafdfca..a07702ad2c 100644 --- a/crates/relayer/src/chain/cosmos/types/events/mod.rs +++ b/crates/relayer/src/chain/cosmos/types/events/mod.rs @@ -4,7 +4,9 @@ use tendermint::abci; use crate::event::{ibc_event_try_from_abci_event, IbcEventWithHeight}; pub mod channel; +pub mod connection; pub mod fee; +pub mod raw_object; pub fn from_tx_response_event(height: Height, event: &abci::Event) -> Option { ibc_event_try_from_abci_event(event) diff --git a/crates/relayer/src/chain/cosmos/types/events/raw_object.rs b/crates/relayer/src/chain/cosmos/types/events/raw_object.rs new file mode 100644 index 0000000000..670d4c96c1 --- /dev/null +++ b/crates/relayer/src/chain/cosmos/types/events/raw_object.rs @@ -0,0 +1,42 @@ +use alloc::collections::btree_map::BTreeMap as HashMap; + +use ibc_relayer_types::events::Error as EventError; +use ibc_relayer_types::Height; + +#[derive(Debug, Clone)] +pub struct RawObject<'a> { + pub height: Height, + pub action: String, + pub idx: usize, + pub events: &'a HashMap>, +} + +impl<'a> RawObject<'a> { + pub fn new( + height: Height, + action: String, + idx: usize, + events: &'a HashMap>, + ) -> RawObject<'a> { + RawObject { + height, + action, + idx, + events, + } + } +} + +pub fn extract_attribute(object: &RawObject<'_>, key: &str) -> Result { + let value = object + .events + .get(key) + .ok_or_else(|| EventError::missing_key(key.to_string()))?[object.idx] + .clone(); + + Ok(value) +} + +pub fn maybe_extract_attribute(object: &RawObject<'_>, key: &str) -> Option { + object.events.get(key).map(|tags| tags[object.idx].clone()) +} diff --git a/crates/relayer/src/chain/cosmos/types/gas.rs b/crates/relayer/src/chain/cosmos/types/gas.rs index e472eb91af..b8944d373f 100644 --- a/crates/relayer/src/chain/cosmos/types/gas.rs +++ b/crates/relayer/src/chain/cosmos/types/gas.rs @@ -48,6 +48,11 @@ pub fn max_gas_from_config(config: &CosmosSdkConfig) -> u64 { config.max_gas.unwrap_or(DEFAULT_MAX_GAS) } +/// The maximum amount of gas the relayer is willing to pay for a transaction +pub fn max_gas_from_config_opt(config: &CosmosSdkConfig) -> Option { + config.max_gas +} + /// The gas multiplier pub fn gas_multiplier_from_config(config: &CosmosSdkConfig) -> f64 { config.gas_multiplier.unwrap_or_default().to_f64() diff --git a/crates/relayer/src/chain/cosmos/version.rs b/crates/relayer/src/chain/cosmos/version.rs index 5db1b56961..d9c2b3b658 100644 --- a/crates/relayer/src/chain/cosmos/version.rs +++ b/crates/relayer/src/chain/cosmos/version.rs @@ -9,6 +9,8 @@ use tracing::trace; use ibc_proto::cosmos::base::tendermint::v1beta1::{Module, VersionInfo}; +use crate::chain::version::ConsensusVersion; + /// Specifies the SDK, IBC-go, and Tendermint modules path, as expected /// to appear in the application version information of a /// Cosmos-SDK network. @@ -27,12 +29,6 @@ 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(Clone, Debug, PartialEq, Eq)] pub struct Specs { @@ -56,8 +52,7 @@ impl Display for Specs { .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}"), + Some(ref v) => v.to_string(), None => "Tendermint: UNKNOWN, CometBFT: UNKNOWN".to_string(), }; diff --git a/crates/relayer/src/chain/cosmos/wait.rs b/crates/relayer/src/chain/cosmos/wait.rs index 9ff26b2cce..06d2b3f3b6 100644 --- a/crates/relayer/src/chain/cosmos/wait.rs +++ b/crates/relayer/src/chain/cosmos/wait.rs @@ -117,7 +117,7 @@ async fn update_tx_sync_result( Ok(()) } -fn all_tx_results_found(tx_sync_results: &[TxSyncResult]) -> bool { +pub fn all_tx_results_found(tx_sync_results: &[TxSyncResult]) -> bool { tx_sync_results .iter() .all(|r| matches!(r.status, TxStatus::ReceivedResponse)) diff --git a/crates/relayer/src/chain/endpoint.rs b/crates/relayer/src/chain/endpoint.rs index 387ff0b8d6..ff33a4b815 100644 --- a/crates/relayer/src/chain/endpoint.rs +++ b/crates/relayer/src/chain/endpoint.rs @@ -36,10 +36,10 @@ use tendermint_rpc::endpoint::broadcast::tx_sync::Response as TxResponse; use crate::account::Balance; use crate::chain::client::ClientSettings; -use crate::chain::cosmos::version::Specs; use crate::chain::handle::Subscription; use crate::chain::requests::*; use crate::chain::tracking::TrackedMsgs; +use crate::chain::version::Specs; use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; use crate::config::ChainConfig; use crate::connection::ConnectionMsgType; diff --git a/crates/relayer/src/chain/handle.rs b/crates/relayer/src/chain/handle.rs index b4aae48916..bd356fb030 100644 --- a/crates/relayer/src/chain/handle.rs +++ b/crates/relayer/src/chain/handle.rs @@ -48,10 +48,10 @@ use crate::{ use super::{ client::ClientSettings, - cosmos::version::Specs, endpoint::{ChainStatus, HealthCheck}, requests::*, tracking::TrackedMsgs, + version::Specs, }; mod base; diff --git a/crates/relayer/src/chain/handle/base.rs b/crates/relayer/src/chain/handle/base.rs index 64d7d7d30e..00f54c6faf 100644 --- a/crates/relayer/src/chain/handle/base.rs +++ b/crates/relayer/src/chain/handle/base.rs @@ -34,8 +34,8 @@ use ibc_relayer_types::{ use crate::{ account::Balance, chain::{ - client::ClientSettings, cosmos::version::Specs, endpoint::ChainStatus, requests::*, - tracking::TrackedMsgs, + client::ClientSettings, endpoint::ChainStatus, requests::*, tracking::TrackedMsgs, + version::Specs, }, client_state::{AnyClientState, IdentifiedAnyClientState}, config::ChainConfig, diff --git a/crates/relayer/src/chain/handle/cache.rs b/crates/relayer/src/chain/handle/cache.rs index 403fee0bb2..0c692424e4 100644 --- a/crates/relayer/src/chain/handle/cache.rs +++ b/crates/relayer/src/chain/handle/cache.rs @@ -30,11 +30,11 @@ use ibc_relayer_types::Height; use crate::account::Balance; use crate::cache::{Cache, CacheStatus}; use crate::chain::client::ClientSettings; -use crate::chain::cosmos::version::Specs; use crate::chain::endpoint::{ChainStatus, HealthCheck}; use crate::chain::handle::{ChainHandle, ChainRequest, Subscription}; use crate::chain::requests::*; use crate::chain::tracking::TrackedMsgs; +use crate::chain::version::Specs; use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; use crate::config::ChainConfig; use crate::connection::ConnectionMsgType; diff --git a/crates/relayer/src/chain/handle/counting.rs b/crates/relayer/src/chain/handle/counting.rs index 4fe7685a9e..886372ca4f 100644 --- a/crates/relayer/src/chain/handle/counting.rs +++ b/crates/relayer/src/chain/handle/counting.rs @@ -31,11 +31,11 @@ use ibc_relayer_types::Height; use crate::account::Balance; use crate::chain::client::ClientSettings; -use crate::chain::cosmos::version::Specs; use crate::chain::endpoint::{ChainStatus, HealthCheck}; use crate::chain::handle::{ChainHandle, ChainRequest, Subscription}; use crate::chain::requests::*; use crate::chain::tracking::TrackedMsgs; +use crate::chain::version::Specs; use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; use crate::config::ChainConfig; use crate::connection::ConnectionMsgType; diff --git a/crates/relayer/src/chain/namada.rs b/crates/relayer/src/chain/namada.rs new file mode 100644 index 0000000000..4a362764d1 --- /dev/null +++ b/crates/relayer/src/chain/namada.rs @@ -0,0 +1,1408 @@ +use alloc::sync::Arc; +use core::str::FromStr; +use prost::Message; +use std::thread; +use tracing::debug; + +use core::time::Duration; + +use ibc_proto::ibc::applications::fee::v1::{ + QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, +}; +use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; +use ibc_relayer_types::applications::ics28_ccv::msgs::{ConsumerChain, ConsumerId}; +use ibc_relayer_types::applications::ics31_icq::response::CrossChainQueryResponse; +use ibc_relayer_types::clients::ics07_tendermint::client_state::{ + AllowUpdate, ClientState as TmClientState, +}; +use ibc_relayer_types::clients::ics07_tendermint::consensus_state::ConsensusState as TmConsensusState; +use ibc_relayer_types::clients::ics07_tendermint::header::Header as TmHeader; +use ibc_relayer_types::core::ics02_client::events::UpdateClient; +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::packet::Sequence; +use ibc_relayer_types::core::ics04_channel::upgrade::{ErrorReceipt, 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::{ + ChainId, ChannelId, ClientId, ConnectionId, PortId, +}; +use ibc_relayer_types::core::ics24_host::path::{ + AcksPath, ChannelEndsPath, ChannelUpgradeErrorPath, ChannelUpgradePath, + ClientConsensusStatePath, ClientStatePath, CommitmentsPath, ConnectionsPath, ReceiptsPath, + SeqRecvsPath, +}; +use ibc_relayer_types::signer::Signer; +use ibc_relayer_types::Height as ICSHeight; +use namada_sdk::address::{Address, InternalAddress}; +use namada_sdk::borsh::BorshDeserialize; +use namada_sdk::ibc::core::host::types::path::UPGRADED_IBC_STATE; +use namada_sdk::ibc::{storage, COMMITMENT_PREFIX}; +use namada_sdk::io::NullIo; +use namada_sdk::io::{Client, NamadaIo}; +use namada_sdk::masp::fs::FsShieldedUtils; +use namada_sdk::parameters::{storage as param_storage, EpochDuration}; +use namada_sdk::proof_of_stake::storage_key as pos_storage_key; +use namada_sdk::proof_of_stake::OwnedPosParams; +use namada_sdk::state::ics23_specs::ibc_proof_specs; +use namada_sdk::state::Sha256Hasher; +use namada_sdk::storage::{Key, KeySeg, PrefixValue}; +use namada_sdk::token::storage_key::{balance_key, denom_key, is_any_token_balance_key}; +use namada_sdk::token::{Amount, DenominatedAmount, Denomination}; +use namada_sdk::wallet::Store; +use namada_sdk::wallet::Wallet; +use namada_sdk::{rpc, Namada, NamadaImpl}; +use namada_tendermint::block::Height as TmHeight; +use namada_tendermint::{node, Time}; +use namada_tendermint_rpc::client::CompatMode; +use namada_tendermint_rpc::endpoint::broadcast::tx_sync::Response; +use namada_tendermint_rpc::{HttpClient, Url}; +use tendermint_proto::Protobuf as TmProtobuf; +use tokio::runtime::Runtime as TokioRuntime; + +use crate::account::Balance; +use crate::chain::client::ClientSettings; +use crate::chain::cosmos::batch::response_to_tx_sync_result; +use crate::chain::cosmos::config::CosmosSdkConfig; +use crate::chain::endpoint::{ChainEndpoint, ChainStatus, HealthCheck}; +use crate::chain::handle::Subscription; +use crate::chain::requests::*; +use crate::chain::tracking::TrackedMsgs; +use crate::chain::version::{ConsensusVersion, Specs}; +use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; +use crate::config::error::Error as ConfigError; +use crate::config::ChainConfig; +use crate::consensus_state::AnyConsensusState; +use crate::denom::DenomTrace; +use crate::error::Error; +use crate::event::source::{EventSource, TxEventSourceCmd}; +use crate::event::IbcEventWithHeight; +use crate::keyring::{KeyRing, NamadaKeyPair, SigningKeyPair}; +use crate::light_client::tendermint::LightClient as TmLightClient; +use crate::light_client::{LightClient, Verified}; +use crate::misbehaviour::MisbehaviourEvidence; + +use self::error::Error as NamadaError; + +pub mod error; +pub mod key; +mod query; +mod tx; +pub mod version; +pub mod wallet; + +pub struct NamadaChain { + /// Reuse CosmosSdkConfig for tendermint's light clients + config: CosmosSdkConfig, + /// Namada context + ctx: NamadaImpl, + compat_mode: CompatMode, + light_client: TmLightClient, + rt: Arc, + keybase: KeyRing, + tx_monitor_cmd: Option, +} + +impl NamadaChain { + fn init_event_source(&mut self) -> Result { + crate::time!( + "init_event_source", + { + "src_chain": self.config.id.to_string(), + } + ); + + use crate::config::EventSourceMode as Mode; + let http_client = tendermint_rpc::HttpClient::new(self.config.rpc_addr.clone()) + .map_err(|e| Error::rpc(self.config.rpc_addr.clone(), e))?; + let compat_mode = self + .compat_mode + .to_string() + .parse() + .map_err(|e| Error::rpc(self.config.rpc_addr.clone(), e))?; + let (event_source, monitor_tx) = match &self.config.event_source { + Mode::Push { url, batch_delay } => EventSource::websocket( + self.config.id.clone(), + url.clone(), + compat_mode, + *batch_delay, + self.rt.clone(), + ), + Mode::Pull { + interval, + max_retries, + } => EventSource::rpc( + self.config.id.clone(), + http_client, + *interval, + *max_retries, + self.rt.clone(), + ), + } + .map_err(Error::event_source)?; + + thread::spawn(move || event_source.run()); + + Ok(monitor_tx) + } + + fn get_unbonding_time(&self) -> Result { + let key = pos_storage_key::params_key(); + let (value, _) = self.query(key, QueryHeight::Latest, IncludeProof::No)?; + let pos_params = + OwnedPosParams::try_from_slice(&value[..]).map_err(NamadaError::borsh_decode)?; + + let key = param_storage::get_epoch_duration_storage_key(); + let (value, _) = self.query(key, QueryHeight::Latest, IncludeProof::No)?; + let epoch_duration = + EpochDuration::try_from_slice(&value[..]).map_err(NamadaError::borsh_decode)?; + let unbonding_period = pos_params.pipeline_len * epoch_duration.min_duration.0; + Ok(Duration::from_secs(unbonding_period)) + } + + fn get_latest_block_time(&self) -> Result { + let status = self + .rt + .block_on(Client::status(self.ctx.client())) + .map_err(|e| NamadaError::rpc(self.config.rpc_addr.clone(), e))?; + let time = + tendermint::Time::parse_from_rfc3339(&status.sync_info.latest_block_time.to_rfc3339()) + .expect("Time should be parsable"); + Ok(time) + } +} + +impl ChainEndpoint for NamadaChain { + type LightBlock = tendermint_light_client::types::LightBlock; + type Header = TmHeader; + type ConsensusState = TmConsensusState; + type ClientState = TmClientState; + type Time = Time; + type SigningKeyPair = NamadaKeyPair; + + fn id(&self) -> &ChainId { + &self.config.id + } + + fn config(&self) -> ChainConfig { + ChainConfig::Namada(self.config.clone()) + } + + fn bootstrap(config: ChainConfig, rt: Arc) -> Result { + #[allow(irrefutable_let_patterns)] + let ChainConfig::Namada(config) = config + else { + return Err(Error::config(ConfigError::wrong_type())); + }; + + let rpc_addr = Url::from_str(&config.rpc_addr.to_string()) + .map_err(|e| NamadaError::rpc(config.rpc_addr.clone(), e))?; + let mut rpc_client = + HttpClient::new(rpc_addr).map_err(|e| NamadaError::rpc(config.rpc_addr.clone(), e))?; + let node_info = rt.block_on(fetch_node_info(&rpc_client, &config))?; + let compat_mode = CompatMode::from_version(node_info.version) + .ok() + .or_else(|| { + config.compat_mode.map(|mode| { + mode.to_string() + .parse() + .expect("compatMode should be parsable") + }) + }) + .unwrap_or(CompatMode::V0_37); + rpc_client.set_compat_mode(compat_mode); + + let node_info = rt.block_on(fetch_node_info(&rpc_client, &config))?; + let node_id = tendermint_light_client_verifier::types::PeerId::new( + node_info + .id + .as_bytes() + .try_into() + .expect("node ID should be able to converted"), + ); + let light_client = TmLightClient::from_cosmos_sdk_config(&config, node_id)?; + + let keybase = + KeyRing::new_namada(config.key_store_type, &config.id, &config.key_store_folder) + .map_err(Error::key_base)?; + + let shielded_dir = dirs_next::home_dir() + .expect("No home directory") + .join(".hermes/shielded") + .join(config.id.to_string()); + std::fs::create_dir_all(&shielded_dir).map_err(Error::io)?; + let shielded_ctx = FsShieldedUtils::new(shielded_dir); + + let mut store = Store::default(); + let key = keybase + .get_key(&config.key_name) + .map_err(|e| Error::key_not_found(config.key_name.clone(), e))?; + store.insert_keypair::( + config.key_name.clone().into(), + key.secret_key, + None, + Some(key.address), + None, + true, + ); + let wallet = Wallet::new(wallet::NullWalletUtils, store); + + let native_token = rt + .block_on(rpc::query_native_token(&rpc_client)) + .map_err(NamadaError::namada)?; + + // overwrite the proof spec + let config = CosmosSdkConfig { + proof_specs: Some(ibc_proof_specs::().into()), + ..config + }; + + let ctx = NamadaImpl::native_new(rpc_client, wallet, shielded_ctx, NullIo, native_token); + + Ok(Self { + config, + ctx, + compat_mode, + light_client, + rt, + keybase, + tx_monitor_cmd: None, + }) + } + + fn shutdown(self) -> Result<(), Error> { + if let Some(monitor_tx) = self.tx_monitor_cmd { + monitor_tx.shutdown().map_err(Error::event_source)?; + } + + Ok(()) + } + + fn health_check(&mut self) -> Result { + self.rt + .block_on(Client::health(self.ctx.client())) + .map_err(|e| { + NamadaError::health_check_json_rpc( + self.config.id.clone(), + self.config.rpc_addr.to_string(), + "/health".to_string(), + e, + ) + })?; + + Ok(HealthCheck::Healthy) + } + + fn subscribe(&mut self) -> Result { + let tx_monitor_cmd = match &self.tx_monitor_cmd { + Some(tx_monitor_cmd) => tx_monitor_cmd, + None => { + let tx_monitor_cmd = self.init_event_source()?; + self.tx_monitor_cmd = Some(tx_monitor_cmd); + self.tx_monitor_cmd.as_ref().unwrap() + } + }; + + let subscription = tx_monitor_cmd.subscribe().map_err(Error::event_source)?; + Ok(subscription) + } + + fn keybase(&self) -> &KeyRing { + &self.keybase + } + + fn keybase_mut(&mut self) -> &mut KeyRing { + &mut self.keybase + } + + fn get_key(&self) -> Result { + self.keybase + .get_key(&self.config.key_name) + .map_err(|e| Error::key_not_found(self.config.key_name.clone(), e)) + } + + fn get_signer(&self) -> Result { + let key = self + .keybase + .get_key(&self.config.key_name) + .map_err(|e| Error::key_not_found(self.config.key_name.clone(), e))?; + Ok(Signer::from_str(&key.account()).expect("The key name shouldn't be empty")) + } + + fn version_specs(&self) -> Result { + let status = self + .rt + .block_on(Client::status(self.ctx.client())) + .map_err(|e| NamadaError::rpc(self.config.rpc_addr.clone(), e))?; + + let cometbft_version = status.node_info.version.to_string(); + let cometbft_version = cometbft_version + .parse() + .map_err(|_| NamadaError::version(cometbft_version))?; + + let moniker = &status.node_info.moniker; + let namada_version = moniker + .to_string() + .split_once('-') + .and_then(|(_, version)| version.strip_prefix('v')) + .ok_or_else(|| NamadaError::version(moniker.to_string()))? + .parse() + .map_err(|_| NamadaError::version(moniker.to_string()))?; + + let specs = version::Specs { + namada: Some(namada_version), + consensus: Some(ConsensusVersion::Comet(cometbft_version)), + }; + Ok(Specs::Namada(specs)) + } + + fn send_messages_and_wait_commit( + &mut self, + tracked_msgs: TrackedMsgs, + ) -> Result, Error> { + crate::time!("send_messages_and_wait_commit"); + + let proto_msgs = tracked_msgs.messages(); + if proto_msgs.is_empty() { + return Ok(vec![]); + } + let max_msg_num = self.config.max_msg_num.to_usize(); + let msg_chunks = proto_msgs.chunks(max_msg_num); + let mut tx_sync_results = vec![]; + for msg_chunk in msg_chunks { + let response = self.batch_txs(msg_chunk)?; + tx_sync_results.push(response_to_tx_sync_result( + &self.config.id, + msg_chunk.len(), + into_tm_response(response), + )); + if self.config.sequential_batch_tx { + self.wait_for_block_commits(&mut tx_sync_results)?; + } + } + if !self.config.sequential_batch_tx { + self.wait_for_block_commits(&mut tx_sync_results)?; + } + + let events: Vec = tx_sync_results + .into_iter() + .flat_map(|el| el.events) + .collect(); + let mut dedup_events = vec![]; + for event in events { + if !dedup_events.contains(&event) { + dedup_events.push(event); + } + } + + Ok(dedup_events) + } + + fn send_messages_and_wait_check_tx( + &mut self, + tracked_msgs: TrackedMsgs, + ) -> Result, Error> { + crate::time!("send_messages_and_wait_check_tx"); + + let proto_msgs = tracked_msgs.messages(); + if proto_msgs.is_empty() { + return Ok(vec![]); + } + + let max_msg_num = self.config.max_msg_num.to_usize(); + let msg_chunks = proto_msgs.chunks(max_msg_num); + let mut responses = vec![]; + for msg_chunk in msg_chunks { + let resp = self.batch_txs(msg_chunk)?; + let response = into_tm_response(resp); + if response.code.is_err() { + return Err(Error::send_tx(response.log)); + } + responses.push(response); + } + + Ok(responses) + } + + fn verify_header( + &mut self, + trusted: ICSHeight, + target: ICSHeight, + client_state: &AnyClientState, + ) -> Result { + crate::time!( + "verify_header", + { + "src_chain": self.config.id.to_string(), + } + ); + + let now = self.get_latest_block_time()?; + self.light_client + .verify(trusted, target, client_state, now) + .map(|v| v.target) + } + + fn check_misbehaviour( + &mut self, + update: &UpdateClient, + client_state: &AnyClientState, + ) -> Result, Error> { + crate::time!( + "check_misbehaviour", + { + "src_chain": self.config.id.to_string(), + } + ); + + let now = self.get_latest_block_time()?; + self.light_client + .detect_misbehaviour(update, client_state, now) + } + + fn query_balance(&self, key_name: Option<&str>, denom: Option<&str>) -> Result { + // Given key_name and denom should be raw Namada addresses + let default_owner = self.get_signer()?; + let owner = key_name.unwrap_or(default_owner.as_ref()); + let owner = + Address::decode(owner).map_err(|_| NamadaError::address_decode(owner.to_string()))?; + + let default_token = self.ctx.native_token().to_string(); + let denom = denom.unwrap_or(&default_token); + let token = + Address::decode(denom).map_err(|_| NamadaError::address_decode(denom.to_string()))?; + + let balance_key = balance_key(&token, &owner); + let (value, _) = self.query(balance_key, QueryHeight::Latest, IncludeProof::No)?; + if value.is_empty() { + return Ok(Balance { + amount: "0".to_string(), + denom: denom.to_string(), + }); + } + let amount = Amount::try_from_slice(&value[..]).map_err(NamadaError::borsh_decode)?; + let denom_key = denom_key(&token); + let (value, _) = self.query(denom_key, QueryHeight::Latest, IncludeProof::No)?; + let denominated_amount = if value.is_empty() { + DenominatedAmount::new(amount, 0.into()) + } else { + let token_denom = + Denomination::try_from_slice(&value[..]).map_err(NamadaError::borsh_decode)?; + DenominatedAmount::new(amount, token_denom) + }; + + Ok(Balance { + amount: denominated_amount.to_string(), + denom: denom.to_string(), + }) + } + + fn query_all_balances(&self, key_name: Option<&str>) -> Result, Error> { + let default_owner = self.get_signer()?; + let owner = key_name.unwrap_or(default_owner.as_ref()); + let owner = + Address::decode(owner).map_err(|_| NamadaError::address_decode(owner.to_string()))?; + + let mut balances = vec![]; + let prefix = Key::from(Address::Internal(InternalAddress::Multitoken).to_db_key()); + for PrefixValue { key, value } in self.query_prefix(prefix)? { + if let Some([token, bal_owner]) = is_any_token_balance_key(&key) { + if owner == *bal_owner { + let amount = + Amount::try_from_slice(&value[..]).map_err(NamadaError::borsh_decode)?; + let denom_key = denom_key(token); + let (value, _) = + self.query(denom_key, QueryHeight::Latest, IncludeProof::No)?; + let denominated_amount = if value.is_empty() { + DenominatedAmount::new(amount, 0.into()) + } else { + let namada_denom = Denomination::try_from_slice(&value[..]) + .map_err(NamadaError::borsh_decode)?; + DenominatedAmount::new(amount, namada_denom) + }; + let balance = Balance { + amount: denominated_amount.to_string(), + denom: token.to_string(), + }; + balances.push(balance); + } + } + } + Ok(balances) + } + + // Query the denom trace with "{IbcToken}" address which has a hashed denom. + fn query_denom_trace(&self, hash: String) -> Result { + let denom = self.query_denom(hash)?; + match denom.rsplit_once('/') { + Some((path, base_denom)) => Ok(DenomTrace { + path: path.to_string(), + base_denom: base_denom.to_string(), + }), + None => Err(Error::query(format!( + "The denom is not a PrefixedDenom: denom {}", + denom + ))), + } + } + + fn query_commitment_prefix(&self) -> Result { + crate::time!( + "query_commitment_prefix", + { + "src_chain": self.config.id.to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_commitment_prefix"); + + CommitmentPrefix::try_from(b"ibc".to_vec()).map_err(Error::ics23) + } + + fn query_application_status(&self) -> Result { + crate::time!( + "query_application_status", + { + "src_chain": self.config.id.to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_application_status"); + + let status = self + .rt + .block_on(Client::status(self.ctx.client())) + .map_err(|e| NamadaError::rpc(self.config.rpc_addr.clone(), e))?; + + if status.sync_info.catching_up { + return Err(Error::chain_not_caught_up( + self.config.rpc_addr.to_string(), + self.config.id.clone(), + )); + } + + let time = self.get_latest_block_time()?; + let height = ICSHeight::new( + ChainId::chain_version(status.node_info.network.as_str()), + u64::from(status.sync_info.latest_block_height), + ) + .map_err(Error::ics02)?; + + Ok(ChainStatus { + height, + timestamp: time.into(), + }) + } + + fn query_clients( + &self, + _request: QueryClientStatesRequest, + ) -> Result, Error> { + crate::time!( + "query_clients", + { + "src_chain": self.config.id.to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_clients"); + + let prefix = storage::ibc_key("clients").expect("the path should be parsable"); + let mut states = vec![]; + for prefix_value in self.query_prefix(prefix)? { + let PrefixValue { key, value } = prefix_value; + if key.to_string().ends_with("clientState") { + let client_id = + storage::client_id(&key).map_err(|e| Error::query(e.to_string()))?; + let client_id = ClientId::from_str(&client_id.to_string()) + .expect("ibc-rs ClientId should be parsable with the relayer-types one"); + let client_state = AnyClientState::decode_vec(&value).map_err(Error::decode)?; + states.push(IdentifiedAnyClientState::new(client_id, client_state)); + } + } + + Ok(states) + } + + fn query_client_state( + &self, + request: QueryClientStateRequest, + include_proof: IncludeProof, + ) -> Result<(AnyClientState, Option), Error> { + crate::time!( + "query_client_state", + { + "src_chain": self.config.id.to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_client_state"); + + let path = ClientStatePath(request.client_id); + let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); + let (value, proof) = self.query(key, request.height, include_proof)?; + let client_state = AnyClientState::decode_vec(&value).map_err(Error::decode)?; + + Ok((client_state, proof)) + } + + fn query_consensus_state( + &self, + request: QueryConsensusStateRequest, + include_proof: IncludeProof, + ) -> Result<(AnyConsensusState, Option), Error> { + crate::time!( + "query_consensus_state", + { + "src_chain": self.config.id.to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_consensus_state"); + + let path = ClientConsensusStatePath { + client_id: request.client_id, + epoch: request.consensus_height.revision_number(), + height: request.consensus_height.revision_height(), + }; + let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); + let (value, proof) = self.query(key, request.query_height, include_proof)?; + let consensus_state = AnyConsensusState::decode_vec(&value).map_err(Error::decode)?; + Ok((consensus_state, proof)) + } + + fn query_consensus_state_heights( + &self, + request: QueryConsensusStateHeightsRequest, + ) -> Result, Error> { + let prefix = storage::ibc_key(format!("clients/{}", request.client_id)) + .expect("the path should be parsable"); + let mut heights = vec![]; + for prefix_value in self.query_prefix(prefix)? { + let PrefixValue { key, value: _ } = prefix_value; + match storage::consensus_height(&key) { + Ok(h) => { + let height = ICSHeight::new(h.revision_number(), h.revision_height()) + .expect("ibc-rs height should be parsable with the relayer-types one"); + heights.push(height); + } + Err(_) => { + debug!("The key {key} is not for a consensus state"); + continue; + } + } + } + Ok(heights) + } + + fn query_upgraded_client_state( + &self, + request: QueryUpgradedClientStateRequest, + ) -> Result<(AnyClientState, MerkleProof), Error> { + crate::time!( + "query_upgraded_client_state", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_upgraded_client_state"); + + let height = request + .upgrade_height + .to_string() + .parse() + .expect("height conversion is infallible"); + let query_height = request + .upgrade_height + .decrement() + .map_err(|_| Error::invalid_height_no_source())?; + let key = namada_sdk::ibc::storage::upgraded_client_state_key(height); + let (value, proof) = + self.query(key, QueryHeight::Specific(query_height), IncludeProof::Yes)?; + if let Some(proof) = proof { + let client_state = AnyClientState::decode_vec(&value).map_err(Error::decode)?; + Ok((client_state, proof)) + } else { + Err(Error::queried_proof_not_found()) + } + } + + fn query_upgraded_consensus_state( + &self, + request: QueryUpgradedConsensusStateRequest, + ) -> Result<(AnyConsensusState, MerkleProof), Error> { + crate::time!( + "query_upgraded_consensus_state", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_upgraded_consensus_state"); + + let height = request + .upgrade_height + .to_string() + .parse() + .expect("height conversion is infallible"); + let query_height = request + .upgrade_height + .decrement() + .map_err(|_| Error::invalid_height_no_source())?; + let key = namada_sdk::ibc::storage::upgraded_consensus_state_key(height); + let (value, proof) = + self.query(key, QueryHeight::Specific(query_height), IncludeProof::Yes)?; + if let Some(proof) = proof { + let client_state = AnyConsensusState::decode_vec(&value).map_err(Error::decode)?; + Ok((client_state, proof)) + } else { + Err(Error::queried_proof_not_found()) + } + } + + fn query_connections( + &self, + _request: QueryConnectionsRequest, + ) -> Result, Error> { + crate::time!( + "query_connections", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_connections"); + + let prefix = storage::ibc_key("connections").expect("the path should be parsable"); + let mut connections = vec![]; + for prefix_value in self.query_prefix(prefix)? { + let PrefixValue { key, value } = prefix_value; + // "connections/counter" should be skipped + if key == storage::connection_counter_key() { + continue; + } + let conn_id = storage::connection_id(&key).map_err(|e| Error::query(e.to_string()))?; + let connection_id = conn_id + .as_str() + .parse() + .expect("The connection ID should be parsable"); + let connection = ConnectionEnd::decode_vec(&value).map_err(Error::decode)?; + connections.push(IdentifiedConnectionEnd::new(connection_id, connection)); + } + + Ok(connections) + } + + fn query_client_connections( + &self, + request: QueryClientConnectionsRequest, + ) -> Result, Error> { + crate::time!( + "query_client_connections", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_client_connections"); + + let query_request = QueryConnectionsRequest { pagination: None }; + let connections = self.query_connections(query_request)?; + let ids = connections + .iter() + .filter(|c| *c.connection_end.client_id() == request.client_id) + .map(|c| c.connection_id.clone()) + .collect(); + Ok(ids) + } + + fn query_connection( + &self, + request: QueryConnectionRequest, + include_proof: IncludeProof, + ) -> Result<(ConnectionEnd, Option), Error> { + crate::time!( + "query_connection", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_connection"); + + let path = ConnectionsPath(request.connection_id); + let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); + let (value, proof) = self.query(key, request.height, include_proof)?; + let connection_end = ConnectionEnd::decode_vec(&value).map_err(Error::decode)?; + Ok((connection_end, proof)) + } + + fn query_connection_channels( + &self, + request: QueryConnectionChannelsRequest, + ) -> Result, Error> { + crate::time!( + "query_connection_channels", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_connection_channels"); + + let hops = vec![request.connection_id]; + let query_request = QueryChannelsRequest { pagination: None }; + let channels = self + .query_channels(query_request)? + .into_iter() + .filter(|c| c.channel_end.connection_hops_matches(&hops)) + .collect(); + + Ok(channels) + } + + fn query_channels( + &self, + _request: QueryChannelsRequest, + ) -> Result, Error> { + crate::time!( + "query_channels", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_channels"); + + let prefix = storage::ibc_key("channelEnds").expect("the path should be parsable"); + let mut channels = vec![]; + for prefix_value in self.query_prefix(prefix)? { + let PrefixValue { key, value } = prefix_value; + // "channelEnds/counter" should be skipped + if key == storage::channel_counter_key() { + continue; + } + let (port_id, channel_id) = + storage::port_channel_id(&key).map_err(|e| Error::query(e.to_string()))?; + let port_id = port_id + .as_ref() + .parse() + .expect("ibc-rs PortId should be parsable with the relayer-types one"); + let channel_id = channel_id + .as_ref() + .parse() + .expect("ibc-rs ChannelId should be parsable with the relayer-types one"); + let channel = ChannelEnd::decode_vec(&value).map_err(Error::decode)?; + channels.push(IdentifiedChannelEnd::new(port_id, channel_id, channel)) + } + + Ok(channels) + } + + fn query_channel( + &self, + request: QueryChannelRequest, + include_proof: IncludeProof, + ) -> Result<(ChannelEnd, Option), Error> { + crate::time!( + "query_channel", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_channel"); + + let path = ChannelEndsPath(request.port_id, request.channel_id); + let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); + let (value, proof) = self.query(key, request.height, include_proof)?; + let channel_end = ChannelEnd::decode_vec(&value).map_err(Error::decode)?; + Ok((channel_end, proof)) + } + + fn query_channel_client_state( + &self, + request: QueryChannelClientStateRequest, + ) -> Result, Error> { + crate::time!( + "query_channel_client_state", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_channel_client_state"); + + let request = QueryChannelRequest { + port_id: request.port_id, + channel_id: request.channel_id, + height: QueryHeight::Latest, + }; + let (channel_end, _) = self.query_channel(request, IncludeProof::No)?; + let connection_id = channel_end + .connection_hops() + .first() + .ok_or_else(|| Error::query("no connection ID in the channel end".to_string()))? + .clone(); + let request = QueryConnectionRequest { + connection_id, + height: QueryHeight::Latest, + }; + let (connection_end, _) = self.query_connection(request, IncludeProof::No)?; + let client_id = connection_end.client_id().clone(); + let request = QueryClientStateRequest { + client_id: client_id.clone(), + height: QueryHeight::Latest, + }; + let (client_state, _) = self.query_client_state(request, IncludeProof::No)?; + + Ok(Some(IdentifiedAnyClientState { + client_id, + client_state, + })) + } + + fn query_packet_commitment( + &self, + request: QueryPacketCommitmentRequest, + include_proof: IncludeProof, + ) -> Result<(Vec, Option), Error> { + let path = CommitmentsPath { + port_id: request.port_id, + channel_id: request.channel_id, + sequence: request.sequence, + }; + let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); + self.query(key, request.height, include_proof) + } + + fn query_packet_commitments( + &self, + request: QueryPacketCommitmentsRequest, + ) -> Result<(Vec, ICSHeight), Error> { + crate::time!( + "query_packet_commitments", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_packet_commitments"); + + let path = format!( + "commitments/ports/{}/channels/{}/sequences", + request.port_id, request.channel_id + ); + let prefix = storage::ibc_key(path).expect("the path should be parsable"); + let mut sequences = vec![]; + for prefix_value in self.query_prefix(prefix)? { + let PrefixValue { key, value: _ } = prefix_value; + let (_, _, sequence) = + storage::port_channel_sequence_id(&key).map_err(|e| Error::query(e.to_string()))?; + let sequence = u64::from(sequence).into(); + sequences.push(sequence); + } + + // NOTE the height might be mismatched with the previous query + let status = self.query_application_status()?; + + Ok((sequences, status.height)) + } + + fn query_packet_receipt( + &self, + request: QueryPacketReceiptRequest, + include_proof: IncludeProof, + ) -> Result<(Vec, Option), Error> { + let path = ReceiptsPath { + port_id: request.port_id, + channel_id: request.channel_id, + sequence: request.sequence, + }; + let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); + self.query(key, request.height, include_proof) + } + + fn query_unreceived_packets( + &self, + request: QueryUnreceivedPacketsRequest, + ) -> Result, Error> { + crate::time!( + "query_unreceived_packets", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_unreceived_packets"); + + let path = format!( + "receipts/ports/{}/channels/{}/sequences", + request.port_id, request.channel_id + ); + let prefix = storage::ibc_key(path).expect("the path should be parsable"); + let mut received_seqs = vec![]; + for prefix_value in self.query_prefix(prefix)? { + let (_, _, sequence) = storage::port_channel_sequence_id(&prefix_value.key) + .map_err(|e| Error::query(e.to_string()))?; + let sequence = u64::from(sequence).into(); + received_seqs.push(sequence) + } + + let unreceived_seqs = request + .packet_commitment_sequences + .into_iter() + .filter(|seq| !received_seqs.contains(seq)) + .collect(); + + Ok(unreceived_seqs) + } + + fn query_packet_acknowledgement( + &self, + request: QueryPacketAcknowledgementRequest, + include_proof: IncludeProof, + ) -> Result<(Vec, Option), Error> { + let path = AcksPath { + port_id: request.port_id, + channel_id: request.channel_id, + sequence: request.sequence, + }; + let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); + self.query(key, request.height, include_proof) + } + + fn query_packet_acknowledgements( + &self, + request: QueryPacketAcknowledgementsRequest, + ) -> Result<(Vec, ICSHeight), Error> { + crate::time!( + "query_packet_acknowledgements", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_packet_acknowledgements"); + + let path = format!( + "acks/ports/{}/channels/{}/sequences", + request.port_id, request.channel_id + ); + let prefix = storage::ibc_key(path).expect("the path should be parsable"); + let mut sequences = vec![]; + for prefix_value in self.query_prefix(prefix)? { + let PrefixValue { key, value: _ } = prefix_value; + let (_, _, sequence) = + storage::port_channel_sequence_id(&key).map_err(|e| Error::query(e.to_string()))?; + let sequence = u64::from(sequence).into(); + if request.packet_commitment_sequences.contains(&sequence) { + sequences.push(sequence); + } + } + + // NOTE the height might be mismatched with the previous query + let status = self.query_application_status()?; + Ok((sequences, status.height)) + } + + fn query_unreceived_acknowledgements( + &self, + request: QueryUnreceivedAcksRequest, + ) -> Result, Error> { + crate::time!( + "query_unreceived_acknowledgements", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_unreceived_acknowledgements"); + + let path = format!( + "commitments/ports/{}/channels/{}/sequences", + request.port_id, request.channel_id + ); + let prefix = storage::ibc_key(path).expect("the path should be parsable"); + let mut unreceived_seqs = vec![]; + for prefix_value in self.query_prefix(prefix)? { + let PrefixValue { key, value: _ } = prefix_value; + let (_, _, sequence) = + storage::port_channel_sequence_id(&key).map_err(|e| Error::query(e.to_string()))?; + let sequence = u64::from(sequence).into(); + if request.packet_ack_sequences.contains(&sequence) { + unreceived_seqs.push(sequence); + } + } + Ok(unreceived_seqs) + } + + fn query_next_sequence_receive( + &self, + request: QueryNextSequenceReceiveRequest, + include_proof: IncludeProof, + ) -> Result<(Sequence, Option), Error> { + crate::time!( + "query_next_sequence_receive", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_next_sequence_receive"); + + let path = SeqRecvsPath(request.port_id, request.channel_id); + let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); + let (value, proof) = self.query(key, request.height, include_proof)?; + + // As ibc-go, the sequence index is encoded with big-endian + let index: [u8; 8] = value + .try_into() + .map_err(|_| Error::query("Encoding u64 failed".to_owned()))?; + let sequence = u64::from_be_bytes(index).into(); + + Ok((sequence, proof)) + } + + fn query_txs(&self, request: QueryTxRequest) -> Result, Error> { + crate::time!("query_txs", + { + "src_chain": self.id().to_string(), + }); + crate::telemetry!(query, self.id(), "query_txs"); + + match request { + QueryTxRequest::Client(request) => { + crate::time!("query_txs: single client update event"); + match self.query_update_event(&request)? { + Some(event) => Ok(vec![event]), + None => Ok(vec![]), + } + } + QueryTxRequest::Transaction(tx) => { + let tm_hash = namada_tendermint::Hash::from_bytes( + namada_tendermint::hash::Algorithm::Sha256, + tx.0.as_bytes(), + ) + .expect("hash should be converted"); + + self.query_tx_events(&tm_hash) + } + } + } + + fn query_packet_events( + &self, + request: QueryPacketEventDataRequest, + ) -> Result, Error> { + crate::time!( + "query_packet_events", + { + "src_chain": self.id().to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_packet_events"); + self.query_packet_events_from_block(&request) + } + + fn query_host_consensus_state( + &self, + request: QueryHostConsensusStateRequest, + ) -> Result { + let height = match request.height { + QueryHeight::Latest => TmHeight::from(0u32), + QueryHeight::Specific(ibc_height) => TmHeight::try_from(ibc_height.revision_height()) + .map_err(NamadaError::invalid_height)?, + }; + + let rpc_call = match height.value() { + 0 => Client::latest_block(self.ctx.client()), + _ => Client::block(self.ctx.client(), height), + }; + let response = self + .rt + .block_on(rpc_call) + .map_err(|e| NamadaError::rpc(self.config.rpc_addr.clone(), e))?; + let raw_header = namada_tendermint_proto::v0_37::types::Header::from(response.block.header); + let encoded_header = raw_header.encode_to_vec(); + let raw_header: tendermint_proto::v0_37::types::Header = + prost::Message::decode(&encoded_header[..]) + .map_err(|e| Error::protobuf_decode("TmBlockHeader".to_string(), e))?; + let header: tendermint::block::Header = + raw_header.try_into().expect("header should be converted"); + Ok(Self::ConsensusState::from(header)) + } + + fn build_client_state( + &self, + height: ICSHeight, + settings: ClientSettings, + ) -> Result { + let ClientSettings::Tendermint(settings) = settings; + let unbonding_period = self.get_unbonding_time()?; + let trusting_period = settings.trusting_period.unwrap_or_else(|| { + self.config + .trusting_period + .unwrap_or(2 * unbonding_period / 3) + }); + TmClientState::new( + self.id().clone(), + settings.trust_threshold, + trusting_period, + unbonding_period, + settings.max_clock_drift, + height, + self.config + .proof_specs + .clone() + .expect("ProofSpecs should be set"), + vec![ + COMMITMENT_PREFIX.to_string(), + UPGRADED_IBC_STATE.to_string(), + ], + AllowUpdate { + after_expiry: true, + after_misbehaviour: true, + }, + ) + .map_err(Error::ics07) + } + + fn build_consensus_state( + &self, + light_block: Self::LightBlock, + ) -> Result { + crate::time!( + "build_consensus_state", + { + "src_chain": self.id().to_string(), + } + ); + + Ok(TmConsensusState::from(light_block.signed_header.header)) + } + + fn build_header( + &mut self, + trusted_height: ICSHeight, + target_height: ICSHeight, + client_state: &AnyClientState, + ) -> Result<(Self::Header, Vec), Error> { + crate::time!( + "build_header", + { + "src_chain": self.id().to_string(), + } + ); + + let now = self.get_latest_block_time()?; + // Get the light block at target_height from chain. + let Verified { target, supporting } = self.light_client.header_and_minimal_set( + trusted_height, + target_height, + client_state, + now, + )?; + + Ok((target, supporting)) + } + + fn maybe_register_counterparty_payee( + &mut self, + _channel_id: &ChannelId, + _port_id: &PortId, + _counterparty_payee: &Signer, + ) -> Result<(), Error> { + // not supported + unimplemented!() + } + + fn cross_chain_query( + &self, + _requests: Vec, + ) -> Result, Error> { + // not supported + unimplemented!() + } + + fn query_incentivized_packet( + &self, + _request: QueryIncentivizedPacketRequest, + ) -> Result { + // not supported + unimplemented!() + } + + fn query_consumer_chains(&self) -> Result, Error> { + // not supported + unimplemented!() + } + + fn query_upgrade( + &self, + request: QueryUpgradeRequest, + height: ICSHeight, + 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 path = ChannelUpgradePath { + port_id, + channel_id, + }; + let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); + let (value, proof) = self.query(key, QueryHeight::Specific(height), include_proof)?; + + let upgrade = Upgrade::decode_vec(&value).map_err(Error::decode)?; + + Ok((upgrade, proof)) + } + + fn query_upgrade_error( + &self, + request: QueryUpgradeErrorRequest, + height: ICSHeight, + 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 path = ChannelUpgradeErrorPath { + port_id, + channel_id, + }; + let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); + let (value, proof) = self.query(key, QueryHeight::Specific(height), include_proof)?; + + let error_receipt = ErrorReceipt::decode_vec(&value).map_err(Error::decode)?; + + Ok((error_receipt, proof)) + } + + fn query_ccv_consumer_id(&self, _client_id: ClientId) -> Result { + // not supported + unimplemented!() + } +} + +/// Fetch the node info +async fn fetch_node_info( + rpc_client: &HttpClient, + config: &CosmosSdkConfig, +) -> Result { + crate::time!("fetch_node_info", + { + "src_chain": config.id.to_string(), + }); + + Client::status(rpc_client) + .await + .map(|s| s.node_info) + .map_err(|e| NamadaError::rpc(config.rpc_addr.clone(), e)) +} + +fn into_tm_response(response: Response) -> tendermint_rpc::endpoint::broadcast::tx_sync::Response { + let code = match response.code { + namada_tendermint::abci::Code::Ok => tendermint::abci::Code::Ok, + namada_tendermint::abci::Code::Err(c) => tendermint::abci::Code::Err(c), + }; + let hash = tendermint::Hash::from_bytes( + tendermint::hash::Algorithm::Sha256, + response.hash.as_bytes(), + ) + .expect("hash should be converted"); + tendermint_rpc::endpoint::broadcast::tx_sync::Response { + codespace: response.codespace, + code, + data: response.data, + log: response.log, + hash, + } +} diff --git a/crates/relayer/src/chain/namada/error.rs b/crates/relayer/src/chain/namada/error.rs new file mode 100644 index 0000000000..aa938dd154 --- /dev/null +++ b/crates/relayer/src/chain/namada/error.rs @@ -0,0 +1,71 @@ +use flex_error::{define_error, DisplayOnly, TraceError}; +use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use namada_tendermint::Error as TendermintError; +use namada_tendermint_proto::Error as TendermintProtoError; +use namada_tendermint_rpc::Error as TendermintRpcError; + +define_error! { + Error { + AddressDecode + { raw: String } + |e| { format!("Namada address decoding failed for {}", e.raw) }, + + DenomNotFound + { denom: String } + |e| { format!("No denom for {}", e.denom) }, + + Namada + [ TraceError ] + |_| { "Namada error" }, + + Rpc + { url: tendermint_rpc::Url } + [ TendermintRpcError ] + |e| { format!("RPC error to endpoint {}", e.url) }, + + HealthCheckJsonRpc + { + chain_id: ChainId, + address: String, + endpoint: String, + } + [ DisplayOnly ] + |e| { + format!("health check failed for endpoint {0} on the JSON-RPC interface of chain {1}:{2}", + e.endpoint, e.chain_id, e.address) + }, + + InvalidHeight + [ TendermintError ] + |_| { "invalid height" }, + + Decode + [ TendermintProtoError ] + |_| { "error decoding protobuf" }, + + Query + [ TraceError ] + |_| { "Query error" }, + + BorshDecode + [ TraceError ] + |_| { "borsh decoding failed" }, + + DryRun + { tx_result: namada_sdk::tx::data::TxResult } + |e| { format!("Dry run to simulate a transaction failed: {:?}", e.tx_result) }, + + Upgrade + |_| { "Namada doesn't support `MsgIbcSoftwareUpgrade` and `UpgradeProposal`" }, + + Version + { version: String } + |e| { format!("Parsing the version string failed: {}", e.version) }, + } +} + +impl From for crate::error::Error { + fn from(error: Error) -> Self { + Self::namada(error) + } +} diff --git a/crates/relayer/src/chain/namada/key.rs b/crates/relayer/src/chain/namada/key.rs new file mode 100644 index 0000000000..9f8486dc52 --- /dev/null +++ b/crates/relayer/src/chain/namada/key.rs @@ -0,0 +1,47 @@ +use core::any::Any; + +use namada_sdk::address::Address; +use namada_sdk::key::common::SecretKey; + +use crate::config::AddressType; +use crate::keyring::errors::Error; +use crate::keyring::{KeyFile, KeyType, SigningKeyPair}; +use hdpath::StandardHDPath; +use serde::{Deserialize, Serialize}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct NamadaKeyPair { + pub alias: String, + pub address: Address, + pub secret_key: SecretKey, +} + +impl SigningKeyPair for NamadaKeyPair { + const KEY_TYPE: KeyType = KeyType::Secp256k1; + type KeyFile = KeyFile; + + fn from_key_file(_key_file: Self::KeyFile, _hd_path: &StandardHDPath) -> Result { + unimplemented!("Namada key can't be restored from a KeyFile") + } + + fn from_mnemonic( + _mnemonic: &str, + _hd_path: &StandardHDPath, + _address_type: &AddressType, + _account_prefix: &str, + ) -> Result { + unimplemented!("Namada key can't be restored from a KeyFile") + } + + fn account(&self) -> String { + self.address.to_string() + } + + fn sign(&self, _message: &[u8]) -> Result, Error> { + unimplemented!("don't use this to sign a Namada transaction") + } + + fn as_any(&self) -> &dyn Any { + self + } +} diff --git a/crates/relayer/src/chain/namada/query.rs b/crates/relayer/src/chain/namada/query.rs new file mode 100644 index 0000000000..8953ac80a3 --- /dev/null +++ b/crates/relayer/src/chain/namada/query.rs @@ -0,0 +1,346 @@ +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics23_commitment::merkle::convert_tm_to_ics_merkle_proof; +use ibc_relayer_types::core::ics23_commitment::merkle::MerkleProof; +use ibc_relayer_types::events::IbcEvent; +use ibc_relayer_types::Height as ICSHeight; +use namada_sdk::address::{Address, InternalAddress}; +use namada_sdk::borsh::BorshDeserialize; +use namada_sdk::events::extend::Height as HeightAttr; +use namada_sdk::events::Event as NamadaEvent; +use namada_sdk::ibc::storage::{ibc_trace_key_prefix, is_ibc_trace_key}; +use namada_sdk::io::Client; +use namada_sdk::io::NamadaIo; +use namada_sdk::queries::RPC; +use namada_sdk::rpc; +use namada_sdk::storage::{BlockHeight, Epoch, Key, PrefixValue}; +use namada_sdk::tx::data::ResultCode; +use namada_sdk::tx::event::{Batch as BatchAttr, Code as CodeAttr}; +use namada_tendermint::block::Height as TmHeight; +use namada_tendermint::merkle::proof::ProofOps; +use namada_tendermint::Hash as TmHash; +use namada_tendermint_proto::v0_37::abci::Event as TmEvent; + +use crate::chain::endpoint::ChainEndpoint; +use crate::chain::requests::{ + IncludeProof, QueryClientEventRequest, QueryHeight, QueryPacketEventDataRequest, +}; +use crate::error::Error; +use crate::event::{ibc_event_try_from_abci_event, IbcEventWithHeight}; + +use super::error::Error as NamadaError; +use super::NamadaChain; + +impl NamadaChain { + pub fn query( + &self, + key: Key, + height: QueryHeight, + include_proof: IncludeProof, + ) -> Result<(Vec, Option), Error> { + let height = match height { + QueryHeight::Latest => None, + QueryHeight::Specific(h) => Some(BlockHeight(h.revision_height())), + }; + let is_proven = matches!(include_proof, IncludeProof::Yes); + let (value, proof) = self + .rt + .block_on(rpc::query_storage_value_bytes( + self.ctx.client(), + &key, + height, + is_proven, + )) + .map_err(NamadaError::namada)?; + + let proof = if is_proven { + let proof_ops = proof.ok_or_else(Error::empty_response_proof)?; + let tm_proof_ops = into_tm_proof(proof_ops); + let proof = convert_tm_to_ics_merkle_proof(&tm_proof_ops).map_err(Error::ics23)?; + Some(proof) + } else { + None + }; + // return an empty data for non-existence proof + Ok((value.unwrap_or_default(), proof)) + } + + pub fn query_prefix(&self, prefix: Key) -> Result, Error> { + let response = self + .rt + .block_on( + // We can't use rpc::query_storage_prefix` because we need byte data + RPC.shell() + .storage_prefix(self.ctx.client(), None, None, false, &prefix), + ) + .map_err(NamadaError::query)?; + Ok(response.data) + } + + pub fn query_epoch(&self) -> Result { + self.rt + .block_on(rpc::query_epoch(self.ctx.client())) + .map_err(|e| Error::namada(NamadaError::namada(e))) + } + + pub fn query_update_event( + &self, + request: &QueryClientEventRequest, + ) -> Result, Error> { + let height = BlockHeight(request.consensus_height.revision_height()); + let event = self + .rt + .block_on(RPC.shell().ibc_client_update( + self.ctx.client(), + &request.client_id.as_str().parse().unwrap(), + &height, + )) + .map_err(NamadaError::query)?; + match event { + Some(event) => { + let h = event + .read_attribute::() + .map_err(|_| Error::invalid_height_no_source())?; + let height = ICSHeight::new(self.config.id.version(), h.0) + .map_err(|_| Error::invalid_height_no_source())?; + let pb_abci_event = TmEvent::from(event); + let abci_event = into_abci_event(pb_abci_event); + match ibc_event_try_from_abci_event(&abci_event) { + Ok(event) => Ok(Some(IbcEventWithHeight { event, height })), + // non IBC event + Err(_) => Ok(None), + } + } + None => Ok(None), + } + } + + /// Get all IBC events when the tx has been applied + pub fn query_tx_events(&self, tx_hash: &TmHash) -> Result, Error> { + match self.query_applied_event(tx_hash)? { + Some(applied) => { + let h = applied + .read_attribute::() + .map_err(|_| Error::invalid_height_no_source())?; + let height = ICSHeight::new(self.config.id.version(), h.0) + .map_err(|_| Error::invalid_height_no_source())?; + // Check if the tx is valid + let tx_result = applied + .read_attribute::>() + .expect("The batch attribute should exist"); + let code = applied + .read_attribute::() + .expect("The code attribute should exist"); + if code != ResultCode::Ok { + return Ok(vec![IbcEventWithHeight::new( + IbcEvent::ChainError(format!( + "The transaction was invalid: TxResult {tx_result}", + )), + height, + )]); + } + let events = tx_result.iter().filter_map(|(_, r)| { + r.as_ref().map(|batched_tx_result| { + // Get IBC events when the transaction was accepted + if batched_tx_result.is_accepted() { + batched_tx_result.events.iter().filter_map(|event| { + let pb_abci_event = TmEvent::from(event.clone()); + let abci_event = into_abci_event(pb_abci_event); + ibc_event_try_from_abci_event(&abci_event).ok() + }).map(|ibc_event| IbcEventWithHeight::new(ibc_event, height)).collect() + } else { + vec![IbcEventWithHeight::new( + IbcEvent::ChainError(format!( + "The transaction was invalid: BatchedTxResult {batched_tx_result}", + )), + height, + )] + } + }).ok() + }).flatten().collect(); + Ok(events) + } + None => Ok(vec![]), + } + } + + fn query_applied_event(&self, tx_hash: &TmHash) -> Result, Error> { + self.rt + .block_on(RPC.shell().applied( + self.ctx.client(), + &tx_hash.as_ref().try_into().expect("Invalid tx hash"), + )) + .map_err(|e| Error::namada(NamadaError::query(e))) + } + + /// Get IBC packet events + pub fn query_packet_events_from_block( + &self, + request: &QueryPacketEventDataRequest, + ) -> Result, Error> { + let mut block_events = vec![]; + for seq in &request.sequences { + if let Some(response_height) = self.query_packet_height(request, *seq)? { + if let QueryHeight::Specific(query_height) = request.height.get() { + if response_height > query_height { + continue; + } + } + let events = self.query_events(response_height)?; + let mut packet_events = events + .into_iter() + .filter(|e| { + let packet = match &e.event { + IbcEvent::SendPacket(send_event) => &send_event.packet, + IbcEvent::WriteAcknowledgement(write_ack_event) => { + &write_ack_event.packet + } + _ => return false, + }; + !block_events.contains(e) + && packet.source_port == request.source_port_id + && packet.source_channel == request.source_channel_id + && packet.destination_port == request.destination_port_id + && packet.destination_channel == request.destination_channel_id + && packet.sequence == *seq + }) + .collect(); + block_events.append(&mut packet_events); + } + } + Ok(block_events) + } + + /// Get the height at which the packet event has been emitted + fn query_packet_height( + &self, + request: &QueryPacketEventDataRequest, + sequence: Sequence, + ) -> Result, Error> { + match self + .rt + .block_on( + RPC.shell().ibc_packet( + self.ctx.client(), + &request + .event_id + .as_str() + .parse() + .expect("invalid event type"), + &request + .source_port_id + .as_str() + .parse() + .expect("PortId should be parsable"), + &request + .source_channel_id + .as_str() + .parse() + .expect("ChannelId should be parsable"), + &request + .destination_port_id + .as_str() + .parse() + .expect("PortId should be parsable"), + &request + .destination_channel_id + .as_str() + .parse() + .expect("ChannelId should be parsable"), + &u64::from(sequence).into(), + ), + ) + .map_err(NamadaError::query)? + { + Some(event) => { + let h = event + .read_attribute::() + .map_err(|_| Error::invalid_height_no_source())?; + let height = ICSHeight::new(self.config.id.version(), h.0) + .map_err(|_| Error::invalid_height_no_source())?; + Ok(Some(height)) + } + None => Ok(None), + } + } + + /// Get IBC events at the given height + fn query_events(&self, height: ICSHeight) -> Result, Error> { + crate::time!( + "query_blocks: query block packet events", + { + "src_chain": self.config.id.to_string(), + } + ); + crate::telemetry!(query, self.id(), "query_block"); + + let tm_height = TmHeight::try_from(height.revision_height()) + .map_err(|_| Error::invalid_height_no_source())?; + let response = self + .rt + .block_on(Client::block_results(self.ctx.client(), tm_height)) + .map_err(|e| NamadaError::rpc(self.config.rpc_addr.clone(), e))?; + + let events = response + .end_block_events + .ok_or_else(|| Error::query("No transaction result was found".to_string()))?; + let mut ibc_events = vec![]; + for event in events { + let pb_abci_event = TmEvent::from(event); + let abci_event = into_abci_event(pb_abci_event); + if let Ok(ibc_event) = ibc_event_try_from_abci_event(&abci_event) { + ibc_events.push(IbcEventWithHeight::new(ibc_event, height)) + } + } + Ok(ibc_events) + } + + /// Get IBC denom + pub fn query_denom(&self, raw_addr: String) -> Result { + let token = Address::decode(&raw_addr) + .map_err(|_| NamadaError::address_decode(raw_addr.to_string()))?; + let hash = match &token { + Address::Internal(InternalAddress::IbcToken(hash)) => hash.to_string(), + _ => return Err(NamadaError::denom_not_found(raw_addr).into()), + }; + + let prefix = ibc_trace_key_prefix(None); + let pairs = self.query_prefix(prefix)?; + let pair = pairs + .iter() + .find(|PrefixValue { key, value: _ }| { + if let Some((_, token_hash)) = is_ibc_trace_key(key) { + token_hash == *hash + } else { + false + } + }) + .ok_or(NamadaError::denom_not_found(raw_addr))?; + + String::try_from_slice(&pair.value).map_err(|e| Error::namada(NamadaError::borsh_decode(e))) + } +} + +fn into_tm_proof(proof_ops: ProofOps) -> tendermint::merkle::proof::ProofOps { + let ops = proof_ops + .ops + .into_iter() + .map(|op| tendermint::merkle::proof::ProofOp { + field_type: op.field_type, + key: op.key, + data: op.data, + }) + .collect(); + tendermint::merkle::proof::ProofOps { ops } +} + +fn into_abci_event(event: TmEvent) -> tendermint::abci::Event { + let attributes = event + .attributes + .into_iter() + .map(|attribute| (attribute.key, attribute.value).into()) + .collect(); + tendermint::abci::Event { + kind: event.r#type, + attributes, + } +} diff --git a/crates/relayer/src/chain/namada/tx.rs b/crates/relayer/src/chain/namada/tx.rs new file mode 100644 index 0000000000..4dc7f25e84 --- /dev/null +++ b/crates/relayer/src/chain/namada/tx.rs @@ -0,0 +1,384 @@ +use core::str::FromStr; +use core::time::Duration; +use std::path::PathBuf; +use std::thread; +use std::time::Instant; + +use ibc_proto::google::protobuf::Any; +use itertools::Itertools; +use namada_sdk::address::{Address, ImplicitAddress}; +use namada_sdk::args::TxBuilder; +use namada_sdk::args::{Tx as TxArgs, TxCustom}; +use namada_sdk::chain::ChainId; +use namada_sdk::io::NamadaIo; +use namada_sdk::tx::{prepare_tx, ProcessTxResponse}; +use namada_sdk::{rpc, signing, tx, Namada}; +use namada_tendermint_rpc::endpoint::broadcast::tx_sync::Response; +use tracing::{debug, debug_span, trace, warn}; + +use crate::chain::cosmos::gas::{adjust_estimated_gas, AdjustGas}; +use crate::chain::cosmos::types::gas::max_gas_from_config_opt; +use crate::chain::cosmos::types::tx::{TxStatus, TxSyncResult}; +use crate::chain::cosmos::wait::all_tx_results_found; +use crate::chain::endpoint::ChainEndpoint; +use crate::error::{Error, ErrorDetail}; + +use super::error::{Error as NamadaError, ErrorDetail as NamadaErrorDetail}; +use super::NamadaChain; + +const WAIT_BACKOFF: Duration = Duration::from_millis(300); + +impl NamadaChain { + pub fn batch_txs(&mut self, msgs: &[Any]) -> Result { + if msgs.is_empty() { + return Err(Error::send_tx("No message to be batched".to_string())); + } + + let tx_args = self.make_tx_args()?; + + let relayer_key = self.get_key()?; + let relayer_addr = relayer_key.address; + + let rt = self.rt.clone(); + rt.block_on(self.submit_reveal_aux(&tx_args, &relayer_addr))?; + + let args = TxCustom { + tx: tx_args.clone(), + code_path: Some(PathBuf::from(tx::TX_IBC_WASM)), + data_path: None, + serialized_tx: None, + owner: Some(relayer_addr.clone()), + }; + let mut txs = Vec::new(); + for msg in msgs { + let (mut tx, signing_data) = rt + .block_on(args.build(&self.ctx)) + .map_err(NamadaError::namada)?; + self.set_tx_data(&mut tx, msg)?; + txs.push((tx, signing_data.expect("signing_data should exist"))); + } + let (mut tx, signing_data) = tx::build_batch(txs).map_err(NamadaError::namada)?; + // This is fine, as only the relayers is signing the transactions + let signing_data = signing_data.first().expect("SigningData should exist"); + + // Estimate the fee with dry-run + match self.estimate_fee(tx.clone(), &tx_args, signing_data) { + // Set the estimated fee + Ok(Some((fee_token, gas_limit, fee_amount))) => { + self.prepare_tx_with_gas(&mut tx, &tx_args, &fee_token, gas_limit, fee_amount)? + } + Ok(None) => { + // the default gas limit will be used + } + Err(err) => match err.detail() { + ErrorDetail::Namada(namada_err) => { + match namada_err.source { + NamadaErrorDetail::DryRun(ref tx_results) => { + warn!("Simulation failed: {tx_results}"); + // Return the failure response to avoid the actual request. + // The response will be converted to `TxSyncResult`. + let response = Response { + codespace: Default::default(), + // the code value isn't used, but it should be non-zero to + // recognize the transaction failed + code: 1.into(), + data: Default::default(), + log: format!("Simulation failed: Results {tx_results}"), + hash: Default::default(), + }; + return Ok(response); + } + _ => return Err(err), + } + } + _ => return Err(err), + }, + } + + rt.block_on(self.ctx.sign( + &mut tx, + &tx_args, + signing_data.clone(), + signing::default_sign, + (), + )) + .map_err(NamadaError::namada)?; + + let tx_header_hash = tx.header_hash().to_string(); + let response = rt + .block_on(self.ctx.submit(tx, &tx_args)) + .map_err(NamadaError::namada)?; + + match response { + tx::ProcessTxResponse::Broadcast(mut response) => { + // overwrite the tx decrypted hash for the tx query + response.hash = tx_header_hash.parse().expect("invalid hash"); + Ok(response) + } + _ => unreachable!("The response type was unexpected"), + } + } + + fn make_tx_args(&mut self) -> Result { + let chain_id = ChainId::from_str(self.config.id.as_str()).expect("invalid chain ID"); + + let namada_key = self.get_key()?; + let relayer_public_key = namada_key.secret_key.to_public(); + + let tx_args = self.ctx.tx_builder(); + let tx_args = tx_args.chain_id(chain_id); + let tx_args = tx_args.signing_keys(vec![relayer_public_key]); + // Confirm the transaction later + let mut tx_args = tx_args.broadcast_only(true); + + let memo = self + .config + .memo_overwrite + .as_ref() + .unwrap_or(&self.config.memo_prefix); + let memo = if !memo.as_str().is_empty() { + Some(memo.as_str().to_string().as_bytes().to_vec()) + } else { + None + }; + tx_args.memo = memo; + + Ok(tx_args) + } + + fn set_tx_data(&self, tx: &mut tx::Tx, proto_msg: &Any) -> Result<(), Error> { + let mut tx_data = vec![]; + prost::Message::encode(proto_msg, &mut tx_data) + .map_err(|e| Error::protobuf_encode(String::from("Encoding the message failed"), e))?; + tx.add_serialized_data(tx_data); + Ok(()) + } + + fn estimate_fee( + &self, + mut tx: tx::Tx, + args: &TxArgs, + signing_data: &signing::SigningTxData, + ) -> Result, Error> { + let chain_id = self.config.id.clone(); + let fee_token_str = self.config.gas_price.denom.clone(); + let fee_token = Address::from_str(&fee_token_str) + .map_err(|_| NamadaError::address_decode(fee_token_str.clone()))?; + let gas_price = self.config.gas_price.price; + + let max_block_gas_key = namada_sdk::parameters::storage::get_max_block_gas_key(); + let max_block_gas: u64 = self + .rt + .block_on(rpc::query_storage_value( + self.ctx.client(), + &max_block_gas_key, + )) + .map_err(NamadaError::namada)?; + let max_gas = max_gas_from_config_opt(&self.config).unwrap_or(max_block_gas); + + let args = args.clone().dry_run_wrapper(true); + // Set the max gas to the gas limit for the simulation + self.prepare_tx_with_gas(&mut tx, &args, &fee_token, max_block_gas, gas_price)?; + + self.rt + .block_on(self.ctx.sign( + &mut tx, + &args, + signing_data.clone(), + signing::default_sign, + (), + )) + .map_err(NamadaError::namada)?; + + let response = match self.rt.block_on(self.ctx.submit(tx, &args)) { + Ok(resp) => resp, + Err(e) => { + warn!( + id = %chain_id, + "send_tx: gas estimation failed, using the default gas limit. Error: {}", + e + ); + return Ok(None); + } + }; + + let estimated_gas = match response { + ProcessTxResponse::DryRun(result) => { + if result + .0 + .iter() + .all(|(_, r)| matches!(&r, Ok(result) if result.is_accepted())) + { + result.1.into() + } else { + // All or some of requests will fail + return Err(NamadaError::dry_run(result.0).into()); + } + } + _ => unreachable!("Unexpected response"), + }; + if estimated_gas > max_gas { + debug!( + id = %chain_id, estimated = ?estimated_gas, max_gas, + "send_tx: estimated gas is higher than max gas" + ); + + return Err(Error::tx_simulate_gas_estimate_exceeded( + chain_id, + estimated_gas, + max_gas, + )); + } + + let gas_multiplier = self.config.gas_multiplier.unwrap_or_default().to_f64(); + + let adjusted_gas = adjust_estimated_gas(AdjustGas { + gas_multiplier, + max_gas, + gas_amount: estimated_gas, + }); + + debug!( + id = %chain_id, + "send_tx: using {} gas, gas_price {:?}", + estimated_gas, + gas_price, + ); + + Ok(Some((fee_token, adjusted_gas, gas_price))) + } + + fn prepare_tx_with_gas( + &self, + tx: &mut tx::Tx, + args: &TxArgs, + fee_token: &Address, + gas_limit: u64, + fee_amount: f64, + ) -> Result<(), Error> { + let relayer_key = self.get_key()?; + let relayer_public_key = relayer_key.secret_key.to_public(); + + let args = args + .clone() + .fee_token(fee_token.clone()) + .gas_limit(gas_limit.into()) + .fee_amount( + fee_amount + .to_string() + .parse() + .expect("Fee should be parsable"), + ); + let fee_amount = self + .rt + .block_on(signing::validate_fee(&self.ctx, &args)) + .map_err(NamadaError::namada)?; + self.rt + .block_on(prepare_tx(&args, tx, fee_amount, relayer_public_key)) + .map_err(NamadaError::namada)?; + + Ok(()) + } + + pub fn wait_for_block_commits( + &self, + tx_sync_results: &mut [TxSyncResult], + ) -> Result<(), Error> { + if all_tx_results_found(tx_sync_results) { + return Ok(()); + } + + let chain_id = &self.id(); + crate::time!( + "wait_for_block_commits", + { + "src_chain": chain_id, + } + ); + let _span = debug_span!("wait_for_block_commits", id = %chain_id).entered(); + + let start_time = Instant::now(); + + let hashes = tx_sync_results + .iter() + .map(|res| res.response.hash.to_string()) + .join(", "); + + debug!("waiting for commit of tx hashes(s) {}", hashes); + + loop { + let elapsed = start_time.elapsed(); + + if all_tx_results_found(tx_sync_results) { + trace!( + "retrieved {} tx results after {} ms", + tx_sync_results.len(), + elapsed.as_millis(), + ); + + return Ok(()); + } else if elapsed > self.config.rpc_timeout { + debug!("timed out after {} ms", elapsed.as_millis()); + return Err(Error::tx_no_confirmation()); + } else { + thread::sleep(WAIT_BACKOFF); + + for tx_sync_result in tx_sync_results.iter_mut() { + if let Err(e) = self.update_tx_sync_result(tx_sync_result) { + debug!("update_tx_sync_result failed. It will be retried: {e}"); + } + } + } + } + } + + fn update_tx_sync_result(&self, tx_sync_result: &mut TxSyncResult) -> Result<(), Error> { + if let TxStatus::Pending { .. } = tx_sync_result.status { + let tm_hash = namada_tendermint::Hash::from_bytes( + namada_tendermint::hash::Algorithm::Sha256, + tx_sync_result.response.hash.as_bytes(), + ) + .expect("tendermint hash should be converted"); + // If the transaction failed, query_txs returns the IbcEvent::ChainError, + // so that we don't attempt to resolve the transaction later on. + let events = self.query_tx_events(&tm_hash)?; + // If we get events back, progress was made, so we replace the events + // with the new ones. in both cases we will check in the next iteration + // whether or not the transaction was fully committed. + if !events.is_empty() { + tx_sync_result.events = events; + tx_sync_result.status = TxStatus::ReceivedResponse; + } + } + Ok(()) + } + + async fn submit_reveal_aux(&mut self, args: &TxArgs, address: &Address) -> Result<(), Error> { + if let Address::Implicit(ImplicitAddress(pkh)) = address { + let public_key = self + .ctx + .wallet() + .await + .find_public_key(pkh.to_string()) + .map_err(|e| NamadaError::namada(namada_sdk::error::Error::Other(e.to_string())))?; + + if tx::is_reveal_pk_needed(self.ctx.client(), address) + .await + .map_err(NamadaError::namada)? + { + let (mut tx, signing_data) = tx::build_reveal_pk(&self.ctx, args, &public_key) + .await + .map_err(NamadaError::namada)?; + self.ctx + .sign(&mut tx, args, signing_data, signing::default_sign, ()) + .await + .map_err(NamadaError::namada)?; + self.ctx + .submit(tx, args) + .await + .map_err(NamadaError::namada)?; + } + } + Ok(()) + } +} diff --git a/crates/relayer/src/chain/namada/version.rs b/crates/relayer/src/chain/namada/version.rs new file mode 100644 index 0000000000..295ae16393 --- /dev/null +++ b/crates/relayer/src/chain/namada/version.rs @@ -0,0 +1,27 @@ +use core::fmt::{Display, Error as FmtError, Formatter}; + +use crate::chain::version::ConsensusVersion; + +/// Captures the version(s) specification of different modules of a network. +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct Specs { + pub namada: Option, + pub consensus: Option, +} + +impl Display for Specs { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + let namada = self + .namada + .as_ref() + .map(|v| v.to_string()) + .unwrap_or_else(|| "UNKNOWN".to_string()); + + let consensus = match self.consensus { + Some(ref v) => v.to_string(), + None => "Tendermint: UNKNOWN, CometBFT: UNKNOWN".to_string(), + }; + + write!(f, "Namada {}, {}", namada, consensus) + } +} diff --git a/crates/relayer/src/chain/namada/wallet.rs b/crates/relayer/src/chain/namada/wallet.rs new file mode 100644 index 0000000000..c30742f489 --- /dev/null +++ b/crates/relayer/src/chain/namada/wallet.rs @@ -0,0 +1,65 @@ +use std::path::PathBuf; +use std::{env, fs}; + +use namada_sdk::wallet::fs::FsWalletStorage; +use namada_sdk::wallet::{LoadStoreError, Store, Wallet, WalletIo, WalletStorage}; +use namada_sdk::zeroize::Zeroizing; +use signature::rand_core::OsRng; + +/// Wallet utils for Namada context +#[derive(Clone)] +pub(super) struct NullWalletUtils; + +impl WalletIo for NullWalletUtils { + type Rng = OsRng; +} + +// Namada wallet never accesses the storage. It reads the keys added in the bootstrap from the store. +impl WalletStorage for NullWalletUtils { + fn save(&self, _wallet: &Wallet) -> Result<(), LoadStoreError> { + Ok(()) + } + + fn load(&self, _wallet: &mut Wallet) -> Result<(), LoadStoreError> { + Ok(()) + } +} + +/// For Namada wallet for adding a key with a password +#[derive(Clone)] +pub struct CliWalletUtils { + store_dir: PathBuf, +} + +impl CliWalletUtils { + pub fn new(store_dir: PathBuf) -> Wallet { + Wallet::new(Self { store_dir }, Store::default()) + } +} + +impl FsWalletStorage for CliWalletUtils { + fn store_dir(&self) -> &PathBuf { + &self.store_dir + } +} + +impl WalletIo for CliWalletUtils { + type Rng = OsRng; + + fn read_password(_confirm: bool, _target_key: Option<&str>) -> Zeroizing { + match env::var("NAMADA_WALLET_PASSWORD_FILE") { + Ok(path) => Zeroizing::new( + fs::read_to_string(path).expect("Something went wrong reading the file"), + ), + Err(_) => match env::var("NAMADA_WALLET_PASSWORD") { + Ok(password) => Zeroizing::new(password), + Err(_) => { + let prompt = "Enter your decryption password: "; + rpassword::read_password_from_tty(Some(prompt)) + .map(Zeroizing::new) + .expect("Failed reading password from tty.") + } + }, + } + } +} diff --git a/crates/relayer/src/chain/runtime.rs b/crates/relayer/src/chain/runtime.rs index 0aff1cb248..9c6a4a17fe 100644 --- a/crates/relayer/src/chain/runtime.rs +++ b/crates/relayer/src/chain/runtime.rs @@ -48,11 +48,11 @@ use crate::{ use super::{ client::ClientSettings, - cosmos::version::Specs, endpoint::{ChainEndpoint, ChainStatus, HealthCheck}, handle::{ChainHandle, ChainRequest, ReplyTo, Subscription}, requests::*, tracking::TrackedMsgs, + version::Specs, }; pub struct Threads { diff --git a/crates/relayer/src/chain/version.rs b/crates/relayer/src/chain/version.rs new file mode 100644 index 0000000000..0a43f51381 --- /dev/null +++ b/crates/relayer/src/chain/version.rs @@ -0,0 +1,27 @@ +use core::fmt::{Display, Error as FmtError, Formatter}; + +use crate::chain::cosmos::version::Specs as CosmosSpecs; +use crate::chain::namada::version::Specs as NamadaSpecs; + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum ConsensusVersion { + Tendermint(semver::Version), + Comet(semver::Version), +} + +impl Display for ConsensusVersion { + fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { + let consensus = match self { + ConsensusVersion::Tendermint(ref v) => format!("Tendermint {v}"), + ConsensusVersion::Comet(ref v) => format!("CometBFT {v}"), + }; + write!(f, "{consensus}") + } +} + +/// Captures the version(s) specification of different modules of a network. +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum Specs { + Cosmos(CosmosSpecs), + Namada(NamadaSpecs), +} diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index fa4725a6d2..584d0cf347 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -322,7 +322,7 @@ impl Config { } match chain_config { - ChainConfig::CosmosSdk(cosmos_config) => { + ChainConfig::CosmosSdk(cosmos_config) | ChainConfig::Namada(cosmos_config) => { cosmos_config .validate() .map_err(Into::>::into)?; @@ -655,36 +655,43 @@ pub enum EventSourceMode { #[serde(tag = "type")] pub enum ChainConfig { CosmosSdk(CosmosSdkConfig), + // Reuse CosmosSdkConfig for tendermint light clients + Namada(CosmosSdkConfig), } impl ChainConfig { pub fn id(&self) -> &ChainId { match self { Self::CosmosSdk(config) => &config.id, + Self::Namada(config) => &config.id, } } pub fn packet_filter(&self) -> &PacketFilter { match self { Self::CosmosSdk(config) => &config.packet_filter, + Self::Namada(config) => &config.packet_filter, } } pub fn max_block_time(&self) -> Duration { match self { Self::CosmosSdk(config) => config.max_block_time, + Self::Namada(config) => config.max_block_time, } } pub fn key_name(&self) -> &String { match self { Self::CosmosSdk(config) => &config.key_name, + Self::Namada(config) => &config.key_name, } } pub fn set_key_name(&mut self, key_name: String) { match self { Self::CosmosSdk(config) => config.key_name = key_name, + Self::Namada(config) => config.key_name = key_name, } } @@ -703,6 +710,15 @@ impl ChainConfig { .map(|(key_name, keys)| (key_name, keys.into())) .collect() } + ChainConfig::Namada(config) => { + let keyring = + KeyRing::new_namada(Store::Test, &config.id, &config.key_store_folder)?; + keyring + .keys()? + .into_iter() + .map(|(key_name, keys)| (key_name, keys.into())) + .collect() + } }; Ok(keys) @@ -710,25 +726,27 @@ impl ChainConfig { pub fn clear_interval(&self) -> Option { match self { - Self::CosmosSdk(config) => config.clear_interval, + Self::CosmosSdk(config) | Self::Namada(config) => config.clear_interval, } } pub fn query_packets_chunk_size(&self) -> usize { match self { - Self::CosmosSdk(config) => config.query_packets_chunk_size, + Self::CosmosSdk(config) | Self::Namada(config) => config.query_packets_chunk_size, } } pub fn set_query_packets_chunk_size(&mut self, query_packets_chunk_size: usize) { match self { - Self::CosmosSdk(config) => config.query_packets_chunk_size = query_packets_chunk_size, + Self::CosmosSdk(config) | Self::Namada(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 + Self::CosmosSdk(config) | Self::Namada(config) => config .excluded_sequences .map .get(channel_id) @@ -739,7 +757,7 @@ impl ChainConfig { pub fn allow_ccq(&self) -> bool { match self { - Self::CosmosSdk(config) => config.allow_ccq, + Self::CosmosSdk(config) | Self::Namada(config) => config.allow_ccq, } } } @@ -768,7 +786,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}"))), - + "Namada" => CosmosSdkConfig::deserialize(value) + .map(Self::Namada) + .map_err(|e| serde::de::Error::custom(format!("invalid Namada config: {e}"))), // // <-- Add new chain types here --> // @@ -927,6 +947,9 @@ mod tests { super::ChainConfig::CosmosSdk(_) => { // all good } + super::ChainConfig::Namada(_) => { + panic!("Default chain is expected to be CosmosSDK not Namada") + } } } @@ -953,11 +976,15 @@ mod tests { 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(), + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(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::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + chain_config.excluded_sequences.clone() + } }; assert_eq!(excluded_sequences1, excluded_sequences2); diff --git a/crates/relayer/src/config/filter.rs b/crates/relayer/src/config/filter.rs index 5feb4376e1..002a19b0f9 100644 --- a/crates/relayer/src/config/filter.rs +++ b/crates/relayer/src/config/filter.rs @@ -208,7 +208,7 @@ impl Serialize for ChannelFilters { b: &'a FilterPattern, } - impl<'a> Serialize for Pair<'a> { + impl Serialize for Pair<'_> { fn serialize(&self, serializer: S) -> Result where S: Serializer, @@ -378,7 +378,7 @@ pub(crate) mod port { pub struct PortFilterMatchVisitor; - impl<'de> de::Visitor<'de> for PortFilterMatchVisitor { + impl de::Visitor<'_> for PortFilterMatchVisitor { type Value = PortFilterMatch; fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { @@ -407,7 +407,7 @@ pub(crate) mod channel { pub struct ChannelFilterMatchVisitor; - impl<'de> de::Visitor<'de> for ChannelFilterMatchVisitor { + impl de::Visitor<'_> for ChannelFilterMatchVisitor { type Value = ChannelFilterMatch; fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/crates/relayer/src/config/proof_specs.rs b/crates/relayer/src/config/proof_specs.rs index d7c7f80cce..33fa2f8a78 100644 --- a/crates/relayer/src/config/proof_specs.rs +++ b/crates/relayer/src/config/proof_specs.rs @@ -19,7 +19,7 @@ pub fn serialize( struct ProofSpecsVisitor; -impl<'de> de::Visitor<'de> for ProofSpecsVisitor { +impl de::Visitor<'_> for ProofSpecsVisitor { type Value = Option; fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index c8ac6d656d..9059195537 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -36,6 +36,7 @@ use ibc_relayer_types::proofs::ProofError; use crate::chain::cosmos::version; use crate::chain::cosmos::BLOCK_MAX_BYTES_MAX_FRACTION; +use crate::chain::namada::error::Error as NamadaError; use crate::config::Error as ConfigError; use crate::event::source; use crate::keyring::{errors::Error as KeyringError, KeyType}; @@ -642,6 +643,10 @@ define_error! { Ics24HostValidationError [ ValidationError ] |_| { "ICS24 host validation error" }, + + Namada + [ NamadaError ] + |_| { "Namada error" }, } } diff --git a/crates/relayer/src/event.rs b/crates/relayer/src/event.rs index f5219f4750..0b59747dba 100644 --- a/crates/relayer/src/event.rs +++ b/crates/relayer/src/event.rs @@ -39,7 +39,7 @@ pub mod bus; pub mod error; pub mod source; -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug, Serialize, PartialEq)] pub struct IbcEventWithHeight { pub event: IbcEvent, pub height: Height, diff --git a/crates/relayer/src/event/source/websocket/extract.rs b/crates/relayer/src/event/source/websocket/extract.rs index ddc692054d..8e0539b144 100644 --- a/crates/relayer/src/event/source/websocket/extract.rs +++ b/crates/relayer/src/event/source/websocket/extract.rs @@ -6,11 +6,12 @@ use tendermint_rpc::{event::Event as RpcEvent, event::EventData as RpcEventData} use ibc_relayer_types::applications::ics31_icq::events::CrossChainQueryPacket; use ibc_relayer_types::core::ics02_client::{events as ClientEvents, height::Height}; +use ibc_relayer_types::core::ics03_connection::events as ConnectionEvents; use ibc_relayer_types::core::ics04_channel::events as ChannelEvents; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use ibc_relayer_types::events::IbcEvent; -use crate::chain::cosmos::types::events::channel::RawObject; +use crate::chain::cosmos::types::events::raw_object::RawObject; use crate::event::source::queries; use crate::telemetry; @@ -300,6 +301,36 @@ fn extract_block_events( } let mut events: Vec = vec![]; + append_events::( + &mut events, + extract_events( + height, + block_events, + "connection_open_init", + "connection_id", + ), + height, + ); + append_events::( + &mut events, + extract_events(height, block_events, "connection_open_try", "connection_id"), + height, + ); + append_events::( + &mut events, + extract_events(height, block_events, "connection_open_ack", "connection_id"), + height, + ); + append_events::( + &mut events, + extract_events( + height, + block_events, + "connection_open_confirm", + "connection_id", + ), + height, + ); append_events::( &mut events, extract_events(height, block_events, "channel_open_init", "channel_id"), @@ -330,6 +361,11 @@ fn extract_block_events( extract_events(height, block_events, "send_packet", "packet_data_hex"), height, ); + append_events::( + &mut events, + extract_events(height, block_events, "write_acknowledgement", "packet_ack"), + height, + ); append_events::( &mut events, extract_events(height, block_events, "channel_close_init", "channel_id"), diff --git a/crates/relayer/src/foreign_client.rs b/crates/relayer/src/foreign_client.rs index 1120ee2dda..fab20454db 100644 --- a/crates/relayer/src/foreign_client.rs +++ b/crates/relayer/src/foreign_client.rs @@ -906,7 +906,9 @@ impl ForeignClient config.client_refresh_rate, + ChainConfig::CosmosSdk(config) | ChainConfig::Namada(config) => { + config.client_refresh_rate + } }; let refresh_period = client_state @@ -1758,7 +1760,9 @@ impl ForeignClient config.ccv_consumer_chain, + ChainConfig::CosmosSdk(config) | ChainConfig::Namada(config) => { + config.ccv_consumer_chain + } }; let mut msgs = vec![]; diff --git a/crates/relayer/src/keyring.rs b/crates/relayer/src/keyring.rs index 1260de235e..446ba7b039 100644 --- a/crates/relayer/src/keyring.rs +++ b/crates/relayer/src/keyring.rs @@ -5,6 +5,8 @@ pub use key_type::KeyType; pub use secp256k1_key_pair::Secp256k1KeyPair; pub use signing_key_pair::{SigningKeyPair, SigningKeyPairSized}; +pub use crate::chain::namada::key::NamadaKeyPair; + mod any_signing_key_pair; mod ed25519_key_pair; mod key_type; @@ -286,7 +288,15 @@ impl KeyRing { } } -// Why is this not a method on `ChainConfig`? +impl KeyRing { + pub fn new_namada( + store: Store, + chain_id: &ChainId, + ks_folder: &Option, + ) -> Result { + Self::new(store, "", chain_id, ks_folder) + } +} fn disk_store_path(folder_name: &str, keystore_folder: &Option) -> Result { let ks_folder = match keystore_folder { diff --git a/crates/relayer/src/keyring/any_signing_key_pair.rs b/crates/relayer/src/keyring/any_signing_key_pair.rs index f6aa27bd0b..3bd57177a2 100644 --- a/crates/relayer/src/keyring/any_signing_key_pair.rs +++ b/crates/relayer/src/keyring/any_signing_key_pair.rs @@ -1,12 +1,13 @@ use serde::Serialize; -use super::{Ed25519KeyPair, KeyType, Secp256k1KeyPair, SigningKeyPair}; +use super::{Ed25519KeyPair, KeyType, NamadaKeyPair, Secp256k1KeyPair, SigningKeyPair}; #[derive(Clone, Debug, Serialize)] #[serde(untagged)] pub enum AnySigningKeyPair { Secp256k1(Secp256k1KeyPair), Ed25519(Ed25519KeyPair), + Namada(NamadaKeyPair), } impl AnySigningKeyPair { @@ -14,6 +15,7 @@ impl AnySigningKeyPair { match self { Self::Secp256k1(key_pair) => key_pair.account(), Self::Ed25519(key_pair) => key_pair.account(), + Self::Namada(key_pair) => key_pair.account(), } } @@ -21,6 +23,7 @@ impl AnySigningKeyPair { match self { Self::Secp256k1(_) => Secp256k1KeyPair::KEY_TYPE, Self::Ed25519(_) => Ed25519KeyPair::KEY_TYPE, + Self::Namada(_) => NamadaKeyPair::KEY_TYPE, } } @@ -28,6 +31,7 @@ impl AnySigningKeyPair { match self { Self::Secp256k1(key_pair) => key_pair.as_any(), Self::Ed25519(key_pair) => key_pair.as_any(), + Self::Namada(key_pair) => key_pair.as_any(), } .downcast_ref::() .cloned() @@ -45,3 +49,9 @@ impl From for AnySigningKeyPair { Self::Ed25519(key_pair) } } + +impl From for AnySigningKeyPair { + fn from(key_pair: NamadaKeyPair) -> Self { + Self::Namada(key_pair) + } +} diff --git a/crates/relayer/src/light_client/tendermint.rs b/crates/relayer/src/light_client/tendermint.rs index 808c616235..4628517b51 100644 --- a/crates/relayer/src/light_client/tendermint.rs +++ b/crates/relayer/src/light_client/tendermint.rs @@ -153,12 +153,12 @@ impl super::LightClient for LightClient { )) })?; - let update_header: &TmHeader = match any_header { - AnyHeader::Tendermint(header) => Ok(header), + let update_header = match any_header { + AnyHeader::Tendermint(header) => Ok::<_, Error>(header), }?; let client_state = match client_state { - AnyClientState::Tendermint(client_state) => Ok(client_state), + AnyClientState::Tendermint(client_state) => Ok::<_, Error>(client_state), }?; let next_validators = self @@ -322,7 +322,7 @@ impl LightClient { let scheduler = components::scheduler::basic_bisecting_schedule; let client_state = match client_state { - AnyClientState::Tendermint(client_state) => Ok(client_state), + AnyClientState::Tendermint(client_state) => Ok::<_, Error>(client_state), }?; Ok(TmLightClient::new( diff --git a/crates/relayer/src/spawn.rs b/crates/relayer/src/spawn.rs index 113ac1f6a7..f791fddabc 100644 --- a/crates/relayer/src/spawn.rs +++ b/crates/relayer/src/spawn.rs @@ -6,7 +6,9 @@ use tokio::runtime::Runtime as TokioRuntime; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use crate::{ - chain::{cosmos::CosmosSdkChain, handle::ChainHandle, runtime::ChainRuntime}, + chain::{ + cosmos::CosmosSdkChain, handle::ChainHandle, namada::NamadaChain, runtime::ChainRuntime, + }, config::{ChainConfig, Config}, error::Error as RelayerError, }; @@ -82,6 +84,7 @@ pub fn spawn_chain_runtime_with_config( ) -> Result { let handle = match config { ChainConfig::CosmosSdk(_) => ChainRuntime::::spawn(config, rt), + ChainConfig::Namada(_) => ChainRuntime::::spawn(config, rt), } .map_err(SpawnError::relayer)?; diff --git a/crates/relayer/src/upgrade_chain.rs b/crates/relayer/src/upgrade_chain.rs index 318f35130b..f6a7277120 100644 --- a/crates/relayer/src/upgrade_chain.rs +++ b/crates/relayer/src/upgrade_chain.rs @@ -22,6 +22,7 @@ use tracing::warn; use crate::chain::handle::ChainHandle; use crate::chain::requests::{IncludeProof, QueryClientStateRequest, QueryHeight}; use crate::chain::tracking::TrackedMsgs; +use crate::chain::version::Specs; use crate::client_state::AnyClientState; use crate::error::Error; @@ -76,7 +77,7 @@ pub fn build_and_send_ibc_upgrade_proposal( src_chain: impl ChainHandle, // the source chain; supplies a client state for building the upgrade plan opts: &UpgradePlanOptions, ) -> Result { - let any_msg = if requires_legacy_upgrade_proposal(dst_chain.clone()) { + let any_msg = if requires_legacy_upgrade_proposal(dst_chain.clone())? { build_legacy_upgrade_proposal(dst_chain.clone(), src_chain, opts) } else { build_upgrade_proposal(dst_chain.clone(), src_chain, opts) @@ -98,10 +99,22 @@ pub fn build_and_send_ibc_upgrade_proposal( /// 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, 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 { +pub fn requires_legacy_upgrade_proposal( + dst_chain: impl ChainHandle, +) -> Result { let Ok(version_specs) = dst_chain.version_specs() else { warn!("failed to get version specs, assuming legacy upgrade proposal is required"); - return true; + return Ok(true); + }; + + let version_specs = match version_specs { + Specs::Cosmos(v) => v, + Specs::Namada(_) => { + return Err(UpgradeChainError::submit( + dst_chain.id(), + crate::chain::namada::error::Error::upgrade().into(), + )) + } }; let sdk_before_50 = version_specs @@ -110,7 +123,7 @@ pub fn requires_legacy_upgrade_proposal(dst_chain: impl ChainHandle) -> bool { .map(|s| s.minor < 50) .unwrap_or(true); - match version_specs.ibc_go { + Ok(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 @@ -123,7 +136,7 @@ pub fn requires_legacy_upgrade_proposal(dst_chain: impl ChainHandle) -> bool { ibc_version.major < 8 } } - } + }) } /// Ibc-go versions up to v7.x.x use the deprecated `UpgradeProposal` to upgrade a chain diff --git a/crates/relayer/src/util/compat_mode.rs b/crates/relayer/src/util/compat_mode.rs index c637d5a247..104026e70e 100644 --- a/crates/relayer/src/util/compat_mode.rs +++ b/crates/relayer/src/util/compat_mode.rs @@ -2,7 +2,7 @@ use tracing::warn; use tendermint::Version; -use crate::chain::cosmos::version::ConsensusVersion; +use crate::chain::version::ConsensusVersion; use crate::config::compat_mode::CompatMode; use crate::error::Error; diff --git a/crates/relayer/src/util/pretty.rs b/crates/relayer/src/util/pretty.rs index 0b433bd289..9561188fe0 100644 --- a/crates/relayer/src/util/pretty.rs +++ b/crates/relayer/src/util/pretty.rs @@ -16,7 +16,7 @@ use crate::event::IbcEventWithHeight; pub struct PrettyAny<'a>(pub &'a Any); -impl<'a> Display for PrettyAny<'a> { +impl Display for PrettyAny<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "Any {{ type_url: {} }}", self.0.type_url) } @@ -97,7 +97,7 @@ impl Display for PrettyDuration<'_> { /// For use in debug messages pub struct PrettyEvents<'a>(pub &'a [IbcEventWithHeight]); -impl<'a> Display for PrettyEvents<'a> { +impl Display for PrettyEvents<'_> { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { writeln!(f, "events:")?; for v in self.0 { @@ -180,7 +180,7 @@ impl Display for PrettyIdentifiedConnection<'_> { pub struct PrettyOption<'a, T>(pub &'a Option); -impl<'a, T: Display> Display for PrettyOption<'a, T> { +impl Display for PrettyOption<'_, T> { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { match &self.0 { Some(v) => write!(f, "{v}"), @@ -191,7 +191,7 @@ impl<'a, T: Display> Display for PrettyOption<'a, T> { pub struct PrettySlice<'a, T>(pub &'a [T]); -impl<'a, T: Display> Display for PrettySlice<'a, T> { +impl Display for PrettySlice<'_, T> { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "[ ")?; let mut vec_iterator = self.0.iter().peekable(); diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index eb22530255..abd1761784 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.76.0" +rust-version = "1.79.0" description = """ Telemetry service for the Hermes IBC relayer """ diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 77b9d86c61..9bacc19498 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -2,7 +2,7 @@ name = "ibc-integration-test" version = "0.29.4" edition = "2021" -rust-version = "1.76.0" +rust-version = "1.79.0" license = "Apache-2.0" readme = "README.md" keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] @@ -50,6 +50,7 @@ new-register-interchain-account = [] authz = [] benchmark = [] no-denom-trace = [] +namada = [] [[bin]] name = "test_setup_with_binary_channel" 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 44d6cb40e4..85565698e2 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 @@ -43,7 +43,7 @@ impl TestOverrides for Test { fn modify_relayer_config(&self, config: &mut Config) { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { // Modify the key store type to `Store::Test` so that the wallet // keys are stored to ~/.hermes/keys so that we can use them // with external relayer commands. 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 ac938158d2..39b749c3bf 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 @@ -44,7 +44,7 @@ impl TestOverrides for Test { fn modify_relayer_config(&self, config: &mut Config) { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { // Modify the key store type to `Store::Test` so that the wallet // keys are stored to ~/.hermes/keys so that we can use them // with external relayer commands. 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 1cfcd0f921..b11f77634d 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 @@ -43,7 +43,7 @@ impl TestOverrides for Test { fn modify_relayer_config(&self, config: &mut Config) { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { // Modify the key store type to `Store::Test` so that the wallet // keys are stored to ~/.hermes/keys so that we can use them // with external relayer commands. 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 493d034b1a..bce4a2c69b 100644 --- a/tools/integration-test/src/tests/async_icq/simple_query.rs +++ b/tools/integration-test/src/tests/async_icq/simple_query.rs @@ -2,7 +2,7 @@ use std::env; use ibc_relayer::channel::version::Version; use ibc_relayer::config::ChainConfig; -use ibc_test_framework::chain::config::{ +use ibc_test_framework::chain::config::cosmos::{ add_allow_message_interchainquery, set_floor_gas_price, set_max_deposit_period, set_min_deposit_amount, set_voting_period, }; @@ -70,7 +70,7 @@ impl BinaryConnectionTest for AsyncIcqTest { connection: ConnectedConnection, ) -> Result<(), Error> { let fee_denom_b: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1))); + MonoTagged::new(Denom::base(config.native_token(1), 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( @@ -217,7 +217,7 @@ impl BinaryConnectionTest for FailedAsyncIcqTest { connection: ConnectedConnection, ) -> Result<(), Error> { let fee_denom_b: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1))); + MonoTagged::new(Denom::base(config.native_token(1), 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( @@ -336,7 +336,7 @@ fn assert_eventual_async_icq_success( relayer: &RelayerDriver, ) -> Result<(), Error> { let rpc_addr = match relayer.config.chains.first().unwrap() { - ChainConfig::CosmosSdk(c) => c.rpc_addr.clone(), + ChainConfig::CosmosSdk(c) | ChainConfig::Namada(c) => c.rpc_addr.clone(), }; let mut rpc_client = HttpClient::new(rpc_addr).unwrap(); @@ -371,7 +371,7 @@ fn assert_eventual_async_icq_error( relayer: &RelayerDriver, ) -> Result<(), Error> { let rpc_addr = match relayer.config.chains.first().unwrap() { - ChainConfig::CosmosSdk(c) => c.rpc_addr.clone(), + ChainConfig::CosmosSdk(c) | ChainConfig::Namada(c) => c.rpc_addr.clone(), }; let mut rpc_client = HttpClient::new(rpc_addr).unwrap(); diff --git a/tools/integration-test/src/tests/authz.rs b/tools/integration-test/src/tests/authz.rs index 28f5c11a18..9a661a9a6a 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_token(0))); + MonoTagged::new(Denom::base(config.native_token(0), config.native_token(0))); let wallet_b = chains.node_b.wallets().user1().cloned(); let a_to_b_amount = 12345u64; @@ -75,6 +75,7 @@ impl BinaryChannelTest for AuthzTest { .query_balance(&chains.node_a.wallets().user2().address(), &denom_a)?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, @@ -120,7 +121,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_token(0))); + MonoTagged::new(Denom::base(config.native_token(0), config.native_token(0))); let wallet_b = chains.node_b.wallets().user1().cloned(); let a_to_b_amount = 12345u64; @@ -140,6 +141,7 @@ impl BinaryChannelTest for NoAuthzTest { .to_string(); let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/channel_upgrade/flushing.rs b/tools/integration-test/src/tests/channel_upgrade/flushing.rs index 0e4bdf7143..3b2777f733 100644 --- a/tools/integration-test/src/tests/channel_upgrade/flushing.rs +++ b/tools/integration-test/src/tests/channel_upgrade/flushing.rs @@ -10,7 +10,7 @@ use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeigh 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::chain::config::cosmos::{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, @@ -166,6 +166,7 @@ impl BinaryChannelTest for ChannelUpgradeFlushing { relayer.with_supervisor(|| { let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, @@ -384,6 +385,7 @@ impl BinaryChannelTest for ChannelUpgradeHandshakeFlushPackets { // and move channel ends to `FLUSH_COMPLETE` relayer.with_supervisor(|| { let ibc_denom_a = derive_ibc_denom( + &chains.node_a.chain_driver().value().chain_type, &channels.port_a.as_ref(), &channels.channel_id_a.as_ref(), &denom_b, @@ -395,6 +397,7 @@ impl BinaryChannelTest for ChannelUpgradeHandshakeFlushPackets { )?; let ibc_denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/channel_upgrade/ica.rs b/tools/integration-test/src/tests/channel_upgrade/ica.rs index 8ddd4fb5c7..c2f1846f48 100644 --- a/tools/integration-test/src/tests/channel_upgrade/ica.rs +++ b/tools/integration-test/src/tests/channel_upgrade/ica.rs @@ -32,7 +32,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::{ +use ibc_test_framework::chain::config::cosmos::{ add_allow_message_interchainaccounts, set_max_deposit_period, set_voting_period, }; use ibc_test_framework::chain::ext::ica::register_ordered_interchain_account; @@ -91,8 +91,8 @@ impl BinaryConnectionTest for ChannelUpgradeICACloseChannel { 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")); + MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake", "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 @@ -315,7 +315,7 @@ impl TestOverrides for ChannelUpgradeICAUnordered { for chain in &mut config.chains { match chain { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.packet_filter = self.packet_filter.clone(); } } @@ -344,8 +344,8 @@ impl BinaryConnectionTest for ChannelUpgradeICAUnordered { 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")); + MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); info!("Will register interchain account..."); diff --git a/tools/integration-test/src/tests/channel_upgrade/ics29.rs b/tools/integration-test/src/tests/channel_upgrade/ics29.rs index 02f90b2745..95db144604 100644 --- a/tools/integration-test/src/tests/channel_upgrade/ics29.rs +++ b/tools/integration-test/src/tests/channel_upgrade/ics29.rs @@ -7,7 +7,7 @@ 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::chain::config::cosmos::{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, @@ -202,6 +202,7 @@ impl BinaryChannelTest for ChannelUpgradeICS29 { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/channel_upgrade/timeout.rs b/tools/integration-test/src/tests/channel_upgrade/timeout.rs index 42bdd288ed..ed391391f1 100644 --- a/tools/integration-test/src/tests/channel_upgrade/timeout.rs +++ b/tools/integration-test/src/tests/channel_upgrade/timeout.rs @@ -27,7 +27,7 @@ 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::chain::config::cosmos::{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, @@ -992,6 +992,7 @@ impl BinaryChannelTest for ChannelUpgradeHandshakeTimeoutOnPacketAck { // and move channel ends to `FLUSH_COMPLETE` relayer.with_supervisor(|| { let ibc_denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs b/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs index 1a8dbe27ed..2929bf649a 100644 --- a/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs +++ b/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs @@ -11,7 +11,7 @@ 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::chain::config::cosmos::{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, 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 index 31b665bc9a..c295ab55e4 100644 --- a/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake_steps.rs +++ b/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake_steps.rs @@ -29,7 +29,7 @@ use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeigh 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::chain::config::cosmos::{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, diff --git a/tools/integration-test/src/tests/clear_packet.rs b/tools/integration-test/src/tests/clear_packet.rs index cf09b6dbad..d45fab572d 100644 --- a/tools/integration-test/src/tests/clear_packet.rs +++ b/tools/integration-test/src/tests/clear_packet.rs @@ -122,8 +122,11 @@ impl BinaryChannelTest for DisabledClearPacketTest { sleep(Duration::from_secs(1)); - let amount_b = - amount2.transfer(&channel.port_b.as_ref(), &channel.channel_id_b.as_ref())?; + let amount_b = amount2.transfer( + &chains.node_b.chain_driver().value().chain_type, + &channel.port_b.as_ref(), + &channel.channel_id_b.as_ref(), + )?; // Wallet on chain A should have both amount deducted. chains.node_a.chain_driver().assert_eventual_wallet_amount( @@ -162,7 +165,7 @@ impl BinaryChannelTest for ClearPacketRecoveryTest { channel: ConnectedChannel, ) -> Result<(), Error> { let fee_denom_b: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1))); + MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); let denom_a = chains.node_a.denom(); let denom_b1 = chains.node_b.denom(); @@ -190,6 +193,7 @@ impl BinaryChannelTest for ClearPacketRecoveryTest { )?; let denom_b2 = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -233,7 +237,10 @@ 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_token(0))); + let fee_denom_a = MonoTagged::new(Denom::base( + &config.native_tokens[0], + &config.native_tokens[0], + )); let wallet_a = chains.node_a.wallets().user1().cloned(); let wallet_b = chains.node_b.wallets().user1().cloned(); @@ -254,6 +261,7 @@ impl BinaryChannelTest for ClearPacketNoScanTest { )?; let denom_b2 = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -334,7 +342,9 @@ impl TestOverrides for ClearPacketOverrideTest { for chain_config in config.chains.iter_mut() { match chain_config { // Use a small clear interval in the chain configurations to override the global high interval - ChainConfig::CosmosSdk(chain_config) => chain_config.clear_interval = Some(10), + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + chain_config.clear_interval = Some(10) + } } } } @@ -353,7 +363,10 @@ 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_token(0))); + let fee_denom_a = MonoTagged::new(Denom::base( + &config.native_tokens[0], + &config.native_tokens[0], + )); let wallet_a = chains.node_a.wallets().user1().cloned(); let wallet_b = chains.node_b.wallets().user1().cloned(); @@ -374,6 +387,7 @@ impl BinaryChannelTest for ClearPacketOverrideTest { )?; let denom_b2 = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -657,8 +671,11 @@ impl BinaryChannelTest for LimitedClearPacketTest { // 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())?; + let amount_b = cleared_amount.transfer( + &chains.node_b.chain_driver().value().chain_type, + &channel.port_b.as_ref(), + &channel.channel_id_b.as_ref(), + )?; info!("Assert that {sent_amount} was escrowed from sending chain"); diff --git a/tools/integration-test/src/tests/client_expiration.rs b/tools/integration-test/src/tests/client_expiration.rs index 082cacf70a..234bea6b1c 100644 --- a/tools/integration-test/src/tests/client_expiration.rs +++ b/tools/integration-test/src/tests/client_expiration.rs @@ -7,6 +7,7 @@ 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::chain::chain_type::ChainType; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::{ assert_eventually_channel_established, init_channel, query_channel_end, @@ -113,7 +114,7 @@ impl TestOverrides for ExpirationTestOverrides { for chain_config in config.chains.iter_mut() { match chain_config { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.trusting_period = Some(CLIENT_EXPIRY); } } @@ -212,8 +213,16 @@ impl BinaryChainTest for ChannelExpirationTest { }, // From simapp version v7.1.0 if `ConnOpenInit` is sent while the client // is expired, an error will be returned. - // See https://github.com/cosmos/ibc-go/blob/v7.1.0/modules/core/03-connection/keeper/handshake.go#L40 - Err(e) => assert!(e.to_string().contains("status is Expired: client state is not active")), + Err(e) => match chains.node_b.chain_driver().value().chain_type { + ChainType::Namada => { + // See https://github.com/cosmos/ibc-rs/blob/v0.53.0/ibc-core/ics02-client/types/src/error.rs#L22 + assert!(e.to_string().contains("client is not active. Status=`Expired`")) + } + _ => { + // See https://github.com/cosmos/ibc-go/blob/v7.1.0/modules/core/03-connection/keeper/handshake.go#L40 + assert!(e.to_string().contains("status is Expired: client state is not active")) + } + } } } @@ -313,6 +322,7 @@ impl BinaryChainTest for PacketExpirationTest { let denom_a = chains.node_a.denom(); let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/client_refresh.rs b/tools/integration-test/src/tests/client_refresh.rs index e29adbb821..32d5ce067e 100644 --- a/tools/integration-test/src/tests/client_refresh.rs +++ b/tools/integration-test/src/tests/client_refresh.rs @@ -19,6 +19,7 @@ fn test_client_fail_refresh() -> Result<(), Error> { run_binary_chain_test(&ClientFailsTest) } +#[allow(dead_code)] struct ClientFailsTest; struct ClientDefaultsTest; @@ -126,12 +127,24 @@ impl BinaryChainTest for ClientFailsTest { chains, |config| { { - let ChainConfig::CosmosSdk(config_chain_a) = &mut config.chains[0]; - config_chain_a.gas_multiplier = Some(GasMultiplier::unsafe_new(0.8)); + match &mut config.chains[0] { + ChainConfig::CosmosSdk(config_chain_a) => { + config_chain_a.gas_multiplier = Some(GasMultiplier::unsafe_new(0.8)); + } + ChainConfig::Namada(config_chain_a) => { + config_chain_a.gas_multiplier = Some(GasMultiplier::unsafe_new(0.8)); + } + } } - let ChainConfig::CosmosSdk(config_chain_b) = &mut config.chains[1]; - config_chain_b.gas_multiplier = Some(GasMultiplier::unsafe_new(0.8)); + match &mut config.chains[1] { + ChainConfig::CosmosSdk(config_chain_b) => { + config_chain_b.gas_multiplier = Some(GasMultiplier::unsafe_new(0.8)); + } + ChainConfig::Namada(config_chain_b) => { + config_chain_b.gas_multiplier = Some(GasMultiplier::unsafe_new(0.8)); + } + } }, config, )?; @@ -160,6 +173,7 @@ impl BinaryChainTest for ClientFailsTest { } } +#[allow(dead_code)] fn override_connected_chains( chains: ConnectedChains, config_modifier: impl FnOnce(&mut Config), @@ -202,6 +216,7 @@ where Ok(chains) } +#[allow(dead_code)] fn restore_foreign_client_pair( chain_a: &ChainA, chain_b: &ChainB, diff --git a/tools/integration-test/src/tests/client_settings.rs b/tools/integration-test/src/tests/client_settings.rs index 0a3c7656a4..ccaee68b41 100644 --- a/tools/integration-test/src/tests/client_settings.rs +++ b/tools/integration-test/src/tests/client_settings.rs @@ -26,7 +26,7 @@ struct ClientOptionsTest; impl TestOverrides for ClientDefaultsTest { fn modify_relayer_config(&self, config: &mut Config) { match &mut config.chains[0] { - ChainConfig::CosmosSdk(chain_config_a) => { + ChainConfig::CosmosSdk(chain_config_a) | ChainConfig::Namada(chain_config_a) => { chain_config_a.clock_drift = Duration::from_secs(3); chain_config_a.max_block_time = Duration::from_secs(5); chain_config_a.trusting_period = Some(Duration::from_secs(120_000)); @@ -35,7 +35,7 @@ impl TestOverrides for ClientDefaultsTest { } match &mut config.chains[1] { - ChainConfig::CosmosSdk(chain_config_b) => { + ChainConfig::CosmosSdk(chain_config_b) | ChainConfig::Namada(chain_config_b) => { chain_config_b.clock_drift = Duration::from_secs(6); chain_config_b.max_block_time = Duration::from_secs(15); chain_config_b.trusting_period = Some(Duration::from_secs(340_000)); diff --git a/tools/integration-test/src/tests/client_upgrade.rs b/tools/integration-test/src/tests/client_upgrade.rs index 9480a4a105..b420c481a5 100644 --- a/tools/integration-test/src/tests/client_upgrade.rs +++ b/tools/integration-test/src/tests/client_upgrade.rs @@ -21,7 +21,7 @@ use ibc_relayer::chain::requests::QueryHeight; use ibc_relayer::client_state::AnyClientState; use ibc_relayer::upgrade_chain::{build_and_send_ibc_upgrade_proposal, UpgradePlanOptions}; use ibc_relayer_types::core::ics02_client::height::Height; -use ibc_test_framework::chain::config::{ +use ibc_test_framework::chain::config::cosmos::{ set_max_deposit_period, set_min_deposit_amount, set_voting_period, }; use ibc_test_framework::chain::ext::bootstrap::ChainBootstrapMethodsExt; @@ -82,8 +82,10 @@ impl BinaryChainTest for ClientUpgradeTest { chains: ibc_test_framework::prelude::ConnectedChains, ) -> 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_token(0))); + let fee_denom_a: MonoTagged = MonoTagged::new(Denom::base( + &config.native_tokens[0], + &config.native_tokens[0], + )); let foreign_clients = chains.clone().foreign_clients; // Create and send an chain upgrade proposal @@ -241,8 +243,10 @@ impl BinaryChainTest for HeightTooHighClientUpgradeTest { chains: ibc_test_framework::prelude::ConnectedChains, ) -> 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_token(0))); + let fee_denom_a: MonoTagged = MonoTagged::new(Denom::base( + &config.native_tokens[0], + &config.native_tokens[0], + )); let foreign_clients = chains.clone().foreign_clients; // Create and send an chain upgrade proposal @@ -339,8 +343,10 @@ impl BinaryChainTest for HeightTooLowClientUpgradeTest { chains: ibc_test_framework::prelude::ConnectedChains, ) -> 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_token(0))); + let fee_denom_a: MonoTagged = MonoTagged::new(Denom::base( + &config.native_tokens[0], + &config.native_tokens[0], + )); let foreign_clients = chains.clone().foreign_clients; let opts = create_upgrade_plan(config, &chains, &upgraded_chain_id)?; @@ -432,8 +438,10 @@ fn create_upgrade_plan( chains: &ibc_test_framework::prelude::ConnectedChains, upgraded_chain_id: &ChainId, ) -> Result { - let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(0))); + let fee_denom_a: MonoTagged = MonoTagged::new(Denom::base( + &config.native_tokens[0], + &config.native_tokens[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/connection_delay.rs b/tools/integration-test/src/tests/connection_delay.rs index 0c8ca19e57..43f034f45e 100644 --- a/tools/integration-test/src/tests/connection_delay.rs +++ b/tools/integration-test/src/tests/connection_delay.rs @@ -58,6 +58,7 @@ impl BinaryChannelTest for ConnectionDelayTest { let time1 = OffsetDateTime::now_utc(); let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/consensus_states.rs b/tools/integration-test/src/tests/consensus_states.rs index bfd0891679..b94045d666 100644 --- a/tools/integration-test/src/tests/consensus_states.rs +++ b/tools/integration-test/src/tests/consensus_states.rs @@ -1,9 +1,13 @@ -use ibc_relayer::chain::{ - cosmos::query::consensus_state::query_consensus_states, - requests::{PageRequest, QueryConsensusStateHeightsRequest, QueryConsensusStatesRequest}, +use ibc_relayer::{ + chain::{ + cosmos::query::consensus_state::query_consensus_states, + requests::{PageRequest, QueryConsensusStateHeightsRequest, QueryConsensusStatesRequest}, + }, + config::ChainConfig, }; use ibc_test_framework::prelude::*; +use ibc_test_framework::util::namada; #[test] fn test_consensus_state_heights() -> Result<(), Error> { @@ -48,29 +52,42 @@ impl BinaryChainTest for ConsensusStateHeights { &CONSENSUS_STATES_COUNT, )?; - let grpc_address = chains - .node_b - .value() - .chain_driver - .grpc_address() - .as_str() - .parse() - .unwrap(); + let states = match chains.handle_b().config().expect("Config should exist") { + ChainConfig::Namada(config) => chains.node_b.value().chain_driver.runtime.block_on( + namada::query_consensus_states( + config + .rpc_addr + .to_string() + .parse() + .expect("RPC address should be converted"), + chains.client_id_b().value(), + ), + )?, + _ => { + let grpc_address = chains + .node_b + .value() + .chain_driver + .grpc_address() + .as_str() + .parse() + .unwrap(); - let states = - chains - .node_b - .value() - .chain_driver - .runtime - .block_on(query_consensus_states( - chains.node_b.chain_id().value(), - &grpc_address, - QueryConsensusStatesRequest { - client_id: (*chains.client_id_b().value()).clone(), - pagination: Some(PageRequest::all()), - }, - ))?; + chains + .node_b + .value() + .chain_driver + .runtime + .block_on(query_consensus_states( + chains.node_b.chain_id().value(), + &grpc_address, + QueryConsensusStatesRequest { + client_id: (*chains.client_id_b().value()).clone(), + pagination: Some(PageRequest::all()), + }, + ))? + } + }; assert_eq( "did not find the expected number of consensus states", diff --git a/tools/integration-test/src/tests/denom_trace.rs b/tools/integration-test/src/tests/denom_trace.rs index 3c56efbdcb..50dbbd4aa8 100644 --- a/tools/integration-test/src/tests/denom_trace.rs +++ b/tools/integration-test/src/tests/denom_trace.rs @@ -40,6 +40,7 @@ impl BinaryChannelTest for IbcDenomTraceTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -83,7 +84,8 @@ impl BinaryChannelTest for IbcDenomTraceTest { assert_eq( "Denom returned by denom_trace query should be the same as denom_a", &denom_trace.base_denom, - &denom_a.value().as_str().to_string(), + // check the raw address + &denom_a.value().hash_only(), )?; Ok(()) diff --git a/tools/integration-test/src/tests/dynamic_gas_fee.rs b/tools/integration-test/src/tests/dynamic_gas_fee.rs index 3e30ec468d..950e8b9617 100644 --- a/tools/integration-test/src/tests/dynamic_gas_fee.rs +++ b/tools/integration-test/src/tests/dynamic_gas_fee.rs @@ -52,6 +52,7 @@ impl TestOverrides for DynamicGasTest { 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); } + ChainConfig::Namada(_) => {} } match &mut config.chains[1] { @@ -61,6 +62,7 @@ impl TestOverrides for DynamicGasTest { chain_config_b.dynamic_gas_price = DynamicGasPrice::unsafe_new(self.dynamic_gas_enabled, 1.1, 0.6); } + ChainConfig::Namada(_) => {} } } @@ -84,15 +86,38 @@ impl BinaryChannelTest for DynamicGasTest { let a_to_b_amount = 12345u64; let denom_a_to_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, )?; + let gas_denom_str_a = match relayer + .config + .chains + .first() + .ok_or_else(|| eyre!("chain configuration is empty"))? + { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + chain_config.gas_price.denom.clone() + } + }; + + let gas_denom_str_b: String = match relayer + .config + .chains + .get(1) + .ok_or_else(|| eyre!("chain configuration is empty"))? + { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + chain_config.gas_price.denom.clone() + } + }; + let gas_denom_a: MonoTagged = - MonoTagged::new(Denom::Base("stake".to_owned())); + MonoTagged::new(Denom::base(&gas_denom_str_a, &gas_denom_str_a)); let gas_denom_b: MonoTagged = - MonoTagged::new(Denom::Base("stake".to_owned())); + MonoTagged::new(Denom::base(&gas_denom_str_b, &gas_denom_str_b)); let balance_relayer_b_before = chains.node_b.chain_driver().query_balance( &chains.node_b.wallets().relayer().address(), @@ -148,6 +173,7 @@ impl BinaryChannelTest for DynamicGasTest { let denom_b = chains.node_b.denom(); let denom_b_to_a = derive_ibc_denom( + &chains.node_a.chain_driver().value().chain_type, &channel.port_a.as_ref(), &channel.channel_id_a.as_ref(), &denom_b, diff --git a/tools/integration-test/src/tests/error_events.rs b/tools/integration-test/src/tests/error_events.rs index 24602d0122..af054aac26 100644 --- a/tools/integration-test/src/tests/error_events.rs +++ b/tools/integration-test/src/tests/error_events.rs @@ -1,5 +1,6 @@ use ibc_relayer::chain::tracking::TrackedMsgs; use ibc_relayer_types::events::IbcEvent; +use ibc_test_framework::chain::chain_type::ChainType; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::transfer::build_transfer_message; @@ -36,24 +37,36 @@ impl BinaryChannelTest for ErrorEventsTest { let balance_a_amount: u128 = balance_a.value().amount.0.as_u128(); - let transfer_message = build_transfer_message( - &channel.port_a.as_ref(), - &channel.channel_id_a.as_ref(), - &wallet_a.as_ref(), - &wallet_b.address(), - &denom_a.with_amount((balance_a_amount / 3) + 1).as_ref(), - Duration::from_secs(30), - None, - )?; + let mut transfer_messages = Vec::new(); + for i in 0..4 { + let transfer_message = build_transfer_message( + &channel.port_a.as_ref(), + &channel.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount((balance_a_amount / 3) + 1).as_ref(), + Duration::from_secs(30), + // Namada batch transaction can't have the exact same message + Some(i.to_string()), + )?; + transfer_messages.push(transfer_message); + } - let messages = TrackedMsgs::new_static(vec![transfer_message; 4], "test_error_events"); + let messages = TrackedMsgs::new_static(transfer_messages, "test_error_events"); let events = chains.handle_a().send_messages_and_wait_commit(messages)?; - // We expect 4 error events to be returned, corresponding to the - // 4 messages sent. - - assert_eq!(events.len(), 4); + if matches!( + chains.node_a.chain_driver().value().chain_type, + ChainType::Namada + ) { + // Requested the messages with a batched transaction + assert_eq!(events.len(), 1); + } else { + // We expect 4 error events to be returned, corresponding to the + // 4 messages sent. + assert_eq!(events.len(), 4); + } for event_with_height in events { match event_with_height.event { 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 ca120394a5..e5aad208ce 100644 --- a/tools/integration-test/src/tests/fee/auto_forward_relayer.rs +++ b/tools/integration-test/src/tests/fee/auto_forward_relayer.rs @@ -76,6 +76,7 @@ impl BinaryChannelTest for AutoForwardRelayerTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/fee/filter_fees.rs b/tools/integration-test/src/tests/fee/filter_fees.rs index 963e93e2d8..b257f66bfd 100644 --- a/tools/integration-test/src/tests/fee/filter_fees.rs +++ b/tools/integration-test/src/tests/fee/filter_fees.rs @@ -22,6 +22,8 @@ struct FilterIncentivizedFeesRelayerTest; impl TestOverrides for FilterIncentivizedFeesRelayerTest { fn modify_relayer_config(&self, config: &mut Config) { + config.mode.packets.clear_on_start = false; + config.mode.packets.clear_interval = 0; config.mode.packets.auto_register_counterparty_payee = true; let recv_fee = MinFee::new(50, Some("samoleans".to_owned())); let fees_filters = FeePolicy::new(vec![recv_fee]); @@ -30,7 +32,7 @@ impl TestOverrides for FilterIncentivizedFeesRelayerTest { let packet_filter = PacketFilter::new(ChannelPolicy::default(), min_fees); for chain_config in config.chains.iter_mut() { match chain_config { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.packet_filter = packet_filter.clone(); } } @@ -92,6 +94,7 @@ impl BinaryChannelTest for FilterIncentivizedFeesRelayerTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -141,6 +144,7 @@ impl BinaryChannelTest for FilterIncentivizedFeesRelayerTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -180,7 +184,7 @@ impl TestOverrides for FilterByChannelIncentivizedFeesRelayerTest { let packet_filter = PacketFilter::new(ChannelPolicy::default(), min_fees); for chain_config in config.chains.iter_mut() { match chain_config { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.packet_filter = packet_filter.clone(); } } @@ -227,6 +231,7 @@ impl BinaryChannelTest for FilterByChannelIncentivizedFeesRelayerTest { let balance_a2 = balance_a1.clone() - send_amount; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/fee/forward_relayer.rs b/tools/integration-test/src/tests/fee/forward_relayer.rs index daa5bcf317..ca91aef498 100644 --- a/tools/integration-test/src/tests/fee/forward_relayer.rs +++ b/tools/integration-test/src/tests/fee/forward_relayer.rs @@ -115,6 +115,7 @@ impl BinaryChannelTest for ForwardRelayerTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, 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 8b840640e8..13683f9cfe 100644 --- a/tools/integration-test/src/tests/fee/no_forward_relayer.rs +++ b/tools/integration-test/src/tests/fee/no_forward_relayer.rs @@ -93,6 +93,7 @@ impl BinaryChannelTest for NoForwardRelayerTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -179,6 +180,7 @@ impl BinaryChannelTest for InvalidForwardRelayerTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, 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 b7b026ae3a..e2c8c44c6a 100644 --- a/tools/integration-test/src/tests/fee/non_fee_channel.rs +++ b/tools/integration-test/src/tests/fee/non_fee_channel.rs @@ -93,6 +93,7 @@ impl BinaryChannelTest for NonFeeChannelTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, 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 dc8f5a816d..73f5ae7e55 100644 --- a/tools/integration-test/src/tests/fee/pay_fee_async.rs +++ b/tools/integration-test/src/tests/fee/pay_fee_async.rs @@ -254,6 +254,7 @@ impl BinaryChannelTest for PayPacketFeeAsyncTest { } let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/fee/register_payee.rs b/tools/integration-test/src/tests/fee/register_payee.rs index 638800c846..9ddab19fe0 100644 --- a/tools/integration-test/src/tests/fee/register_payee.rs +++ b/tools/integration-test/src/tests/fee/register_payee.rs @@ -130,6 +130,7 @@ impl BinaryChannelTest for ForwardRelayerTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/fee_grant.rs b/tools/integration-test/src/tests/fee_grant.rs index a936c02e20..2a0a8aa272 100644 --- a/tools/integration-test/src/tests/fee_grant.rs +++ b/tools/integration-test/src/tests/fee_grant.rs @@ -42,7 +42,10 @@ 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_token(0))); + let fee_denom_a = MonoTagged::new(Denom::base( + &config.native_tokens[0], + &config.native_tokens[0], + )); let a_to_b_amount = 12345u64; let granter = chains @@ -70,6 +73,7 @@ impl BinaryChannelTest for FeeGrantTest { thread::sleep(Duration::from_secs(5)); let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, @@ -81,10 +85,13 @@ impl BinaryChannelTest for FeeGrantTest { .first() .ok_or_else(|| eyre!("chain configuration is empty"))? { - ChainConfig::CosmosSdk(chain_config) => chain_config.gas_price.denom.clone(), + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + chain_config.gas_price.denom.clone() + } }; - let gas_denom: MonoTagged = MonoTagged::new(Denom::Base(gas_denom_str)); + let gas_denom: MonoTagged = + MonoTagged::new(Denom::base(&gas_denom_str, &gas_denom_str)); let balance_user1_before = chains .node_a @@ -104,7 +111,7 @@ impl BinaryChannelTest for FeeGrantTest { .for_each(|chain_config| { if chain_config.id() == chains.node_a.chain_id().0 { match chain_config { - ChainConfig::CosmosSdk(c) => { + ChainConfig::CosmosSdk(c) | ChainConfig::Namada(c) => { c.fee_granter = Some("user2".to_owned()); } } @@ -185,7 +192,10 @@ 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_token(0))); + let fee_denom_a = MonoTagged::new(Denom::base( + &config.native_tokens[0], + &config.native_tokens[0], + )); let a_to_b_amount = 12345u64; let granter = chains @@ -213,6 +223,7 @@ impl BinaryChannelTest for NoFeeGrantTest { thread::sleep(Duration::from_secs(5)); let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, @@ -224,10 +235,13 @@ impl BinaryChannelTest for NoFeeGrantTest { .first() .ok_or_else(|| eyre!("chain configuration is empty"))? { - ChainConfig::CosmosSdk(chain_config) => chain_config.gas_price.denom.clone(), + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + chain_config.gas_price.denom.clone() + } }; - let gas_denom: MonoTagged = MonoTagged::new(Denom::Base(gas_denom_str)); + let gas_denom: MonoTagged = + MonoTagged::new(Denom::base(&gas_denom_str, &gas_denom_str)); let balance_user1_before = chains .node_a 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 f42376c5b7..b86211233d 100644 --- a/tools/integration-test/src/tests/forward/forward_hop_transfer.rs +++ b/tools/integration-test/src/tests/forward/forward_hop_transfer.rs @@ -67,24 +67,28 @@ impl NaryChannelTest<4> for IbcForwardHopTransferTest { let denom_a = connected_chains.node_a.denom(); let denom_b = derive_ibc_denom( + &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_b = derive_ibc_denom( + &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_c = derive_ibc_denom( + &node_c.chain_driver().value().chain_type, &channel_b_to_c.port_b.as_ref(), &channel_b_to_c.channel_id_b.as_ref(), &denom_b.as_ref(), )?; let denom_a_to_d = derive_ibc_denom( + &node_d.chain_driver().value().chain_type, &channel_c_to_d.port_b.as_ref(), &channel_c_to_d.channel_id_b.as_ref(), &denom_a_to_c.as_ref(), @@ -188,24 +192,28 @@ impl NaryChannelTest<4> for AtomicIbcForwardHopTransferTest { let denom_a = connected_chains.node_a.denom(); let denom_b = derive_ibc_denom( + &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_b = derive_ibc_denom( + &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_c = derive_ibc_denom( + &node_c.chain_driver().value().chain_type, &channel_b_to_c.port_b.as_ref(), &channel_b_to_c.channel_id_b.as_ref(), &denom_b.as_ref(), )?; let denom_a_to_d = derive_ibc_denom( + &node_d.chain_driver().value().chain_type, &channel_c_to_d.port_b.as_ref(), &channel_c_to_d.channel_id_b.as_ref(), &denom_a_to_c.as_ref(), diff --git a/tools/integration-test/src/tests/forward/forward_transfer.rs b/tools/integration-test/src/tests/forward/forward_transfer.rs index a9569c8528..acef77d626 100644 --- a/tools/integration-test/src/tests/forward/forward_transfer.rs +++ b/tools/integration-test/src/tests/forward/forward_transfer.rs @@ -85,18 +85,21 @@ impl NaryChannelTest<3> for IbcForwardTransferTest { let denom_a = connected_chains.node_a.denom(); let denom_b = derive_ibc_denom( + &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_b = derive_ibc_denom( + &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_c = derive_ibc_denom( + &node_c.chain_driver().value().chain_type, &channel_b_to_c.port_b.as_ref(), &channel_b_to_c.channel_id_b.as_ref(), &denom_b.as_ref(), @@ -188,18 +191,21 @@ impl NaryChannelTest<3> for MisspelledMemoFieldsIbcForwardTransferTest { let denom_a = connected_chains.node_a.denom(); let denom_b = derive_ibc_denom( + &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_b = derive_ibc_denom( + &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_c = derive_ibc_denom( + &node_c.chain_driver().value().chain_type, &channel_b_to_c.port_b.as_ref(), &channel_b_to_c.channel_id_b.as_ref(), &denom_b.as_ref(), @@ -434,18 +440,21 @@ impl NaryChannelTest<3> for MisspelledMemoContentIbcForwardTransferTest { let denom_a = connected_chains.node_a.denom(); let denom_b = derive_ibc_denom( + &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_b = derive_ibc_denom( + &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_c = derive_ibc_denom( + &node_c.chain_driver().value().chain_type, &channel_b_to_c.port_b.as_ref(), &channel_b_to_c.channel_id_b.as_ref(), &denom_b.as_ref(), diff --git a/tools/integration-test/src/tests/ica.rs b/tools/integration-test/src/tests/ica.rs index 0fe90d43ad..a6fb40408f 100644 --- a/tools/integration-test/src/tests/ica.rs +++ b/tools/integration-test/src/tests/ica.rs @@ -17,7 +17,7 @@ use ibc_relayer_types::timestamp::Timestamp; use ibc_relayer_types::tx_msg::Msg; use ibc_test_framework::chain::{ - config::add_allow_message_interchainaccounts, + config::cosmos::add_allow_message_interchainaccounts, ext::ica::{register_ordered_interchain_account, register_unordered_interchain_account}, }; use ibc_test_framework::prelude::*; @@ -71,7 +71,7 @@ impl TestOverrides for IcaFilterTestAllow { for chain in &mut config.chains { match chain { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.packet_filter = self.packet_filter.clone(); } } @@ -95,7 +95,7 @@ impl BinaryConnectionTest for IcaFilterTestAllow { connection: ConnectedConnection, ) -> Result<(), Error> { let fee_denom_host: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1))); + MonoTagged::new(Denom::base(config.native_token(1), 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) = @@ -115,7 +115,7 @@ impl BinaryConnectionTest for IcaFilterTestAllow { .chain_driver() .query_interchain_account(&wallet.address(), &connection.connection_id_a.as_ref())?; - let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); chains.node_b.chain_driver().assert_eventual_wallet_amount( &ica_address.as_ref(), @@ -188,7 +188,7 @@ impl TestOverrides for IcaFilterTestDeny { for chain in &mut config.chains { match chain { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.packet_filter.channel_policy = ChannelPolicy::Deny(ChannelFilters::new(vec![( FilterPattern::Wildcard("ica*".parse().unwrap()), @@ -252,8 +252,8 @@ impl BinaryConnectionTest for ICACloseChannelTest { 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")); + MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); let (wallet, ica_address, controller_channel_id, controller_port_id) = relayer .with_supervisor(|| { // Register an interchain account on behalf of diff --git a/tools/integration-test/src/tests/ics20_filter/memo.rs b/tools/integration-test/src/tests/ics20_filter/memo.rs index 0ec207af37..ca696ec150 100644 --- a/tools/integration-test/src/tests/ics20_filter/memo.rs +++ b/tools/integration-test/src/tests/ics20_filter/memo.rs @@ -71,6 +71,7 @@ impl BinaryChannelTest for IbcMemoFilterTest { info!("Assert that the IBC transfer was filtered"); let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/ics31.rs b/tools/integration-test/src/tests/ics31.rs index 33065dc091..54e7408e78 100644 --- a/tools/integration-test/src/tests/ics31.rs +++ b/tools/integration-test/src/tests/ics31.rs @@ -13,7 +13,7 @@ use ibc_relayer::config::{self, ModeConfig}; use ibc_test_framework::chain::{ cli::host_zone::register_host_zone, - config::{ + config::cosmos::{ set_crisis_denom, set_mint_mint_denom, set_staking_bond_denom, set_staking_max_entries, set_voting_period, }, @@ -101,6 +101,7 @@ impl BinaryChannelTest for ICS31Test { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, 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 index 3d2f217554..e45d3dfd78 100644 --- a/tools/integration-test/src/tests/interchain_security/dynamic_gas_fee.rs +++ b/tools/integration-test/src/tests/interchain_security/dynamic_gas_fee.rs @@ -80,7 +80,7 @@ impl TestOverrides for DynamicGasTest { update_relayer_config_for_consumer_chain(config); match &mut config.chains[0] { - ChainConfig::CosmosSdk(chain_config_a) => { + ChainConfig::CosmosSdk(chain_config_a) | ChainConfig::Namada(chain_config_a) => { chain_config_a.gas_price = GasPrice::new(0.3, chain_config_a.gas_price.denom.clone()); @@ -89,7 +89,7 @@ impl TestOverrides for DynamicGasTest { } match &mut config.chains[1] { - ChainConfig::CosmosSdk(chain_config_b) => { + ChainConfig::CosmosSdk(chain_config_b) | ChainConfig::Namada(chain_config_b) => { chain_config_b.gas_price = GasPrice::new(0.3, chain_config_b.gas_price.denom.clone()); @@ -121,15 +121,14 @@ impl BinaryChannelTest for DynamicGasTest { let a_to_b_amount = 12345u64; let denom_a_to_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &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 gas_denom_a: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); + let gas_denom_b: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); let balance_relayer_b_before = chains.node_b.chain_driver().query_balance( &chains.node_b.wallets().relayer().address(), @@ -185,6 +184,7 @@ impl BinaryChannelTest for DynamicGasTest { let denom_b = chains.node_b.denom(); let denom_b_to_a = derive_ibc_denom( + &chains.node_a.chain_driver().value().chain_type, &channel.port_a.as_ref(), &channel.channel_id_a.as_ref(), &denom_b, 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 7498d724f2..651a96f404 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,7 +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::config::cosmos::add_allow_message_interchainaccounts; 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::*; @@ -72,7 +72,7 @@ impl BinaryChannelTest for IcaOrderedChannelTest { channel: ConnectedChannel, ) -> Result<(), Error> { let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(0))); + MonoTagged::new(Denom::base(config.native_token(0), config.native_token(0))); let connection_b_to_a = channel.connection.clone().flip(); let (wallet, channel_id, port_id) = register_ordered_interchain_account( &chains.node_b, @@ -104,7 +104,7 @@ impl BinaryChannelTest for IcaOrderedChannelTest { &channel.connection.connection_id_b.as_ref(), )?; - let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); chains.node_a.chain_driver().assert_eventual_wallet_amount( &ica_address.as_ref(), 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 ec12f6b591..dfedfc9951 100644 --- a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs +++ b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs @@ -11,7 +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::config::cosmos::add_allow_message_interchainaccounts; 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::*; @@ -55,7 +55,7 @@ impl BinaryChannelTest for InterchainSecurityIcaTransferTest { channel: ConnectedChannel, ) -> Result<(), Error> { let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(0))); + MonoTagged::new(Denom::base(config.native_token(0), config.native_token(0))); let connection_b_to_a = channel.connection.clone().flip(); let (wallet, channel_id, port_id) = register_unordered_interchain_account( &chains.node_b, @@ -77,7 +77,7 @@ impl BinaryChannelTest for InterchainSecurityIcaTransferTest { &channel.connection.connection_id_b.as_ref(), )?; - let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); chains.node_a.chain_driver().assert_eventual_wallet_amount( &ica_address.as_ref(), diff --git a/tools/integration-test/src/tests/interchain_security/icq.rs b/tools/integration-test/src/tests/interchain_security/icq.rs index 19f2a84efb..5e940b7055 100644 --- a/tools/integration-test/src/tests/interchain_security/icq.rs +++ b/tools/integration-test/src/tests/interchain_security/icq.rs @@ -11,7 +11,7 @@ use ibc_relayer::config::ChainConfig; use ibc_test_framework::chain::cli::host_zone::register_host_zone; -use ibc_test_framework::chain::config::{ +use ibc_test_framework::chain::config::cosmos::{ set_crisis_denom, set_mint_mint_denom, set_staking_bond_denom, set_staking_max_entries, set_voting_period, }; @@ -92,7 +92,7 @@ impl TestOverrides for InterchainSecurityIcqTest { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.allow_ccq = self.allow_ccq; } } @@ -130,6 +130,7 @@ impl BinaryChannelTest for InterchainSecurityIcqTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, 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 05317917ed..1d6afed1e5 100644 --- a/tools/integration-test/src/tests/interchain_security/simple_transfer.rs +++ b/tools/integration-test/src/tests/interchain_security/simple_transfer.rs @@ -69,6 +69,7 @@ impl BinaryChannelTest for InterchainSecurityTransferTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/manual/simulation.rs b/tools/integration-test/src/tests/manual/simulation.rs index 30c801bfcf..827f4ba969 100644 --- a/tools/integration-test/src/tests/manual/simulation.rs +++ b/tools/integration-test/src/tests/manual/simulation.rs @@ -29,7 +29,7 @@ impl TestOverrides for SimulationTest { fn modify_relayer_config(&self, config: &mut Config) { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.max_msg_num = MaxMsgNum::new(MAX_MSGS).unwrap(); } } diff --git a/tools/integration-test/src/tests/memo.rs b/tools/integration-test/src/tests/memo.rs index cf59bb712d..79483127ef 100644 --- a/tools/integration-test/src/tests/memo.rs +++ b/tools/integration-test/src/tests/memo.rs @@ -6,6 +6,7 @@ use ibc_relayer::config::types::Memo; use ibc_relayer::config::ChainConfig; +use ibc_test_framework::util::namada::query_receive_tx_memo; use serde_json as json; use ibc_test_framework::prelude::*; @@ -35,7 +36,7 @@ impl TestOverrides for MemoTest { fn modify_relayer_config(&self, config: &mut Config) { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.memo_prefix = self.memo.clone(); } } @@ -69,6 +70,7 @@ impl BinaryChannelTest for MemoTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -79,12 +81,7 @@ impl BinaryChannelTest for MemoTest { &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, self.memo.as_str())?; + assert_tx_memo_equals(&chains, &channel, self.memo.as_str())?; Ok(()) } @@ -98,7 +95,7 @@ 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) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.memo_prefix = self.memo.clone(); chain_config.memo_overwrite = Some(Memo::new(OVERWRITE_MEMO).unwrap()) } @@ -133,6 +130,7 @@ impl BinaryChannelTest for MemoOverwriteTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -143,18 +141,13 @@ impl BinaryChannelTest for MemoOverwriteTest { &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)?; + assert_tx_memo_equals(&chains, &channel, OVERWRITE_MEMO)?; Ok(()) } } -fn assert_tx_memo_equals(tx_info: &json::Value, expected_memo: &str) -> Result<(), Error> { +fn get_tx_memo(tx_info: &json::Value) -> Result { debug!("comparing memo field from json value {}", tx_info); let memo_field = &tx_info["txs"][0]["tx"]["body"]["memo"]; @@ -165,7 +158,44 @@ fn assert_tx_memo_equals(tx_info: &json::Value, expected_memo: &str) -> Result<( .as_str() .ok_or_else(|| eyre!("expect memo string field to be present in JSON"))?; - assert_eq!(memo_str, expected_memo); + Ok(memo_str.to_string()) +} + +fn assert_tx_memo_equals( + chains: &ConnectedChains, + channel: &ConnectedChannel, + expected_memo: &str, +) -> Result<(), Error> { + let memo = match chains.handle_b().config().expect("Config should exist") { + ChainConfig::Namada(config) => { + chains + .node_b + .chain_driver() + .value() + .runtime + .block_on(query_receive_tx_memo( + config + .rpc_addr + .to_string() + .parse() + .expect("RPC address should be converted"), + channel.port_a.value(), + channel.channel_id_a.value(), + channel.port_b.value(), + channel.channel_id_b.value(), + 1.into(), + ))? + } + _ => { + let tx_info = chains + .node_b + .chain_driver() + .query_recipient_transactions(&chains.node_b.wallets().user1().address())?; + + get_tx_memo(&tx_info)? + } + }; + assert_eq!(memo, expected_memo); Ok(()) } diff --git a/tools/integration-test/src/tests/mod.rs b/tools/integration-test/src/tests/mod.rs index e8812377d6..d5e6411d8f 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(feature = "celestia"))] +#[cfg(not(any(feature = "celestia", feature = "namada")))] pub mod client_upgrade; pub mod connection_delay; pub mod consensus_states; @@ -21,13 +21,12 @@ pub mod execute_schedule; pub mod handshake_on_start; pub mod ics20_filter; pub mod memo; +#[cfg(not(feature = "namada"))] 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"))] +#[cfg(not(any(feature = "celestia")))] pub mod ternary_transfer; pub mod transfer; diff --git a/tools/integration-test/src/tests/ordered_channel.rs b/tools/integration-test/src/tests/ordered_channel.rs index a72126d3f2..1d9b3b99da 100644 --- a/tools/integration-test/src/tests/ordered_channel.rs +++ b/tools/integration-test/src/tests/ordered_channel.rs @@ -94,6 +94,7 @@ impl BinaryChannelTest for OrderedChannelTest { sleep(Duration::from_secs(1)); let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/ordered_channel_clear.rs b/tools/integration-test/src/tests/ordered_channel_clear.rs index ed6e124e64..f687196419 100644 --- a/tools/integration-test/src/tests/ordered_channel_clear.rs +++ b/tools/integration-test/src/tests/ordered_channel_clear.rs @@ -51,7 +51,7 @@ impl TestOverrides for OrderedChannelClearTest { { let chain_a = &mut config.chains[0]; match chain_a { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.sequential_batch_tx = self.sequential_batch_tx; } } @@ -59,7 +59,7 @@ impl TestOverrides for OrderedChannelClearTest { let chain_b = &mut config.chains[1]; match chain_b { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.sequential_batch_tx = self.sequential_batch_tx; } } @@ -157,6 +157,7 @@ impl BinaryChannelTest for OrderedChannelClearTest { sleep(Duration::from_secs(10)); let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -196,7 +197,7 @@ impl TestOverrides for OrderedChannelClearEqualCLITest { { let chain_a = &mut config.chains[0]; match chain_a { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.sequential_batch_tx = true; chain_config.max_msg_num = MaxMsgNum::new(3).unwrap(); } @@ -205,7 +206,7 @@ impl TestOverrides for OrderedChannelClearEqualCLITest { let chain_b = &mut config.chains[1]; match chain_b { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.sequential_batch_tx = true; chain_config.max_msg_num = MaxMsgNum::new(3).unwrap(); } diff --git a/tools/integration-test/src/tests/python.rs b/tools/integration-test/src/tests/python.rs index 29d6457885..96c77e8ba1 100644 --- a/tools/integration-test/src/tests/python.rs +++ b/tools/integration-test/src/tests/python.rs @@ -10,7 +10,7 @@ impl TestOverrides for PythonTest { fn modify_relayer_config(&self, config: &mut Config) { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { // Modify the key store type to `Store::Test` so that the wallet // keys are stored to ~/.hermes/keys so that we can use them // with external relayer commands. diff --git a/tools/integration-test/src/tests/sequence_filter.rs b/tools/integration-test/src/tests/sequence_filter.rs index a880f7720e..52e80d8f5a 100644 --- a/tools/integration-test/src/tests/sequence_filter.rs +++ b/tools/integration-test/src/tests/sequence_filter.rs @@ -52,7 +52,7 @@ impl TestOverrides for FilterClearOnStartTest { excluded_sequences.insert(ChannelId::new(2), vec![2.into()]); let chain_a = &mut config.chains[0]; match chain_a { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.excluded_sequences = ExcludedSequences::new(excluded_sequences); } } @@ -89,7 +89,7 @@ impl TestOverrides for FilterClearIntervalTest { excluded_sequences.insert(ChannelId::new(2), vec![2.into()]); let chain_a = &mut config.chains[0]; match chain_a { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.excluded_sequences = ExcludedSequences::new(excluded_sequences); } } @@ -248,7 +248,7 @@ impl TestOverrides for StandardRelayingNoFilterTest { excluded_sequences.insert(ChannelId::new(2), vec![2.into()]); let chain_a = &mut config.chains[0]; match chain_a { - ChainConfig::CosmosSdk(chain_config) => { + ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { chain_config.excluded_sequences = ExcludedSequences::new(excluded_sequences); } } diff --git a/tools/integration-test/src/tests/supervisor.rs b/tools/integration-test/src/tests/supervisor.rs index 17ee1b5af7..5ff051962c 100644 --- a/tools/integration-test/src/tests/supervisor.rs +++ b/tools/integration-test/src/tests/supervisor.rs @@ -56,9 +56,9 @@ impl BinaryChainTest for SupervisorTest { chains: ConnectedChains, ) -> Result<(), Error> { let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(0))); + MonoTagged::new(Denom::base(config.native_token(0), config.native_token(0))); let fee_denom_b: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1))); + MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); let (connection_id_b, _) = init_connection( &chains.handle_a, &chains.handle_b, @@ -95,7 +95,12 @@ impl BinaryChainTest for SupervisorTest { let denom_a = chains.node_a.denom(); - let denom_b = derive_ibc_denom(&port_b.as_ref(), &channel_id_b.as_ref(), &denom_a)?; + let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, + &port_b.as_ref(), + &channel_id_b.as_ref(), + &denom_a, + )?; // Use the same wallet as the relayer to perform token transfer. // This will cause an account sequence mismatch error. @@ -199,9 +204,13 @@ 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_token(0))); + let fee_denom_a = MonoTagged::new(Denom::base( + &config.native_tokens[0], + &config.native_tokens[0], + )); let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/tendermint/sequential.rs b/tools/integration-test/src/tests/tendermint/sequential.rs index be9d254873..6bd106dc53 100644 --- a/tools/integration-test/src/tests/tendermint/sequential.rs +++ b/tools/integration-test/src/tests/tendermint/sequential.rs @@ -3,6 +3,7 @@ use std::time::Instant; use ibc_relayer::chain::tracking::TrackedMsgs; use ibc_relayer::config::types::max_msg_num::MaxMsgNum; use ibc_relayer::config::ChainConfig; +use ibc_test_framework::chain::chain_type::ChainType; use ibc_test_framework::chain::config; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::transfer::build_transfer_message; @@ -22,11 +23,20 @@ pub struct SequentialCommitTest; impl TestOverrides for SequentialCommitTest { fn modify_node_config(&self, config: &mut toml::Value) -> Result<(), Error> { - config::set_timeout_commit(config, BLOCK_TIME)?; - config::set_timeout_propose(config, BLOCK_TIME)?; + let config = if let Some(config) = config.get_mut("ledger") { + // Namada + config + .get_mut("cometbft") + .ok_or_else(|| eyre!("expect cometbft section"))? + } else { + config + }; + + config::cosmos::set_timeout_commit(config, BLOCK_TIME)?; + config::cosmos::set_timeout_propose(config, BLOCK_TIME)?; // Enable priority mempool - config::set_mempool_version(config, "v1")?; + config::cosmos::set_mempool_version(config, "v1")?; Ok(()) } @@ -34,14 +44,14 @@ impl TestOverrides for SequentialCommitTest { fn modify_relayer_config(&self, config: &mut Config) { // Use sequential batching for chain A, and default parallel batching for chain B match &mut config.chains[0] { - ChainConfig::CosmosSdk(chain_config_a) => { + ChainConfig::CosmosSdk(chain_config_a) | ChainConfig::Namada(chain_config_a) => { chain_config_a.max_msg_num = MaxMsgNum::new(MESSAGES_PER_BATCH).unwrap(); chain_config_a.sequential_batch_tx = true; } }; match &mut config.chains[1] { - ChainConfig::CosmosSdk(chain_config_b) => { + ChainConfig::CosmosSdk(chain_config_b) | ChainConfig::Namada(chain_config_b) => { chain_config_b.max_msg_num = MaxMsgNum::new(MESSAGES_PER_BATCH).unwrap(); chain_config_b.sequential_batch_tx = false; } @@ -67,20 +77,22 @@ impl BinaryChannelTest for SequentialCommitTest { { let denom_a = chains.node_a.denom(); - let transfer_message = build_transfer_message( - &channel.port_a.as_ref(), - &channel.channel_id_a.as_ref(), - &wallet_a.as_ref(), - &wallet_b.address(), - &denom_a.with_amount(100u64).as_ref(), - Duration::from_secs(30), - None, - )?; - - let messages = TrackedMsgs::new_static( - vec![transfer_message; TOTAL_MESSAGES], - "test_error_events", - ); + let mut transfer_messages = Vec::new(); + for i in 0..TOTAL_MESSAGES { + let transfer_message = build_transfer_message( + &channel.port_a.as_ref(), + &channel.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(100u64).as_ref(), + Duration::from_secs(30), + // Namada batch transaction can't have the exact same message + Some(i.to_string()), + )?; + transfer_messages.push(transfer_message); + } + + let messages = TrackedMsgs::new_static(transfer_messages, "test_sequential_commit"); let start = Instant::now(); @@ -95,35 +107,49 @@ impl BinaryChannelTest for SequentialCommitTest { TOTAL_MESSAGES, duration ); - // Time taken for submitting sequential batches should be around number of transactions * block time - - assert!( - duration - > Duration::from_millis((BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) - 1000) - ); - assert!( - duration - < Duration::from_millis((BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) + 1000) - ); + let (min_duration, max_duration) = match chains.node_a.chain_driver().value().chain_type + { + ChainType::Namada => ( + Duration::from_millis((BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) - 1000), + Duration::from_millis( + (BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64 * 2) + 1000, + ), + ), + _ => { + // Time taken for submitting sequential batches should be around number of transactions * block time + ( + Duration::from_millis( + (BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) - 1000, + ), + Duration::from_millis( + (BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) + 1000, + ), + ) + } + }; + assert!(duration > min_duration); + assert!(duration < max_duration); } { let denom_b = chains.node_b.denom(); - let transfer_message = build_transfer_message( - &channel.port_b.as_ref(), - &channel.channel_id_b.as_ref(), - &wallet_b.as_ref(), - &wallet_a.address(), - &denom_b.with_amount(100u64).as_ref(), - Duration::from_secs(30), - None, - )?; - - let messages = TrackedMsgs::new_static( - vec![transfer_message; TOTAL_MESSAGES], - "test_error_events", - ); + let mut transfer_messages = Vec::new(); + for i in 0..TOTAL_MESSAGES { + let transfer_message = build_transfer_message( + &channel.port_b.as_ref(), + &channel.channel_id_b.as_ref(), + &wallet_b.as_ref(), + &wallet_a.address(), + &denom_b.with_amount(100u64).as_ref(), + Duration::from_secs(30), + // Namada batch transaction can't have the exact same message + Some(i.to_string()), + )?; + transfer_messages.push(transfer_message); + } + + let messages = TrackedMsgs::new_static(transfer_messages, "test_sequential_commit"); let start = Instant::now(); @@ -141,7 +167,14 @@ impl BinaryChannelTest for SequentialCommitTest { TOTAL_MESSAGES, duration ); - assert!(duration < Duration::from_millis(BLOCK_TIME_MILLIS * 2)); + let max_duration = match chains.node_b.chain_driver().value().chain_type { + ChainType::Namada => { + // Shorter than the sequential batches + Duration::from_millis(BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64 * 2) + } + _ => Duration::from_millis(BLOCK_TIME_MILLIS * 2), + }; + assert!(duration < max_duration); } Ok(()) diff --git a/tools/integration-test/src/tests/ternary_transfer.rs b/tools/integration-test/src/tests/ternary_transfer.rs index 527c085629..945c1e8417 100644 --- a/tools/integration-test/src/tests/ternary_transfer.rs +++ b/tools/integration-test/src/tests/ternary_transfer.rs @@ -66,6 +66,7 @@ impl NaryChannelTest<3> for TernaryIbcTransferTest { )?; let denom_a_to_b = derive_ibc_denom( + &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, @@ -97,6 +98,7 @@ impl NaryChannelTest<3> for TernaryIbcTransferTest { let channel_b_to_c = channels.channel_at::<1, 2>()?; let denom_a_to_c = derive_ibc_denom( + &node_c.chain_driver().value().chain_type, &channel_b_to_c.port_b.as_ref(), &channel_b_to_c.channel_id_b.as_ref(), &denom_a_to_b.as_ref(), @@ -134,6 +136,7 @@ impl NaryChannelTest<3> for TernaryIbcTransferTest { let channel_c_to_a = channels.channel_at::<2, 0>()?; let denom_a_to_c_to_a = derive_ibc_denom( + &node_a.chain_driver().value().chain_type, &channel_c_to_a.port_b.as_ref(), &channel_c_to_a.channel_id_b.as_ref(), &denom_a_to_c.as_ref(), diff --git a/tools/integration-test/src/tests/transfer.rs b/tools/integration-test/src/tests/transfer.rs index f117dc742f..3e2a4cf014 100644 --- a/tools/integration-test/src/tests/transfer.rs +++ b/tools/integration-test/src/tests/transfer.rs @@ -69,7 +69,7 @@ impl BinaryChannelTest for IbcTransferTest { chains.chain_id_a(), chains.chain_id_b(), a_to_b_amount, - denom_a + denom_a, ); chains.node_a.chain_driver().ibc_transfer_token( @@ -81,14 +81,15 @@ impl BinaryChannelTest for IbcTransferTest { )?; let denom_b = derive_ibc_denom( + &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, )?; info!( - "Waiting for user on chain B to receive IBC transferred amount of {}", - a_to_b_amount + "Waiting for user on chain B to receive IBC transferred amount of {} {}", + a_to_b_amount, denom_b, ); chains.node_a.chain_driver().assert_eventual_wallet_amount( @@ -115,10 +116,11 @@ impl BinaryChannelTest for IbcTransferTest { let b_to_a_amount = random_u128_range(500, a_to_b_amount); info!( - "Sending IBC transfer from chain {} to chain {} with amount of {}", + "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( @@ -129,6 +131,12 @@ impl BinaryChannelTest for IbcTransferTest { &denom_b.with_amount(b_to_a_amount).as_ref(), )?; + info!( + "Waiting for user on chain A to receive IBC transferred amount of {} {}", + b_to_a_amount, + balance_c.denom(), + ); + chains.node_b.chain_driver().assert_eventual_wallet_amount( &wallet_b.address(), &denom_b.with_amount(a_to_b_amount - b_to_a_amount).as_ref(), diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 50839dfd63..8c83399bf9 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -18,8 +18,14 @@ ibc-relayer-types = { workspace = true } ibc-relayer = { workspace = true } ibc-relayer-cli = { workspace = true } ibc-proto = { workspace = true, features = ["serde"] } +namada_sdk = { workspace = true } +tendermint = { workspace = true } tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } +# for Namada +namada-tendermint = { workspace = true } +namada-tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } + color-eyre = { workspace = true } crossbeam-channel = { workspace = true } eyre = { workspace = true } diff --git a/tools/test-framework/src/bootstrap/binary/chain.rs b/tools/test-framework/src/bootstrap/binary/chain.rs index 365c079e8c..750c56d794 100644 --- a/tools/test-framework/src/bootstrap/binary/chain.rs +++ b/tools/test-framework/src/bootstrap/binary/chain.rs @@ -67,6 +67,9 @@ pub fn bootstrap_chains_with_full_nodes( let registry = new_registry(config.clone()); + // Wait before spawning the chain handle + std::thread::sleep(Duration::from_secs(10)); + // Pass in unique closure expressions `||{}` as the first argument so that // the returned chains are considered different types by Rust. // See [`spawn_chain_handle`] for more details. @@ -211,7 +214,7 @@ pub fn add_key_to_chain_handle( chain: &Chain, wallet: &Wallet, ) -> Result<(), Error> { - let res = chain.add_key(wallet.id.0.clone(), wallet.key.clone().into()); + let res = chain.add_key(wallet.id.0.clone(), wallet.key.clone()); // Ignore error if chain handle already have the given key match res { diff --git a/tools/test-framework/src/bootstrap/consumer.rs b/tools/test-framework/src/bootstrap/consumer.rs index c473ab6c28..e5acabc87a 100644 --- a/tools/test-framework/src/bootstrap/consumer.rs +++ b/tools/test-framework/src/bootstrap/consumer.rs @@ -5,6 +5,7 @@ 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; @@ -25,9 +26,9 @@ pub fn bootstrap_consumer_node( provider_chain_driver: &ChainDriver, provider_fee: &String, ) -> Result { - let stake_denom = Denom::base("stake"); + let stake_denom = Denom::base("stake", "stake"); - let denom = Denom::base("samoleans"); + let denom = Denom::base("samoleans", "samoleans"); let initial_amount = random_u128_range(1_000_000_000_000_000_000, 2_000_000_000_000_000_000); @@ -85,34 +86,34 @@ pub fn bootstrap_consumer_node( } ]); chain_driver.update_genesis_file("genesis.json", |genesis| { - 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")?; + config::cosmos::set_soft_opt_out_threshold(genesis, "0.05")?; + config::cosmos::consensus_params_max_gas(genesis, "3000000")?; + config::cosmos::globalfee_minimum_gas_prices(genesis, globalfee_minimum_gas)?; + config::cosmos::set_retry_delay_period(genesis, "100s")?; Ok(()) })?; let log_level = std::env::var("CHAIN_LOG_LEVEL").unwrap_or_else(|_| "info".to_string()); - chain_driver.update_chain_config("config.toml", |config| { - config::set_log_level(config, &log_level)?; - config::set_rpc_port(config, chain_driver.rpc_port)?; - config::set_p2p_port(config, chain_driver.p2p_port)?; - config::set_pprof_port(config, chain_driver.pprof_port)?; - config::set_timeout_commit(config, Duration::from_secs(1))?; - config::set_timeout_propose(config, Duration::from_secs(1))?; - config::set_mode(config, "validator")?; + chain_driver.update_chain_config("config/config.toml", |config| { + config::cosmos::set_log_level(config, &log_level)?; + config::cosmos::set_rpc_port(config, chain_driver.rpc_port)?; + config::cosmos::set_p2p_port(config, chain_driver.p2p_port)?; + config::cosmos::set_pprof_port(config, chain_driver.pprof_port)?; + config::cosmos::set_timeout_commit(config, Duration::from_secs(1))?; + config::cosmos::set_timeout_propose(config, Duration::from_secs(1))?; + config::cosmos::set_mode(config, "validator")?; config_modifier(config)?; Ok(()) })?; - chain_driver.update_chain_config("app.toml", |config| { - config::set_grpc_port(config, chain_driver.grpc_port)?; - config::disable_grpc_web(config)?; - config::disable_api(config)?; - config::set_minimum_gas_price(config, "0stake")?; + chain_driver.update_chain_config("config/app.toml", |config| { + config::cosmos::set_grpc_port(config, chain_driver.grpc_port)?; + config::cosmos::disable_grpc_web(config)?; + config::cosmos::disable_api(config)?; + config::cosmos::set_minimum_gas_price(config, "0stake")?; Ok(()) })?; diff --git a/tools/test-framework/src/bootstrap/mod.rs b/tools/test-framework/src/bootstrap/mod.rs index 17216d9455..b31132f5b6 100644 --- a/tools/test-framework/src/bootstrap/mod.rs +++ b/tools/test-framework/src/bootstrap/mod.rs @@ -14,5 +14,6 @@ pub mod binary; pub mod consumer; pub mod init; +pub mod namada; pub mod nary; pub mod single; diff --git a/tools/test-framework/src/bootstrap/namada.rs b/tools/test-framework/src/bootstrap/namada.rs new file mode 100644 index 0000000000..608a35f6ce --- /dev/null +++ b/tools/test-framework/src/bootstrap/namada.rs @@ -0,0 +1,328 @@ +/*! + Helper functions for bootstrapping a single full node. +*/ +use core::time::Duration; +use eyre::eyre; +use std::env; +use std::path::PathBuf; +use std::sync::{Arc, RwLock}; +use toml; + +use ibc_relayer::chain::namada::wallet::CliWalletUtils; +use ibc_relayer::keyring::{KeyRing, NamadaKeyPair, Store}; +use ibc_relayer_types::core::ics24_host::identifier::ChainId; + +use crate::chain::builder::ChainBuilder; +use crate::chain::config; +use crate::chain::exec::{simple_exec, simple_exec_with_envs}; +use crate::chain::ext::bootstrap::ChainBootstrapMethodsExt; +use crate::error::Error; +use crate::ibc::denom::Denom; +use crate::prelude::{TestWallets, Wallet}; +use crate::types::single::node::FullNode; +use crate::util::namada::get_namada_denom_address; + +use std::fs; +use std::process::{Command, Stdio}; +use std::str; +use std::thread::sleep; + +use crate::types::process::ChildProcess; +use crate::util::file::pipe_to_file; + +/** + Bootstrap a single Namada full node with the provided [`ChainBuilder`] and + a prefix for the chain ID. + + The bootstrap function follows the commands and configurations done in the + the setup-namada-single-node script found in the scripts/ directory. +*/ +pub fn bootstrap_namada_node( + builder: &ChainBuilder, + prefix: &str, + use_random_id: bool, + config_modifier: impl FnOnce(&mut toml::Value) -> Result<(), Error>, + _genesis_modifier: impl FnOnce(&mut serde_json::Value) -> Result<(), Error>, + parameters_modifier: impl FnOnce(&mut toml::Value) -> Result<(), Error>, + chain_number: usize, +) -> Result { + let namada_repo_path = env::var("NAMADA_REPO_PATH") + .map_err(|_| Error::generic(eyre!("missing environment variable `NAMADA_REPO_PATH")))?; + let chain_driver = builder.new_chain(prefix, use_random_id, chain_number)?; + let home_path = &chain_driver.home_path; + let templates_path = &format!("{home_path}/templates"); + fs::create_dir_all(templates_path)?; + + // Copy templates + let copy_loop = format!("for file in {namada_repo_path}/genesis/localnet/*.toml; do cp \"$file\" {templates_path}; done"); + simple_exec("namada", "sh", &["-c", ©_loop])?; + + chain_driver.update_chain_config("templates/parameters.toml", |parameters| { + config::namada::set_default_mint_limit(parameters, i64::MAX)?; + config::namada::set_epochs_per_year(parameters, 31536)?; + config::namada::set_default_per_epoch_throughput_limit(parameters, i64::MAX)?; + config::namada::set_pipeline_len(parameters, 2000)?; + + parameters_modifier(parameters)?; + + Ok(()) + })?; + + let pre_genesis_path = &format!("{home_path}/pre-genesis"); + fs::create_dir_all(pre_genesis_path)?; + + // Copy pre-genesis + let copy_loop = format!("for file in {namada_repo_path}/genesis/localnet/src/pre-genesis/*; do cp \"$file\" {pre_genesis_path}; done"); + simple_exec("namada", "sh", &["-c", ©_loop])?; + simple_exec( + "namada", + "cp", + &[ + "-r", + &format!("{namada_repo_path}/genesis/localnet/src/pre-genesis/validator-0"), + pre_genesis_path, + ], + )?; + + let genesis_path = &format!("{home_path}/genesis"); + fs::create_dir_all(genesis_path)?; + + let wasm_dir = &format!("{namada_repo_path}/wasm"); + let wasm_checksum = &format!("{wasm_dir}/checksums.json"); + + // Init network + let output = simple_exec_with_envs( + "namada", + "namadac", + &[ + "utils", + "init-network", + "--chain-prefix", + &chain_driver.chain_id.to_string(), + "--genesis-time", + "2023-01-01T00:00:00.000000000+00:00", + "--templates-path", + templates_path, + "--wasm-checksums-path", + wasm_checksum, + "--archive-dir", + genesis_path, + "--wasm-dir", + wasm_dir, + ], + &[("NAMADA_BASE_DIR", home_path)], + )?; + + let chain_id = extract_chain_id(output.stdout)?; + + let validator_base_dir = &format!("{home_path}/setup/validator-0"); + let pre_genesis_path = &format!("{home_path}/pre-genesis/validator-0"); + + // TODO: workaround a bug of specifying the wasm directory in Namada v0.43.0 + let cur_dir = std::env::current_dir()?; + std::env::set_current_dir(&namada_repo_path)?; + simple_exec_with_envs( + &chain_id, + "namadac", + &[ + "--base-dir", + validator_base_dir, + "utils", + "join-network", + "--chain-id", + &chain_id, + "--genesis-validator", + "validator-0", + "--pre-genesis-path", + pre_genesis_path, + ], + &[("NAMADA_NETWORK_CONFIGS_DIR", genesis_path)], + )?; + + let chain_dir = &format!("{home_path}/{chain_id}"); + simple_exec("namada", "rm", &["-rf", chain_dir])?; + + simple_exec_with_envs( + &chain_id, + "namadac", + &[ + "--base-dir", + home_path, + "utils", + "join-network", + "--chain-id", + &chain_id, + ], + &[("NAMADA_NETWORK_CONFIGS_DIR", genesis_path)], + )?; + std::env::set_current_dir(cur_dir)?; + + let config_path = format!("{home_path}/setup/validator-0/{chain_id}/config.toml"); + + chain_driver.update_chain_config(&config_path, |config| { + config::namada::set_rpc_port(config, chain_driver.rpc_port)?; + config::namada::set_p2p_port(config, chain_driver.p2p_port)?; + config::namada::set_proxy_app_port(config, chain_driver.pprof_port)?; + config::namada::set_block_cache_bytes(config, 268435456)?; + + config_modifier(config)?; + + Ok(()) + })?; + + let base_args = ["--base-dir", validator_base_dir, "ledger", "run"]; + + let args: Vec<&str> = base_args.to_vec(); + + let mut child = Command::new("namadan") + .args(&args) + .stdin(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + .spawn()?; + + let stdout = child + .stdout + .take() + .ok_or_else(|| eyre!("expected stdout to be present in child process"))?; + + let stderr = child + .stderr + .take() + .ok_or_else(|| eyre!("expected stderr to be present in child process"))?; + + let stderr_path = format!("{home_path}/stdout.log"); + let stdout_path = format!("{home_path}/stderr.log"); + + pipe_to_file(stdout, &stdout_path)?; + pipe_to_file(stderr, &stderr_path)?; + + // Wait for a while and check if the child process exited immediately. + // If so, return error since we expect the full node to be running in the background. + + sleep(Duration::from_millis(2000)); + + let status = child + .try_wait() + .map_err(|e| eyre!("error try waiting for child status: {}", e))?; + + let process = match status { + None => ChildProcess::new(child), + Some(status) => { + let stdout_output = fs::read_to_string(stdout_path)?; + let stderr_output = fs::read_to_string(stderr_path)?; + + return Err(eyre!( + "expected full node process to be running, but it exited immediately with exit status {} and output: {}\n{}", + status, + stdout_output, + stderr_output, + ).into()); + } + }; + + let ks_folder = Some(format!("{}/hermes_keyring", builder.base_store_dir).into()); + + let albert_key = add_namada_key(home_path, &chain_id, "albert-key", "albert", &ks_folder)?; + let bertha_key = add_namada_key(home_path, &chain_id, "bertha-key", "bertha", &ks_folder)?; + let christel_key = + add_namada_key(home_path, &chain_id, "christel-key", "christel", &ks_folder)?; + let daewon_key = add_namada_key(home_path, &chain_id, "daewon", "daewon", &ks_folder)?; + + let albert = Wallet::new_namada( + "albert".to_string(), + albert_key.address.to_string(), + albert_key, + ); + let bertha = Wallet::new_namada( + "bertha".to_string(), + bertha_key.address.to_string(), + bertha_key, + ); + let christel = Wallet::new_namada( + "christel".to_string(), + christel_key.address.to_string(), + christel_key, + ); + let daewon = Wallet::new_namada( + "daewon".to_string(), + daewon_key.address.to_string(), + daewon_key, + ); + + let wallets = TestWallets { + validator: albert, + relayer: bertha, + user1: christel, + user2: daewon, + }; + + sleep(Duration::from_secs(10)); + + let mut updated_chain_driver = chain_driver.clone(); + updated_chain_driver.chain_id = ChainId::from_string(&chain_id); + + let denom_str = get_namada_denom_address(&chain_id, home_path, "nam")?; + let denom = Denom::base("nam", &denom_str); + + let node = FullNode { + chain_driver: updated_chain_driver, + denom, + wallets, + process: Arc::new(RwLock::new(process)), + }; + + Ok(node) +} + +fn extract_chain_id(output: String) -> Result { + let words: Vec<&str> = output.split_whitespace().collect(); + + if let Some(derived_index) = words.iter().position(|&w| w == "Derived") { + if let Some(&chain_id) = words.get(derived_index + 3) { + return Ok(chain_id.to_owned()); + } + return Err(Error::generic(eyre!( + "chain id is not 3 words after `Derived`: {output}" + ))); + } + Err(Error::generic(eyre!( + "could not find `Derived` in output: {output}" + ))) +} + +fn add_namada_key( + home_path: &str, + chain_id: &str, + key_name: &str, + address_name: &str, + ks_folder: &Option, +) -> Result { + let chain_id = ChainId::from_string(chain_id); + let mut keyring = KeyRing::new_namada(Store::Test, &chain_id, ks_folder) + .map_err(|e| Error::generic(eyre!("error creating keyring: {e}")))?; + + let key_file: PathBuf = format!("{home_path}/{chain_id}").into(); + + let mut wallet = CliWalletUtils::new(key_file.to_path_buf()); + wallet + .load() + .map_err(|e| eyre!("error loading Namada wallet: {e}"))?; + + let secret_key = wallet + .find_secret_key(key_name, None) + .map_err(|e| eyre!("error loading the key from Namada wallet: {e}"))?; + let address = wallet + .find_address(address_name) + .ok_or_else(|| eyre!("error loading the address from Namada wallet"))?; + let namada_key = NamadaKeyPair { + alias: address_name.to_string(), + address: address.into_owned(), + secret_key: secret_key.clone(), + }; + keyring + .add_key(address_name, namada_key.clone()) + .map_err(|e| Error::generic(eyre!("error adding Namada key: {e}")))?; + + Ok(namada_key) +} diff --git a/tools/test-framework/src/bootstrap/single.rs b/tools/test-framework/src/bootstrap/single.rs index df87589b35..62764be9be 100644 --- a/tools/test-framework/src/bootstrap/single.rs +++ b/tools/test-framework/src/bootstrap/single.rs @@ -46,12 +46,13 @@ pub fn bootstrap_single_node( ) -> Result { let native_token_number = chain_number % builder.native_tokens.len(); let native_token = &builder.native_tokens[native_token_number]; - let native_denom = Denom::base(native_token); + let native_denom = Denom::base(native_token, native_token); let denom = if use_random_id { - Denom::base(&format!("coin{:x}", random_u32())) + let random_coin = format!("coin{:x}", random_u32()); + Denom::base(&random_coin, &random_coin) } else { - Denom::base("samoleans") + Denom::base("samoleans", "samoleans") }; // Evmos requires of at least 1_000_000_000_000_000_000 or else there will be the @@ -95,16 +96,16 @@ pub fn bootstrap_single_node( let log_level = std::env::var("CHAIN_LOG_LEVEL").unwrap_or_else(|_| "info".to_string()); - chain_driver.update_chain_config("config.toml", |config| { - config::set_log_level(config, &log_level)?; - config::set_rpc_port(config, chain_driver.rpc_port)?; - config::set_p2p_port(config, chain_driver.p2p_port)?; - config::set_pprof_port(config, chain_driver.pprof_port)?; - config::set_block_sync(config, true)?; - config::set_timeout_commit(config, Duration::from_secs(1))?; - config::set_timeout_propose(config, Duration::from_secs(1))?; - config::set_mode(config, "validator")?; - config::set_indexer(config, "kv")?; + chain_driver.update_chain_config("config/config.toml", |config| { + config::cosmos::set_log_level(config, &log_level)?; + config::cosmos::set_rpc_port(config, chain_driver.rpc_port)?; + config::cosmos::set_p2p_port(config, chain_driver.p2p_port)?; + config::cosmos::set_pprof_port(config, chain_driver.pprof_port)?; + config::cosmos::set_block_sync(config, true)?; + config::cosmos::set_timeout_commit(config, Duration::from_secs(1))?; + config::cosmos::set_timeout_propose(config, Duration::from_secs(1))?; + config::cosmos::set_mode(config, "validator")?; + config::cosmos::set_indexer(config, "kv")?; config_modifier(config)?; @@ -112,16 +113,16 @@ pub fn bootstrap_single_node( })?; let minimum_gas = format!("0{}", native_token); - chain_driver.update_chain_config("app.toml", |config| { + chain_driver.update_chain_config("config/app.toml", |config| { if builder.ipv6_grpc { - config::set_grpc_port_ipv6(config, chain_driver.grpc_port)?; + config::cosmos::set_grpc_port_ipv6(config, chain_driver.grpc_port)?; } else { - config::set_grpc_port(config, chain_driver.grpc_port)?; + config::cosmos::set_grpc_port(config, chain_driver.grpc_port)?; } - config::enable_grpc(config)?; - config::disable_grpc_web(config)?; - config::disable_api(config)?; - config::set_minimum_gas_price(config, &minimum_gas)?; + config::cosmos::enable_grpc(config)?; + config::cosmos::disable_grpc_web(config)?; + config::cosmos::disable_api(config)?; + config::cosmos::set_minimum_gas_price(config, &minimum_gas)?; Ok(()) })?; diff --git a/tools/test-framework/src/chain/chain_type.rs b/tools/test-framework/src/chain/chain_type.rs index 309a91b00e..84dfd7d2a1 100644 --- a/tools/test-framework/src/chain/chain_type.rs +++ b/tools/test-framework/src/chain/chain_type.rs @@ -8,6 +8,7 @@ use crate::util::random::{random_u32, random_unused_tcp_port}; const COSMOS_HD_PATH: &str = "m/44'/118'/0'/0/0"; const EVMOS_HD_PATH: &str = "m/44'/60'/0'/0/0"; const PROVENANCE_HD_PATH: &str = "m/44'/505'/0'/0/0"; +const NAMADA_HD_PATH: &str = "m/44'/877'/0'/0'/0'"; #[derive(Clone, Debug)] pub enum ChainType { @@ -16,6 +17,7 @@ pub enum ChainType { Evmos, Provenance, Injective, + Namada, } impl ChainType { @@ -24,6 +26,7 @@ impl ChainType { Self::Cosmos { dynamic_fee: _ } | Self::Osmosis => COSMOS_HD_PATH, Self::Evmos | Self::Injective => EVMOS_HD_PATH, Self::Provenance => PROVENANCE_HD_PATH, + Self::Namada => NAMADA_HD_PATH, } } @@ -46,6 +49,7 @@ impl ChainType { 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}")), + Self::Namada => ChainId::from_string(&format!("namada-{prefix}")), } } @@ -54,7 +58,8 @@ impl ChainType { let mut res = vec![]; let json_rpc_port = random_unused_tcp_port(); match self { - Self::Cosmos { dynamic_fee: _ } | Self::Injective | Self::Provenance => {} + Self::Cosmos { dynamic_fee: _ } | Self::Injective | Self::Provenance | Self::Namada => { + } Self::Osmosis => { res.push("--reject-config-defaults".to_owned()); } @@ -70,7 +75,11 @@ impl ChainType { pub fn extra_add_genesis_account_args(&self, chain_id: &ChainId) -> Vec { let mut res = vec![]; match self { - Self::Cosmos { dynamic_fee: _ } | Self::Osmosis | Self::Evmos | Self::Provenance => {} + Self::Cosmos { dynamic_fee: _ } + | Self::Osmosis + | Self::Evmos + | Self::Provenance + | Self::Namada => {} Self::Injective => { res.push("--chain-id".to_owned()); res.push(format!("{chain_id}")); @@ -81,7 +90,7 @@ impl ChainType { pub fn address_type(&self) -> AddressType { match self { - Self::Cosmos { dynamic_fee: _ } | Self::Osmosis | Self::Provenance => { + Self::Cosmos { dynamic_fee: _ } | Self::Osmosis | Self::Provenance | Self::Namada => { AddressType::default() } Self::Evmos => AddressType::Ethermint { @@ -110,6 +119,7 @@ impl FromStr for ChainType { name if name.contains("injectived") => Ok(ChainType::Injective), name if name.contains("provenanced") => Ok(ChainType::Provenance), name if name.contains("osmosisd") => Ok(ChainType::Osmosis), + name if name.contains("namada") => Ok(ChainType::Namada), _ => Ok(ChainType::Cosmos { dynamic_fee: false }), } } diff --git a/tools/test-framework/src/chain/cli/query.rs b/tools/test-framework/src/chain/cli/query.rs index 9c662a7161..d4cd140a24 100644 --- a/tools/test-framework/src/chain/cli/query.rs +++ b/tools/test-framework/src/chain/cli/query.rs @@ -8,6 +8,7 @@ use tracing::debug; use crate::chain::exec::simple_exec; use crate::error::{handle_generic_error, Error}; +use crate::prelude::*; pub fn query_balance( chain_id: &str, @@ -102,6 +103,58 @@ pub fn query_balance( } } +pub fn query_namada_balance( + chain_id: &str, + _command_path: &str, + home_path: &str, + denom: &Denom, + wallet_id: &str, + rpc_listen_address: &str, +) -> Result { + let output = simple_exec( + chain_id, + "namadac", + &[ + "--base-dir", + home_path, + "balance", + "--owner", + wallet_id, + "--token", + &denom.hash_only(), + "--node", + rpc_listen_address, + ], + )?; + + let words: Vec<&str> = output.stdout.split_whitespace().collect(); + let raw_addr = &format!("{}:", denom.hash_only()); + + if let Some(derived_index) = words.iter().position(|&w| w.contains(raw_addr)) { + if let Some(&amount_str) = words.get(derived_index + 1) { + return Amount::from_str(amount_str).map_err(handle_generic_error); + } + Err(Error::generic(eyre!( + "chain id is not 1 words after `{raw_addr}`: raw output `{}` split output `{words:#?}`", + output.stdout + ))) + } else { + let denom_display_name = &format!("{}:", denom.namada_display_name()); + if let Some(derived_index) = words.iter().position(|&w| w.contains(denom_display_name)) { + if let Some(&amount_str) = words.get(derived_index + 1) { + return Amount::from_str(amount_str).map_err(handle_generic_error); + } + Err(Error::generic(eyre!( + "chain id is not 1 words after `{denom_display_name}`: raw output `{}` split output `{words:#?}`", + output.stdout + ))) + } else { + debug!("Denom `{denom_display_name}` not found when querying for balance, will return 0{denom}"); + Ok(Amount::from_str("0").map_err(handle_generic_error)?) + } + } +} + /** Query for the transactions related to a wallet on `Chain` receiving token transfer from others. diff --git a/tools/test-framework/src/chain/config.rs b/tools/test-framework/src/chain/config/cosmos.rs similarity index 100% rename from tools/test-framework/src/chain/config.rs rename to tools/test-framework/src/chain/config/cosmos.rs diff --git a/tools/test-framework/src/chain/config/mod.rs b/tools/test-framework/src/chain/config/mod.rs new file mode 100644 index 0000000000..5cffe3a80f --- /dev/null +++ b/tools/test-framework/src/chain/config/mod.rs @@ -0,0 +1,2 @@ +pub mod cosmos; +pub mod namada; diff --git a/tools/test-framework/src/chain/config/namada.rs b/tools/test-framework/src/chain/config/namada.rs new file mode 100644 index 0000000000..27f3bef64e --- /dev/null +++ b/tools/test-framework/src/chain/config/namada.rs @@ -0,0 +1,144 @@ +use eyre::{eyre, Report as Error}; +use toml::Value; + +/// Set the `rpc` field in the full node config. +pub fn set_rpc_port(config: &mut Value, port: u16) -> Result<(), Error> { + config + .get_mut("ledger") + .ok_or_else(|| eyre!("expect ledger section"))? + .get_mut("cometbft") + .ok_or_else(|| eyre!("expect cometbft section"))? + .get_mut("rpc") + .ok_or_else(|| eyre!("expect cometbft rpc"))? + .as_table_mut() + .ok_or_else(|| eyre!("expect object"))? + .insert( + "laddr".to_string(), + format!("tcp://0.0.0.0:{}", port).into(), + ); + + Ok(()) +} + +/// Set the `p2p` field in the full node config. +pub fn set_p2p_port(config: &mut Value, port: u16) -> Result<(), Error> { + config + .get_mut("ledger") + .ok_or_else(|| eyre!("expect ledger section"))? + .get_mut("cometbft") + .ok_or_else(|| eyre!("expect cometbft section"))? + .get_mut("p2p") + .ok_or_else(|| eyre!("expect cometbft p2p"))? + .as_table_mut() + .ok_or_else(|| eyre!("expect object"))? + .insert( + "laddr".to_string(), + format!("tcp://0.0.0.0:{}", port).into(), + ); + + Ok(()) +} + +/// Set the `proxy_app` field in the full node config. +pub fn set_proxy_app_port(config: &mut Value, port: u16) -> Result<(), Error> { + config + .get_mut("ledger") + .ok_or_else(|| eyre!("expect ledger section"))? + .get_mut("cometbft") + .ok_or_else(|| eyre!("expect cometbft section"))? + .as_table_mut() + .ok_or_else(|| eyre!("expect object"))? + .insert( + "proxy_app".to_string(), + format!("tcp://0.0.0.0:{}", port).into(), + ); + + Ok(()) +} + +/// Set the `block_cache_bytes` field in the full node config. +pub fn set_block_cache_bytes(config: &mut Value, block_cache_bytes: i64) -> Result<(), Error> { + config + .get_mut("ledger") + .ok_or_else(|| eyre!("expect ledger section"))? + .get_mut("shell") + .ok_or_else(|| eyre!("expect shell section"))? + .as_table_mut() + .ok_or_else(|| eyre!("expect object"))? + .insert( + "block_cache_bytes".to_string(), + Value::Integer(block_cache_bytes), + ); + + Ok(()) +} + +pub fn set_unbonding_len(parameters: &mut Value, unbonding_len: i64) -> Result<(), Error> { + parameters + .get_mut("pos_params") + .ok_or_else(|| eyre!("expect pos_params section"))? + .as_table_mut() + .ok_or_else(|| eyre!("expect object"))? + .insert("unbonding_len".to_string(), Value::Integer(unbonding_len)); + + Ok(()) +} + +pub fn set_pipeline_len(parameters: &mut Value, pipeline_len: i64) -> Result<(), Error> { + parameters + .get_mut("pos_params") + .ok_or_else(|| eyre!("expect pos_params section"))? + .as_table_mut() + .ok_or_else(|| eyre!("expect object"))? + .insert("pipeline_len".to_string(), Value::Integer(pipeline_len)); + + Ok(()) +} + +pub fn set_default_mint_limit( + parameters: &mut Value, + default_mint_limit: i64, +) -> Result<(), Error> { + parameters + .get_mut("ibc_params") + .ok_or_else(|| eyre!("expect ibc_params section"))? + .as_table_mut() + .ok_or_else(|| eyre!("expect object"))? + .insert( + "default_mint_limit".to_string(), + Value::String(default_mint_limit.to_string()), + ); + + Ok(()) +} + +pub fn set_default_per_epoch_throughput_limit( + parameters: &mut Value, + default_per_epoch_throughput_limit: i64, +) -> Result<(), Error> { + parameters + .get_mut("ibc_params") + .ok_or_else(|| eyre!("expect ibc_params section"))? + .as_table_mut() + .ok_or_else(|| eyre!("expect object"))? + .insert( + "default_per_epoch_throughput_limit".to_string(), + Value::String(default_per_epoch_throughput_limit.to_string()), + ); + + Ok(()) +} + +pub fn set_epochs_per_year(parameters: &mut Value, epochs_per_year: i64) -> Result<(), Error> { + parameters + .get_mut("parameters") + .ok_or_else(|| eyre!("expect parameters section"))? + .as_table_mut() + .ok_or_else(|| eyre!("expect object"))? + .insert( + "epochs_per_year".to_string(), + Value::Integer(epochs_per_year), + ); + + Ok(()) +} diff --git a/tools/test-framework/src/chain/driver.rs b/tools/test-framework/src/chain/driver.rs index bd4aba6543..a1348f5855 100644 --- a/tools/test-framework/src/chain/driver.rs +++ b/tools/test-framework/src/chain/driver.rs @@ -23,6 +23,8 @@ use crate::types::env::{EnvWriter, ExportEnv}; use crate::types::wallet::WalletAddress; use crate::util::retry::assert_eventually_succeed; +use super::cli::query::query_namada_balance; + /** Number of times (seconds) to try and query a wallet to reach the target amount, as used by [`assert_eventual_wallet_amount`]. @@ -188,7 +190,11 @@ impl ChainDriver { as it requires the `"tcp://"` scheme. */ pub fn rpc_listen_address(&self) -> String { - format!("tcp://localhost:{}", self.rpc_port) + if self.command_path == "namada" { + format!("http://localhost:{}", self.rpc_port) + } else { + format!("tcp://localhost:{}", self.rpc_port) + } } /** @@ -210,13 +216,23 @@ impl ChainDriver { Query for the balances for a given wallet address and denomination */ pub fn query_balance(&self, wallet_id: &WalletAddress, denom: &Denom) -> Result { - query_balance( - self.chain_id.as_str(), - &self.command_path, - &self.rpc_listen_address(), - &wallet_id.0, - &denom.to_string(), - ) + match self.chain_type { + ChainType::Namada => query_namada_balance( + self.chain_id.as_str(), + &self.command_path, + &self.home_path, + denom, + &wallet_id.0, + &self.rpc_listen_address(), + ), + _ => query_balance( + self.chain_id.as_str(), + &self.command_path, + &self.rpc_listen_address(), + &wallet_id.0, + &denom.to_string(), + ), + } } /** diff --git a/tools/test-framework/src/chain/exec.rs b/tools/test-framework/src/chain/exec.rs index c9b958de3f..1ca6134d8b 100644 --- a/tools/test-framework/src/chain/exec.rs +++ b/tools/test-framework/src/chain/exec.rs @@ -49,3 +49,54 @@ pub fn simple_exec(desc: &str, command_path: &str, args: &[&str]) -> Result Result { + debug!( + "Executing command for {}: {} {}", + desc, + command_path, + itertools::join(args, " ") + ); + + let mut cmd = Command::new(command_path); + + for (key, value) in envs { + cmd.env(key, value); + } + + let output = cmd + .args(args) + .output() + .map_err(handle_exec_error(command_path))?; + + if output.status.success() { + let stdout = str::from_utf8(&output.stdout) + .map_err(handle_generic_error)? + .to_string(); + + let stderr = str::from_utf8(&output.stderr) + .map_err(handle_generic_error)? + .to_string(); + + trace!( + "command executed successfully with stdout: {}, stderr: {}", + stdout, + stderr + ); + + Ok(ExecOutput { stdout, stderr }) + } else { + let message = str::from_utf8(&output.stderr).map_err(handle_generic_error)?; + + Err(Error::generic(eyre!( + "command exited with error status {:?} and message: {}", + output.status.code(), + message + ))) + } +} diff --git a/tools/test-framework/src/chain/ext/async_icq.rs b/tools/test-framework/src/chain/ext/async_icq.rs index 88dd7f7aa6..ec0a59fa56 100644 --- a/tools/test-framework/src/chain/ext/async_icq.rs +++ b/tools/test-framework/src/chain/ext/async_icq.rs @@ -10,7 +10,7 @@ pub trait AsyncIcqMethodsExt { fn async_icq(&self, channel_id: &ChannelId, query_json: &str, from: &str) -> Result<(), Error>; } -impl<'a, Chain: Send> AsyncIcqMethodsExt for MonoTagged { +impl AsyncIcqMethodsExt for MonoTagged { fn update_oracle(&self, relayer: &str, fees: &str, init_args: &str) -> Result<(), Error> { let driver = *self.value(); diff --git a/tools/test-framework/src/chain/ext/authz.rs b/tools/test-framework/src/chain/ext/authz.rs index e6a8ad09a7..a87cda86b2 100644 --- a/tools/test-framework/src/chain/ext/authz.rs +++ b/tools/test-framework/src/chain/ext/authz.rs @@ -36,7 +36,7 @@ pub trait AuthzMethodsExt { ) -> Result<(), Error>; } -impl<'a, Chain: Send> AuthzMethodsExt for MonoTagged { +impl AuthzMethodsExt for MonoTagged { fn authz_grant( &self, granter: &str, diff --git a/tools/test-framework/src/chain/ext/bootstrap.rs b/tools/test-framework/src/chain/ext/bootstrap.rs index 07103fcd05..60033b6752 100644 --- a/tools/test-framework/src/chain/ext/bootstrap.rs +++ b/tools/test-framework/src/chain/ext/bootstrap.rs @@ -182,9 +182,7 @@ impl ChainBootstrapMethodsExt for ChainDriver { file: &str, cont: impl FnOnce(&mut toml::Value) -> Result<(), Error>, ) -> Result<(), Error> { - let config_path = format!("config/{file}"); - - let config1 = self.read_file(&config_path)?; + let config1 = self.read_file(file)?; let mut config2 = toml::from_str(&config1).map_err(handle_generic_error)?; @@ -192,7 +190,7 @@ impl ChainBootstrapMethodsExt for ChainDriver { let config3 = toml::to_string_pretty(&config2).map_err(handle_generic_error)?; - self.write_file(&config_path, &config3)?; + self.write_file(file, &config3)?; Ok(()) } @@ -245,7 +243,11 @@ impl ChainBootstrapMethodsExt for ChainDriver { let key = Secp256k1KeyPair::from_seed_file(&seed_content, &hd_path) .map_err(handle_generic_error)?; - Ok(Wallet::new(wallet_id.to_string(), wallet_address, key)) + Ok(Wallet::new_secp256( + wallet_id.to_string(), + wallet_address, + key, + )) } fn add_genesis_account(&self, wallet: &WalletAddress, amounts: &[&Token]) -> Result<(), Error> { diff --git a/tools/test-framework/src/chain/ext/crosschainquery.rs b/tools/test-framework/src/chain/ext/crosschainquery.rs index dbdbaa9500..35ad76d116 100644 --- a/tools/test-framework/src/chain/ext/crosschainquery.rs +++ b/tools/test-framework/src/chain/ext/crosschainquery.rs @@ -22,7 +22,7 @@ pub trait CrossChainQueryMethodsExt { fn assert_processed_cross_chain_query(&self) -> Result<(), Error>; } -impl<'a, Chain: Send> CrossChainQueryMethodsExt for MonoTagged { +impl CrossChainQueryMethodsExt for MonoTagged { fn assert_pending_cross_chain_query(&self) -> Result<(), Error> { assert_eventually_succeed( "waiting for a cross chain query request", diff --git a/tools/test-framework/src/chain/ext/fee.rs b/tools/test-framework/src/chain/ext/fee.rs index b3783304fa..8dc8f81c41 100644 --- a/tools/test-framework/src/chain/ext/fee.rs +++ b/tools/test-framework/src/chain/ext/fee.rs @@ -69,7 +69,7 @@ pub trait ChainFeeMethodsExt { ) -> Result, Error>; } -impl<'a, Chain: Send> ChainFeeMethodsExt for MonoTagged { +impl ChainFeeMethodsExt for MonoTagged { fn ibc_token_transfer_with_fee( &self, port_id: &TaggedPortIdRef<'_, Chain, Counterparty>, diff --git a/tools/test-framework/src/chain/ext/fee_grant.rs b/tools/test-framework/src/chain/ext/fee_grant.rs index ca8dcb156e..e63de5a6fc 100644 --- a/tools/test-framework/src/chain/ext/fee_grant.rs +++ b/tools/test-framework/src/chain/ext/fee_grant.rs @@ -11,7 +11,7 @@ pub trait FeeGrantMethodsExt { ) -> Result<(), Error>; } -impl<'a, Chain: Send> FeeGrantMethodsExt for MonoTagged { +impl FeeGrantMethodsExt for MonoTagged { fn feegrant_grant( &self, granter: &str, diff --git a/tools/test-framework/src/chain/ext/ica.rs b/tools/test-framework/src/chain/ext/ica.rs index b97b3ad2d8..f335774d31 100644 --- a/tools/test-framework/src/chain/ext/ica.rs +++ b/tools/test-framework/src/chain/ext/ica.rs @@ -27,7 +27,7 @@ pub trait InterchainAccountMethodsExt { ) -> Result, Error>; } -impl<'a, Chain: Send> InterchainAccountMethodsExt for MonoTagged { +impl InterchainAccountMethodsExt for MonoTagged { fn register_interchain_account_cli( &self, from: &MonoTagged, @@ -88,24 +88,25 @@ pub fn register_unordered_interchain_account Result<(), Error>; } -impl<'a, Chain: Send> ChainProposalMethodsExt for MonoTagged { +impl ChainProposalMethodsExt for MonoTagged { fn query_upgrade_proposal_height( &self, grpc_address: &Uri, diff --git a/tools/test-framework/src/chain/ext/transfer.rs b/tools/test-framework/src/chain/ext/transfer.rs index e1c50cd546..55c0f08661 100644 --- a/tools/test-framework/src/chain/ext/transfer.rs +++ b/tools/test-framework/src/chain/ext/transfer.rs @@ -1,15 +1,18 @@ use core::time::Duration; use ibc_relayer_types::core::ics02_client::height::Height; -use ibc_relayer_types::core::ics04_channel::packet::Packet; use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId}; +use crate::chain::chain_type::ChainType; use crate::chain::cli::transfer::{local_transfer_token, transfer_from_chain}; use crate::chain::driver::ChainDriver; use crate::chain::tagged::TaggedChainDriverExt; use crate::error::Error; use crate::ibc::token::TaggedTokenRef; -use crate::relayer::transfer::{batched_ibc_token_transfer, ibc_token_transfer}; +use crate::relayer::transfer::{ + batched_ibc_token_transfer, ibc_namada_token_transfer, ibc_token_transfer, + local_namada_token_transfer, +}; use crate::types::id::{TaggedChannelIdRef, TaggedPortIdRef}; use crate::types::tagged::*; use crate::types::wallet::{Wallet, WalletAddress}; @@ -42,7 +45,7 @@ pub trait ChainTransferMethodsExt { sender: &MonoTagged, recipient: &MonoTagged, token: &TaggedTokenRef, - ) -> Result; + ) -> Result<(), Error>; fn ibc_transfer_token_with_memo_and_timeout( &self, @@ -53,7 +56,7 @@ pub trait ChainTransferMethodsExt { token: &TaggedTokenRef, memo: Option, timeout: Option, - ) -> Result; + ) -> Result<(), Error>; fn ibc_transfer_token_multiple( &self, @@ -86,7 +89,7 @@ pub trait ChainTransferMethodsExt { ) -> Result<(), Error>; } -impl<'a, Chain: Send> ChainTransferMethodsExt for MonoTagged { +impl ChainTransferMethodsExt for MonoTagged { fn ibc_transfer_token( &self, port_id: &TaggedPortIdRef, @@ -94,19 +97,34 @@ impl<'a, Chain: Send> ChainTransferMethodsExt for MonoTagged, recipient: &MonoTagged, token: &TaggedTokenRef, - ) -> Result { - let rpc_client = self.rpc_client()?; - self.value().runtime.block_on(ibc_token_transfer( - rpc_client.as_ref(), - &self.tx_config(), - port_id, - channel_id, - sender, - recipient, - token, - None, - None, - )) + ) -> Result<(), Error> { + match self.value().chain_type { + crate::chain::chain_type::ChainType::Namada => ibc_namada_token_transfer( + &self.value().home_path, + &sender.value().id.to_string(), + recipient.value().as_str(), + token.value().denom.as_str(), + &token.value().amount.to_string(), + &channel_id.to_string(), + &self.value().rpc_port.to_string(), + None, + None, + ), + _ => { + let rpc_client = self.rpc_client()?; + self.value().runtime.block_on(ibc_token_transfer( + rpc_client.as_ref(), + &self.tx_config(), + port_id, + channel_id, + sender, + recipient, + token, + None, + None, + )) + } + } } fn ibc_transfer_token_with_memo_and_timeout( @@ -118,19 +136,39 @@ impl<'a, Chain: Send> ChainTransferMethodsExt for MonoTagged, memo: Option, timeout: Option, - ) -> Result { - let rpc_client = self.rpc_client()?; - self.value().runtime.block_on(ibc_token_transfer( - rpc_client.as_ref(), - &self.tx_config(), - port_id, - channel_id, - sender, - recipient, - token, - memo, - timeout, - )) + ) -> Result<(), Error> { + match self.value().chain_type { + ChainType::Namada => { + let denom = token.value().denom.to_string(); + let amount = token.value().amount.to_string(); + let rpc_port = self.value().rpc_port.to_string(); + ibc_namada_token_transfer( + &self.value().home_path, + &sender.value().id.to_string(), + recipient.value().as_str(), + &denom, + &amount, + channel_id.value().as_ref(), + &rpc_port, + memo, + timeout, + ) + } + _ => { + let rpc_client = self.rpc_client()?; + self.value().runtime.block_on(ibc_token_transfer( + rpc_client.as_ref(), + &self.tx_config(), + port_id, + channel_id, + sender, + recipient, + token, + memo, + timeout, + )) + } + } } fn ibc_transfer_token_multiple( @@ -143,18 +181,42 @@ impl<'a, Chain: Send> ChainTransferMethodsExt for MonoTagged, ) -> Result<(), Error> { - let rpc_client = self.rpc_client()?; - self.value().runtime.block_on(batched_ibc_token_transfer( - rpc_client.as_ref(), - &self.tx_config(), - port_id, - channel_id, - sender, - recipient, - token, - num_msgs, - memo, - )) + match self.value().chain_type { + ChainType::Namada => { + let denom = token.value().denom.to_string(); + let amount = token.value().amount.to_string(); + let rpc_port = self.value().rpc_port.to_string(); + // Namada CLI doesn't support batching transactions + for _ in 0..num_msgs { + ibc_namada_token_transfer( + &self.value().home_path, + &sender.value().id.to_string(), + recipient.value().as_str(), + &denom, + &amount, + &channel_id.to_string(), + &rpc_port, + memo.clone(), + None, + )?; + } + Ok(()) + } + _ => { + let rpc_client = self.rpc_client()?; + self.value().runtime.block_on(batched_ibc_token_transfer( + rpc_client.as_ref(), + &self.tx_config(), + port_id, + channel_id, + sender, + recipient, + token, + num_msgs, + memo, + )) + } + } } fn local_transfer_token( @@ -165,16 +227,31 @@ impl<'a, Chain: Send> ChainTransferMethodsExt for MonoTagged, ) -> Result<(), Error> { let driver = *self.value(); - local_transfer_token( - driver.chain_id.as_str(), - &driver.command_path, - &driver.home_path, - &driver.rpc_listen_address(), - sender.value().address.as_str(), - recipient.value().as_str(), - &token.value().to_string(), - &fees.value().to_string(), - ) + match driver.chain_type { + ChainType::Namada => { + let denom = token.value().denom.to_string(); + let amount = token.value().amount.to_string(); + let rpc_port = self.value().rpc_port.to_string(); + local_namada_token_transfer( + &driver.home_path, + &sender.value().id.to_string(), + recipient.value().as_str(), + &denom, + &amount, + &rpc_port, + ) + } + _ => local_transfer_token( + driver.chain_id.as_str(), + &driver.command_path, + &driver.home_path, + &driver.rpc_listen_address(), + sender.value().address.as_str(), + recipient.value().as_str(), + &token.value().to_string(), + &fees.value().to_string(), + ), + } } fn transfer_from_chain( @@ -188,19 +265,39 @@ impl<'a, Chain: Send> ChainTransferMethodsExt for MonoTagged Result<(), Error> { let driver = *self.value(); - let timeout_height_str = timeout_height.revision_height() + 100; - transfer_from_chain( - driver.chain_id.as_str(), - &driver.command_path, - &driver.home_path, - &driver.rpc_listen_address(), - sender.value().address.as_str(), - port.as_ref(), - channel.as_ref(), - recipient.value().as_str(), - &token.value().to_string(), - &fees.value().to_string(), - &timeout_height_str.to_string(), - ) + match driver.chain_type { + ChainType::Namada => { + let denom = token.value().denom.to_string(); + let amount = token.value().amount.to_string(); + let rpc_port = self.value().rpc_port.to_string(); + ibc_namada_token_transfer( + &driver.home_path, + &sender.value().id.to_string(), + recipient.value().as_str(), + &denom, + &amount, + channel.as_ref(), + &rpc_port, + None, + None, + ) + } + _ => { + let timeout_height_str = timeout_height.revision_height() + 100; + transfer_from_chain( + driver.chain_id.as_str(), + &driver.command_path, + &driver.home_path, + &driver.rpc_listen_address(), + sender.value().address.as_str(), + port.as_ref(), + channel.as_ref(), + recipient.value().as_str(), + &token.value().to_string(), + &fees.value().to_string(), + &timeout_height_str.to_string(), + ) + } + } } } diff --git a/tools/test-framework/src/chain/ext/version.rs b/tools/test-framework/src/chain/ext/version.rs index be1d6582ff..3156ddacd9 100644 --- a/tools/test-framework/src/chain/ext/version.rs +++ b/tools/test-framework/src/chain/ext/version.rs @@ -7,7 +7,7 @@ pub trait ChainVersionMethodsExt { fn major_version(&self) -> Result; } -impl<'a, Chain: Send> ChainVersionMethodsExt for MonoTagged { +impl ChainVersionMethodsExt for MonoTagged { fn major_version(&self) -> Result { major_version(&self.value().command_path) } diff --git a/tools/test-framework/src/chain/ext/wasm_client.rs b/tools/test-framework/src/chain/ext/wasm_client.rs index cfcb657dd0..70cebfb430 100644 --- a/tools/test-framework/src/chain/ext/wasm_client.rs +++ b/tools/test-framework/src/chain/ext/wasm_client.rs @@ -27,7 +27,7 @@ pub trait StoreWasmClientCodeMethodsExt { ) -> Result; } -impl<'a, Chain: Send> StoreWasmClientCodeMethodsExt for MonoTagged { +impl StoreWasmClientCodeMethodsExt for MonoTagged { fn store_wasm_client_code( &self, wasm_path: &Path, diff --git a/tools/test-framework/src/chain/tagged.rs b/tools/test-framework/src/chain/tagged.rs index af7a73c06a..8f324bf922 100644 --- a/tools/test-framework/src/chain/tagged.rs +++ b/tools/test-framework/src/chain/tagged.rs @@ -1,6 +1,8 @@ /*! Methods for tagged version of the chain driver. */ +use eyre::eyre; +use serde_json as json; use ibc_proto::google::protobuf::Any; use ibc_relayer::chain::cosmos::tx::simple_send_tx; @@ -8,7 +10,6 @@ use ibc_relayer::chain::cosmos::types::config::TxConfig; use ibc_relayer::config::compat_mode::CompatMode; use ibc_relayer::event::IbcEventWithHeight; use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use serde_json as json; use tendermint_rpc::client::{Client, HttpClient}; use tendermint_rpc::Url; use tracing::warn; @@ -110,7 +111,7 @@ pub trait TaggedChainDriverExt { fn query_auth_module(&self, module_name: &str) -> Result; } -impl<'a, Chain: Send> TaggedChainDriverExt for MonoTagged { +impl TaggedChainDriverExt for MonoTagged { fn chain_id(&self) -> TaggedChainIdRef { self.map_ref(|val| &val.chain_id) } @@ -144,12 +145,18 @@ impl<'a, Chain: Send> TaggedChainDriverExt for MonoTagged Result, Error> { let rpc_client = self.rpc_client()?; + let key = &wallet + .value() + .key + .downcast() + .ok_or_else(|| eyre!("unable to downcast key")) + .map_err(Error::generic)?; self.value() .runtime .block_on(simple_send_tx( rpc_client.as_ref().into_value(), &self.value().tx_config, - &wallet.value().key, + key, messages, )) .map_err(Error::relayer) diff --git a/tools/test-framework/src/docs/walkthroughs/memo.rs b/tools/test-framework/src/docs/walkthroughs/memo.rs index 7c0887a76c..336bc5d874 100644 --- a/tools/test-framework/src/docs/walkthroughs/memo.rs +++ b/tools/test-framework/src/docs/walkthroughs/memo.rs @@ -10,8 +10,7 @@ //! //! ```no_run //! # use serde_json as json; -//! # use ibc_relayer::config::{types::Memo, Config}; -//! # use ibc_relayer::config::ChainConfig; +//! # use ibc_relayer::config::{types::Memo, 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}; @@ -32,9 +31,9 @@ //! fn modify_relayer_config(&self, config: &mut Config) { //! for mut chain in config.chains.iter_mut() { //! match chain { -//! ChainConfig::CosmosSdk(chain_config) => { +//! ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { //! chain_config.memo_prefix = self.memo.clone(); -//! }, +//! } //! } //! } //! } @@ -61,6 +60,7 @@ //! )?; //! //! let denom_b = derive_ibc_denom( +//! &chains.node_b.chain_driver().value().chain_type, //! &channel.port_b.as_ref(), //! &channel.channel_id_b.as_ref(), //! &denom_a, diff --git a/tools/test-framework/src/docs/walkthroughs/ordered_channel.rs b/tools/test-framework/src/docs/walkthroughs/ordered_channel.rs index 36c04807a6..6f717d436e 100644 --- a/tools/test-framework/src/docs/walkthroughs/ordered_channel.rs +++ b/tools/test-framework/src/docs/walkthroughs/ordered_channel.rs @@ -95,6 +95,7 @@ //! sleep(Duration::from_secs(1)); //! //! let denom_b = derive_ibc_denom( +//! &chains.node_b.chain_driver().value().chain_type, //! &channel.port_b.as_ref(), //! &channel.channel_id_b.as_ref(), //! &denom_a, diff --git a/tools/test-framework/src/framework/base.rs b/tools/test-framework/src/framework/base.rs index 0ba59ea9fb..e7e0415b5d 100644 --- a/tools/test-framework/src/framework/base.rs +++ b/tools/test-framework/src/framework/base.rs @@ -84,7 +84,7 @@ pub struct RunBasicTest<'a, Test> { pub test: &'a Test, } -impl<'a, Test, Overrides> PrimitiveTest for RunBasicTest<'a, Test> +impl PrimitiveTest for RunBasicTest<'_, Test> where Test: BasicTest, Test: HasOverrides, diff --git a/tools/test-framework/src/framework/binary/chain.rs b/tools/test-framework/src/framework/binary/chain.rs index 47eed73001..2c753f2c5a 100644 --- a/tools/test-framework/src/framework/binary/chain.rs +++ b/tools/test-framework/src/framework/binary/chain.rs @@ -13,8 +13,8 @@ use crate::error::Error; use crate::framework::base::{HasOverrides, TestConfigOverride}; use crate::framework::binary::ics::InterchainSecurityChainTest; use crate::framework::binary::node::{ - run_binary_node_test, run_single_node_test, BinaryNodeTest, NodeConfigOverride, - NodeGenesisOverride, + run_binary_node_test, run_single_node_test, BinaryNodeTest, NamadaParametersOverride, + NodeConfigOverride, NodeGenesisOverride, }; use crate::framework::supervisor::{RunWithSupervisor, SupervisorOverride}; use crate::relayer::driver::RelayerDriver; @@ -39,7 +39,8 @@ where + RelayerConfigOverride + ClientOptionsOverride + SupervisorOverride - + TestConfigOverride, + + TestConfigOverride + + NamadaParametersOverride, { run_binary_chain_test(&RunTwoWayBinaryChainTest::new(test)) } @@ -56,7 +57,8 @@ where + RelayerConfigOverride + ClientOptionsOverride + SupervisorOverride - + TestConfigOverride, + + TestConfigOverride + + NamadaParametersOverride, { run_binary_node_test(&RunBinaryChainTest::new(&RunWithSupervisor::new(test))) } @@ -74,7 +76,8 @@ where + NodeGenesisOverride + RelayerConfigOverride + ClientOptionsOverride - + TestConfigOverride, + + TestConfigOverride + + NamadaParametersOverride, { run_single_node_test(&RunBinaryChainTest::new(test)) } @@ -201,7 +204,7 @@ where } } -impl<'a, Test, Overrides> BinaryNodeTest for RunBinaryChainTest<'a, Test> +impl BinaryNodeTest for RunBinaryChainTest<'_, Test> where Test: BinaryChainTest, Test: HasOverrides, @@ -240,7 +243,7 @@ where } } -impl<'a, Test, Overrides> InterchainSecurityChainTest for RunBinaryChainTest<'a, Test> +impl InterchainSecurityChainTest for RunBinaryChainTest<'_, Test> where Test: BinaryChainTest, Test: HasOverrides, @@ -279,7 +282,7 @@ where } } -impl<'a, Test: BinaryChainTest> BinaryChainTest for RunTwoWayBinaryChainTest<'a, Test> { +impl BinaryChainTest for RunTwoWayBinaryChainTest<'_, Test> { fn run( &self, config: &TestConfig, @@ -308,7 +311,7 @@ impl<'a, Test: BinaryChainTest> BinaryChainTest for RunTwoWayBinaryChainTest<'a, } } -impl<'a, Test, Overrides> BinaryChainTest for RunWithSupervisor<'a, Test> +impl BinaryChainTest for RunWithSupervisor<'_, Test> where Test: BinaryChainTest, Test: HasOverrides, @@ -332,7 +335,7 @@ where } } -impl<'a, Test, Overrides> HasOverrides for RunBinaryChainTest<'a, Test> +impl HasOverrides for RunBinaryChainTest<'_, Test> where Test: HasOverrides, { @@ -343,7 +346,7 @@ where } } -impl<'a, Test, Overrides> HasOverrides for RunTwoWayBinaryChainTest<'a, Test> +impl HasOverrides for RunTwoWayBinaryChainTest<'_, Test> where Test: HasOverrides, { diff --git a/tools/test-framework/src/framework/binary/channel.rs b/tools/test-framework/src/framework/binary/channel.rs index 00ae9efd89..3f3d964da2 100644 --- a/tools/test-framework/src/framework/binary/channel.rs +++ b/tools/test-framework/src/framework/binary/channel.rs @@ -24,7 +24,7 @@ use crate::framework::binary::connection::{ }; use crate::framework::binary::ics::run_binary_interchain_security_node_test; use crate::framework::binary::node::{ - run_binary_node_test, NodeConfigOverride, NodeGenesisOverride, + run_binary_node_test, NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, }; use crate::framework::supervisor::{RunWithSupervisor, SupervisorOverride}; use crate::relayer::driver::RelayerDriver; @@ -54,7 +54,8 @@ where + ConnectionDelayOverride + PortsOverride + ChannelOrderOverride - + ChannelVersionOverride, + + ChannelVersionOverride + + NamadaParametersOverride, { run_binary_channel_test(&RunTwoWayBinaryChannelTest::new(test)) } @@ -75,7 +76,8 @@ where + ConnectionDelayOverride + PortsOverride + ChannelOrderOverride - + ChannelVersionOverride, + + ChannelVersionOverride + + NamadaParametersOverride, { run_binary_node_test(&RunBinaryChainTest::new(&RunBinaryConnectionTest::new( &RunBinaryChannelTest::new(&RunWithSupervisor::new(test)), @@ -205,7 +207,7 @@ where } } -impl<'a, Test, Overrides> BinaryConnectionTest for RunBinaryChannelTest<'a, Test> +impl BinaryConnectionTest for RunBinaryChannelTest<'_, Test> where Test: BinaryChannelTest, Test: HasOverrides, @@ -249,7 +251,7 @@ where } } -impl<'a, Test: BinaryChannelTest> BinaryChannelTest for RunTwoWayBinaryChannelTest<'a, Test> { +impl BinaryChannelTest for RunTwoWayBinaryChannelTest<'_, Test> { fn run( &self, config: &TestConfig, @@ -285,7 +287,7 @@ impl<'a, Test: BinaryChannelTest> BinaryChannelTest for RunTwoWayBinaryChannelTe } } -impl<'a, Test, Overrides> BinaryChannelTest for RunWithSupervisor<'a, Test> +impl BinaryChannelTest for RunWithSupervisor<'_, Test> where Test: BinaryChannelTest, Test: HasOverrides, @@ -310,7 +312,7 @@ where } } -impl<'a, Test, Overrides> HasOverrides for RunBinaryChannelTest<'a, Test> +impl HasOverrides for RunBinaryChannelTest<'_, Test> where Test: HasOverrides, { @@ -321,7 +323,7 @@ where } } -impl<'a, Test, Overrides> HasOverrides for RunTwoWayBinaryChannelTest<'a, Test> +impl HasOverrides for RunTwoWayBinaryChannelTest<'_, Test> where Test: HasOverrides, { diff --git a/tools/test-framework/src/framework/binary/connection.rs b/tools/test-framework/src/framework/binary/connection.rs index 9e96a7665e..0f01082f98 100644 --- a/tools/test-framework/src/framework/binary/connection.rs +++ b/tools/test-framework/src/framework/binary/connection.rs @@ -16,7 +16,7 @@ use crate::framework::binary::chain::{ BinaryChainTest, ClientOptionsOverride, RelayerConfigOverride, RunBinaryChainTest, }; use crate::framework::binary::node::{ - run_binary_node_test, NodeConfigOverride, NodeGenesisOverride, + run_binary_node_test, NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, }; use crate::framework::supervisor::{RunWithSupervisor, SupervisorOverride}; use crate::relayer::driver::RelayerDriver; @@ -41,7 +41,8 @@ where + RelayerConfigOverride + ClientOptionsOverride + SupervisorOverride - + ConnectionDelayOverride, + + ConnectionDelayOverride + + NamadaParametersOverride, { run_binary_connection_test(&RunTwoWayBinaryConnectionTest::new(test)) } @@ -59,7 +60,8 @@ where + RelayerConfigOverride + ClientOptionsOverride + SupervisorOverride - + ConnectionDelayOverride, + + ConnectionDelayOverride + + NamadaParametersOverride, { run_binary_node_test(&RunBinaryChainTest::new(&RunBinaryConnectionTest::new( &RunWithSupervisor::new(test), @@ -142,7 +144,7 @@ where } } -impl<'a, Test, Overrides> BinaryChainTest for RunBinaryConnectionTest<'a, Test> +impl BinaryChainTest for RunBinaryConnectionTest<'_, Test> where Test: BinaryConnectionTest, Test: HasOverrides, @@ -172,9 +174,7 @@ where } } -impl<'a, Test: BinaryConnectionTest> BinaryConnectionTest - for RunTwoWayBinaryConnectionTest<'a, Test> -{ +impl BinaryConnectionTest for RunTwoWayBinaryConnectionTest<'_, Test> { fn run( &self, config: &TestConfig, @@ -210,7 +210,7 @@ impl<'a, Test: BinaryConnectionTest> BinaryConnectionTest } } -impl<'a, Test, Overrides> BinaryConnectionTest for RunWithSupervisor<'a, Test> +impl BinaryConnectionTest for RunWithSupervisor<'_, Test> where Test: BinaryConnectionTest, Test: HasOverrides, @@ -235,7 +235,7 @@ where } } -impl<'a, Test, Overrides> HasOverrides for RunBinaryConnectionTest<'a, Test> +impl HasOverrides for RunBinaryConnectionTest<'_, Test> where Test: HasOverrides, { @@ -246,7 +246,7 @@ where } } -impl<'a, Test, Overrides> HasOverrides for RunTwoWayBinaryConnectionTest<'a, Test> +impl HasOverrides for RunTwoWayBinaryConnectionTest<'_, Test> where Test: HasOverrides, { diff --git a/tools/test-framework/src/framework/binary/ics.rs b/tools/test-framework/src/framework/binary/ics.rs index e620ccfedc..7117fea5c2 100644 --- a/tools/test-framework/src/framework/binary/ics.rs +++ b/tools/test-framework/src/framework/binary/ics.rs @@ -47,7 +47,7 @@ where } } -impl<'a, Test, Overrides> BasicTest for RunInterchainSecurityChainTest<'a, Test> +impl BasicTest for RunInterchainSecurityChainTest<'_, Test> where Test: InterchainSecurityChainTest, Test: HasOverrides, @@ -104,7 +104,7 @@ where } } -impl<'a, Test, Overrides> HasOverrides for RunInterchainSecurityChainTest<'a, Test> +impl HasOverrides for RunInterchainSecurityChainTest<'_, Test> where Test: HasOverrides, { diff --git a/tools/test-framework/src/framework/binary/node.rs b/tools/test-framework/src/framework/binary/node.rs index ff59b4a13e..528a4dd021 100644 --- a/tools/test-framework/src/framework/binary/node.rs +++ b/tools/test-framework/src/framework/binary/node.rs @@ -3,8 +3,14 @@ running without setting up the relayer. */ +use std::str::FromStr; + +use toml; + +use crate::bootstrap::namada::bootstrap_namada_node; use crate::bootstrap::single::bootstrap_single_node; use crate::chain::builder::ChainBuilder; +use crate::chain::chain_type::ChainType; use crate::error::Error; use crate::framework::base::HasOverrides; use crate::framework::base::{run_basic_test, BasicTest, TestConfigOverride}; @@ -18,7 +24,8 @@ pub fn run_binary_node_test(test: &Test) -> Result<(), Error> where Test: BinaryNodeTest, Test: HasOverrides, - Overrides: NodeConfigOverride + NodeGenesisOverride + TestConfigOverride, + Overrides: + NodeConfigOverride + NodeGenesisOverride + TestConfigOverride + NamadaParametersOverride, { run_basic_test(&RunBinaryNodeTest { test }) } @@ -27,7 +34,8 @@ pub fn run_single_node_test(test: &Test) -> Result<(), Error> where Test: BinaryNodeTest, Test: HasOverrides, - Overrides: NodeConfigOverride + NodeGenesisOverride + TestConfigOverride, + Overrides: + NodeConfigOverride + NodeGenesisOverride + TestConfigOverride + NamadaParametersOverride, { run_basic_test(&RunSingleNodeTest { test }) } @@ -87,6 +95,10 @@ pub trait NodeGenesisOverride { fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error>; } +pub trait NamadaParametersOverride { + fn namada_modify_parameter_file(&self, parameter: &mut toml::Value) -> Result<(), Error>; +} + /** A wrapper type that lifts a test case that implements [`BinaryNodeTest`] into a test case that implements [`BasicTest`]. @@ -101,30 +113,63 @@ pub struct RunSingleNodeTest<'a, Test> { pub test: &'a Test, } -impl<'a, Test, Overrides> BasicTest for RunBinaryNodeTest<'a, Test> +impl BasicTest for RunBinaryNodeTest<'_, Test> where Test: BinaryNodeTest, Test: HasOverrides, - Overrides: NodeConfigOverride + NodeGenesisOverride, + Overrides: NodeConfigOverride + NodeGenesisOverride + NamadaParametersOverride, { fn run(&self, config: &TestConfig, builder: &ChainBuilder) -> Result<(), Error> { - let node_a = bootstrap_single_node( - builder, - "1", - config.bootstrap_with_random_ids, - |config| self.test.get_overrides().modify_node_config(config), - |genesis| self.test.get_overrides().modify_genesis_file(genesis), - 0, - )?; - - let node_b = bootstrap_single_node( - builder, - "2", - config.bootstrap_with_random_ids, - |config| self.test.get_overrides().modify_node_config(config), - |genesis| self.test.get_overrides().modify_genesis_file(genesis), - 1, - )?; + let command_paths_len = builder.command_paths.len(); + let node_a_type = ChainType::from_str(&builder.command_paths[0 % command_paths_len])?; + let node_a = match node_a_type { + ChainType::Namada => bootstrap_namada_node( + builder, + "a", + false, + |config| self.test.get_overrides().modify_node_config(config), + |genesis| self.test.get_overrides().modify_genesis_file(genesis), + |parameters| { + self.test + .get_overrides() + .namada_modify_parameter_file(parameters) + }, + 0, + ), + _ => bootstrap_single_node( + builder, + "1", + config.bootstrap_with_random_ids, + |config| self.test.get_overrides().modify_node_config(config), + |genesis| self.test.get_overrides().modify_genesis_file(genesis), + 0, + ), + }?; + let node_b_type = ChainType::from_str(&builder.command_paths[1 % command_paths_len])?; + + let node_b = match node_b_type { + ChainType::Namada => bootstrap_namada_node( + builder, + "b", + false, + |config| self.test.get_overrides().modify_node_config(config), + |genesis| self.test.get_overrides().modify_genesis_file(genesis), + |parameters| { + self.test + .get_overrides() + .namada_modify_parameter_file(parameters) + }, + 1, + ), + _ => bootstrap_single_node( + builder, + "2", + config.bootstrap_with_random_ids, + |config| self.test.get_overrides().modify_node_config(config), + |genesis| self.test.get_overrides().modify_genesis_file(genesis), + 1, + ), + }?; let _node_process_a = node_a.process.clone(); let _node_process_b = node_b.process.clone(); @@ -135,21 +180,38 @@ where } } -impl<'a, Test, Overrides> BasicTest for RunSingleNodeTest<'a, Test> +impl BasicTest for RunSingleNodeTest<'_, Test> where Test: BinaryNodeTest, Test: HasOverrides, - Overrides: NodeConfigOverride + NodeGenesisOverride, + Overrides: NodeConfigOverride + NodeGenesisOverride + NamadaParametersOverride, { fn run(&self, config: &TestConfig, builder: &ChainBuilder) -> Result<(), Error> { - let node = bootstrap_single_node( - builder, - "1", - config.bootstrap_with_random_ids, - |config| self.test.get_overrides().modify_node_config(config), - |genesis| self.test.get_overrides().modify_genesis_file(genesis), - 0, - )?; + let command_paths_len = builder.command_paths.len(); + let node_type = ChainType::from_str(&builder.command_paths[0 % command_paths_len])?; + let node = match node_type { + ChainType::Namada => bootstrap_namada_node( + builder, + "a", + false, + |config| self.test.get_overrides().modify_node_config(config), + |genesis| self.test.get_overrides().modify_genesis_file(genesis), + |parameters| { + self.test + .get_overrides() + .namada_modify_parameter_file(parameters) + }, + 0, + ), + _ => bootstrap_single_node( + builder, + "1", + config.bootstrap_with_random_ids, + |config| self.test.get_overrides().modify_node_config(config), + |genesis| self.test.get_overrides().modify_genesis_file(genesis), + 0, + ), + }?; let _node_process = node.process.clone(); @@ -159,7 +221,7 @@ where } } -impl<'a, Test, Overrides> HasOverrides for RunBinaryNodeTest<'a, Test> +impl HasOverrides for RunBinaryNodeTest<'_, Test> where Test: HasOverrides, { @@ -170,7 +232,7 @@ where } } -impl<'a, Test, Overrides> HasOverrides for RunSingleNodeTest<'a, Test> +impl HasOverrides for RunSingleNodeTest<'_, Test> where Test: HasOverrides, { diff --git a/tools/test-framework/src/framework/nary/chain.rs b/tools/test-framework/src/framework/nary/chain.rs index 4584ba2df7..19fff4dc00 100644 --- a/tools/test-framework/src/framework/nary/chain.rs +++ b/tools/test-framework/src/framework/nary/chain.rs @@ -12,7 +12,9 @@ use crate::bootstrap::nary::chain::{ use crate::error::Error; use crate::framework::base::{HasOverrides, TestConfigOverride}; use crate::framework::binary::chain::{RelayerConfigOverride, TopologyOverride}; -use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; +use crate::framework::binary::node::{ + NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, +}; use crate::framework::nary::node::{run_nary_node_test, NaryNodeTest}; use crate::framework::supervisor::{RunWithSupervisor, SupervisorOverride}; use crate::relayer::driver::RelayerDriver; @@ -49,6 +51,7 @@ where + NodeGenesisOverride + RelayerConfigOverride + SupervisorOverride + + NamadaParametersOverride + TopologyOverride, { run_nary_node_test(&RunNaryChainTest::new(&RunWithSupervisor::new(test))) @@ -79,6 +82,7 @@ where + NodeGenesisOverride + RelayerConfigOverride + SupervisorOverride + + NamadaParametersOverride + TopologyOverride, { run_nary_node_test(&RunSelfConnectedNaryChainTest::new( @@ -123,7 +127,7 @@ pub struct RunSelfConnectedNaryChainTest<'a, Test, const SIZE: usize> { pub test: &'a Test, } -impl<'a, Test, Overrides, const SIZE: usize> NaryNodeTest for RunNaryChainTest<'a, Test, SIZE> +impl NaryNodeTest for RunNaryChainTest<'_, Test, SIZE> where Test: NaryChainTest, Test: HasOverrides, @@ -157,8 +161,8 @@ where } } -impl<'a, Test, Overrides, const SIZE: usize> NaryNodeTest<1> - for RunSelfConnectedNaryChainTest<'a, Test, SIZE> +impl NaryNodeTest<1> + for RunSelfConnectedNaryChainTest<'_, Test, SIZE> where Test: NaryChainTest, Test: HasOverrides, @@ -192,7 +196,7 @@ where } } -impl<'a, Test, Overrides, const SIZE: usize> NaryChainTest for RunWithSupervisor<'a, Test> +impl NaryChainTest for RunWithSupervisor<'_, Test> where Test: NaryChainTest, Test: HasOverrides, @@ -234,7 +238,7 @@ where } } -impl<'a, Test, Overrides, const SIZE: usize> HasOverrides for RunNaryChainTest<'a, Test, SIZE> +impl HasOverrides for RunNaryChainTest<'_, Test, SIZE> where Test: HasOverrides, { @@ -245,8 +249,8 @@ where } } -impl<'a, Test, Overrides, const SIZE: usize> HasOverrides - for RunSelfConnectedNaryChainTest<'a, Test, SIZE> +impl HasOverrides + for RunSelfConnectedNaryChainTest<'_, Test, SIZE> where Test: HasOverrides, { diff --git a/tools/test-framework/src/framework/nary/channel.rs b/tools/test-framework/src/framework/nary/channel.rs index 38896a2a2a..c48f728fd7 100644 --- a/tools/test-framework/src/framework/nary/channel.rs +++ b/tools/test-framework/src/framework/nary/channel.rs @@ -14,7 +14,9 @@ use crate::framework::base::{HasOverrides, TestConfigOverride}; 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}; +use crate::framework::binary::node::{ + NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, +}; use crate::framework::nary::chain::RunNaryChainTest; use crate::framework::nary::connection::{NaryConnectionTest, RunNaryConnectionTest}; use crate::framework::nary::node::run_nary_node_test; @@ -39,6 +41,7 @@ where + ConnectionDelayOverride + PortsOverride + ChannelOrderOverride + + NamadaParametersOverride + TopologyOverride, { run_nary_node_test(&RunNaryChainTest::new(&RunNaryConnectionTest::new( @@ -58,6 +61,7 @@ where + ConnectionDelayOverride + PortsOverride<2> + ChannelOrderOverride + + NamadaParametersOverride + TopologyOverride, { run_nary_channel_test(&RunBinaryAsNaryChannelTest::new(test)) @@ -157,8 +161,8 @@ where } } -impl<'a, Test, Overrides, const SIZE: usize> NaryConnectionTest - for RunNaryChannelTest<'a, Test, SIZE> +impl NaryConnectionTest + for RunNaryChannelTest<'_, Test, SIZE> where Test: NaryChannelTest, Test: HasOverrides, @@ -194,7 +198,7 @@ where } } -impl<'a, Test> NaryChannelTest<2> for RunBinaryAsNaryChannelTest<'a, Test> +impl NaryChannelTest<2> for RunBinaryAsNaryChannelTest<'_, Test> where Test: BinaryChannelTest, { @@ -210,7 +214,7 @@ where } } -impl<'a, Test, Overrides, const SIZE: usize> NaryChannelTest for RunWithSupervisor<'a, Test> +impl NaryChannelTest for RunWithSupervisor<'_, Test> where Test: NaryChannelTest, Test: HasOverrides, @@ -235,7 +239,7 @@ where } } -impl<'a, Test, Overrides, const SIZE: usize> HasOverrides for RunNaryChannelTest<'a, Test, SIZE> +impl HasOverrides for RunNaryChannelTest<'_, Test, SIZE> where Test: HasOverrides, { @@ -246,7 +250,7 @@ where } } -impl<'a, Test, Overrides> HasOverrides for RunBinaryAsNaryChannelTest<'a, Test> +impl HasOverrides for RunBinaryAsNaryChannelTest<'_, Test> where Test: HasOverrides, { diff --git a/tools/test-framework/src/framework/nary/connection.rs b/tools/test-framework/src/framework/nary/connection.rs index 6870d3be9e..646ffdbd2e 100644 --- a/tools/test-framework/src/framework/nary/connection.rs +++ b/tools/test-framework/src/framework/nary/connection.rs @@ -12,7 +12,9 @@ use crate::error::Error; use crate::framework::base::{HasOverrides, TestConfigOverride}; use crate::framework::binary::chain::{RelayerConfigOverride, TopologyOverride}; use crate::framework::binary::connection::{BinaryConnectionTest, ConnectionDelayOverride}; -use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; +use crate::framework::binary::node::{ + NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, +}; use crate::framework::nary::chain::{NaryChainTest, RunNaryChainTest}; use crate::framework::nary::node::run_nary_node_test; use crate::framework::supervisor::{RunWithSupervisor, SupervisorOverride}; @@ -35,6 +37,7 @@ where + RelayerConfigOverride + SupervisorOverride + ConnectionDelayOverride + + NamadaParametersOverride + TopologyOverride, { run_nary_node_test(&RunNaryChainTest::new(&RunNaryConnectionTest::new( @@ -92,8 +95,8 @@ where } } -impl<'a, Test, Overrides, const SIZE: usize> NaryChainTest - for RunNaryConnectionTest<'a, Test, SIZE> +impl NaryChainTest + for RunNaryConnectionTest<'_, Test, SIZE> where Test: NaryConnectionTest, Test: HasOverrides, @@ -125,7 +128,7 @@ where } } -impl<'a, Test> NaryConnectionTest<2> for RunBinaryAsNaryConnectionTest<'a, Test> +impl NaryConnectionTest<2> for RunBinaryAsNaryConnectionTest<'_, Test> where Test: BinaryConnectionTest, { @@ -141,8 +144,7 @@ where } } -impl<'a, Test, Overrides, const SIZE: usize> NaryConnectionTest - for RunWithSupervisor<'a, Test> +impl NaryConnectionTest for RunWithSupervisor<'_, Test> where Test: NaryConnectionTest, Test: HasOverrides, @@ -167,7 +169,7 @@ where } } -impl<'a, Test, Overrides, const SIZE: usize> HasOverrides for RunNaryConnectionTest<'a, Test, SIZE> +impl HasOverrides for RunNaryConnectionTest<'_, Test, SIZE> where Test: HasOverrides, { @@ -178,7 +180,7 @@ where } } -impl<'a, Test, Overrides> HasOverrides for RunBinaryAsNaryConnectionTest<'a, Test> +impl HasOverrides for RunBinaryAsNaryConnectionTest<'_, Test> where Test: HasOverrides, { diff --git a/tools/test-framework/src/framework/nary/node.rs b/tools/test-framework/src/framework/nary/node.rs index cea7c81ac4..e5c0d7a5fe 100644 --- a/tools/test-framework/src/framework/nary/node.rs +++ b/tools/test-framework/src/framework/nary/node.rs @@ -3,12 +3,15 @@ running without setting up the relayer. */ +use crate::bootstrap::namada::bootstrap_namada_node; use crate::bootstrap::single::bootstrap_single_node; use crate::chain::builder::ChainBuilder; use crate::error::Error; use crate::framework::base::HasOverrides; use crate::framework::base::{run_basic_test, BasicTest, TestConfigOverride}; -use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; +use crate::framework::binary::node::{ + NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, +}; use crate::types::config::TestConfig; use crate::types::single::node::FullNode; use crate::util::array::try_into_array; @@ -17,7 +20,8 @@ pub fn run_nary_node_test(test: &Test) -> Re where Test: NaryNodeTest, Test: HasOverrides, - Overrides: NodeConfigOverride + NodeGenesisOverride + TestConfigOverride, + Overrides: + NodeConfigOverride + NodeGenesisOverride + TestConfigOverride + NamadaParametersOverride, { run_basic_test(&RunNaryNodeTest { test }) } @@ -45,25 +49,43 @@ pub struct RunNaryNodeTest<'a, Test, const SIZE: usize> { pub test: &'a Test, } -impl<'a, Test, Overrides, const SIZE: usize> BasicTest for RunNaryNodeTest<'a, Test, SIZE> +impl BasicTest for RunNaryNodeTest<'_, Test, SIZE> where Test: NaryNodeTest, Test: HasOverrides, - Overrides: NodeConfigOverride + NodeGenesisOverride, + Overrides: NodeConfigOverride + NodeGenesisOverride + NamadaParametersOverride, { fn run(&self, config: &TestConfig, builder: &ChainBuilder) -> Result<(), Error> { let mut nodes = Vec::new(); let mut node_processes = Vec::new(); for i in 0..SIZE { - let node = bootstrap_single_node( - builder, - &format!("{}", i + 1), - config.bootstrap_with_random_ids, - |config| self.test.get_overrides().modify_node_config(config), - |genesis| self.test.get_overrides().modify_genesis_file(genesis), - i, - )?; + let is_namada = builder.command_paths == vec!["namada".to_string()] + || builder.command_paths.get(i) == Some(&"namada".to_string()); + let node = if is_namada { + bootstrap_namada_node( + builder, + &format!("{}", i + 1), + config.bootstrap_with_random_ids, + |config| self.test.get_overrides().modify_node_config(config), + |genesis| self.test.get_overrides().modify_genesis_file(genesis), + |parameters| { + self.test + .get_overrides() + .namada_modify_parameter_file(parameters) + }, + i, + )? + } else { + bootstrap_single_node( + builder, + &format!("{}", i + 1), + config.bootstrap_with_random_ids, + |config| self.test.get_overrides().modify_node_config(config), + |genesis| self.test.get_overrides().modify_genesis_file(genesis), + i, + )? + }; node_processes.push(node.process.clone()); nodes.push(node); @@ -75,7 +97,7 @@ where } } -impl<'a, Test, Overrides, const SIZE: usize> HasOverrides for RunNaryNodeTest<'a, Test, SIZE> +impl HasOverrides for RunNaryNodeTest<'_, Test, SIZE> where Test: HasOverrides, { diff --git a/tools/test-framework/src/framework/overrides.rs b/tools/test-framework/src/framework/overrides.rs index 70398de376..bf08d8c06d 100644 --- a/tools/test-framework/src/framework/overrides.rs +++ b/tools/test-framework/src/framework/overrides.rs @@ -18,7 +18,9 @@ use crate::framework::binary::channel::{ ChannelOrderOverride, ChannelVersionOverride, PortsOverride, }; use crate::framework::binary::connection::ConnectionDelayOverride; -use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; +use crate::framework::binary::node::{ + NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, +}; use crate::framework::nary::channel::PortsOverride as NaryPortsOverride; use crate::framework::supervisor::SupervisorOverride; use crate::types::config::TestConfig; @@ -81,6 +83,10 @@ pub trait TestOverrides { // No modification by default } + fn namada_modify_parameter_file(&self, _parameter: &mut toml::Value) -> Result<(), Error> { + Ok(()) + } + /// Returns the settings for the foreign client on the first chain for the /// second chain. The defaults are for a client connecting two Cosmos chains /// with no custom settings. @@ -180,6 +186,12 @@ impl NodeGenesisOverride for Test { } } +impl NamadaParametersOverride for Test { + fn namada_modify_parameter_file(&self, parameter: &mut toml::Value) -> Result<(), Error> { + TestOverrides::namada_modify_parameter_file(self, parameter) + } +} + impl RelayerConfigOverride for Test { fn modify_relayer_config(&self, config: &mut Config) { TestOverrides::modify_relayer_config(self, config) diff --git a/tools/test-framework/src/framework/supervisor.rs b/tools/test-framework/src/framework/supervisor.rs index f43ea89536..e5c9f1933b 100644 --- a/tools/test-framework/src/framework/supervisor.rs +++ b/tools/test-framework/src/framework/supervisor.rs @@ -46,7 +46,7 @@ impl<'a, Test> RunWithSupervisor<'a, Test> { } } -impl<'a, Test, Overrides> HasOverrides for RunWithSupervisor<'a, Test> +impl HasOverrides for RunWithSupervisor<'_, Test> where Test: HasOverrides, { diff --git a/tools/test-framework/src/ibc/denom.rs b/tools/test-framework/src/ibc/denom.rs index 965a56b1b7..d0301b9e15 100644 --- a/tools/test-framework/src/ibc/denom.rs +++ b/tools/test-framework/src/ibc/denom.rs @@ -8,6 +8,7 @@ use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId}; use sha2::{Digest, Sha256}; use subtle_encoding::hex; +use crate::chain::chain_type::ChainType; use crate::types::id::{TaggedChannelIdRef, TaggedPortIdRef}; use crate::types::tagged::*; @@ -16,11 +17,16 @@ use crate::types::tagged::*; */ #[derive(Debug, Clone)] pub enum Denom { - Base(String), + Base { + display_name: String, + raw_address: String, + token_denom: u8, + }, Ibc { path: String, - denom: String, + denom: Box, hashed: String, + token_denom: u8, }, } @@ -51,6 +57,18 @@ pub type TaggedDenomRef<'a, Chain> = MonoTagged; Returns the derived denomination on `ChainB`. */ pub fn derive_ibc_denom( + chain_type: &ChainType, + port_id: &TaggedPortIdRef, + channel_id: &TaggedChannelIdRef, + denom: &TaggedDenomRef, +) -> Result, Error> { + match chain_type { + ChainType::Namada => derive_namada_ibc_denom(port_id, channel_id, denom), + _ => derive_cosmos_ibc_denom(port_id, channel_id, denom), + } +} + +fn derive_cosmos_ibc_denom( port_id: &TaggedPortIdRef, channel_id: &TaggedChannelIdRef, denom: &TaggedDenomRef, @@ -77,16 +95,26 @@ pub fn derive_ibc_denom( } match denom.value() { - Denom::Base(denom) => { - let hashed = derive_denom(port_id.value(), channel_id.value(), denom)?; + Denom::Base { + raw_address, + token_denom, + .. + } => { + let hashed = derive_denom(port_id.value(), channel_id.value(), raw_address)?; Ok(MonoTagged::new(Denom::Ibc { path: format!("{port_id}/{channel_id}"), - denom: denom.clone(), + denom: Box::new((*denom.value()).clone()), hashed, + token_denom: *token_denom, })) } - Denom::Ibc { path, denom, .. } => { + Denom::Ibc { + path, + denom, + token_denom, + .. + } => { let new_path = format!("{port_id}/{channel_id}/{path}"); let hashed = derive_denom_with_path(&format!("{new_path}/{denom}"))?; @@ -94,19 +122,65 @@ pub fn derive_ibc_denom( path: new_path, denom: denom.clone(), hashed, + token_denom: *token_denom, + })) + } + } +} + +fn derive_namada_ibc_denom( + port_id: &TaggedPortIdRef, + channel_id: &TaggedChannelIdRef, + denom: &TaggedDenomRef, +) -> Result, Error> { + match denom.value() { + Denom::Base { + raw_address, + token_denom, + .. + } => { + let path = format!("{port_id}/{channel_id}"); + let ibc_token_addr = namada_sdk::ibc::trace::ibc_token(format!("{path}/{raw_address}")); + + Ok(MonoTagged::new(Denom::Ibc { + path, + denom: Box::new((*denom.value()).clone()), + hashed: ibc_token_addr.to_string(), + token_denom: *token_denom, + })) + } + Denom::Ibc { + path, + denom, + token_denom, + .. + } => { + let new_path = format!("{port_id}/{channel_id}/{path}"); + let ibc_token_addr = + namada_sdk::ibc::trace::ibc_token(format!("{new_path}/{}", denom.hash_only())); + + Ok(MonoTagged::new(Denom::Ibc { + path: new_path, + denom: denom.clone(), + hashed: ibc_token_addr.to_string(), + token_denom: *token_denom, })) } } } impl Denom { - pub fn base(denom: &str) -> Self { - Denom::Base(denom.to_string()) + pub fn base(display_name: &str, raw_address: &str) -> Self { + Denom::Base { + display_name: display_name.to_owned(), + raw_address: raw_address.to_owned(), + token_denom: if display_name == "nam" { 6 } else { 0 }, + } } pub fn hash_only(&self) -> String { match self { - Denom::Base(denom) => denom.to_string(), + Denom::Base { raw_address, .. } => raw_address.to_string(), Denom::Ibc { hashed, .. } => match hashed.find('/') { Some(index) => hashed[index + 1..].to_string(), None => hashed.to_string(), @@ -114,9 +188,23 @@ impl Denom { } } + pub fn display_name(&self) -> String { + match self { + Denom::Base { display_name, .. } => display_name.to_string(), + Denom::Ibc { hashed, .. } => hashed.to_string(), + } + } + + pub fn namada_display_name(&self) -> String { + match self { + Denom::Base { display_name, .. } => display_name.to_string(), + Denom::Ibc { path, denom, .. } => format!("{path}/{}", denom.namada_display_name()), + } + } + pub fn as_str(&self) -> &str { match self { - Denom::Base(denom) => denom, + Denom::Base { display_name, .. } => display_name, Denom::Ibc { hashed, .. } => hashed, } } @@ -125,8 +213,8 @@ impl Denom { impl Display for Denom { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { match self { - Denom::Base(denom) => { - write!(f, "{denom}") + Denom::Base { raw_address, .. } => { + write!(f, "{raw_address}") } Denom::Ibc { hashed, .. } => { write!(f, "{hashed}") @@ -138,19 +226,32 @@ impl Display for Denom { impl PartialEq for Denom { fn eq(&self, other: &Self) -> bool { match (self, other) { - (Self::Base(d1), Self::Base(d2)) => d1 == d2, + ( + Self::Base { + display_name: d1, + raw_address: a1, + token_denom: td1, + }, + Self::Base { + display_name: d2, + raw_address: a2, + token_denom: td2, + }, + ) => (d1 == d2) && (a1 == a2) && (td1 == td2), ( Self::Ibc { path: p1, denom: d1, hashed: h1, + token_denom: td1, }, Self::Ibc { path: p2, denom: d2, hashed: h2, + token_denom: td2, }, - ) => p1 == p2 && d1 == d2 && h1 == h2, + ) => p1 == p2 && d1 == d2 && h1 == h2 && (td1 == td2), _ => self.as_str() == other.as_str(), } } diff --git a/tools/test-framework/src/ibc/token.rs b/tools/test-framework/src/ibc/token.rs index ac7b6785ad..e7ece52fc0 100644 --- a/tools/test-framework/src/ibc/token.rs +++ b/tools/test-framework/src/ibc/token.rs @@ -1,7 +1,9 @@ use core::ops::{Add, Sub}; use ibc_relayer_types::applications::transfer::amount::Amount; use ibc_relayer_types::applications::transfer::coin::{Coin, RawCoin}; +use ibc_relayer_types::bigint::U256; +use crate::chain::chain_type::ChainType; use crate::error::Error; use crate::ibc::denom::{derive_ibc_denom, Denom, TaggedDenom, TaggedDenomRef}; use crate::types::id::{TaggedChannelIdRef, TaggedPortIdRef}; @@ -21,6 +23,7 @@ pub trait TaggedTokenExt { fn transfer( &self, + chain_type: &ChainType, port_id: &TaggedPortIdRef, channel_id: &TaggedChannelIdRef, ) -> Result, Error>; @@ -45,16 +48,17 @@ impl TaggedTokenExt for TaggedToken { fn transfer( &self, + chain_type: &ChainType, port_id: &TaggedPortIdRef, channel_id: &TaggedChannelIdRef, ) -> Result, Error> { - let denom = derive_ibc_denom(port_id, channel_id, &self.denom())?; + let denom = derive_ibc_denom(chain_type, port_id, channel_id, &self.denom())?; Ok(denom.with_amount(self.value().amount)) } } -impl<'a, Chain> TaggedTokenExt for TaggedTokenRef<'a, Chain> { +impl TaggedTokenExt for TaggedTokenRef<'_, Chain> { fn denom(&self) -> TaggedDenomRef { self.map_ref(|t| &t.denom) } @@ -69,10 +73,11 @@ impl<'a, Chain> TaggedTokenExt for TaggedTokenRef<'a, Chain> { fn transfer( &self, + chain_type: &ChainType, port_id: &TaggedPortIdRef, channel_id: &TaggedChannelIdRef, ) -> Result, Error> { - let denom = derive_ibc_denom(port_id, channel_id, &self.denom())?; + let denom = derive_ibc_denom(chain_type, port_id, channel_id, &self.denom())?; Ok(denom.with_amount(self.value().amount)) } @@ -80,18 +85,32 @@ impl<'a, Chain> TaggedTokenExt for TaggedTokenRef<'a, Chain> { impl TaggedDenomExt for TaggedDenom { fn with_amount(&self, amount: impl Into) -> TaggedToken { + let amount: Amount = match self.value() { + Denom::Base { .. } => amount.into(), + Denom::Ibc { token_denom, .. } => { + let amount: Amount = amount.into(); + (amount.0 * U256::from(10).pow(U256::from(*token_denom))).into() + } + }; self.map(|denom| Token { denom: denom.clone(), - amount: amount.into(), + amount, }) } } -impl<'a, Chain> TaggedDenomExt for TaggedDenomRef<'a, Chain> { +impl TaggedDenomExt for TaggedDenomRef<'_, Chain> { fn with_amount(&self, amount: impl Into) -> TaggedToken { + let amount: Amount = match self.value() { + Denom::Base { .. } => amount.into(), + Denom::Ibc { token_denom, .. } => { + let amount: Amount = amount.into(); + (amount.0 * U256::from(10).pow(U256::from(*token_denom))).into() + } + }; self.map(|denom| Token { denom: (*denom).clone(), - amount: amount.into(), + amount, }) } } diff --git a/tools/test-framework/src/relayer/chain.rs b/tools/test-framework/src/relayer/chain.rs index 4d98354aea..1308d49d5a 100644 --- a/tools/test-framework/src/relayer/chain.rs +++ b/tools/test-framework/src/relayer/chain.rs @@ -22,7 +22,7 @@ use crossbeam_channel as channel; use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; -use ibc_relayer::chain::cosmos::version::Specs; +use ibc_relayer::chain::version::Specs; use ibc_relayer_types::applications::ics28_ccv::msgs::{ConsumerChain, ConsumerId}; use ibc_relayer_types::core::ics04_channel::upgrade::{ErrorReceipt, Upgrade}; use tracing::Span; diff --git a/tools/test-framework/src/relayer/fee.rs b/tools/test-framework/src/relayer/fee.rs index 51b1ff6814..e4a2a92bd4 100644 --- a/tools/test-framework/src/relayer/fee.rs +++ b/tools/test-framework/src/relayer/fee.rs @@ -1,3 +1,5 @@ +use eyre::eyre; + use core::time::Duration; use http::uri::Uri; use ibc_relayer::chain::cosmos::query::fee::{ @@ -63,13 +65,13 @@ pub async fn ibc_token_transfer_with_fee( let messages = vec![pay_message, transfer_message]; - let events = simple_send_tx( - rpc_client.value(), - tx_config.value(), - &sender.value().key, - messages, - ) - .await?; + let key = &sender + .value() + .key + .downcast() + .ok_or_else(|| eyre!("unable to downcast key")) + .map_err(Error::generic)?; + let events = simple_send_tx(rpc_client.value(), tx_config.value(), key, messages).await?; Ok(events) } @@ -101,14 +103,15 @@ pub async fn pay_packet_fee( ) .map_err(handle_generic_error)?; - let events = simple_send_tx( - rpc_client.value(), - tx_config.value(), - &payer.value().key, - vec![message], - ) - .await - .map_err(Error::relayer)?; + let key = &payer + .value() + .key + .downcast() + .ok_or_else(|| eyre!("unable to downcast key")) + .map_err(Error::generic)?; + let events = simple_send_tx(rpc_client.value(), tx_config.value(), key, vec![message]) + .await + .map_err(Error::relayer)?; Ok(events) } @@ -140,13 +143,13 @@ pub async fn register_counterparty_payee( let messages = vec![message]; - simple_send_tx( - rpc_client.value(), - tx_config.value(), - &wallet.value().key, - messages, - ) - .await?; + let key = &wallet + .value() + .key + .downcast() + .ok_or_else(|| eyre!("unable to downcast key")) + .map_err(Error::generic)?; + simple_send_tx(rpc_client.value(), tx_config.value(), key, messages).await?; Ok(()) } @@ -174,13 +177,13 @@ pub async fn register_payee( let messages = vec![message]; - simple_send_tx( - rpc_client.value(), - tx_config.value(), - &wallet.value().key, - messages, - ) - .await?; + let key = &wallet + .value() + .key + .downcast() + .ok_or_else(|| eyre!("unable to downcast key")) + .map_err(Error::generic)?; + simple_send_tx(rpc_client.value(), tx_config.value(), key, messages).await?; Ok(()) } diff --git a/tools/test-framework/src/relayer/transfer.rs b/tools/test-framework/src/relayer/transfer.rs index 26595051a5..43a379ee29 100644 --- a/tools/test-framework/src/relayer/transfer.rs +++ b/tools/test-framework/src/relayer/transfer.rs @@ -6,7 +6,6 @@ use core::ops::Add; use core::time::Duration; use eyre::eyre; -use ibc_relayer_types::core::ics04_channel::packet::Packet; use ibc_relayer_types::events::IbcEvent; use ibc_proto::google::protobuf::Any; @@ -20,6 +19,7 @@ use ibc_relayer_types::core::ics04_channel::timeout::TimeoutHeight; use ibc_relayer_types::timestamp::Timestamp; use tendermint_rpc::HttpClient; +use crate::chain::exec::simple_exec; use crate::error::{handle_generic_error, Error}; use crate::ibc::token::TaggedTokenRef; use crate::types::id::{TaggedChannelIdRef, TaggedPortIdRef}; @@ -92,7 +92,7 @@ pub async fn ibc_token_transfer( token: &TaggedTokenRef<'_, SrcChain>, memo: Option, timeout: Option, -) -> Result { +) -> Result<(), Error> { let message = build_transfer_message( port_id, channel_id, @@ -103,15 +103,21 @@ pub async fn ibc_token_transfer( memo.clone(), )?; + let key = &sender + .value() + .key + .downcast() + .ok_or_else(|| eyre!("unable to downcast key")) + .map_err(Error::generic)?; let events = simple_send_tx( rpc_client.into_value(), tx_config.value(), - &sender.value().key, + key, vec![message], ) .await?; - let packet = events + let _packet = events .into_iter() .find_map(|event| match event.event { IbcEvent::SendPacket(ev) => Some(ev.packet), @@ -119,7 +125,95 @@ pub async fn ibc_token_transfer( }) .ok_or_else(|| eyre!("failed to find send packet event"))?; - Ok(packet) + Ok(()) +} + +pub fn local_namada_token_transfer( + home_path: &str, + sender: &str, + recipient: &str, + denom: &str, + amount: &str, + rpc_port: &str, +) -> Result<(), Error> { + simple_exec( + "namada local transfer", + "namadac", + &[ + "--base-dir", + home_path, + "transparent-transfer", + "--source", + sender, + "--target", + recipient, + "--token", + denom, + "--amount", + amount, + "--signing-keys", + &format!("{sender}-key"), + "--gas-limit", + "150000", + "--node", + &format!("http://127.0.0.1:{rpc_port}"), + ], + )?; + + Ok(()) +} + +pub fn ibc_namada_token_transfer( + home_path: &str, + sender: &str, + receiver: &str, + denom: &str, + amount: &str, + channel_id: &str, + rpc_port: &str, + memo: Option, + timeout: Option, +) -> Result<(), Error> { + let signing_key = format!("{sender}-key"); + let node = format!("http://127.0.0.1:{rpc_port}"); + let mut args = vec![ + "--base-dir", + home_path, + "ibc-transfer", + "--source", + sender, + "--receiver", + receiver, + "--token", + denom, + "--amount", + amount, + "--signing-keys", + &signing_key, + "--channel-id", + channel_id, + "--gas-limit", + "150000", + "--node", + &node, + ]; + + let memo_str = memo.clone().unwrap_or_default(); + if memo.is_some() { + args.push("--ibc-memo"); + args.push(&memo_str); + } + + let timeout_str; + if let Some(timeout) = timeout { + args.push("--timeout-sec-offset"); + timeout_str = timeout.as_secs().to_string(); + args.push(&timeout_str); + } + + simple_exec("namada transfer", "namadac", &args)?; + + Ok(()) } pub async fn batched_ibc_token_transfer( @@ -147,13 +241,13 @@ pub async fn batched_ibc_token_transfer( .take(num_msgs) .collect::, _>>()?; - batched_send_tx( - rpc_client.value(), - tx_config.value(), - &sender.value().key, - messages, - ) - .await?; + let key = &sender + .value() + .key + .downcast() + .ok_or_else(|| eyre!("unable to downcast key")) + .map_err(Error::generic)?; + batched_send_tx(rpc_client.value(), tx_config.value(), key, messages).await?; Ok(()) } diff --git a/tools/test-framework/src/types/env.rs b/tools/test-framework/src/types/env.rs index 7028aa8b32..ba0986f442 100644 --- a/tools/test-framework/src/types/env.rs +++ b/tools/test-framework/src/types/env.rs @@ -66,7 +66,7 @@ impl EnvWriter for BTreeMap { } } -impl<'a, Writer: EnvWriter> EnvWriter for PrefixEnvWriter<'a, Writer> { +impl EnvWriter for PrefixEnvWriter<'_, Writer> { fn write_env(&mut self, key: &str, value: &str) { self.writer .write_env(&format!("{}_{}", self.prefix, key), value); diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index ae4d0f34bb..51ab9499d3 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -21,6 +21,7 @@ use tendermint_rpc::WebSocketClientUrl; use crate::chain::chain_type::ChainType as TestedChainType; use crate::chain::driver::ChainDriver; +use crate::chain::exec::simple_exec; use crate::ibc::denom::Denom; use crate::prelude::TestConfig; use crate::types::env::{prefix_writer, EnvWriter, ExportEnv}; @@ -103,7 +104,7 @@ impl TaggedFullNodeExt for MonoTagged { } } -impl<'a, Chain> TaggedFullNodeExt for MonoTagged { +impl TaggedFullNodeExt for MonoTagged { fn chain_id(&self) -> MonoTagged { self.map_ref(|c| &c.chain_driver.chain_id) } @@ -149,6 +150,10 @@ impl FullNode { TestedChainType::Provenance => { config::GasPrice::new(5000.0, test_config.native_token(chain_number).clone()) } + TestedChainType::Namada => { + let denom = get_denom(&self.chain_driver.home_path)?; + config::GasPrice::new(0.000003, denom) + } _ => config::GasPrice::new(0.003, test_config.native_token(chain_number).clone()), }; @@ -158,51 +163,104 @@ impl FullNode { DynamicGasPrice::disabled() }; - Ok(config::ChainConfig::CosmosSdk(CosmosSdkConfig { - 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())?, - event_source: config::EventSourceMode::Push { - url: WebSocketClientUrl::from_str(&self.chain_driver.websocket_address())?, - batch_delay: config::default::batch_delay(), - }, - rpc_timeout: config::default::rpc_timeout(), - trusted_node: false, - genesis_restart: None, - account_prefix: self.chain_driver.account_prefix.clone(), - key_name: self.wallets.relayer.id.0.clone(), - key_store_type: Store::Test, - key_store_folder: Some(hermes_keystore_dir.into()), - store_prefix: "ibc".to_string(), - default_gas: None, - max_gas: Some(3000000), - gas_adjustment: None, - gas_multiplier: Some(GasMultiplier::unsafe_new(1.5)), - dynamic_gas_price, - fee_granter: None, - max_msg_num: Default::default(), - max_tx_size: Default::default(), - max_grpc_decoding_size: config::default::max_grpc_decoding_size(), - query_packets_chunk_size: config::default::query_packets_chunk_size(), - max_block_time: Duration::from_secs(30), - clock_drift: Duration::from_secs(5), - trusting_period: Some(Duration::from_secs(14 * 24 * 3600)), - client_refresh_rate: config::default::client_refresh_rate(), - ccv_consumer_chain: false, - trust_threshold: Default::default(), - gas_price, - 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, - compat_mode, - clear_interval: None, - excluded_sequences: ExcludedSequences::new(BTreeMap::new()), - allow_ccq: true, - })) + let chain_config = match chain_type { + TestedChainType::Cosmos { dynamic_fee: _ } + | TestedChainType::Provenance + | TestedChainType::Evmos + | TestedChainType::Osmosis + | TestedChainType::Injective => config::ChainConfig::CosmosSdk(CosmosSdkConfig { + 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())?, + event_source: config::EventSourceMode::Push { + url: WebSocketClientUrl::from_str(&self.chain_driver.websocket_address())?, + batch_delay: config::default::batch_delay(), + }, + rpc_timeout: config::default::rpc_timeout(), + trusted_node: false, + genesis_restart: None, + account_prefix: self.chain_driver.account_prefix.clone(), + key_name: self.wallets.relayer.id.0.clone(), + key_store_type: Store::Test, + key_store_folder: Some(hermes_keystore_dir.into()), + store_prefix: "ibc".to_string(), + default_gas: None, + max_gas: Some(3000000), + gas_adjustment: None, + gas_multiplier: Some(GasMultiplier::unsafe_new(1.5)), + dynamic_gas_price, + fee_granter: None, + max_msg_num: Default::default(), + max_tx_size: Default::default(), + max_grpc_decoding_size: config::default::max_grpc_decoding_size(), + query_packets_chunk_size: config::default::query_packets_chunk_size(), + max_block_time: Duration::from_secs(30), + clock_drift: Duration::from_secs(5), + trusting_period: Some(Duration::from_secs(14 * 24 * 3600)), + client_refresh_rate: config::default::client_refresh_rate(), + ccv_consumer_chain: false, + trust_threshold: Default::default(), + gas_price, + 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, + compat_mode, + clear_interval: None, + excluded_sequences: ExcludedSequences::new(BTreeMap::new()), + allow_ccq: true, + }), + TestedChainType::Namada => config::ChainConfig::Namada(CosmosSdkConfig { + 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())?, + event_source: config::EventSourceMode::Push { + url: WebSocketClientUrl::from_str(&self.chain_driver.websocket_address())?, + batch_delay: config::default::batch_delay(), + }, + rpc_timeout: config::default::rpc_timeout(), + trusted_node: false, + genesis_restart: None, + account_prefix: "".to_owned(), + key_name: self.wallets.relayer.id.0.clone(), + key_store_type: Store::Test, + key_store_folder: Some(hermes_keystore_dir.into()), + store_prefix: "ibc".to_string(), + default_gas: None, + max_gas: Some(4000000), + gas_adjustment: None, + gas_multiplier: Some(GasMultiplier::unsafe_new(1.2)), + dynamic_gas_price: DynamicGasPrice::default(), + fee_granter: None, + max_msg_num: Default::default(), + max_tx_size: Default::default(), + max_grpc_decoding_size: config::default::max_grpc_decoding_size(), + query_packets_chunk_size: config::default::query_packets_chunk_size(), + max_block_time: Duration::from_secs(30), + clock_drift: Duration::from_secs(5), + trusting_period: Some(Duration::from_secs(1999)), + client_refresh_rate: config::default::client_refresh_rate(), + ccv_consumer_chain: false, + trust_threshold: Default::default(), + gas_price, + 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, + compat_mode, + clear_interval: None, + excluded_sequences: ExcludedSequences::new(BTreeMap::new()), + allow_ccq: false, + }), + }; + + Ok(chain_config) } /** @@ -220,6 +278,27 @@ impl FullNode { } } +fn get_denom(home_path: &str) -> Result { + let output = simple_exec( + "namada", + "namadaw", + &["--base-dir", home_path, "find", "--alias", "nam"], + )? + .stdout; + + let words: Vec<&str> = output.split_whitespace().collect(); + + if let Some(derived_index) = words.iter().position(|&w| w == "Established:") { + if let Some(&denom) = words.get(derived_index + 1) { + return Ok(denom.to_owned()); + } + return Err(eyre!( + "chain id is not 3 words after `Established:`: {output}" + )); + } + Err(eyre!("could not find `Derived` in output: {output}")) +} + impl ExportEnv for FullNode { fn export_env(&self, writer: &mut impl EnvWriter) { self.chain_driver.export_env(writer); diff --git a/tools/test-framework/src/types/tagged/dual.rs b/tools/test-framework/src/types/tagged/dual.rs index 605f15820c..25eb15eab6 100644 --- a/tools/test-framework/src/types/tagged/dual.rs +++ b/tools/test-framework/src/types/tagged/dual.rs @@ -310,7 +310,7 @@ impl Tagged { } } -impl<'a, TagA, TagB, Value: Clone> Tagged { +impl Tagged { /** Convert a [`Clone`]eable tagged reference into a tagged value. @@ -376,7 +376,7 @@ impl Tagged> { } } -impl<'a, TagA, TagB, Value> AsRef for Tagged { +impl AsRef for Tagged { fn as_ref(&self) -> &Value { self.value() } diff --git a/tools/test-framework/src/types/tagged/mono.rs b/tools/test-framework/src/types/tagged/mono.rs index a1e8a1f448..9611638a55 100644 --- a/tools/test-framework/src/types/tagged/mono.rs +++ b/tools/test-framework/src/types/tagged/mono.rs @@ -220,7 +220,7 @@ impl Tagged { } } -impl<'a, Tag, Value: Clone> Tagged { +impl Tagged { /** Convert a [`Clone`]eable tagged reference into a tagged value. @@ -302,7 +302,7 @@ impl Tagged> { } } -impl<'a, Tag, Value> AsRef for Tagged { +impl AsRef for Tagged { fn as_ref(&self) -> &Value { self.value() } diff --git a/tools/test-framework/src/types/wallet.rs b/tools/test-framework/src/types/wallet.rs index 9886c19cbe..943ebb9aa3 100644 --- a/tools/test-framework/src/types/wallet.rs +++ b/tools/test-framework/src/types/wallet.rs @@ -3,7 +3,7 @@ */ use core::fmt::{self, Display}; -use ibc_relayer::keyring::Secp256k1KeyPair; +use ibc_relayer::keyring::{AnySigningKeyPair, NamadaKeyPair, Secp256k1KeyPair}; use crate::types::env::{prefix_writer, EnvWriter, ExportEnv}; use crate::types::tagged::*; @@ -36,7 +36,7 @@ pub struct Wallet { // TODO: Parameterize this type on `SigningKeyPair` /// The wallet key information in the form of `SigningKeyPair` /// that is used by the relayer. - pub key: Secp256k1KeyPair, + pub key: AnySigningKeyPair, } /** @@ -82,7 +82,7 @@ pub trait TaggedWallet { fn address(&self) -> MonoTagged; /// Get the `SigningKeyPair` tagged with the given `Chain`. - fn key(&self) -> MonoTagged; + fn key(&self) -> MonoTagged; } /** @@ -107,11 +107,19 @@ pub trait TaggedTestWalletsExt { impl Wallet { /// Create a new [`Wallet`] - pub fn new(id: String, address: String, key: Secp256k1KeyPair) -> Self { + pub fn new_secp256(id: String, address: String, secp256_key: Secp256k1KeyPair) -> Self { Self { id: WalletId(id), address: WalletAddress(address), - key, + key: secp256_key.into(), + } + } + + pub fn new_namada(id: String, address: String, namada_key: NamadaKeyPair) -> Self { + Self { + id: WalletId(id), + address: WalletAddress(address), + key: namada_key.into(), } } } @@ -131,12 +139,12 @@ impl TaggedWallet for MonoTagged { self.map_ref(|w| &w.address) } - fn key(&self) -> MonoTagged { + fn key(&self) -> MonoTagged { self.map_ref(|w| &w.key) } } -impl<'a, Chain> TaggedWallet for MonoTagged { +impl TaggedWallet for MonoTagged { fn id(&self) -> MonoTagged { self.map_ref(|w| &w.id) } @@ -145,7 +153,7 @@ impl<'a, Chain> TaggedWallet for MonoTagged { self.map_ref(|w| &w.address) } - fn key(&self) -> MonoTagged { + fn key(&self) -> MonoTagged { self.map_ref(|w| &w.key) } } @@ -168,7 +176,7 @@ impl TaggedTestWalletsExt for MonoTagged { } } -impl<'a, Chain> TaggedTestWalletsExt for MonoTagged { +impl TaggedTestWalletsExt for MonoTagged { fn validator(&self) -> MonoTagged { self.map_ref(|w| &w.validator) } diff --git a/tools/test-framework/src/util/interchain_security.rs b/tools/test-framework/src/util/interchain_security.rs index ea66e12f4f..70a0e5da39 100644 --- a/tools/test-framework/src/util/interchain_security.rs +++ b/tools/test-framework/src/util/interchain_security.rs @@ -1,4 +1,4 @@ -use crate::chain::config::set_voting_period; +use crate::chain::config::cosmos::set_voting_period; use crate::prelude::*; use ibc_relayer::chain::tracking::TrackedMsgs; @@ -35,7 +35,7 @@ pub fn update_relayer_config_for_consumer_chain(config: &mut Config) { chain_config.ccv_consumer_chain = true; chain_config.trusting_period = Some(Duration::from_secs(99)); } - ChainConfig::CosmosSdk(_) => {} + ChainConfig::CosmosSdk(_) | ChainConfig::Namada(_) => {} } } } diff --git a/tools/test-framework/src/util/mod.rs b/tools/test-framework/src/util/mod.rs index 7db62f867e..0e677c7d6f 100644 --- a/tools/test-framework/src/util/mod.rs +++ b/tools/test-framework/src/util/mod.rs @@ -6,6 +6,7 @@ pub mod array; pub mod assert; pub mod file; pub mod interchain_security; +pub mod namada; pub mod proposal_status; pub mod random; pub mod retry; diff --git a/tools/test-framework/src/util/namada.rs b/tools/test-framework/src/util/namada.rs new file mode 100644 index 0000000000..03d967b17e --- /dev/null +++ b/tools/test-framework/src/util/namada.rs @@ -0,0 +1,176 @@ +use ibc_proto::Protobuf; +use ibc_relayer::consensus_state::{AnyConsensusState, AnyConsensusStateWithHeight}; +use ibc_relayer_types::core::ics04_channel::packet::Sequence; +use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, ClientId, PortId}; +use ibc_relayer_types::events::IbcEventType; +use ibc_relayer_types::Height; +use itertools::Itertools; +use namada_sdk::events::extend::Height as HeightAttr; +use namada_sdk::ibc::storage::{consensus_height, consensus_state_prefix}; +use namada_sdk::queries::RPC; +use namada_sdk::storage::{Key, PrefixValue}; +use namada_sdk::tx::Tx; +use namada_tendermint_rpc::{Client, HttpClient, Url}; +use std::fs::File; +use std::io::Read; +use toml::Value; + +use crate::prelude::*; + +pub fn get_namada_denom_address( + chain_id: &str, + home_path: &str, + denom: &str, +) -> Result { + let file_path = format!("{}/{}/wallet.toml", home_path, chain_id); + tracing::warn!("file path: {file_path}"); + let mut toml_content = String::new(); + let mut file = File::open(file_path).expect("Failed to open file"); + file.read_to_string(&mut toml_content) + .expect("Failed to read file"); + + // Parse the TOML content into a `toml::Value` object + let toml_value: Value = toml::from_str(&toml_content).expect("Failed to parse TOML"); + + // Extract a field from the TOML file + let denom_address = toml_value + .get("addresses") + .ok_or_else(|| eyre!("missing `addresses` field"))? + .get(denom) + .ok_or_else(|| eyre!("missing `{denom}` field"))? + .as_str() + .unwrap_or(denom) + .to_owned(); + + Ok(denom_address) +} + +pub async fn query_consensus_states( + rpc_address: Url, + client_id: &ClientId, +) -> Result, Error> { + // convert to that of ibc-rs + let client_id = client_id + .to_string() + .parse() + .expect("Client ID conversion shouldn't fail"); + let prefix = consensus_state_prefix(&client_id); + let mut states = vec![]; + for PrefixValue { key, value } in query_prefix(rpc_address, &prefix).await? { + let height = consensus_height(&key).expect("Key should have the height"); + let state = AnyConsensusStateWithHeight { + height: Height::new(height.revision_number(), height.revision_height()).unwrap(), + consensus_state: AnyConsensusState::decode_vec(&value) + .map_err(|_| Error::query_client())?, + }; + states.push(state); + } + Ok(states) +} + +async fn query_prefix(rpc_address: Url, prefix: &Key) -> Result, Error> { + let client = HttpClient::new(rpc_address).expect("Failed to make a RPC client"); + let response = RPC + .shell() + .storage_prefix(&client, None, None, false, prefix) + .await + .map_err(|e| eyre!("Namada query with prefix failed: {e}"))?; + Ok(response.data) +} + +pub async fn query_receive_tx_memo( + rpc_address: Url, + src_port_id: &PortId, + src_channel_id: &ChannelId, + dst_port_id: &PortId, + dst_channel_id: &ChannelId, + sequence: Sequence, +) -> Result { + let client = HttpClient::new(rpc_address).expect("Failed to make a RPC client"); + let height = query_write_ack_packet_height( + &client, + src_port_id, + src_channel_id, + dst_port_id, + dst_channel_id, + sequence, + ) + .await?; + + let height = namada_tendermint::block::Height::try_from(height.revision_height()) + .expect("Height should be converted"); + let response = client + .block(height) + .await + .map_err(|e| eyre!("Query a block failed: {e}"))?; + let memo: Vec = response + .block + .data + .iter() + .flat_map(|tx_bytes| { + let tx = Tx::try_from(&tx_bytes[..]) + .map_err(|e| e.to_string()) + .expect("Decoding tx failed"); + let memo: Vec = tx + .header() + .batch + .iter() + .filter_map(|cmt| { + tx.memo(cmt) + .map(|memo_bytes| String::from_utf8_lossy(&memo_bytes).to_string()) + }) + .collect(); + memo + }) + .collect(); + + // All memo should be the same for now + assert!(memo.iter().all_equal()); + + let memo = memo.first().ok_or_else(|| eyre!("No memo field"))?; + Ok(memo.to_string()) +} + +async fn query_write_ack_packet_height( + client: &HttpClient, + src_port_id: &PortId, + src_channel_id: &ChannelId, + dst_port_id: &PortId, + dst_channel_id: &ChannelId, + sequence: Sequence, +) -> Result { + let event = RPC + .shell() + .ibc_packet( + client, + &IbcEventType::WriteAck + .as_str() + .parse() + .expect("IbcEventType should be parsable"), + &src_port_id + .as_str() + .parse() + .expect("PortId should be parsable"), + &src_channel_id + .as_str() + .parse() + .expect("ChannelId should be parsable"), + &dst_port_id + .as_str() + .parse() + .expect("PortId should be parsable"), + &dst_channel_id + .as_str() + .parse() + .expect("ChannelId should be parsable"), + &u64::from(sequence).into(), + ) + .await + .map_err(|e| eyre!("Namada packet query failed: {e}"))? + .ok_or_else(|| eyre!("No write ack event"))?; + let height = event + .read_attribute::() + .expect("Height should exist"); + + Ok(Height::new(0, height.0).expect("Height conversion shouldn't fail")) +} From a5e3968ba09a6190fca103903d6bb8a3c35e4daf Mon Sep 17 00:00:00 2001 From: Dawn Date: Wed, 4 Dec 2024 00:22:02 +0900 Subject: [PATCH 222/224] rpc: Collect `finalized_block_events` in `fetch_all_events` (#4262) * add finalized_block_events in fetch_all_events * Add changelog entry --------- Co-authored-by: Luca Joss --- .../ibc-relayer/4263-collect-events-finalize-block.md | 2 ++ crates/relayer/src/event/source/rpc.rs | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 .changelog/unreleased/improvements/ibc-relayer/4263-collect-events-finalize-block.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4263-collect-events-finalize-block.md b/.changelog/unreleased/improvements/ibc-relayer/4263-collect-events-finalize-block.md new file mode 100644 index 0000000000..e7e78897cf --- /dev/null +++ b/.changelog/unreleased/improvements/ibc-relayer/4263-collect-events-finalize-block.md @@ -0,0 +1,2 @@ +- Collect events from `finalized_block_events` when using `pull` mode + ([\#4263](https://github.com/informalsystems/hermes/issues/4263)) \ No newline at end of file diff --git a/crates/relayer/src/event/source/rpc.rs b/crates/relayer/src/event/source/rpc.rs index 5a4b4be722..db64e2d111 100644 --- a/crates/relayer/src/event/source/rpc.rs +++ b/crates/relayer/src/event/source/rpc.rs @@ -381,6 +381,8 @@ async fn fetch_all_events( events.append(end_block_events); } + events.append(&mut response.finalize_block_events); + Ok(events) } From fd9b0605dc22e814a92a08bd052925a19978ba9d Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Fri, 13 Dec 2024 13:29:02 +0100 Subject: [PATCH 223/224] Revert support for Namada (#4276) * Update Cargo.lock * Revert "Add support for Namada (#3705)" This reverts commit 00a0cf504fb094ac02148583679983169e87111d. * Cargo clippy fix * Formatting --------- Co-authored-by: Luca Joss --- .../features/3705-support-namada.md | 2 - .github/codespell/words.txt | 3 - .github/workflows/cargo-doc.yaml | 7 +- .github/workflows/guide-templates.yaml | 10 +- .github/workflows/integration.yaml | 30 - .github/workflows/misbehaviour.yml | 20 - .github/workflows/multi-chains.yaml | 5 - .github/workflows/namada.yaml | 199 - .github/workflows/publish.yml | 5 - .github/workflows/release.yml | 5 - .github/workflows/rust.yml | 24 +- Cargo.lock | 4630 +---------------- Cargo.toml | 7 - ci/release/hermes.Dockerfile | 30 +- clippy.toml | 2 +- config.toml | 2 +- crates/chain-registry/Cargo.toml | 2 +- crates/relayer-cli/Cargo.toml | 2 +- crates/relayer-cli/src/commands/keys/add.rs | 39 +- .../relayer-cli/src/commands/keys/balance.rs | 8 +- .../relayer-cli/src/commands/keys/delete.rs | 13 - crates/relayer-cli/src/commands/listen.rs | 8 +- crates/relayer-cli/src/commands/tx/client.rs | 4 +- crates/relayer-cli/src/commands/tx/upgrade.rs | 4 +- crates/relayer-rest/Cargo.toml | 7 +- crates/relayer-rest/tests/mock.rs | 5 +- crates/relayer-types/Cargo.toml | 2 +- .../src/core/ics03_connection/events.rs | 25 - crates/relayer-types/src/events.rs | 2 +- crates/relayer/Cargo.toml | 7 +- crates/relayer/src/chain.rs | 2 - crates/relayer/src/chain/client.rs | 7 +- crates/relayer/src/chain/cosmos.rs | 5 +- crates/relayer/src/chain/cosmos/batch.rs | 2 +- crates/relayer/src/chain/cosmos/config.rs | 2 +- crates/relayer/src/chain/cosmos/gas.rs | 10 +- .../src/chain/cosmos/types/events/channel.rs | 44 +- .../chain/cosmos/types/events/connection.rs | 68 - .../src/chain/cosmos/types/events/mod.rs | 2 - .../chain/cosmos/types/events/raw_object.rs | 42 - crates/relayer/src/chain/cosmos/types/gas.rs | 5 - crates/relayer/src/chain/cosmos/version.rs | 11 +- crates/relayer/src/chain/cosmos/wait.rs | 2 +- crates/relayer/src/chain/endpoint.rs | 2 +- crates/relayer/src/chain/handle.rs | 2 +- crates/relayer/src/chain/handle/base.rs | 4 +- crates/relayer/src/chain/handle/cache.rs | 2 +- crates/relayer/src/chain/handle/counting.rs | 2 +- crates/relayer/src/chain/namada.rs | 1408 ----- crates/relayer/src/chain/namada/error.rs | 71 - crates/relayer/src/chain/namada/key.rs | 47 - crates/relayer/src/chain/namada/query.rs | 346 -- crates/relayer/src/chain/namada/tx.rs | 384 -- crates/relayer/src/chain/namada/version.rs | 27 - crates/relayer/src/chain/namada/wallet.rs | 65 - crates/relayer/src/chain/runtime.rs | 2 +- crates/relayer/src/chain/version.rs | 27 - crates/relayer/src/config.rs | 45 +- crates/relayer/src/error.rs | 5 - crates/relayer/src/event.rs | 2 +- .../src/event/source/websocket/extract.rs | 38 +- crates/relayer/src/foreign_client.rs | 8 +- crates/relayer/src/keyring.rs | 12 +- .../src/keyring/any_signing_key_pair.rs | 12 +- crates/relayer/src/light_client/tendermint.rs | 8 +- crates/relayer/src/spawn.rs | 5 +- crates/relayer/src/upgrade_chain.rs | 23 +- crates/relayer/src/util/compat_mode.rs | 2 +- crates/telemetry/Cargo.toml | 2 +- tools/integration-test/Cargo.toml | 3 +- .../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 +- .../src/tests/async_icq/simple_query.rs | 10 +- tools/integration-test/src/tests/authz.rs | 6 +- .../src/tests/channel_upgrade/flushing.rs | 5 +- .../src/tests/channel_upgrade/ica.rs | 12 +- .../src/tests/channel_upgrade/ics29.rs | 3 +- .../src/tests/channel_upgrade/timeout.rs | 3 +- .../channel_upgrade/upgrade_handshake.rs | 2 +- .../upgrade_handshake_steps.rs | 2 +- .../src/tests/clear_packet.rs | 33 +- .../src/tests/client_expiration.rs | 16 +- .../src/tests/client_refresh.rs | 23 +- .../src/tests/client_settings.rs | 4 +- .../src/tests/client_upgrade.rs | 26 +- .../src/tests/connection_delay.rs | 1 - .../src/tests/consensus_states.rs | 67 +- .../integration-test/src/tests/denom_trace.rs | 4 +- .../src/tests/dynamic_gas_fee.rs | 30 +- .../src/tests/error_events.rs | 41 +- .../src/tests/fee/auto_forward_relayer.rs | 1 - .../src/tests/fee/filter_fees.rs | 9 +- .../src/tests/fee/forward_relayer.rs | 1 - .../src/tests/fee/no_forward_relayer.rs | 2 - .../src/tests/fee/non_fee_channel.rs | 1 - .../src/tests/fee/pay_fee_async.rs | 1 - .../src/tests/fee/register_payee.rs | 1 - tools/integration-test/src/tests/fee_grant.rs | 28 +- .../src/tests/forward/forward_hop_transfer.rs | 8 - .../src/tests/forward/forward_transfer.rs | 9 - tools/integration-test/src/tests/ica.rs | 14 +- .../src/tests/ics20_filter/memo.rs | 1 - tools/integration-test/src/tests/ics31.rs | 3 +- .../interchain_security/dynamic_gas_fee.rs | 12 +- .../ica_ordered_channel.rs | 6 +- .../tests/interchain_security/ica_transfer.rs | 6 +- .../src/tests/interchain_security/icq.rs | 5 +- .../interchain_security/simple_transfer.rs | 1 - .../src/tests/manual/simulation.rs | 2 +- tools/integration-test/src/tests/memo.rs | 62 +- tools/integration-test/src/tests/mod.rs | 7 +- .../src/tests/ordered_channel.rs | 1 - .../src/tests/ordered_channel_clear.rs | 9 +- tools/integration-test/src/tests/python.rs | 2 +- .../src/tests/sequence_filter.rs | 6 +- .../integration-test/src/tests/supervisor.rs | 17 +- .../src/tests/tendermint/sequential.rs | 121 +- .../src/tests/ternary_transfer.rs | 3 - tools/integration-test/src/tests/transfer.rs | 16 +- tools/test-framework/Cargo.toml | 6 - .../src/bootstrap/binary/chain.rs | 5 +- .../test-framework/src/bootstrap/consumer.rs | 39 +- tools/test-framework/src/bootstrap/mod.rs | 1 - tools/test-framework/src/bootstrap/namada.rs | 328 -- tools/test-framework/src/bootstrap/single.rs | 41 +- tools/test-framework/src/chain/chain_type.rs | 16 +- tools/test-framework/src/chain/cli/query.rs | 53 - .../src/chain/{config/cosmos.rs => config.rs} | 0 tools/test-framework/src/chain/config/mod.rs | 2 - .../test-framework/src/chain/config/namada.rs | 144 - tools/test-framework/src/chain/driver.rs | 32 +- tools/test-framework/src/chain/exec.rs | 51 - .../test-framework/src/chain/ext/bootstrap.rs | 12 +- tools/test-framework/src/chain/ext/ica.rs | 66 +- .../test-framework/src/chain/ext/transfer.rs | 229 +- tools/test-framework/src/chain/tagged.rs | 11 +- .../src/docs/walkthroughs/memo.rs | 8 +- .../src/docs/walkthroughs/ordered_channel.rs | 1 - .../src/framework/binary/chain.rs | 13 +- .../src/framework/binary/channel.rs | 8 +- .../src/framework/binary/connection.rs | 8 +- .../src/framework/binary/node.rs | 120 +- .../src/framework/nary/chain.rs | 6 +- .../src/framework/nary/channel.rs | 6 +- .../src/framework/nary/connection.rs | 5 +- .../test-framework/src/framework/nary/node.rs | 44 +- .../test-framework/src/framework/overrides.rs | 14 +- tools/test-framework/src/ibc/denom.rs | 129 +- tools/test-framework/src/ibc/token.rs | 27 +- tools/test-framework/src/relayer/chain.rs | 2 +- tools/test-framework/src/relayer/fee.rs | 61 +- tools/test-framework/src/relayer/transfer.rs | 118 +- tools/test-framework/src/types/single/node.rs | 169 +- tools/test-framework/src/types/wallet.rs | 22 +- .../src/util/interchain_security.rs | 4 +- tools/test-framework/src/util/mod.rs | 1 - tools/test-framework/src/util/namada.rs | 176 - 158 files changed, 889 insertions(+), 9603 deletions(-) delete mode 100644 .changelog/unreleased/features/3705-support-namada.md delete mode 100644 .github/workflows/namada.yaml delete mode 100644 crates/relayer/src/chain/cosmos/types/events/connection.rs delete mode 100644 crates/relayer/src/chain/cosmos/types/events/raw_object.rs delete mode 100644 crates/relayer/src/chain/namada.rs delete mode 100644 crates/relayer/src/chain/namada/error.rs delete mode 100644 crates/relayer/src/chain/namada/key.rs delete mode 100644 crates/relayer/src/chain/namada/query.rs delete mode 100644 crates/relayer/src/chain/namada/tx.rs delete mode 100644 crates/relayer/src/chain/namada/version.rs delete mode 100644 crates/relayer/src/chain/namada/wallet.rs delete mode 100644 crates/relayer/src/chain/version.rs delete mode 100644 tools/test-framework/src/bootstrap/namada.rs rename tools/test-framework/src/chain/{config/cosmos.rs => config.rs} (100%) delete mode 100644 tools/test-framework/src/chain/config/mod.rs delete mode 100644 tools/test-framework/src/chain/config/namada.rs delete mode 100644 tools/test-framework/src/util/namada.rs diff --git a/.changelog/unreleased/features/3705-support-namada.md b/.changelog/unreleased/features/3705-support-namada.md deleted file mode 100644 index 9e7e7a7eb6..0000000000 --- a/.changelog/unreleased/features/3705-support-namada.md +++ /dev/null @@ -1,2 +0,0 @@ -- Add support for relaying between Namada and CosmosSDK-based chains. - ([\#3705](https://github.com/informalsystems/hermes/issues/3705)) \ No newline at end of file diff --git a/.github/codespell/words.txt b/.github/codespell/words.txt index eed2287f50..d15ff15549 100644 --- a/.github/codespell/words.txt +++ b/.github/codespell/words.txt @@ -2,6 +2,3 @@ crate shs ser numer -nam -inout -wast diff --git a/.github/workflows/cargo-doc.yaml b/.github/workflows/cargo-doc.yaml index 564d51c810..9682a8456f 100644 --- a/.github/workflows/cargo-doc.yaml +++ b/.github/workflows/cargo-doc.yaml @@ -28,12 +28,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: nightly-2024-10-15 - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} + toolchain: nightly-2024-04-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 76152d6513..9eefc0d3fc 100644 --- a/.github/workflows/guide-templates.yaml +++ b/.github/workflows/guide-templates.yaml @@ -31,13 +31,13 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Check templates run: bash scripts/auto_gen_templates.sh --mode "check" + - uses: actions-rs/cargo@v1 + name: Update lockfile + with: + command: generate-lockfile + args: --manifest-path tools/check-guide/Cargo.toml - uses: actions-rs/cargo@v1 name: Check guide with: diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 137a63cafb..fb98841907 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -118,11 +118,6 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test @@ -161,11 +156,6 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test @@ -209,11 +199,6 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test @@ -257,11 +242,6 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test @@ -304,11 +284,6 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test @@ -353,11 +328,6 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test diff --git a/.github/workflows/misbehaviour.yml b/.github/workflows/misbehaviour.yml index 37e5b75986..135ef7c9a1 100644 --- a/.github/workflows/misbehaviour.yml +++ b/.github/workflows/misbehaviour.yml @@ -80,11 +80,6 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Build Hermes uses: actions-rs/cargo@v1 with: @@ -137,11 +132,6 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Build Hermes uses: actions-rs/cargo@v1 with: @@ -194,11 +184,6 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Build Hermes uses: actions-rs/cargo@v1 with: @@ -251,11 +236,6 @@ jobs: uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Build Hermes uses: actions-rs/cargo@v1 with: diff --git a/.github/workflows/multi-chains.yaml b/.github/workflows/multi-chains.yaml index 2e902ce8a0..9aeb907848 100644 --- a/.github/workflows/multi-chains.yaml +++ b/.github/workflows/multi-chains.yaml @@ -99,11 +99,6 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/cargo@v1 with: command: test diff --git a/.github/workflows/namada.yaml b/.github/workflows/namada.yaml deleted file mode 100644 index ded8f201b4..0000000000 --- a/.github/workflows/namada.yaml +++ /dev/null @@ -1,199 +0,0 @@ -name: Namada Integration - -on: - workflow_dispatch: - pull_request: - paths: - - .github/workflows/namada.yaml - - Cargo.toml - - Cargo.lock - - flake.nix - - flake.lock - - ci/** - - e2e/** - - crates/** - - tools/** - -env: - CARGO_INCREMENTAL: 0 - CARGO_PROFILE_DEV_DEBUG: 1 - CARGO_PROFILE_RELEASE_DEBUG: 1 - RUST_BACKTRACE: short - CARGO_NET_RETRY: 10 - RUSTUP_MAX_RETRIES: 10 - -# Cancel previous runs of this workflow when a new commit is added to the PR, branch or tag -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} - cancel-in-progress: true - -jobs: - cosmos-namada: - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - matrix: - chain: - - package: .#gaia20 - command: gaiad,namada - account_prefix: cosmos,'' - native_token: stake,nam - - package: .#osmosis - command: osmosisd,namada - account_prefix: osmo,'' - native_token: stake,nam - steps: - - uses: actions/checkout@v4 - - name: Clone Namada - uses: actions/checkout@v4 - with: - repository: anoma/namada - ref: v0.46.1 - path: namada - - name: Retrieve Namada repository path - id: namada-repo-path - run: | - echo "NAMADA_REPO_PATH=$(pwd)/namada" >> "$GITHUB_ENV" - - 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 - - name: Install libudev - run: sudo apt-get update && sudo apt-get -y install libudev-dev - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions-rs/cargo@v1 - with: - command: test - args: -p ibc-integration-test --features namada --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 - - name: Download CometBFT - run: | - curl -o cometbft.tar.gz -LO https://github.com/cometbft/cometbft/releases/download/v0.37.11/cometbft_0.37.11_linux_amd64.tar.gz - tar -xvzf cometbft.tar.gz - chmod +x cometbft - mkdir -p $HOME/local/bin - mv cometbft ~/local/bin - - name: Download Namada binaries - env: - OPERATING_SYSTEM: Linux - run: | - release_url=$(curl -s "https://api.github.com/repos/anoma/namada/releases/188247367" | grep "browser_download_url" | cut -d '"' -f 4 | grep "$OPERATING_SYSTEM") - wget "$release_url" - tar -xzvf namada*.tar.gz - cp ./namada*/namadac ~/local/bin/namadac - cp ./namada*/namadan ~/local/bin/namadan - cp ./namada*/namadaw ~/local/bin/namadaw - cp ./namada*/namada ~/local/bin/namada - cp ./namada*/wasm/checksums.json $NAMADA_REPO_PATH/wasm - cp ./namada*/wasm/*.wasm $NAMADA_REPO_PATH/wasm - - name: Update environment path - run: | - echo "${HOME}/local/bin" >> $GITHUB_PATH - - name: Download MASP parameters - run: | - echo $HOME - mkdir -p $HOME/.masp-params - curl -o $HOME/.masp-params/masp-spend.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-spend.params\?raw\=true - curl -o $HOME/.masp-params/masp-output.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-output.params?raw=true - curl -o $HOME/.masp-params/masp-convert.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-convert.params?raw=true - - env: - RUST_LOG: info - RUST_BACKTRACE: 1 - NO_COLOR_LOG: 1 - NEXTEST_RETRIES: 2 - CHAIN_COMMAND_PATHS: ${{ matrix.chain.command }} - ACCOUNT_PREFIXES: ${{ matrix.chain.account_prefix }} - NATIVE_TOKENS: ${{ matrix.chain.native_token }} - run: | - nix shell ${{ matrix.chain.package }} -c \ - cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=1 \ - --features namada - - namada: - runs-on: ubuntu-22.04 - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v4 - - name: Clone Namada - uses: actions/checkout@v4 - with: - repository: anoma/namada - ref: v0.46.1 - path: namada - - name: Retrieve Namada repository path - id: namada-repo-path - run: | - echo "NAMADA_REPO_PATH=$(pwd)/namada" >> "$GITHUB_ENV" - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - toolchain: stable - - name: Install libudev - run: sudo apt-get update && sudo apt-get -y install libudev-dev - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions-rs/cargo@v1 - with: - command: test - args: -p ibc-integration-test --features namada --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 - - name: Download CometBFT - run: | - curl -o cometbft.tar.gz -LO https://github.com/cometbft/cometbft/releases/download/v0.37.11/cometbft_0.37.11_linux_amd64.tar.gz - tar -xvzf cometbft.tar.gz - mkdir -p ~/local/bin - chmod +x cometbft - mv cometbft ~/local/bin - - name: Download Namada binaries - env: - OPERATING_SYSTEM: Linux - run: | - release_url=$(curl -s "https://api.github.com/repos/anoma/namada/releases/188247367" | grep "browser_download_url" | cut -d '"' -f 4 | grep "$OPERATING_SYSTEM") - wget "$release_url" - tar -xzvf namada*.tar.gz - cp ./namada*/namadac ~/local/bin/namadac - cp ./namada*/namadan ~/local/bin/namadan - cp ./namada*/namadaw ~/local/bin/namadaw - cp ./namada*/namada ~/local/bin/namada - cp ./namada*/wasm/checksums.json $NAMADA_REPO_PATH/wasm - cp ./namada*/wasm/*.wasm $NAMADA_REPO_PATH/wasm - - name: Update environment path - run: | - echo "${HOME}/local/bin" >> $GITHUB_PATH - - name: Download MASP parameters - run: | - echo $HOME - mkdir -p $HOME/.masp-params - curl -o $HOME/.masp-params/masp-spend.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-spend.params\?raw\=true - curl -o $HOME/.masp-params/masp-output.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-output.params?raw=true - curl -o $HOME/.masp-params/masp-convert.params -L https://github.com/anoma/masp-mpc/releases/download/namada-trusted-setup/masp-convert.params?raw=true - - env: - RUST_LOG: info - RUST_BACKTRACE: 1 - NO_COLOR_LOG: 1 - NEXTEST_RETRIES: 2 - CHAIN_COMMAND_PATHS: namada - ACCOUNT_PREFIXES: '' - NATIVE_TOKENS: nam - run: | - cargo nextest run -p ibc-integration-test --no-fail-fast --failure-output final --test-threads=1 \ - --features namada - diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 34e99fd9f6..42106466c5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,11 +14,6 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: katyo/publish-crates@v2 with: registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 20dd2d8ab2..b1f7b3a39c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,11 +31,6 @@ jobs: runs-on: ${{ matrix.config.os }} steps: - uses: actions/checkout@v4 - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: taiki-e/upload-rust-binary-action@v1 with: # (required) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 12271bbfe6..bc19b03142 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,11 +54,6 @@ jobs: with: toolchain: stable components: clippy - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/clippy-check@v1 with: name: clippy-all-features @@ -73,11 +68,6 @@ jobs: with: toolchain: stable components: clippy - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: actions-rs/clippy-check@v1 with: name: clippy-no-default-features @@ -92,11 +82,6 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - 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 @@ -115,17 +100,12 @@ jobs: - uses: actions-rust-lang/setup-rust-toolchain@v1 with: toolchain: stable - - name: Install Protoc - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Install cargo-binstall uses: taiki-e/install-action@cargo-binstall - name: Install cargo-msrv - run: cargo binstall --no-confirm --force cargo-msrv@0.17.1 + run: cargo binstall --no-confirm --force cargo-msrv@0.16.0-beta.20 - name: Check MSRV - run: cargo msrv verify --output-format json --manifest-path crates/relayer-cli/Cargo.toml + run: cargo msrv verify --output-format minimal --manifest-path crates/relayer-cli/Cargo.toml -- 'cargo check --all-features' # test-coverage: # runs-on: ubuntu-latest diff --git a/Cargo.lock b/Cargo.lock index 0178acb0fa..55cd5f92ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,16 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - [[package]] name = "abscissa_core" version = "0.6.0" @@ -22,13 +12,13 @@ dependencies = [ "arc-swap", "backtrace", "canonical-path", - "clap 3.2.25", + "clap", "color-eyre", "fs-err", "once_cell", "regex", "secrecy", - "semver 1.0.23", + "semver", "serde", "termcolor", "toml 0.5.11", @@ -66,33 +56,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "adler2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" - -[[package]] -name = "aead" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" -dependencies = [ - "crypto-common", - "generic-array", -] - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - [[package]] name = "aho-corasick" version = "1.1.3" @@ -178,91 +141,6 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" -[[package]] -name = "ark-bls12-381" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65be532f9dd1e98ad0150b037276cde464c6f371059e6dd02c0222395761f6aa" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-std", -] - -[[package]] -name = "ark-ec" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea978406c4b1ca13c2db2373b05cc55429c3575b8b21f1b9ee859aa5b03dd42" -dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", - "derivative", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b3235cc41ee7a12aaaf2c575a2ad7b46713a8a50bda2fc3b003a04845c05dd6" -dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", - "derivative", - "num-bigint", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "paste", - "rustc_version 0.3.3", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db02d390bf6643fb404d3d22d31aee1c4bc4459600aef9113833d17e786c6e44" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" -dependencies = [ - "num-bigint", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-serialize" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6c2b318ee6e10f8c2853e73a83adc0ccb88995aa978d8a3408d492ab2ee671" -dependencies = [ - "ark-std", - "digest 0.9.0", -] - -[[package]] -name = "ark-std" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" -dependencies = [ - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.8.5", -] - [[package]] name = "arrayref" version = "0.3.9" @@ -275,15 +153,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" -[[package]] -name = "ascii-canvas" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" -dependencies = [ - "term", -] - [[package]] name = "async-stream" version = "0.3.6" @@ -303,7 +172,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -314,7 +183,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -331,18 +200,7 @@ dependencies = [ "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", - "tungstenite 0.21.0", -] - -[[package]] -name = "async_io_stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" -dependencies = [ - "futures", - "pharos", - "rustc_version 0.4.1", + "tungstenite", ] [[package]] @@ -362,17 +220,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "auto_impl" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", -] - [[package]] name = "autocfg" version = "1.4.0" @@ -485,7 +332,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", ] @@ -496,18 +343,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "base58" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" - -[[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" @@ -526,12 +361,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "bech32" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9ff0bbfd639f15c74af777d81383cf53efb7c93613f6cab67c6c11e05bbf8b" - [[package]] name = "bech32" version = "0.9.1" @@ -544,60 +373,6 @@ version = "0.10.0-beta" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98f7eed2b2781a6f0b5c903471d48e15f56fb4e1165df8a9a2337fd1a59d45ea" -[[package]] -name = "bellman" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afceed28bac7f9f5a508bca8aeeff51cdfa4770c0b967ac55c621e2ddfd6171" -dependencies = [ - "bitvec", - "blake2s_simd", - "byteorder", - "ff", - "group", - "pairing", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "bimap" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" -dependencies = [ - "serde", -] - -[[package]] -name = "bip0039" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568b6890865156d9043af490d4c4081c385dd68ea10acd6ca15733d511e6b51c" -dependencies = [ - "hmac 0.12.1", - "pbkdf2 0.12.2", - "rand 0.8.5", - "sha2 0.10.8", - "unicode-normalization", - "zeroize", -] - -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - [[package]] name = "bitcoin" version = "0.31.2" @@ -644,21 +419,6 @@ name = "bitflags" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" -dependencies = [ - "serde", -] - -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] [[package]] name = "blake2" @@ -669,28 +429,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "blake2b_simd" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" -dependencies = [ - "arrayref", - "arrayvec", - "constant_time_eq 0.3.1", -] - -[[package]] -name = "blake2s_simd" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94230421e395b9920d23df13ea5d77a20e1725331f90fbbf6df6040b33f756ae" -dependencies = [ - "arrayref", - "arrayvec", - "constant_time_eq 0.3.1", -] - [[package]] name = "blake3" version = "1.5.4" @@ -701,7 +439,7 @@ dependencies = [ "arrayvec", "cc", "cfg-if", - "constant_time_eq 0.3.1", + "constant_time_eq", ] [[package]] @@ -722,67 +460,12 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bls12_381" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc6d6292be3a19e6379786dac800f551e5865a5bb51ebbe3064ab80433f403" -dependencies = [ - "ff", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "bls12_381" -version = "0.8.0" -source = "git+https://github.com/heliaxdev/bls12_381.git?rev=d3ebe9dd6488fac1923db120a7498079e55dd838#d3ebe9dd6488fac1923db120a7498079e55dd838" -dependencies = [ - "ff", - "group", - "pairing", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "borsh" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03" -dependencies = [ - "borsh-derive", - "cfg_aliases", -] - -[[package]] -name = "borsh-derive" -version = "1.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2593a3b8b938bd68373196c9832f516be11fa487ef4ae745eb282e6a56a7244" -dependencies = [ - "once_cell", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.89", -] - -[[package]] -name = "borsh-ext" -version = "1.2.0" -source = "git+https://github.com/heliaxdev/borsh-ext?tag=v1.2.0#a62fee3e847e512cad9ac0f1fd5a900e5db9ba37" -dependencies = [ - "borsh", -] - [[package]] name = "bs58" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ - "sha2 0.10.8", "tinyvec", ] @@ -792,12 +475,6 @@ version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" -[[package]] -name = "byte-slice-cast" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" - [[package]] name = "byte-unit" version = "4.0.19" @@ -823,82 +500,18 @@ dependencies = [ "serde", ] -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "camino" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -dependencies = [ - "serde", -] - [[package]] name = "canonical-path" version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" -[[package]] -name = "cargo-platform" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.23", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cbc" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" -dependencies = [ - "cipher", -] - [[package]] name = "cc" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ - "jobserver", - "libc", "shlex", ] @@ -909,69 +522,19 @@ 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.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "chacha20poly1305" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" -dependencies = [ - "aead", - "chacha20", - "cipher", - "poly1305", - "zeroize", -] - -[[package]] -name = "chrono" -version = "0.4.38" +name = "chrono" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits", "wasm-bindgen", "windows-targets 0.52.6", ] -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", - "zeroize", -] - -[[package]] -name = "circular-queue" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d34327ead1c743a10db339de35fb58957564b99d248a67985c55638b22c59b5" -dependencies = [ - "version_check", -] - [[package]] name = "clap" version = "3.2.25" @@ -981,7 +544,7 @@ dependencies = [ "atty", "bitflags 1.3.2", "clap_derive", - "clap_lex 0.2.4", + "clap_lex", "indexmap 1.9.3", "once_cell", "strsim", @@ -989,32 +552,13 @@ dependencies = [ "textwrap", ] -[[package]] -name = "clap" -version = "4.5.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" -dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.5.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" -dependencies = [ - "anstyle", - "clap_lex 0.7.3", -] - [[package]] name = "clap_complete" version = "3.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f7a2e0a962c45ce25afce14220bc24f9dade0a1787f185cecf96bfba7847cd8" dependencies = [ - "clap 3.2.25", + "clap", ] [[package]] @@ -1023,7 +567,7 @@ version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro-error", "proc-macro2", "quote", @@ -1039,69 +583,6 @@ dependencies = [ "os_str_bytes", ] -[[package]] -name = "clap_lex" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" - -[[package]] -name = "clru" -version = "0.5.0" -source = "git+https://github.com/marmeladema/clru-rs.git?rev=71ca566#71ca566915f21f3c308091ca7756a91b0f8b5afc" - -[[package]] -name = "coins-bip32" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" -dependencies = [ - "bs58", - "coins-core", - "digest 0.10.7", - "hmac 0.12.1", - "k256", - "serde", - "sha2 0.10.8", - "thiserror", -] - -[[package]] -name = "coins-bip39" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" -dependencies = [ - "bitvec", - "coins-bip32", - "hmac 0.12.1", - "once_cell", - "pbkdf2 0.12.2", - "rand 0.8.5", - "sha2 0.10.8", - "thiserror", -] - -[[package]] -name = "coins-core" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" -dependencies = [ - "base64 0.21.7", - "bech32 0.9.1", - "bs58", - "digest 0.10.7", - "generic-array", - "hex", - "ripemd", - "serde", - "serde_derive", - "sha2 0.10.8", - "sha3", - "thiserror", -] - [[package]] name = "color-eyre" version = "0.6.3" @@ -1148,37 +629,12 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "const-hex" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487981fa1af147182687064d0a2c336586d337a606595ced9ffb0c685c250c73" -dependencies = [ - "cfg-if", - "cpufeatures", - "hex", - "proptest", - "serde", -] - [[package]] name = "const-oid" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "const_panic" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "013b6c2c3a14d678f38cd23994b02da3a1a1b6a5d1eedddfe63a5a5f11b13a81" - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "constant_time_eq" version = "0.3.1" @@ -1219,9 +675,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "462e1f6a8e005acc8835d32d60cbd7973ed65ea2a8d8473830e675f050956427" dependencies = [ "informalsystems-pbjson", - "prost 0.13.3", + "prost", "serde", - "tendermint-proto 0.40.0", + "tendermint-proto", "tonic", ] @@ -1234,15 +690,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if", -] - [[package]] name = "crossbeam-channel" version = "0.5.13" @@ -1252,16 +699,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - [[package]] name = "crossbeam-epoch" version = "0.9.18" @@ -1290,7 +727,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -1305,31 +742,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "crypto-mac" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" -dependencies = [ - "generic-array", - "subtle", -] - -[[package]] -name = "ct-codecs" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "026ac6ceace6298d2c557ef5ed798894962296469ec7842288ea64674201a2d1" - -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - [[package]] name = "curve25519-dalek" version = "4.1.3" @@ -1341,7 +753,7 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "rustc_version 0.4.1", + "rustc_version", "subtle", "zeroize", ] @@ -1354,7 +766,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -1365,7 +777,7 @@ checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" dependencies = [ "byteorder", "digest 0.9.0", - "rand_core 0.6.4", + "rand_core", "subtle-ng", "zeroize", ] @@ -1414,17 +826,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" -[[package]] -name = "derivative" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive_more" version = "0.99.18" @@ -1433,27 +834,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", -] - -[[package]] -name = "derive_more" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -1490,24 +871,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "directories" -version = "4.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" -dependencies = [ - "dirs-sys 0.3.7", -] - -[[package]] -name = "dirs" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" -dependencies = [ - "dirs-sys 0.4.1", -] - [[package]] name = "dirs-next" version = "2.0.0" @@ -1518,29 +881,6 @@ dependencies = [ "dirs-sys-next", ] -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dirs-sys" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" -dependencies = [ - "libc", - "option-ext", - "redox_users", - "windows-sys 0.48.0", -] - [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -1560,35 +900,9 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", -] - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "duration-str" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c1a2e028bbf7921549873b291ddc0cfe08b673d9489da81ac28898cd5a0e6e0" -dependencies = [ - "chrono", - "rust_decimal", - "serde", - "thiserror", - "time", - "winnow", + "syn 2.0.87", ] -[[package]] -name = "dyn-clone" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" - [[package]] name = "ecdsa" version = "0.16.9" @@ -1599,7 +913,6 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", - "serdect", "signature", "spki", ] @@ -1623,10 +936,8 @@ checksum = "3c8465edc8ee7436ffea81d21a019b16676ee3db267aa8d5a8d729581ecf998b" dependencies = [ "curve25519-dalek-ng", "hex", - "rand_core 0.6.4", - "serde", + "rand_core", "sha2 0.9.9", - "thiserror", "zeroize", ] @@ -1638,7 +949,7 @@ checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", - "rand_core 0.6.4", + "rand_core", "serde", "sha2 0.10.8", "subtle", @@ -1653,7 +964,7 @@ checksum = "6b49a684b133c4980d7ee783936af771516011c8cd15f429dbda77245e282f03" dependencies = [ "derivation-path", "ed25519-dalek", - "hmac 0.12.1", + "hmac", "sha2 0.10.8", ] @@ -1676,22 +987,12 @@ dependencies = [ "generic-array", "group", "pkcs8", - "rand_core 0.6.4", + "rand_core", "sec1", - "serdect", "subtle", "zeroize", ] -[[package]] -name = "ena" -version = "0.14.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d248bdd43ce613d87415282f69b9bb99d947d290b10962dd6c56233312c2ad5" -dependencies = [ - "log", -] - [[package]] name = "encode_unicode" version = "0.3.6" @@ -1707,24 +1008,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enr" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a3d8dc56e02f954cac8eb489772c552c473346fc34f67412bb6244fd647f7e4" -dependencies = [ - "base64 0.21.7", - "bytes", - "hex", - "k256", - "log", - "rand 0.8.5", - "rlp", - "serde", - "sha3", - "zeroize", -] - [[package]] name = "env_filter" version = "0.1.2" @@ -1765,390 +1048,28 @@ dependencies = [ ] [[package]] -name = "eth-keystore" -version = "0.5.0" +name = "eyre" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" dependencies = [ - "aes", - "ctr", - "digest 0.10.7", - "hex", - "hmac 0.12.1", - "pbkdf2 0.11.0", - "rand 0.8.5", - "scrypt", - "serde", - "serde_json", - "sha2 0.10.8", - "sha3", - "thiserror", - "uuid 0.8.2", + "indenter", + "once_cell", ] [[package]] -name = "ethabi" -version = "18.0.0" +name = "fastrand" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" + +[[package]] +name = "ff" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "ethereum-types", - "hex", - "once_cell", - "regex", - "serde", - "serde_json", - "sha3", - "thiserror", - "uint", -] - -[[package]] -name = "ethbloom" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "tiny-keccak", -] - -[[package]] -name = "ethbridge-bridge-contract" -version = "0.24.0" -source = "git+https://github.com/heliaxdev/ethbridge-rs?tag=v0.24.0#d66708bb8a734111988b9eaf08c7473bd7020c00" -dependencies = [ - "ethbridge-bridge-events", - "ethbridge-structs", - "ethers", - "ethers-contract", -] - -[[package]] -name = "ethbridge-bridge-events" -version = "0.24.0" -source = "git+https://github.com/heliaxdev/ethbridge-rs?tag=v0.24.0#d66708bb8a734111988b9eaf08c7473bd7020c00" -dependencies = [ - "ethabi", - "ethbridge-structs", - "ethers", - "ethers-contract", -] - -[[package]] -name = "ethbridge-structs" -version = "0.24.0" -source = "git+https://github.com/heliaxdev/ethbridge-rs?tag=v0.24.0#d66708bb8a734111988b9eaf08c7473bd7020c00" -dependencies = [ - "ethabi", - "ethers", - "ethers-contract", -] - -[[package]] -name = "ethereum-types" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" -dependencies = [ - "ethbloom", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "primitive-types", - "scale-info", - "uint", -] - -[[package]] -name = "ethers" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816841ea989f0c69e459af1cf23a6b0033b19a55424a1ea3a30099becdb8dec0" -dependencies = [ - "ethers-addressbook", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-middleware", - "ethers-providers", - "ethers-signers", - "ethers-solc", -] - -[[package]] -name = "ethers-addressbook" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5495afd16b4faa556c3bba1f21b98b4983e53c1755022377051a975c3b021759" -dependencies = [ - "ethers-core", - "once_cell", - "serde", - "serde_json", -] - -[[package]] -name = "ethers-contract" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fceafa3578c836eeb874af87abacfb041f92b4da0a78a5edd042564b8ecdaaa" -dependencies = [ - "const-hex", - "ethers-contract-abigen", - "ethers-contract-derive", - "ethers-core", - "ethers-providers", - "futures-util", - "once_cell", - "pin-project", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "ethers-contract-abigen" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04ba01fbc2331a38c429eb95d4a570166781f14290ef9fdb144278a90b5a739b" -dependencies = [ - "Inflector", - "const-hex", - "dunce", - "ethers-core", - "ethers-etherscan", - "eyre", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "reqwest", - "serde", - "serde_json", - "syn 2.0.89", - "toml 0.8.19", - "walkdir", -] - -[[package]] -name = "ethers-contract-derive" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87689dcabc0051cde10caaade298f9e9093d65f6125c14575db3fd8c669a168f" -dependencies = [ - "Inflector", - "const-hex", - "ethers-contract-abigen", - "ethers-core", - "proc-macro2", - "quote", - "serde_json", - "syn 2.0.89", -] - -[[package]] -name = "ethers-core" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d80cc6ad30b14a48ab786523af33b37f28a8623fc06afd55324816ef18fb1f" -dependencies = [ - "arrayvec", - "bytes", - "cargo_metadata", - "chrono", - "const-hex", - "elliptic-curve", - "ethabi", - "generic-array", - "k256", - "num_enum", - "once_cell", - "open-fastrlp", - "rand 0.8.5", - "rlp", - "serde", - "serde_json", - "strum 0.26.3", - "syn 2.0.89", - "tempfile", - "thiserror", - "tiny-keccak", - "unicode-xid", -] - -[[package]] -name = "ethers-etherscan" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79e5973c26d4baf0ce55520bd732314328cabe53193286671b47144145b9649" -dependencies = [ - "chrono", - "ethers-core", - "reqwest", - "semver 1.0.23", - "serde", - "serde_json", - "thiserror", - "tracing", -] - -[[package]] -name = "ethers-middleware" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48f9fdf09aec667c099909d91908d5eaf9be1bd0e2500ba4172c1d28bfaa43de" -dependencies = [ - "async-trait", - "auto_impl", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-providers", - "ethers-signers", - "futures-channel", - "futures-locks", - "futures-util", - "instant", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "tracing-futures", - "url", -] - -[[package]] -name = "ethers-providers" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6434c9a33891f1effc9c75472e12666db2fa5a0fec4b29af6221680a6fe83ab2" -dependencies = [ - "async-trait", - "auto_impl", - "base64 0.21.7", - "bytes", - "const-hex", - "enr", - "ethers-core", - "futures-core", - "futures-timer", - "futures-util", - "hashers", - "http 0.2.12", - "instant", - "jsonwebtoken", - "once_cell", - "pin-project", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tokio-tungstenite", - "tracing", - "tracing-futures", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "ws_stream_wasm", -] - -[[package]] -name = "ethers-signers" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "228875491c782ad851773b652dd8ecac62cda8571d3bc32a5853644dd26766c2" -dependencies = [ - "async-trait", - "coins-bip32", - "coins-bip39", - "const-hex", - "elliptic-curve", - "eth-keystore", - "ethers-core", - "rand 0.8.5", - "sha2 0.10.8", - "thiserror", - "tracing", -] - -[[package]] -name = "ethers-solc" -version = "2.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66244a771d9163282646dbeffe0e6eca4dda4146b6498644e678ac6089b11edd" -dependencies = [ - "cfg-if", - "const-hex", - "dirs", - "dunce", - "ethers-core", - "glob", - "home", - "md-5", - "num_cpus", - "once_cell", - "path-slash", - "rayon", - "regex", - "semver 1.0.23", - "serde", - "serde_json", - "solang-parser", - "svm-rs", - "thiserror", - "tiny-keccak", - "tokio", - "tracing", - "walkdir", - "yansi", -] - -[[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 = "fastrand" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" - -[[package]] -name = "fd-lock" -version = "3.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef033ed5e9bad94e55838ca0ca906db0e043f517adda0c8b79c7a8c66c93c1b5" -dependencies = [ - "cfg-if", - "rustix", - "windows-sys 0.48.0", -] - -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "bitvec", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -2164,28 +1085,9 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ - "byteorder", - "rand 0.8.5", - "rustc-hex", "static_assertions", ] -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" -dependencies = [ - "crc32fast", - "miniz_oxide 0.8.0", -] - [[package]] name = "flex-error" version = "0.4.4" @@ -2196,39 +1098,12 @@ dependencies = [ "paste", ] -[[package]] -name = "flume" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" -dependencies = [ - "futures-core", - "futures-sink", - "nanorand", - "spin 0.9.8", -] - [[package]] name = "fnv" version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -2238,20 +1113,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fpe" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c4b37de5ae15812a764c958297cfc50f5c010438f60c6ce75d11b802abd404" -dependencies = [ - "cbc", - "cipher", - "libm", - "num-bigint", - "num-integer", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "fs-err" version = "2.11.0" @@ -2261,22 +1122,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - [[package]] name = "futures" version = "0.3.31" @@ -2325,16 +1170,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" -[[package]] -name = "futures-locks" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ec6fe3675af967e67c5536c0b9d44e34e6c52f86bedc4ea49c5317b8e94d06" -dependencies = [ - "futures-channel", - "futures-task", -] - [[package]] name = "futures-macro" version = "0.3.31" @@ -2343,7 +1178,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -2358,16 +1193,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" -[[package]] -name = "futures-timer" -version = "3.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" -dependencies = [ - "gloo-timers", - "send_wrapper 0.4.0", -] - [[package]] name = "futures-util" version = "0.3.31" @@ -2386,15 +1211,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -2406,19 +1222,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", - "wasm-bindgen", -] - [[package]] name = "getrandom" version = "0.2.15" @@ -2428,7 +1231,7 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "wasm-bindgen", ] @@ -2438,24 +1241,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 = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "group" version = "0.13.0" @@ -2463,8 +1248,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "memuse", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -2550,15 +1334,6 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" -[[package]] -name = "hashers" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" -dependencies = [ - "fxhash", -] - [[package]] name = "hdpath" version = "0.6.3" @@ -2574,12 +1349,6 @@ 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" @@ -2613,16 +1382,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" -[[package]] -name = "hmac" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" -dependencies = [ - "crypto-mac", - "digest 0.9.0", -] - [[package]] name = "hmac" version = "0.12.1" @@ -2632,21 +1391,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "hmac-sha512" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77e806677ce663d0a199541030c816847b36e8dc095f70dae4a4f4ad63da5383" - -[[package]] -name = "home" -version = "0.5.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "http" version = "0.2.12" @@ -2803,19 +1547,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper 0.14.31", - "native-tls", - "tokio", - "tokio-native-tls", -] - [[package]] name = "hyper-util" version = "0.1.10" @@ -2858,87 +1589,6 @@ dependencies = [ "cc", ] -[[package]] -name = "ibc" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "ibc-apps", - "ibc-clients", - "ibc-core", - "ibc-core-host-cosmos", - "ibc-derive", - "ibc-primitives", -] - -[[package]] -name = "ibc-app-nft-transfer" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "ibc-app-nft-transfer-types", - "ibc-core", - "serde-json-wasm", -] - -[[package]] -name = "ibc-app-nft-transfer-types" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "base64 0.22.1", - "borsh", - "derive_more 0.99.18", - "displaydoc", - "http 1.1.0", - "ibc-app-transfer-types", - "ibc-core", - "ibc-proto 0.47.1", - "mime", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "serde-json-wasm", -] - -[[package]] -name = "ibc-app-transfer" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "ibc-app-transfer-types", - "ibc-core", - "serde-json-wasm", -] - -[[package]] -name = "ibc-app-transfer-types" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core", - "ibc-proto 0.47.1", - "parity-scale-codec", - "primitive-types", - "scale-info", - "schemars", - "serde", - "uint", -] - -[[package]] -name = "ibc-apps" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "ibc-app-nft-transfer", - "ibc-app-transfer", -] - [[package]] name = "ibc-chain-registry" version = "0.29.4" @@ -2947,370 +1597,18 @@ dependencies = [ "flex-error", "futures", "http 1.1.0", - "ibc-proto 0.51.1", + "ibc-proto", "ibc-relayer", "ibc-relayer-types", - "itertools 0.13.0", + "itertools", "reqwest", "serde", "serde_json", - "tendermint-rpc 0.40.0", + "tendermint-rpc", "tokio", "tracing", ] -[[package]] -name = "ibc-client-tendermint" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "derive_more 0.99.18", - "ibc-client-tendermint-types", - "ibc-core-client", - "ibc-core-commitment-types", - "ibc-core-handler-types", - "ibc-core-host", - "ibc-primitives", - "serde", - "tendermint 0.38.1", - "tendermint-light-client-verifier 0.38.1", -] - -[[package]] -name = "ibc-client-tendermint-types" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "displaydoc", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto 0.47.1", - "serde", - "tendermint 0.38.1", - "tendermint-light-client-verifier 0.38.1", - "tendermint-proto 0.38.1", -] - -[[package]] -name = "ibc-client-wasm-types" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "base64 0.22.1", - "displaydoc", - "ibc-core-client", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto 0.47.1", - "serde", -] - -[[package]] -name = "ibc-clients" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "ibc-client-tendermint", - "ibc-client-wasm-types", -] - -[[package]] -name = "ibc-core" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "ibc-core-channel", - "ibc-core-client", - "ibc-core-commitment-types", - "ibc-core-connection", - "ibc-core-handler", - "ibc-core-host", - "ibc-core-router", - "ibc-derive", - "ibc-primitives", -] - -[[package]] -name = "ibc-core-channel" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "ibc-core-channel-types", - "ibc-core-client", - "ibc-core-commitment-types", - "ibc-core-connection", - "ibc-core-handler-types", - "ibc-core-host", - "ibc-core-router", - "ibc-primitives", -] - -[[package]] -name = "ibc-core-channel-types" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-connection-types", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto 0.47.1", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "sha2 0.10.8", - "subtle-encoding", - "tendermint 0.38.1", -] - -[[package]] -name = "ibc-core-client" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "ibc-core-client-context", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-handler-types", - "ibc-core-host", - "ibc-primitives", -] - -[[package]] -name = "ibc-core-client-context" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "derive_more 0.99.18", - "displaydoc", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-handler-types", - "ibc-core-host-types", - "ibc-primitives", - "subtle-encoding", - "tendermint 0.38.1", -] - -[[package]] -name = "ibc-core-client-types" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core-commitment-types", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto 0.47.1", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "subtle-encoding", - "tendermint 0.38.1", -] - -[[package]] -name = "ibc-core-commitment-types" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto 0.47.1", - "ics23", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "subtle-encoding", -] - -[[package]] -name = "ibc-core-connection" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "ibc-client-wasm-types", - "ibc-core-client", - "ibc-core-connection-types", - "ibc-core-handler-types", - "ibc-core-host", - "ibc-primitives", - "prost 0.13.3", -] - -[[package]] -name = "ibc-core-connection-types" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto 0.47.1", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "subtle-encoding", - "tendermint 0.38.1", -] - -[[package]] -name = "ibc-core-handler" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "ibc-core-channel", - "ibc-core-client", - "ibc-core-commitment-types", - "ibc-core-connection", - "ibc-core-handler-types", - "ibc-core-host", - "ibc-core-router", - "ibc-primitives", -] - -[[package]] -name = "ibc-core-handler-types" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core-channel-types", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-connection-types", - "ibc-core-host-types", - "ibc-core-router-types", - "ibc-primitives", - "ibc-proto 0.47.1", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "subtle-encoding", - "tendermint 0.38.1", -] - -[[package]] -name = "ibc-core-host" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "derive_more 0.99.18", - "displaydoc", - "ibc-core-channel-types", - "ibc-core-client-context", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-connection-types", - "ibc-core-handler-types", - "ibc-core-host-types", - "ibc-primitives", - "subtle-encoding", -] - -[[package]] -name = "ibc-core-host-cosmos" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "derive_more 0.99.18", - "displaydoc", - "ibc-app-transfer-types", - "ibc-client-tendermint", - "ibc-core-client-context", - "ibc-core-client-types", - "ibc-core-commitment-types", - "ibc-core-connection-types", - "ibc-core-handler-types", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto 0.47.1", - "serde", - "sha2 0.10.8", - "subtle-encoding", - "tendermint 0.38.1", -] - -[[package]] -name = "ibc-core-host-types" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-primitives", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", -] - -[[package]] -name = "ibc-core-router" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "derive_more 0.99.18", - "displaydoc", - "ibc-core-channel-types", - "ibc-core-host-types", - "ibc-core-router-types", - "ibc-primitives", - "subtle-encoding", -] - -[[package]] -name = "ibc-core-router-types" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-core-host-types", - "ibc-primitives", - "ibc-proto 0.47.1", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", - "subtle-encoding", - "tendermint 0.38.1", -] - -[[package]] -name = "ibc-derive" -version = "0.8.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", -] - [[package]] name = "ibc-integration-test" version = "0.29.4" @@ -3320,72 +1618,33 @@ dependencies = [ "ibc-relayer", "ibc-relayer-types", "ibc-test-framework", - "prost 0.13.3", + "prost", "serde", "serde_json", - "tendermint 0.40.0", - "tendermint-rpc 0.40.0", + "tendermint", + "tendermint-rpc", "time", "toml 0.8.19", "tonic", ] -[[package]] -name = "ibc-primitives" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" -dependencies = [ - "borsh", - "derive_more 0.99.18", - "displaydoc", - "ibc-proto 0.47.1", - "parity-scale-codec", - "prost 0.13.3", - "scale-info", - "schemars", - "serde", - "tendermint 0.38.1", - "time", -] - [[package]] name = "ibc-proto" -version = "0.47.1" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c852d22b782d2d793f4a646f968de419be635e02bc8798d5d74a6e44eef27733" +checksum = "9b70f517162e74e2d35875b8b94bf4d1e45f2c69ef3de452dc855944455d33ca" dependencies = [ "base64 0.22.1", - "borsh", "bytes", + "cosmos-sdk-proto", "flex-error", "ics23", "informalsystems-pbjson", - "parity-scale-codec", - "prost 0.13.3", - "scale-info", - "schemars", + "prost", "serde", "subtle-encoding", - "tendermint-proto 0.38.1", -] - -[[package]] -name = "ibc-proto" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b70f517162e74e2d35875b8b94bf4d1e45f2c69ef3de452dc855944455d33ca" -dependencies = [ - "base64 0.22.1", - "bytes", - "cosmos-sdk-proto", - "flex-error", - "ics23", - "informalsystems-pbjson", - "prost 0.13.3", - "serde", - "subtle-encoding", - "tendermint-proto 0.40.0", - "tonic", + "tendermint-proto", + "tonic", ] [[package]] @@ -3414,44 +1673,39 @@ dependencies = [ "http 1.1.0", "humantime", "humantime-serde", - "ibc-proto 0.51.1", + "ibc-proto", "ibc-relayer-types", "ibc-telemetry", - "itertools 0.13.0", + "itertools", "moka", - "namada_sdk", "num-bigint", "num-rational", "once_cell", - "prost 0.13.3", + "prost", "regex", "reqwest", "retry", "ripemd", - "rpassword", "secp256k1", - "semver 1.0.23", + "semver", "serde", "serde_derive", "serde_json", "serial_test", "sha2 0.10.8", "signature", - "strum 0.25.0", + "strum", "subtle-encoding", - "tendermint 0.38.1", - "tendermint 0.40.0", + "tendermint", "tendermint-light-client", "tendermint-light-client-detector", - "tendermint-light-client-verifier 0.40.0", - "tendermint-proto 0.38.1", - "tendermint-proto 0.40.0", - "tendermint-rpc 0.38.1", - "tendermint-rpc 0.40.0", + "tendermint-light-client-verifier", + "tendermint-proto", + "tendermint-rpc", "tendermint-testgen", "test-log", "thiserror", - "tiny-bip39 1.0.0", + "tiny-bip39", "tiny-keccak", "tokio", "tokio-stream", @@ -3459,7 +1713,7 @@ dependencies = [ "tonic", "tracing", "tracing-subscriber", - "uuid 1.11.0", + "uuid", ] [[package]] @@ -3467,7 +1721,7 @@ name = "ibc-relayer-cli" version = "1.10.4" dependencies = [ "abscissa_core", - "clap 3.2.25", + "clap", "clap_complete", "color-eyre", "console", @@ -3485,7 +1739,7 @@ dependencies = [ "ibc-relayer-rest", "ibc-relayer-types", "ibc-telemetry", - "itertools 0.13.0", + "itertools", "once_cell", "oneline-eyre", "regex", @@ -3494,9 +1748,9 @@ dependencies = [ "serial_test", "signal-hook", "subtle-encoding", - "tendermint 0.40.0", - "tendermint-light-client-verifier 0.40.0", - "tendermint-rpc 0.40.0", + "tendermint", + "tendermint-light-client-verifier", + "tendermint-rpc", "time", "tokio", "tracing", @@ -3513,7 +1767,6 @@ dependencies = [ "ibc-relayer-types", "reqwest", "serde", - "serde_json", "tokio", "toml 0.8.19", "tracing", @@ -3524,24 +1777,24 @@ name = "ibc-relayer-types" version = "0.29.4" dependencies = [ "bytes", - "derive_more 0.99.18", + "derive_more", "env_logger", "flex-error", - "ibc-proto 0.51.1", + "ibc-proto", "ics23", - "itertools 0.13.0", + "itertools", "num-rational", "primitive-types", - "prost 0.13.3", + "prost", "regex", "serde", "serde_derive", "serde_json", "subtle-encoding", - "tendermint 0.40.0", - "tendermint-light-client-verifier 0.40.0", - "tendermint-proto 0.40.0", - "tendermint-rpc 0.40.0", + "tendermint", + "tendermint-light-client-verifier", + "tendermint-proto", + "tendermint-rpc", "tendermint-testgen", "test-log", "time", @@ -3564,7 +1817,7 @@ dependencies = [ "prometheus", "serde", "serde_json", - "tendermint 0.40.0", + "tendermint", "tokio", "tracing", ] @@ -3581,25 +1834,21 @@ dependencies = [ "hdpath", "hex", "http 1.1.0", - "ibc-proto 0.51.1", + "ibc-proto", "ibc-relayer", "ibc-relayer-cli", "ibc-relayer-types", - "itertools 0.13.0", - "namada_sdk", + "itertools", "once_cell", - "prost 0.13.3", - "rand 0.8.5", - "semver 1.0.23", + "prost", + "rand", + "semver", "serde", "serde_json", "serde_yaml", "sha2 0.10.8", "subtle-encoding", - "tendermint 0.38.1", - "tendermint 0.40.0", - "tendermint-rpc 0.38.1", - "tendermint-rpc 0.40.0", + "tendermint-rpc", "tokio", "toml 0.8.19", "tonic", @@ -3619,7 +1868,7 @@ dependencies = [ "bytes", "hex", "informalsystems-pbjson", - "prost 0.13.3", + "prost", "ripemd", "serde", "sha2 0.10.8", @@ -3741,7 +1990,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -3771,35 +2020,6 @@ dependencies = [ "icu_properties", ] -[[package]] -name = "impl-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-num-traits" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "951641f13f873bff03d4bf19ae8bec531935ac0ac2cc775f84d7edfdcfed3f17" -dependencies = [ - "integer-sqrt", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "uint", -] - -[[package]] -name = "impl-rlp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" -dependencies = [ - "rlp", -] - [[package]] name = "impl-serde" version = "0.4.0" @@ -3809,41 +2029,12 @@ dependencies = [ "serde", ] -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", -] - -[[package]] -name = "incrementalmerkletree" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5ad43a3f5795945459d577f6589cf62a476e92c79b75e70cd954364e14ce17b" -dependencies = [ - "serde", -] - [[package]] name = "indenter" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" -[[package]] -name = "index-set" -version = "0.8.0" -source = "git+https://github.com/heliaxdev/index-set?tag=v0.8.1#b0d928f83cf0d465ccda299d131e8df2859b5184" -dependencies = [ - "borsh", - "serde", -] - [[package]] name = "indexmap" version = "1.9.3" @@ -3854,17 +2045,6 @@ dependencies = [ "hashbrown 0.12.3", ] -[[package]] -name = "indexmap" -version = "2.2.4" -source = "git+https://github.com/heliaxdev/indexmap?tag=2.2.4-heliax-1#b5b5b547bd6ab04bbb16e060326a50ddaeb6c909" -dependencies = [ - "borsh", - "equivalent", - "hashbrown 0.14.5", - "serde", -] - [[package]] name = "indexmap" version = "2.6.0" @@ -3885,42 +2065,6 @@ dependencies = [ "serde", ] -[[package]] -name = "init-once" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0863329819ed5ecf33446da6cb9104d2f8943ff8530d2b6c51adbc6be4f0632" -dependencies = [ - "portable-atomic", -] - -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "integer-sqrt" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "276ec31bcb4a9ee45f58bec6f9ec700ae4cf4f4f8f2fa7e06cb406bd5ffdd770" -dependencies = [ - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "ipnet" version = "2.10.1" @@ -3933,24 +2077,6 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itertools" version = "0.13.0" @@ -3966,15 +2092,6 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" -[[package]] -name = "jobserver" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" -dependencies = [ - "libc", -] - [[package]] name = "js-sys" version = "0.3.72" @@ -3984,47 +2101,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jsonwebtoken" -version = "8.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" -dependencies = [ - "base64 0.21.7", - "pem", - "ring 0.16.20", - "serde", - "serde_json", - "simple_asn1", -] - -[[package]] -name = "jubjub" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8499f7a74008aafbecb2a2e608a3e13e4dd3e84df198b604451efe93f2de6e61" -dependencies = [ - "bitvec", - "bls12_381 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ff", - "group", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "jubjub" -version = "0.10.0" -source = "git+https://github.com/heliaxdev/jubjub.git?rev=a373686962f4e9d0edb3b4716f86ff6bbd9aa86c#a373686962f4e9d0edb3b4716f86ff6bbd9aa86c" -dependencies = [ - "bitvec", - "bls12_381 0.8.0 (git+https://github.com/heliaxdev/bls12_381.git?rev=d3ebe9dd6488fac1923db120a7498079e55dd838)", - "ff", - "group", - "rand_core 0.6.4", - "subtle", -] - [[package]] name = "k256" version = "0.13.4" @@ -4034,20 +2110,7 @@ dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", - "once_cell", - "serdect", "sha2 0.10.8", - "signature", -] - -[[package]] -name = "kdam" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "526586ea01a9a132b5f8d3a60f6d6b41b411550236f5ee057795f20b37316957" -dependencies = [ - "terminal_size", - "windows-sys 0.52.0", ] [[package]] @@ -4059,56 +2122,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "konst" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0964faf44d2c3e528ade7bd49c3544687cadcdee7641643469d43bd7259a5d88" -dependencies = [ - "const_panic", - "konst_kernel", - "typewit", -] - -[[package]] -name = "konst_kernel" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722062725c1fc0d83cc017e873aac6a2a5ff16a88edfa190bdeb8bd393fcfd97" -dependencies = [ - "typewit", -] - -[[package]] -name = "lalrpop" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cb077ad656299f160924eb2912aa147d7339ea7d69e1b5517326fdcec3c1ca" -dependencies = [ - "ascii-canvas", - "bit-set", - "ena", - "itertools 0.11.0", - "lalrpop-util", - "petgraph", - "regex", - "regex-syntax 0.8.5", - "string_cache", - "term", - "tiny-keccak", - "unicode-xid", - "walkdir", -] - -[[package]] -name = "lalrpop-util" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507460a910eb7b32ee961886ff48539633b788a36b65692b95f225b844c82553" -dependencies = [ - "regex-automata 0.4.9", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -4121,12 +2134,6 @@ version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" -[[package]] -name = "libm" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" - [[package]] name = "libredox" version = "0.1.3" @@ -4165,71 +2172,6 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -[[package]] -name = "masp_note_encryption" -version = "1.0.0" -source = "git+https://github.com/anoma/masp?rev=12ed8b060b295c06502a2ff8468e4a941cb7cca4#12ed8b060b295c06502a2ff8468e4a941cb7cca4" -dependencies = [ - "borsh", - "chacha20", - "chacha20poly1305", - "cipher", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "masp_primitives" -version = "1.0.0" -source = "git+https://github.com/anoma/masp?rev=12ed8b060b295c06502a2ff8468e4a941cb7cca4#12ed8b060b295c06502a2ff8468e4a941cb7cca4" -dependencies = [ - "aes", - "bip0039", - "bitvec", - "blake2b_simd", - "blake2s_simd", - "bls12_381 0.8.0 (git+https://github.com/heliaxdev/bls12_381.git?rev=d3ebe9dd6488fac1923db120a7498079e55dd838)", - "borsh", - "byteorder", - "ff", - "fpe", - "group", - "hex", - "incrementalmerkletree", - "jubjub 0.10.0 (git+https://github.com/heliaxdev/jubjub.git?rev=a373686962f4e9d0edb3b4716f86ff6bbd9aa86c)", - "lazy_static", - "masp_note_encryption", - "memuse", - "nonempty", - "num-traits 0.2.19 (git+https://github.com/heliaxdev/num-traits?rev=3f3657caa34b8e116fdf3f8a3519c4ac29f012fe)", - "rand 0.8.5", - "rand_core 0.6.4", - "sha2 0.10.8", - "subtle", - "zcash_encoding", -] - -[[package]] -name = "masp_proofs" -version = "1.0.0" -source = "git+https://github.com/anoma/masp?rev=12ed8b060b295c06502a2ff8468e4a941cb7cca4#12ed8b060b295c06502a2ff8468e4a941cb7cca4" -dependencies = [ - "bellman", - "blake2b_simd", - "bls12_381 0.8.0 (git+https://github.com/heliaxdev/bls12_381.git?rev=d3ebe9dd6488fac1923db120a7498079e55dd838)", - "directories", - "getrandom 0.2.15", - "group", - "itertools 0.11.0", - "jubjub 0.10.0 (git+https://github.com/heliaxdev/jubjub.git?rev=a373686962f4e9d0edb3b4716f86ff6bbd9aa86c)", - "lazy_static", - "masp_primitives", - "minreq", - "rand_core 0.6.4", - "redjubjub", - "tracing", -] - [[package]] name = "matchers" version = "0.1.0" @@ -4245,34 +2187,12 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" -[[package]] -name = "md-5" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" -dependencies = [ - "cfg-if", - "digest 0.10.7", -] - [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "memuse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2145869435ace5ea6ea3d35f59be559317ec9a0d04e1812d5f185a87b6d36f1a" - -[[package]] -name = "memzero" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93c0d11ac30a033511ae414355d80f70d9f29a44a49140face477117a1ee90db" - [[package]] name = "mime" version = "0.3.17" @@ -4288,28 +2208,6 @@ dependencies = [ "adler", ] -[[package]] -name = "miniz_oxide" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" -dependencies = [ - "adler2", -] - -[[package]] -name = "minreq" -version = "2.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763d142cdff44aaadd9268bebddb156ef6c65a0e13486bb81673cf2d8739f9b0" -dependencies = [ - "log", - "once_cell", - "rustls 0.21.12", - "rustls-webpki 0.101.7", - "webpki-roots", -] - [[package]] name = "mio" version = "1.0.2" @@ -4318,7 +2216,7 @@ checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi 0.3.9", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.52.0", ] @@ -4334,727 +2232,40 @@ dependencies = [ "once_cell", "parking_lot", "quanta", - "rustc_version 0.4.1", + "rustc_version", "smallvec", "tagptr", "thiserror", "triomphe", - "uuid 1.11.0", + "uuid", ] [[package]] -name = "multimap" -version = "0.10.0" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" - -[[package]] -name = "namada_account" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "namada_core", - "namada_macros", - "namada_storage", - "serde", -] - -[[package]] -name = "namada_controller" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ - "namada_core", - "smooth-operator", - "thiserror", + "overload", + "winapi", ] [[package]] -name = "namada_core" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "bech32 0.8.1", - "borsh", - "borsh-ext", - "chrono", - "data-encoding", - "ed25519-consensus", - "ethabi", - "ethbridge-structs", - "eyre", - "ibc", - "ics23", - "impl-num-traits", - "index-set", - "indexmap 2.2.4", - "k256", - "lazy_static", - "masp_primitives", - "namada_macros", "num-integer", - "num-rational", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "num256", - "num_enum", - "primitive-types", - "prost-types 0.13.3", - "rand 0.8.5", - "rand_core 0.6.4", - "rayon", - "ripemd", - "serde", - "serde_json", - "sha2 0.9.9", - "smooth-operator", - "sparse-merkle-tree", - "tendermint 0.38.1", - "tendermint-proto 0.38.1", - "thiserror", - "tiny-keccak", - "tokio", - "tracing", - "uint", - "wasmtimer", - "zeroize", -] - -[[package]] -name = "namada_ethereum_bridge" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "ethers", - "eyre", - "itertools 0.12.1", - "konst", - "namada_core", - "namada_events", - "namada_macros", - "namada_parameters", - "namada_proof_of_stake", - "namada_state", - "namada_storage", - "namada_systems", - "namada_trans_token", - "namada_tx", - "namada_vote_ext", - "namada_vp_env", - "serde", - "smooth-operator", - "thiserror", - "tracing", -] - -[[package]] -name = "namada_events" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "namada_core", - "namada_macros", - "serde", - "serde_json", - "thiserror", - "tracing", -] - -[[package]] -name = "namada_gas" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "namada_core", - "namada_events", - "namada_macros", - "serde", - "thiserror", -] - -[[package]] -name = "namada_governance" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "itertools 0.12.1", - "konst", - "namada_account", - "namada_core", - "namada_events", - "namada_macros", - "namada_state", - "namada_systems", - "namada_tx", - "namada_vp_env", - "serde", - "serde_json", - "smooth-operator", - "thiserror", - "tracing", -] - -[[package]] -name = "namada_ibc" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "data-encoding", - "ibc", - "ibc-derive", - "ics23", - "konst", - "masp_primitives", - "namada_core", - "namada_events", - "namada_gas", - "namada_macros", - "namada_state", - "namada_systems", - "namada_tx", - "namada_vp", - "primitive-types", - "prost 0.13.3", - "serde", - "serde_json", - "sha2 0.9.9", - "smooth-operator", - "thiserror", - "tracing", -] - -[[package]] -name = "namada_io" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "async-trait", - "kdam", - "namada_core", - "tendermint-rpc 0.38.1", - "thiserror", - "tokio", -] - -[[package]] -name = "namada_macros" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "data-encoding", - "proc-macro2", - "quote", - "sha2 0.9.9", - "syn 1.0.109", -] - -[[package]] -name = "namada_merkle_tree" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "eyre", - "ics23", - "namada_core", - "namada_macros", - "prost 0.13.3", - "sparse-merkle-tree", - "thiserror", -] - -[[package]] -name = "namada_parameters" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "namada_core", - "namada_macros", - "namada_state", - "namada_systems", - "namada_tx", - "namada_vp_env", - "smooth-operator", - "thiserror", -] - -[[package]] -name = "namada_proof_of_stake" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "itertools 0.12.1", - "konst", - "namada_account", - "namada_controller", - "namada_core", - "namada_events", - "namada_macros", - "namada_state", - "namada_systems", - "namada_tx", - "namada_vp_env", - "once_cell", - "serde", - "smooth-operator", - "thiserror", - "tracing", -] - -[[package]] -name = "namada_replay_protection" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "namada_core", -] - -[[package]] -name = "namada_sdk" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "async-trait", - "bimap", - "borsh", - "borsh-ext", - "circular-queue", - "clap 4.5.21", - "data-encoding", - "duration-str", - "either", - "ethbridge-bridge-contract", - "ethers", - "eyre", - "fd-lock", - "futures", - "init-once", - "itertools 0.12.1", - "lazy_static", - "masp_primitives", - "masp_proofs", - "namada_account", - "namada_core", - "namada_ethereum_bridge", - "namada_events", - "namada_gas", - "namada_governance", - "namada_ibc", - "namada_io", - "namada_macros", - "namada_parameters", - "namada_proof_of_stake", - "namada_state", - "namada_storage", - "namada_token", - "namada_tx", - "namada_vm", - "namada_vote_ext", - "namada_vp", - "namada_wallet", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "num256", - "owo-colors", - "paste", - "patricia_tree", - "prost 0.13.3", - "rand 0.8.5", - "rand_core 0.6.4", - "rayon", - "regex", - "reqwest", - "rustversion", - "serde", - "serde_json", - "sha2 0.9.9", - "smooth-operator", - "tempfile", - "tendermint-rpc 0.38.1", - "thiserror", - "tiny-bip39 0.8.2", - "tokio", - "toml 0.5.11", - "tracing", - "xorf", - "zeroize", -] - -[[package]] -name = "namada_shielded_token" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "async-trait", - "borsh", - "eyre", - "flume", - "futures", - "itertools 0.12.1", - "lazy_static", - "masp_primitives", - "masp_proofs", - "namada_account", - "namada_controller", - "namada_core", - "namada_events", - "namada_gas", - "namada_io", - "namada_macros", - "namada_state", - "namada_systems", - "namada_tx", - "namada_vp_env", - "namada_wallet", - "rand 0.8.5", - "rand_core 0.6.4", - "rayon", - "ripemd", - "serde", - "serde_json", - "sha2 0.9.9", - "smooth-operator", - "tempfile", - "thiserror", - "tracing", - "typed-builder", - "xorf", -] - -[[package]] -name = "namada_state" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "clru", - "itertools 0.12.1", - "namada_core", - "namada_events", - "namada_gas", - "namada_macros", - "namada_merkle_tree", - "namada_replay_protection", - "namada_storage", - "namada_systems", - "namada_tx", - "patricia_tree", - "smooth-operator", - "thiserror", - "tracing", -] - -[[package]] -name = "namada_storage" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "itertools 0.12.1", - "namada_core", - "namada_gas", - "namada_macros", - "namada_merkle_tree", - "namada_replay_protection", - "regex", + "num-traits", "serde", - "smooth-operator", - "thiserror", - "tracing", -] - -[[package]] -name = "namada_systems" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "namada_core", - "namada_events", - "namada_storage", -] - -[[package]] -name = "namada_token" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "namada_core", - "namada_events", - "namada_macros", - "namada_shielded_token", - "namada_storage", - "namada_systems", - "namada_trans_token", - "namada_tx", - "namada_tx_env", - "serde", -] - -[[package]] -name = "namada_trans_token" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "konst", - "namada_core", - "namada_events", - "namada_state", - "namada_systems", - "namada_tx", - "namada_tx_env", - "namada_vp_env", - "thiserror", - "tracing", -] - -[[package]] -name = "namada_tx" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "ark-bls12-381", - "bitflags 2.6.0", - "borsh", - "data-encoding", - "either", - "konst", - "masp_primitives", - "namada_account", - "namada_core", - "namada_events", - "namada_gas", - "namada_macros", - "num-derive 0.4.2", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "prost 0.13.3", - "prost-types 0.13.3", - "rand_core 0.6.4", - "serde", - "serde_json", - "sha2 0.9.9", - "thiserror", - "tonic-build", -] - -[[package]] -name = "namada_tx_env" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "namada_core", - "namada_events", - "namada_storage", -] - -[[package]] -name = "namada_vm" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "clru", - "namada_account", - "namada_core", - "namada_events", - "namada_gas", - "namada_parameters", - "namada_state", - "namada_token", - "namada_tx", - "namada_vp", - "smooth-operator", - "thiserror", - "tracing", - "wasmparser", -] - -[[package]] -name = "namada_vote_ext" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "borsh", - "namada_core", - "namada_macros", - "namada_tx", - "serde", -] - -[[package]] -name = "namada_vp" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "namada_core", - "namada_events", - "namada_gas", - "namada_state", - "namada_tx", - "namada_vp_env", - "smooth-operator", - "thiserror", - "tracing", -] - -[[package]] -name = "namada_vp_env" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "derivative", - "masp_primitives", - "namada_core", - "namada_events", - "namada_gas", - "namada_storage", - "namada_tx", - "smooth-operator", -] - -[[package]] -name = "namada_wallet" -version = "0.46.1" -source = "git+https://github.com/anoma/namada?tag=v0.46.1#b24938efd948cb43fc996a729138cb099abcadc0" -dependencies = [ - "bimap", - "borsh", - "borsh-ext", - "data-encoding", - "derivation-path", - "fd-lock", - "itertools 0.12.1", - "masp_primitives", - "namada_core", - "namada_ibc", - "namada_macros", - "orion", - "rand 0.8.5", - "rand_core 0.6.4", - "serde", - "slip10_ed25519", - "smooth-operator", - "thiserror", - "tiny-bip39 0.8.2", - "tiny-hderive", - "toml 0.5.11", - "zeroize", -] - -[[package]] -name = "nanorand" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" -dependencies = [ - "getrandom 0.2.15", -] - -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - -[[package]] -name = "nonempty" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" - -[[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" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[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-derive" -version = "0.4.2" +name = "num-conv" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", -] +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-integer" @@ -5062,18 +2273,7 @@ version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits", ] [[package]] @@ -5084,7 +2284,7 @@ checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ "num-bigint", "num-integer", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits", "serde", ] @@ -5095,60 +2295,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm", -] - -[[package]] -name = "num-traits" -version = "0.2.19" -source = "git+https://github.com/heliaxdev/num-traits?rev=3f3657caa34b8e116fdf3f8a3519c4ac29f012fe#3f3657caa34b8e116fdf3f8a3519c4ac29f012fe" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num256" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9b5179e82f0867b23e0b9b822493821f9345561f271364f409c8e4a058367d" -dependencies = [ - "lazy_static", - "num", - "num-derive 0.3.3", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "serde", - "serde_derive", -] - -[[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 = "num_enum" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.89", ] [[package]] @@ -5181,75 +2327,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" -[[package]] -name = "open-fastrlp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", - "ethereum-types", - "open-fastrlp-derive", -] - -[[package]] -name = "open-fastrlp-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" -dependencies = [ - "bytes", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "openssl" -version = "0.10.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" -dependencies = [ - "bitflags 2.6.0", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", -] - [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" -[[package]] -name = "openssl-sys" -version = "0.9.104" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "opentelemetry" version = "0.19.0" @@ -5303,28 +2386,10 @@ dependencies = [ "once_cell", "opentelemetry_api", "percent-encoding", - "rand 0.8.5", + "rand", "thiserror", ] -[[package]] -name = "option-ext" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" - -[[package]] -name = "orion" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6624905ddd92e460ff0685567539ed1ac985b2dee4c92c7edcd64fce905b00c" -dependencies = [ - "ct-codecs", - "getrandom 0.2.15", - "subtle", - "zeroize", -] - [[package]] name = "os_str_bytes" version = "6.6.1" @@ -5344,275 +2409,75 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] -name = "pairing" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" -dependencies = [ - "group", -] - -[[package]] -name = "parity-scale-codec" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be4817d39f3272f69c59fe05d0535ae6456c2dc2fa1ba02910296c7e0a5c590" -dependencies = [ - "arrayvec", - "bitvec", - "byte-slice-cast", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "rustversion", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "3.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8781a75c6205af67215f382092b6e0a4ff3734798523e69073d4bcd294ec767b" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.89", -] - -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "password-hash" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" -dependencies = [ - "base64ct", - "rand_core 0.6.4", - "subtle", -] - -[[package]] -name = "pasta_curves" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" -dependencies = [ - "ff", - "group", - "rand 0.8.5", - "static_assertions", - "subtle", -] - -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "patricia_tree" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f2f4539bffe53fc4b4da301df49d114b845b077bd5727b7fe2bd9d8df2ae68" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "pbkdf2" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" -dependencies = [ - "crypto-mac", -] - -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest 0.10.7", - "hmac 0.12.1", - "password-hash 0.4.2", - "sha2 0.10.8", -] - -[[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest 0.10.7", - "hmac 0.12.1", - "password-hash 0.5.0", -] - -[[package]] -name = "peg" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "295283b02df346d1ef66052a757869b2876ac29a6bb0ac3f5f7cd44aebe40e8f" -dependencies = [ - "peg-macros", - "peg-runtime", -] - -[[package]] -name = "peg-macros" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdad6a1d9cf116a059582ce415d5f5566aabcd4008646779dab7fdc2a9a9d426" -dependencies = [ - "peg-runtime", - "proc-macro2", - "quote", -] - -[[package]] -name = "peg-runtime" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3aeb8f54c078314c2065ee649a7241f46b9d8e418e1a9581ba0546657d7aa3a" - -[[package]] -name = "pem" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8835c273a76a90455d7344889b0964598e3316e2a79ede8e36f16bdcf2228b8" -dependencies = [ - "base64 0.13.1", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "pest" -version = "2.7.14" +name = "parking_lot" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ - "memchr", - "thiserror", - "ucd-trie", + "lock_api", + "parking_lot_core", ] [[package]] -name = "petgraph" -version = "0.6.5" +name = "parking_lot_core" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ - "fixedbitset", - "indexmap 2.6.0", + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", ] [[package]] -name = "pharos" -version = "0.5.3" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" -dependencies = [ - "futures", - "rustc_version 0.4.1", -] +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "phf" -version = "0.11.2" +name = "pbkdf2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "phf_macros", - "phf_shared 0.11.2", + "digest 0.10.7", ] [[package]] -name = "phf_generator" -version = "0.11.2" +name = "peg" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "295283b02df346d1ef66052a757869b2876ac29a6bb0ac3f5f7cd44aebe40e8f" dependencies = [ - "phf_shared 0.11.2", - "rand 0.8.5", + "peg-macros", + "peg-runtime", ] [[package]] -name = "phf_macros" -version = "0.11.2" +name = "peg-macros" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "bdad6a1d9cf116a059582ce415d5f5566aabcd4008646779dab7fdc2a9a9d426" dependencies = [ - "phf_generator", - "phf_shared 0.11.2", + "peg-runtime", "proc-macro2", "quote", - "syn 2.0.89", ] [[package]] -name = "phf_shared" -version = "0.10.0" +name = "peg-runtime" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", -] +checksum = "e3aeb8f54c078314c2065ee649a7241f46b9d8e418e1a9581ba0546657d7aa3a" [[package]] -name = "phf_shared" -version = "0.11.2" +name = "percent-encoding" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" -dependencies = [ - "siphasher", -] +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" @@ -5631,7 +2496,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -5656,29 +2521,6 @@ dependencies = [ "spki", ] -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - -[[package]] -name = "poly1305" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" -dependencies = [ - "cpufeatures", - "opaque-debug", - "universal-hash", -] - -[[package]] -name = "portable-atomic" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" - [[package]] name = "powerfmt" version = "0.2.0" @@ -5694,22 +2536,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "prettyplease" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" -dependencies = [ - "proc-macro2", - "syn 2.0.89", -] - [[package]] name = "primitive-types" version = "0.12.2" @@ -5717,22 +2543,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", - "impl-codec", - "impl-rlp", "impl-serde", - "scale-info", "uint", ] -[[package]] -name = "proc-macro-crate" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" -dependencies = [ - "toml_edit", -] - [[package]] name = "proc-macro-error" version = "1.0.4" @@ -5759,9 +2573,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -5781,32 +2595,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "proptest" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" -dependencies = [ - "bitflags 2.6.0", - "lazy_static", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.8.5", - "rand_chacha 0.3.1", - "rand_xorshift", - "regex-syntax 0.8.5", - "unarray", -] - -[[package]] -name = "prost" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" -dependencies = [ - "bytes", - "prost-derive 0.12.6", -] - [[package]] name = "prost" version = "0.13.3" @@ -5814,41 +2602,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" dependencies = [ "bytes", - "prost-derive 0.13.3", -] - -[[package]] -name = "prost-build" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" -dependencies = [ - "bytes", - "heck 0.4.1", - "itertools 0.12.1", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost 0.12.6", - "prost-types 0.12.6", - "regex", - "syn 2.0.89", - "tempfile", -] - -[[package]] -name = "prost-derive" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" -dependencies = [ - "anyhow", - "itertools 0.12.1", - "proc-macro2", - "quote", - "syn 2.0.89", + "prost-derive", ] [[package]] @@ -5858,28 +2612,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" dependencies = [ "anyhow", - "itertools 0.13.0", + "itertools", "proc-macro2", "quote", - "syn 2.0.89", -] - -[[package]] -name = "prost-types" -version = "0.12.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" -dependencies = [ - "prost 0.12.6", -] - -[[package]] -name = "prost-types" -version = "0.13.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4759aa0d3a6232fb8dbdb97b61de2c20047c68aca932c7ed76da9d788508d670" -dependencies = [ - "prost 0.13.3", + "syn 2.0.87", ] [[package]] @@ -5898,7 +2634,7 @@ dependencies = [ "libc", "once_cell", "raw-cpuid", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "web-sys", "winapi", ] @@ -5912,25 +2648,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] - [[package]] name = "rand" version = "0.8.5" @@ -5938,18 +2655,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "rand_chacha", + "rand_core", ] [[package]] @@ -5959,16 +2666,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", + "rand_core", ] [[package]] @@ -5977,25 +2675,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.15", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] - -[[package]] -name = "rand_xorshift" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" -dependencies = [ - "rand_core 0.6.4", + "getrandom", ] [[package]] @@ -6007,57 +2687,6 @@ dependencies = [ "bitflags 2.6.0", ] -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "reddsa" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78a5191930e84973293aa5f532b513404460cd2216c1cfb76d08748c15b40b02" -dependencies = [ - "blake2b_simd", - "byteorder", - "group", - "hex", - "jubjub 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pasta_curves", - "rand_core 0.6.4", - "serde", - "thiserror", - "zeroize", -] - -[[package]] -name = "redjubjub" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a60db2c3bc9c6fd1e8631fee75abc008841d27144be744951d6b9b75f9b569c" -dependencies = [ - "rand_core 0.6.4", - "reddsa", - "serde", - "thiserror", - "zeroize", -] - [[package]] name = "redox_syscall" version = "0.5.7" @@ -6073,7 +2702,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom 0.2.15", + "getrandom", "libredox", "thiserror", ] @@ -6138,12 +2767,10 @@ dependencies = [ "http-body 0.4.6", "hyper 0.14.31", "hyper-rustls", - "hyper-tls", "ipnet", "js-sys", "log", "mime", - "native-tls", "once_cell", "percent-encoding", "pin-project-lite", @@ -6156,14 +2783,12 @@ dependencies = [ "sync_wrapper 0.1.2", "system-configuration", "tokio", - "tokio-native-tls", "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", "winreg", ] @@ -6179,25 +2804,10 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hmac 0.12.1", + "hmac", "subtle", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.8" @@ -6206,10 +2816,10 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.52.0", ] @@ -6222,74 +2832,17 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "rlp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" -dependencies = [ - "bytes", - "rlp-derive", - "rustc-hex", -] - -[[package]] -name = "rlp-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "rpassword" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "rust_decimal" -version = "1.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b082d80e3e3cc52b2ed634388d436fe1f4de6af5786cc2de9ba9737527bdf555" -dependencies = [ - "arrayvec", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "rustc-demangle" version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] -name = "rustc_version" -version = "0.3.3" +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" -dependencies = [ - "semver 0.11.0", -] +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" @@ -6297,7 +2850,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "semver", ] [[package]] @@ -6320,7 +2873,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.17.8", + "ring", "rustls-webpki 0.101.7", "sct", ] @@ -6332,7 +2885,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", - "ring 0.17.8", + "ring", "rustls-pki-types", "rustls-webpki 0.102.8", "subtle", @@ -6347,7 +2900,7 @@ checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" dependencies = [ "log", "once_cell", - "ring 0.17.8", + "ring", "rustls-pki-types", "rustls-webpki 0.102.8", "subtle", @@ -6422,8 +2975,8 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -6432,9 +2985,9 @@ version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ - "ring 0.17.8", + "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -6449,15 +3002,6 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" -[[package]] -name = "salsa20" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" -dependencies = [ - "cipher", -] - [[package]] name = "same-file" version = "1.0.6" @@ -6467,30 +3011,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "scale-info" -version = "2.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346a3b32eba2640d17a9cb5927056b08f3de90f65b72fe09402c2ad07d684d0b" -dependencies = [ - "cfg-if", - "derive_more 1.0.0", - "parity-scale-codec", - "scale-info-derive", -] - -[[package]] -name = "scale-info-derive" -version = "2.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.89", -] - [[package]] name = "scc" version = "2.2.5" @@ -6509,56 +3029,20 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "schemars" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" -dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", -] - -[[package]] -name = "schemars_derive" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 2.0.89", -] - [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "scrypt" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" -dependencies = [ - "hmac 0.12.1", - "pbkdf2 0.11.0", - "salsa20", - "sha2 0.10.8", -] - [[package]] name = "sct" version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", + "ring", + "untrusted", ] [[package]] @@ -6577,7 +3061,6 @@ dependencies = [ "der", "generic-array", "pkcs8", - "serdect", "subtle", "zeroize", ] @@ -6589,7 +3072,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ "bitcoin_hashes", - "rand 0.8.5", + "rand", "secp256k1-sys", "serde", ] @@ -6636,15 +3119,6 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.23" @@ -6654,27 +3128,6 @@ dependencies = [ "serde", ] -[[package]] -name = "semver-parser" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9900206b54a3527fdc7b8a938bffd94a568bac4f4aa8113b209df75a09c0dec2" -dependencies = [ - "pest", -] - -[[package]] -name = "send_wrapper" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" - -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" - [[package]] name = "serde" version = "1.0.215" @@ -6684,15 +3137,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-json-wasm" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f05da0d153dd4595bdffd5099dc0e9ce425b205ee648eb93437ff7302af8c9a5" -dependencies = [ - "serde", -] - [[package]] name = "serde_bytes" version = "0.11.15" @@ -6720,18 +3164,7 @@ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", -] - -[[package]] -name = "serde_derive_internals" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -6764,7 +3197,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -6801,16 +3234,6 @@ dependencies = [ "unsafe-libyaml", ] -[[package]] -name = "serdect" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" -dependencies = [ - "base16ct", - "serde", -] - [[package]] name = "serial_test" version = "3.2.0" @@ -6833,7 +3256,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -6928,7 +3351,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -6937,24 +3360,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e2accd2c41a0e920d2abd91b2badcfa1da784662f54fbc47e0e3a51f1e2e1cf" -[[package]] -name = "simple_asn1" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" -dependencies = [ - "num-bigint", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror", - "time", -] - -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - [[package]] name = "slab" version = "0.4.9" @@ -6964,39 +3369,12 @@ dependencies = [ "autocfg", ] -[[package]] -name = "slip10_ed25519" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be0ff28bf14f9610a342169084e87a4f435ad798ec528dc7579a3678fa9dc9a" -dependencies = [ - "hmac-sha512", -] - [[package]] name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "smooth-operator" -version = "0.7.0" -source = "git+https://github.com/heliaxdev/smooth-operator?tag=v0.7.0#0e182707f5e5bb9c6e0efa2d235dc9efd715d0a1" -dependencies = [ - "smooth-operator-impl", -] - -[[package]] -name = "smooth-operator-impl" -version = "0.7.0" -source = "git+https://github.com/heliaxdev/smooth-operator?tag=v0.7.0#0e182707f5e5bb9c6e0efa2d235dc9efd715d0a1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", -] - [[package]] name = "socket2" version = "0.5.7" @@ -7007,46 +3385,11 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "solang-parser" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c425ce1c59f4b154717592f0bdf4715c3a1d55058883622d3157e1f0908a5b26" -dependencies = [ - "itertools 0.11.0", - "lalrpop", - "lalrpop-util", - "phf", - "thiserror", - "unicode-xid", -] - -[[package]] -name = "sparse-merkle-tree" -version = "0.3.1-pre" -source = "git+https://github.com/heliaxdev/sparse-merkle-tree?rev=a93c55ccd47840ee0967eee237e47d9245478594#a93c55ccd47840ee0967eee237e47d9245478594" -dependencies = [ - "borsh", - "cfg-if", - "ics23", - "itertools 0.12.1", - "sha2 0.9.9", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -dependencies = [ - "lock_api", -] [[package]] name = "spki" @@ -7070,19 +3413,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "string_cache" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared 0.10.0", - "precomputed-hash", -] - [[package]] name = "strsim" version = "0.10.0" @@ -7095,16 +3425,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" dependencies = [ - "strum_macros 0.25.3", -] - -[[package]] -name = "strum" -version = "0.26.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" -dependencies = [ - "strum_macros 0.26.4", + "strum_macros", ] [[package]] @@ -7113,24 +3434,11 @@ version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.89", -] - -[[package]] -name = "strum_macros" -version = "0.26.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" -dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -7154,26 +3462,6 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" -[[package]] -name = "svm-rs" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11297baafe5fa0c99d5722458eac6a5e25c01eb1b8e5cd137f54079093daa7a4" -dependencies = [ - "dirs", - "fs2", - "hex", - "once_cell", - "reqwest", - "semver 1.0.23", - "serde", - "serde_json", - "sha2 0.10.8", - "thiserror", - "url", - "zip", -] - [[package]] name = "syn" version = "1.0.109" @@ -7187,9 +3475,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.89" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -7228,7 +3516,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -7258,12 +3546,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - [[package]] name = "tempfile" version = "3.14.0" @@ -7277,37 +3559,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "tendermint" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "505d9d6ffeb83b1de47c307c6e0d2dff56c6256989299010ad03cd80a8491e97" -dependencies = [ - "bytes", - "digest 0.10.7", - "ed25519", - "ed25519-consensus", - "flex-error", - "futures", - "k256", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", - "once_cell", - "prost 0.13.3", - "prost-types 0.13.3", - "ripemd", - "serde", - "serde_bytes", - "serde_json", - "serde_repr", - "sha2 0.10.8", - "signature", - "subtle", - "subtle-encoding", - "tendermint-proto 0.38.1", - "time", - "zeroize", -] - [[package]] name = "tendermint" version = "0.40.0" @@ -7321,9 +3572,9 @@ dependencies = [ "flex-error", "futures", "k256", - "num-traits 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits", "once_cell", - "prost 0.13.3", + "prost", "ripemd", "serde", "serde_bytes", @@ -7333,25 +3584,11 @@ dependencies = [ "signature", "subtle", "subtle-encoding", - "tendermint-proto 0.40.0", + "tendermint-proto", "time", "zeroize", ] -[[package]] -name = "tendermint-config" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de111ea653b2adaef627ac2452b463c77aa615c256eaaddf279ec5a1cf9775f" -dependencies = [ - "flex-error", - "serde", - "serde_json", - "tendermint 0.38.1", - "toml 0.8.19", - "url", -] - [[package]] name = "tendermint-config" version = "0.40.0" @@ -7361,7 +3598,7 @@ dependencies = [ "flex-error", "serde", "serde_json", - "tendermint 0.40.0", + "tendermint", "toml 0.8.19", "url", ] @@ -7374,7 +3611,7 @@ checksum = "3e88c08a112db05101396a79f71c017d7dbf548dc21614f82251f17ecbe5d5e8" dependencies = [ "contracts", "crossbeam-channel", - "derive_more 0.99.18", + "derive_more", "flex-error", "futures", "regex", @@ -7383,9 +3620,9 @@ dependencies = [ "serde_derive", "serde_json", "static_assertions", - "tendermint 0.40.0", - "tendermint-light-client-verifier 0.40.0", - "tendermint-rpc 0.40.0", + "tendermint", + "tendermint-light-client-verifier", + "tendermint-rpc", "time", "tokio", "tracing", @@ -7398,111 +3635,48 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48a431ea923182c37ca9f3cc8333490ac6746a64520d1c4a3dd18c08b0806ac" dependencies = [ "crossbeam-channel", - "derive_more 0.99.18", + "derive_more", "flex-error", "futures", "serde", "serde_cbor", "serde_derive", - "serde_json", - "static_assertions", - "tendermint 0.40.0", - "tendermint-light-client", - "tendermint-proto 0.40.0", - "tendermint-rpc 0.40.0", - "time", - "tracing", -] - -[[package]] -name = "tendermint-light-client-verifier" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2674adbf0dc51aa0c8eaf8462c7d6692ec79502713e50ed5432a442002be90" -dependencies = [ - "derive_more 0.99.18", - "flex-error", - "serde", - "tendermint 0.38.1", - "time", -] - -[[package]] -name = "tendermint-light-client-verifier" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7affc5fffe9df158185e15bce3e47fc3a0c901e6708f3b7d33f0867d7aef8ce1" -dependencies = [ - "derive_more 0.99.18", - "flex-error", - "serde", - "tendermint 0.40.0", - "time", -] - -[[package]] -name = "tendermint-proto" -version = "0.38.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ed14abe3b0502a3afe21ca74ca5cdd6c7e8d326d982c26f98a394445eb31d6e" -dependencies = [ - "bytes", - "flex-error", - "prost 0.13.3", - "prost-types 0.13.3", - "serde", - "serde_bytes", - "subtle-encoding", + "serde_json", + "static_assertions", + "tendermint", + "tendermint-light-client", + "tendermint-proto", + "tendermint-rpc", "time", + "tracing", ] [[package]] -name = "tendermint-proto" +name = "tendermint-light-client-verifier" version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c81ba1b023ec00763c3bc4f4376c67c0047f185cccf95c416c7a2f16272c4cbb" +checksum = "7affc5fffe9df158185e15bce3e47fc3a0c901e6708f3b7d33f0867d7aef8ce1" dependencies = [ - "bytes", + "derive_more", "flex-error", - "prost 0.13.3", "serde", - "serde_bytes", - "subtle-encoding", + "tendermint", "time", ] [[package]] -name = "tendermint-rpc" -version = "0.38.1" +name = "tendermint-proto" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f96a2b8a0d3d0b59e4024b1a6bdc1589efc6af4709d08a480a20cc4ba90f63" +checksum = "c81ba1b023ec00763c3bc4f4376c67c0047f185cccf95c416c7a2f16272c4cbb" dependencies = [ - "async-trait", - "async-tungstenite", "bytes", "flex-error", - "futures", - "getrandom 0.2.15", - "peg", - "pin-project", - "rand 0.8.5", - "reqwest", - "semver 1.0.23", + "prost", "serde", "serde_bytes", - "serde_json", - "subtle", "subtle-encoding", - "tendermint 0.38.1", - "tendermint-config 0.38.1", - "tendermint-proto 0.38.1", - "thiserror", "time", - "tokio", - "tracing", - "url", - "uuid 1.11.0", - "walkdir", ] [[package]] @@ -7516,26 +3690,26 @@ dependencies = [ "bytes", "flex-error", "futures", - "getrandom 0.2.15", + "getrandom", "peg", "pin-project", - "rand 0.8.5", + "rand", "reqwest", - "semver 1.0.23", + "semver", "serde", "serde_bytes", "serde_json", "subtle", "subtle-encoding", - "tendermint 0.40.0", - "tendermint-config 0.40.0", - "tendermint-proto 0.40.0", + "tendermint", + "tendermint-config", + "tendermint-proto", "thiserror", "time", "tokio", "tracing", "url", - "uuid 1.11.0", + "uuid", "walkdir", ] @@ -7551,21 +3725,10 @@ dependencies = [ "serde_json", "simple-error", "tempfile", - "tendermint 0.40.0", + "tendermint", "time", ] -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - [[package]] name = "termcolor" version = "1.4.1" @@ -7575,16 +3738,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "terminal_size" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" -dependencies = [ - "rustix", - "windows-sys 0.48.0", -] - [[package]] name = "test-log" version = "0.2.16" @@ -7604,7 +3757,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -7630,7 +3783,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -7650,7 +3803,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", - "itoa", "num-conv", "powerfmt", "serde", @@ -7674,24 +3826,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "tiny-bip39" -version = "0.8.2" -source = "git+https://github.com/anoma/tiny-bip39.git?rev=bf0f6d8713589b83af7a917366ec31f5275c0e57#bf0f6d8713589b83af7a917366ec31f5275c0e57" -dependencies = [ - "anyhow", - "hmac 0.8.1", - "once_cell", - "pbkdf2 0.4.0", - "rand 0.7.3", - "rustc-hash", - "sha2 0.9.9", - "thiserror", - "unicode-normalization", - "wasm-bindgen", - "zeroize", -] - [[package]] name = "tiny-bip39" version = "1.0.0" @@ -7699,10 +3833,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" dependencies = [ "anyhow", - "hmac 0.12.1", + "hmac", "once_cell", - "pbkdf2 0.11.0", - "rand 0.8.5", + "pbkdf2", + "rand", "rustc-hash", "sha2 0.10.8", "thiserror", @@ -7711,18 +3845,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "tiny-hderive" -version = "0.3.0" -source = "git+https://github.com/heliaxdev/tiny-hderive.git?rev=173ae03abed0cd25d88a5a13efac00af96b75b87#173ae03abed0cd25d88a5a13efac00af96b75b87" -dependencies = [ - "base58", - "hmac 0.12.1", - "k256", - "memzero", - "sha2 0.10.8", -] - [[package]] name = "tiny-keccak" version = "2.0.2" @@ -7783,17 +3905,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", + "syn 2.0.87", ] [[package]] @@ -7839,21 +3951,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" -dependencies = [ - "futures-util", - "log", - "rustls 0.21.12", - "tokio", - "tokio-rustls 0.24.1", - "tungstenite 0.20.1", - "webpki-roots", -] - [[package]] name = "tokio-util" version = "0.7.12" @@ -7930,7 +4027,7 @@ dependencies = [ "hyper-util", "percent-encoding", "pin-project", - "prost 0.13.3", + "prost", "rustls-native-certs 0.8.0", "rustls-pemfile 2.2.0", "socket2", @@ -7943,19 +4040,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "tonic-build" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" -dependencies = [ - "prettyplease", - "proc-macro2", - "prost-build", - "quote", - "syn 2.0.89", -] - [[package]] name = "tower" version = "0.4.13" @@ -7967,7 +4051,7 @@ dependencies = [ "indexmap 1.9.3", "pin-project", "pin-project-lite", - "rand 0.8.5", + "rand", "slab", "tokio", "tokio-util", @@ -8022,7 +4106,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -8045,16 +4129,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "tracing-futures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" -dependencies = [ - "pin-project", - "tracing", -] - [[package]] name = "tracing-log" version = "0.1.4" @@ -8120,26 +4194,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "tungstenite" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 0.2.12", - "httparse", - "log", - "rand 0.8.5", - "rustls 0.21.12", - "sha1", - "thiserror", - "url", - "utf-8", -] - [[package]] name = "tungstenite" version = "0.21.0" @@ -8152,7 +4206,7 @@ dependencies = [ "http 1.1.0", "httparse", "log", - "rand 0.8.5", + "rand", "rustls 0.22.4", "rustls-pki-types", "sha1", @@ -8161,53 +4215,12 @@ dependencies = [ "utf-8", ] -[[package]] -name = "typed-builder" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06fbd5b8de54c5f7c91f6fe4cebb949be2125d7758e630bb58b1d831dbce600" -dependencies = [ - "typed-builder-macro", -] - -[[package]] -name = "typed-builder-macro" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9534daa9fd3ed0bd911d462a37f172228077e7abf18c18a5f67199d959205f8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.89", -] - [[package]] name = "typenum" version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" -[[package]] -name = "typewit" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fb9ae6a3cafaf0a5d14c2302ca525f9ae8e07a0f0e6949de88d882c37a6e24" -dependencies = [ - "typewit_proc_macros", -] - -[[package]] -name = "typewit_proc_macros" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36a83ea2b3c704935a01b4642946aadd445cea40b10935e3f8bd8052b8193d6" - -[[package]] -name = "ucd-trie" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" - [[package]] name = "uint" version = "0.9.5" @@ -8220,12 +4233,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "unarray" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" - [[package]] name = "unicode-ident" version = "1.0.13" @@ -8253,28 +4260,12 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" -[[package]] -name = "universal-hash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" -dependencies = [ - "crypto-common", - "subtle", -] - [[package]] name = "unsafe-libyaml" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -8328,23 +4319,13 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom 0.2.15", - "serde", -] - [[package]] name = "uuid" version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" dependencies = [ - "getrandom 0.2.15", + "getrandom", ] [[package]] @@ -8353,12 +4334,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" @@ -8393,12 +4368,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -8427,7 +4396,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -8461,7 +4430,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -8472,30 +4441,6 @@ version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" -[[package]] -name = "wasmparser" -version = "0.107.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" -dependencies = [ - "indexmap 1.9.3", - "semver 1.0.23", -] - -[[package]] -name = "wasmtimer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7ed9d8b15c7fb594d72bfb4b5a276f3d2029333cd93a932f376f5937f6f80ee" -dependencies = [ - "futures", - "js-sys", - "parking_lot", - "pin-utils", - "slab", - "wasm-bindgen", -] - [[package]] name = "web-sys" version = "0.3.72" @@ -8506,12 +4451,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "winapi" version = "0.3.9" @@ -8731,51 +4670,6 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" -[[package]] -name = "ws_stream_wasm" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" -dependencies = [ - "async_io_stream", - "futures", - "js-sys", - "log", - "pharos", - "rustc_version 0.4.1", - "send_wrapper 0.6.0", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - -[[package]] -name = "wyz" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" -dependencies = [ - "tap", -] - -[[package]] -name = "xorf" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf24c008fe464f5d8f58b8d16a1ab7e930bd73b2a6933ff8704c414b2bed7f92" -dependencies = [ - "libm", - "rand 0.8.5", - "serde", -] - -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - [[package]] name = "yoke" version = "0.7.4" @@ -8796,19 +4690,10 @@ checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", "synstructure 0.13.1", ] -[[package]] -name = "zcash_encoding" -version = "0.2.0" -source = "git+https://github.com/zcash/librustzcash?rev=bd7f9d7#bd7f9d7c3ce5cfd14af169ffe0e1c5c903162f46" -dependencies = [ - "byteorder", - "nonempty", -] - [[package]] name = "zerocopy" version = "0.7.35" @@ -8827,7 +4712,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -8847,7 +4732,7 @@ checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", "synstructure 0.13.1", ] @@ -8868,7 +4753,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn 2.0.87", ] [[package]] @@ -8890,54 +4775,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", -] - -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "aes", - "byteorder", - "bzip2", - "constant_time_eq 0.1.5", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac 0.12.1", - "pbkdf2 0.11.0", - "sha1", - "time", - "zstd", -] - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" -dependencies = [ - "cc", - "pkg-config", + "syn 2.0.87", ] diff --git a/Cargo.toml b/Cargo.toml index 0bb6fd2ecb..c7be1ceaaf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,12 +42,6 @@ tendermint-proto = { version = "0.40.0" } tendermint-rpc = { version = "0.40.0" } tendermint-testgen = { version = "0.40.0" } -# Namada dependencies -namada_sdk = { git = "https://github.com/anoma/namada", tag = "v0.46.1" } -# Different tendermint-rs version for Namada -namada-tendermint = { package = "tendermint", version = "0.38.0", default-features = false } -namada-tendermint-proto = { package = "tendermint-proto", version = "0.38.0" } -namada-tendermint-rpc = { package = "tendermint-rpc", version = "0.38.0" } # Other dependencies abscissa_core = "=0.6.0" @@ -99,7 +93,6 @@ regex = "1.11.1" reqwest = { version = "0.11.27", default-features = false } retry = { version = "2.0.0", default-features = false } ripemd = "0.1.3" -rpassword = "5.0.1" secp256k1 = "0.28.2" semver = "1.0.21" serde = "1.0.214" diff --git a/ci/release/hermes.Dockerfile b/ci/release/hermes.Dockerfile index 105b9b2dd8..8540b2446b 100644 --- a/ci/release/hermes.Dockerfile +++ b/ci/release/hermes.Dockerfile @@ -6,23 +6,9 @@ FROM rust:1-buster AS build-env ARG TAG -ARG PROTOC_VERSION=28.3 WORKDIR /root -# Install protoc -RUN ARCH=$(uname -m) && \ - if [ "$ARCH" = "x86_64" ]; then \ - ARCH=x86_64; \ - elif [ "$ARCH" = "aarch64" ]; then \ - ARCH=aarch_64;\ - else \ - echo "Unsupported architecture: $ARCH"; exit 1; \ - fi && \ - wget https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/protoc-$PROTOC_VERSION-linux-$ARCH.zip -O /tmp/protoc.zip && \ - unzip /tmp/protoc.zip -d /usr/local && \ - rm -rf /tmp/protoc.zip - COPY . . RUN cargo build --release @@ -31,24 +17,12 @@ LABEL maintainer="hello@informal.systems" ARG UID=2000 ARG GID=2000 -RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates RUN update-ca-certificates RUN groupadd -g ${GID} hermes && useradd -l -m hermes -s /bin/bash -u ${UID} -g ${GID} WORKDIR /home/hermes - -RUN ARCH=$(uname -m) && \ - if [ "$ARCH" = "x86_64" ]; then \ - DEB_URL=http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.23_amd64.deb; \ - elif [ "$ARCH" = "aarch64" ]; then \ - DEB_URL=http://ports.ubuntu.com/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_arm64.deb; \ - else \ - echo "Unsupported architecture: $ARCH"; exit 1; \ - fi && \ - wget $DEB_URL -O /tmp/libssl1.1.deb && \ - dpkg -i /tmp/libssl1.1.deb && \ - rm -rf /tmp/libssl1.1.deb - USER hermes:hermes ENTRYPOINT ["/usr/bin/hermes"] + COPY --chown=hermes:hermes --from=build-env /root/target/release/hermes /usr/bin/hermes diff --git a/clippy.toml b/clippy.toml index 4233c8791a..7372c60ff2 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.79.0" +msrv = "1.76.0" diff --git a/config.toml b/config.toml index 224d49af7c..aeb2eff924 100644 --- a/config.toml +++ b/config.toml @@ -158,7 +158,7 @@ port = 5555 # Specify the chain ID. Required id = 'ibc-0' -# Specify the chain type, currently `CosmosSdk` and `Namada` are supported. +# Specify the chain type, currently only `CosmosSdk` is supported. # Default: CosmosSdk type = "CosmosSdk" diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index ad48d001ee..5968134be3 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.79.0" +rust-version = "1.76.0" description = """ Service to fetch data from the chain-registry """ diff --git a/crates/relayer-cli/Cargo.toml b/crates/relayer-cli/Cargo.toml index 4de0cdf166..fbdcd20d0d 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.79.0" +rust-version = "1.76.0" description = """ Hermes is an IBC Relayer written in Rust """ diff --git a/crates/relayer-cli/src/commands/keys/add.rs b/crates/relayer-cli/src/commands/keys/add.rs index 30f7c4d055..b24514d00a 100644 --- a/crates/relayer-cli/src/commands/keys/add.rs +++ b/crates/relayer-cli/src/commands/keys/add.rs @@ -10,11 +10,9 @@ use abscissa_core::{Command, Runnable}; use eyre::eyre; use hdpath::StandardHDPath; use ibc_relayer::{ - chain::namada::wallet::CliWalletUtils, config::{ChainConfig, Config}, keyring::{ - AnySigningKeyPair, KeyRing, NamadaKeyPair, Secp256k1KeyPair, SigningKeyPair, - SigningKeyPairSized, Store, + AnySigningKeyPair, KeyRing, Secp256k1KeyPair, SigningKeyPair, SigningKeyPairSized, Store, }, }; use ibc_relayer_types::core::ics24_host::identifier::ChainId; @@ -222,36 +220,6 @@ pub fn add_key( keyring.add_key(key_name, key_pair.clone())?; key_pair.into() } - ChainConfig::Namada(config) => { - let mut keyring = - KeyRing::new_namada(Store::Test, &config.id, &config.key_store_folder)?; - - check_key_exists(&keyring, key_name, overwrite); - - let path = if file.is_file() { - file.parent().ok_or(eyre!("invalid Namada wallet path"))? - } else { - file - }; - let mut wallet = CliWalletUtils::new(path.to_path_buf()); - wallet - .load() - .map_err(|e| eyre!("error loading Namada wallet: {e}"))?; - - let secret_key = wallet - .find_secret_key(key_name, None) - .map_err(|e| eyre!("error loading the key from Namada wallet: {e}"))?; - let address = wallet - .find_address(key_name) - .ok_or_else(|| eyre!("error loading the address from Namada wallet"))?; - let namada_key = NamadaKeyPair { - alias: key_name.to_string(), - address: address.into_owned(), - secret_key: secret_key.clone(), - }; - keyring.add_key(key_name, namada_key.clone())?; - namada_key.into() - } }; Ok(key_pair) @@ -288,11 +256,6 @@ pub fn restore_key( keyring.add_key(key_name, key_pair.clone())?; key_pair.into() } - ChainConfig::Namada(_) => { - return Err(eyre!( - "Namada key can't be restored here. Use Namada wallet." - )); - } }; Ok(key_pair) diff --git a/crates/relayer-cli/src/commands/keys/balance.rs b/crates/relayer-cli/src/commands/keys/balance.rs index b3c9851bb9..b3c1edd90d 100644 --- a/crates/relayer-cli/src/commands/keys/balance.rs +++ b/crates/relayer-cli/src/commands/keys/balance.rs @@ -77,9 +77,7 @@ fn get_balance(chain: impl ChainHandle, key_name: Option, denom: Option< let key_name = key_name.unwrap_or_else(|| { let chain_config = chain.config().unwrap_or_else(exit_with_unrecoverable_error); match chain_config { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { - chain_config.key_name - } + ChainConfig::CosmosSdk(chain_config) => chain_config.key_name, } }); @@ -101,9 +99,7 @@ fn get_balances(chain: impl ChainHandle, key_name: Option) { let key_name = key_name.unwrap_or_else(|| { let chain_config = chain.config().unwrap_or_else(exit_with_unrecoverable_error); match chain_config { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { - chain_config.key_name - } + ChainConfig::CosmosSdk(chain_config) => chain_config.key_name, } }); diff --git a/crates/relayer-cli/src/commands/keys/delete.rs b/crates/relayer-cli/src/commands/keys/delete.rs index aef00748d0..fe25e8a056 100644 --- a/crates/relayer-cli/src/commands/keys/delete.rs +++ b/crates/relayer-cli/src/commands/keys/delete.rs @@ -123,11 +123,6 @@ pub fn delete_key(config: &ChainConfig, key_name: &str) -> eyre::Result<()> { )?; keyring.remove_key(key_name)?; } - ChainConfig::Namada(config) => { - let mut keyring = - KeyRing::new_namada(Store::Test, &config.id, &config.key_store_folder)?; - keyring.remove_key(key_name)?; - } } Ok(()) } @@ -146,14 +141,6 @@ pub fn delete_all_keys(config: &ChainConfig) -> eyre::Result<()> { keyring.remove_key(&key_name)?; } } - ChainConfig::Namada(config) => { - let mut keyring = - KeyRing::new_namada(Store::Test, &config.id, &config.key_store_folder)?; - let keys = keyring.keys()?; - for (key_name, _) in keys { - keyring.remove_key(&key_name)?; - } - } } Ok(()) } diff --git a/crates/relayer-cli/src/commands/listen.rs b/crates/relayer-cli/src/commands/listen.rs index f922aa562c..ea8bd979cb 100644 --- a/crates/relayer-cli/src/commands/listen.rs +++ b/crates/relayer-cli/src/commands/listen.rs @@ -146,7 +146,7 @@ fn subscribe( // Q: Should this be restricted only to backends that support it, // or are all backends expected to support subscriptions? match chain_config { - ChainConfig::CosmosSdk(config) | ChainConfig::Namada(config) => { + ChainConfig::CosmosSdk(config) => { let (event_source, monitor_tx) = match &config.event_source { EventSourceMode::Push { url, batch_delay } => EventSource::websocket( chain_config.id().clone(), @@ -189,7 +189,7 @@ fn detect_compatibility_mode( ) -> eyre::Result { // TODO(erwan): move this to the cosmos sdk endpoint implementation let rpc_addr = match config { - ChainConfig::CosmosSdk(config) | ChainConfig::Namada(config) => config.rpc_addr.clone(), + ChainConfig::CosmosSdk(config) => config.rpc_addr.clone(), }; let client = HttpClient::builder(rpc_addr.try_into()?) @@ -197,9 +197,7 @@ fn detect_compatibility_mode( .build()?; let compat_mode = match config { - ChainConfig::CosmosSdk(config) | ChainConfig::Namada(config) => { - rt.block_on(fetch_compat_mode(&client, config))? - } + ChainConfig::CosmosSdk(config) => rt.block_on(fetch_compat_mode(&client, config))?, }; Ok(compat_mode) diff --git a/crates/relayer-cli/src/commands/tx/client.rs b/crates/relayer-cli/src/commands/tx/client.rs index 9f7edc9556..827d1c5cc1 100644 --- a/crates/relayer-cli/src/commands/tx/client.rs +++ b/crates/relayer-cli/src/commands/tx/client.rs @@ -206,7 +206,7 @@ impl Runnable for TxUpdateClientCmd { if let Some(restart_params) = self.genesis_restart_params() { match config.find_chain_mut(&reference_chain_id) { Some(chain_config) => match chain_config { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.genesis_restart = Some(restart_params) } }, @@ -341,7 +341,7 @@ impl Runnable for TxUpgradeClientCmd { reference_application_latest_height ); - while reference_application_latest_height < target_reference_application_height { + while reference_application_latest_height != target_reference_application_height { thread::sleep(Duration::from_millis(500)); reference_application_latest_height = match client.src_chain().query_latest_height() { diff --git a/crates/relayer-cli/src/commands/tx/upgrade.rs b/crates/relayer-cli/src/commands/tx/upgrade.rs index 5c0773a82b..d41bf6ce1e 100644 --- a/crates/relayer-cli/src/commands/tx/upgrade.rs +++ b/crates/relayer-cli/src/commands/tx/upgrade.rs @@ -127,9 +127,7 @@ impl Runnable for TxIbcUpgradeChainCmd { let reference_chain = spawn_chain_runtime(&config, &self.reference_chain_id) .unwrap_or_else(exit_with_unrecoverable_error); - let gov_account = if requires_legacy_upgrade_proposal(reference_chain.clone()) - .unwrap_or_else(exit_with_unrecoverable_error) - { + let gov_account = if requires_legacy_upgrade_proposal(reference_chain.clone()) { "".to_string() } else if let Some(gov_account) = &self.gov_account { gov_account.clone() diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index 1b7649bd94..cf44344abf 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.79.0" +rust-version = "1.76.0" description = """ Rust implementation of a RESTful API server for Hermes """ @@ -24,6 +24,5 @@ tokio = { workspace = true } tracing = { workspace = true } [dev-dependencies] -reqwest = { workspace = true, features = ["json"] } -serde_json = { workspace = true } -toml = { workspace = true } +reqwest = { workspace = true, features = ["json"] } +toml = { workspace = true } diff --git a/crates/relayer-rest/tests/mock.rs b/crates/relayer-rest/tests/mock.rs index 349f58e30d..301cce7c5a 100644 --- a/crates/relayer-rest/tests/mock.rs +++ b/crates/relayer-rest/tests/mock.rs @@ -46,12 +46,9 @@ where let response = reqwest::get(&format!("http://127.0.0.1:{port}{path}")) .await .unwrap() - .json() + .json::() .await .unwrap(); - // Workaround for serde_json deserialization failure - // from_str/from_slice() failed for ChainConfig - let response = serde_json::from_value::(response).unwrap(); assert_eq!(response, expected); diff --git a/crates/relayer-types/Cargo.toml b/crates/relayer-types/Cargo.toml index 2decce2fb7..7b0f1d1c28 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.79.0" +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-types/src/core/ics03_connection/events.rs b/crates/relayer-types/src/core/ics03_connection/events.rs index e91b7e7ed6..5fddc6cfad 100644 --- a/crates/relayer-types/src/core/ics03_connection/events.rs +++ b/crates/relayer-types/src/core/ics03_connection/events.rs @@ -4,7 +4,6 @@ use serde_derive::{Deserialize, Serialize}; use std::fmt::{Display, Error as FmtError, Formatter}; use tendermint::abci; -use crate::core::ics04_channel::events::EventType; use crate::core::ics24_host::identifier::{ClientId, ConnectionId}; use crate::events::{IbcEvent, IbcEventType}; @@ -69,12 +68,6 @@ impl OpenInit { } } -impl EventType for OpenInit { - fn event_type() -> IbcEventType { - IbcEventType::OpenInitConnection - } -} - impl Display for OpenInit { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "OpenInit {{ {} }}", self.0) @@ -114,12 +107,6 @@ impl OpenTry { } } -impl EventType for OpenTry { - fn event_type() -> IbcEventType { - IbcEventType::OpenTryConnection - } -} - impl Display for OpenTry { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "OpenTry {{ {} }}", self.0) @@ -159,12 +146,6 @@ impl OpenAck { } } -impl EventType for OpenAck { - fn event_type() -> IbcEventType { - IbcEventType::OpenAckConnection - } -} - impl Display for OpenAck { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "OpenAck {{ {} }}", self.0) @@ -204,12 +185,6 @@ impl OpenConfirm { } } -impl EventType for OpenConfirm { - fn event_type() -> IbcEventType { - IbcEventType::OpenConfirmConnection - } -} - impl Display for OpenConfirm { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { write!(f, "OpenConfirm {{ {} }}", self.0) diff --git a/crates/relayer-types/src/events.rs b/crates/relayer-types/src/events.rs index 1d27cc337a..7ceb45d5c2 100644 --- a/crates/relayer-types/src/events.rs +++ b/crates/relayer-types/src/events.rs @@ -282,7 +282,7 @@ impl FromStr for IbcEventType { } /// Events created by the IBC component of a chain, destined for a relayer. -#[derive(Debug, Clone, Serialize, PartialEq)] +#[derive(Debug, Clone, Serialize)] pub enum IbcEvent { NewBlock(NewBlock), diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index 3538f8fbe1..a5560a766c 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.79.0" +rust-version = "1.76.0" description = """ Implementation of an IBC Relayer in Rust, as a library """ @@ -46,10 +46,6 @@ humantime = { workspace = true } humantime-serde = { workspace = true } itertools = { workspace = true } moka = { workspace = true, features = ["sync"] } -namada_sdk = { workspace = true } -namada-tendermint = { workspace = true } -namada-tendermint-proto = { workspace = true } -namada-tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } num-bigint = { workspace = true, features = ["serde"] } num-rational = { workspace = true, features = ["num-bigint", "serde"] } once_cell = { workspace = true } @@ -58,7 +54,6 @@ regex = { workspace = true } reqwest = { workspace = true, features = ["rustls-tls-native-roots", "json"] } retry = { workspace = true } ripemd = { workspace = true } -rpassword = { workspace = true } secp256k1 = { workspace = true, features = ["rand-std"] } semver = { workspace = true } serde = { workspace = true } diff --git a/crates/relayer/src/chain.rs b/crates/relayer/src/chain.rs index 9512e3865e..bcca34e85f 100644 --- a/crates/relayer/src/chain.rs +++ b/crates/relayer/src/chain.rs @@ -3,8 +3,6 @@ pub mod cosmos; pub mod counterparty; pub mod endpoint; pub mod handle; -pub mod namada; pub mod requests; pub mod runtime; pub mod tracking; -pub mod version; diff --git a/crates/relayer/src/chain/client.rs b/crates/relayer/src/chain/client.rs index 54341c525d..6f00ec8df9 100644 --- a/crates/relayer/src/chain/client.rs +++ b/crates/relayer/src/chain/client.rs @@ -27,12 +27,9 @@ impl ClientSettings { // // TODO: extract Tendermint-related configs into a separate substructure // that can be used both by CosmosSdkConfig and configs for nonSDK chains. - use ChainConfig::{CosmosSdk as Csdk, Namada}; + use ChainConfig::CosmosSdk as Csdk; match (src_chain_config, dst_chain_config) { - (Csdk(src_chain_config), Csdk(dst_chain_config)) - | (Namada(src_chain_config), Namada(dst_chain_config)) - | (Csdk(src_chain_config), Namada(dst_chain_config)) - | (Namada(src_chain_config), Csdk(dst_chain_config)) => { + (Csdk(src_chain_config), Csdk(dst_chain_config)) => { ClientSettings::Tendermint(cosmos::client::Settings::for_create_command( options, src_chain_config, diff --git a/crates/relayer/src/chain/cosmos.rs b/crates/relayer/src/chain/cosmos.rs index f6e00232bd..1dc99d6923 100644 --- a/crates/relayer/src/chain/cosmos.rs +++ b/crates/relayer/src/chain/cosmos.rs @@ -98,7 +98,6 @@ use crate::chain::endpoint::{ChainEndpoint, ChainStatus, HealthCheck}; use crate::chain::handle::Subscription; use crate::chain::requests::*; use crate::chain::tracking::TrackedMsgs; -use crate::chain::version::Specs; use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; use crate::config::Error as ConfigError; use crate::config::{parse_gas_prices, ChainConfig, GasPrice}; @@ -120,6 +119,7 @@ use crate::HERMES_VERSION; use self::gas::dynamic_gas_price; use self::types::gas::GasConfig; +use self::version::Specs; pub mod batch; pub mod client; @@ -1119,7 +1119,8 @@ impl ChainEndpoint for CosmosSdkChain { &self.rpc_client, &self.config.rpc_addr, ))?; - Ok(Specs::Cosmos(version_specs)) + + Ok(version_specs) } fn query_balance(&self, key_name: Option<&str>, denom: Option<&str>) -> Result { diff --git a/crates/relayer/src/chain/cosmos/batch.rs b/crates/relayer/src/chain/cosmos/batch.rs index bf55a4ec27..3e52f52aec 100644 --- a/crates/relayer/src/chain/cosmos/batch.rs +++ b/crates/relayer/src/chain/cosmos/batch.rs @@ -209,7 +209,7 @@ async fn sequential_send_messages_as_batches( Ok(tx_sync_results) } -pub fn response_to_tx_sync_result( +fn response_to_tx_sync_result( chain_id: &ChainId, message_count: usize, response: Response, diff --git a/crates/relayer/src/chain/cosmos/config.rs b/crates/relayer/src/chain/cosmos/config.rs index 1a58cc27ac..911e147f32 100644 --- a/crates/relayer/src/chain/cosmos/config.rs +++ b/crates/relayer/src/chain/cosmos/config.rs @@ -167,7 +167,7 @@ impl CosmosSdkConfig { /// a) non-zero /// b) greater or equal to 1/3 /// c) strictly less than 1 -pub fn validate_trust_threshold( +fn validate_trust_threshold( id: &ChainId, trust_threshold: TrustThreshold, ) -> Result<(), Diagnostic> { diff --git a/crates/relayer/src/chain/cosmos/gas.rs b/crates/relayer/src/chain/cosmos/gas.rs index 76ad0adcb3..2106da3375 100644 --- a/crates/relayer/src/chain/cosmos/gas.rs +++ b/crates/relayer/src/chain/cosmos/gas.rs @@ -117,16 +117,16 @@ pub fn mul_floor(a: u64, f: f64) -> BigInt { (f * a).floor().to_integer() } -pub struct AdjustGas { - pub gas_multiplier: f64, - pub max_gas: u64, - pub gas_amount: u64, +struct AdjustGas { + gas_multiplier: f64, + max_gas: u64, + gas_amount: u64, } /// Adjusts the fee based on the configured `gas_multiplier` to prevent out of gas errors. /// The actual gas cost, when a transaction is executed, may be slightly higher than the /// one returned by the simulation. -pub fn adjust_estimated_gas( +fn adjust_estimated_gas( AdjustGas { gas_multiplier, max_gas, diff --git a/crates/relayer/src/chain/cosmos/types/events/channel.rs b/crates/relayer/src/chain/cosmos/types/events/channel.rs index 5c3279987a..7a1313ae00 100644 --- a/crates/relayer/src/chain/cosmos/types/events/channel.rs +++ b/crates/relayer/src/chain/cosmos/types/events/channel.rs @@ -1,3 +1,5 @@ +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; @@ -16,10 +18,6 @@ use ibc_relayer_types::core::ics24_host::identifier::ChainId; use ibc_relayer_types::events::Error as EventError; use ibc_relayer_types::Height; -use crate::chain::cosmos::types::events::raw_object::extract_attribute; -use crate::chain::cosmos::types::events::raw_object::maybe_extract_attribute; -use crate::chain::cosmos::types::events::raw_object::RawObject; - fn extract_attributes(object: &RawObject<'_>, namespace: &str) -> Result { Ok(Attributes { port_id: extract_attribute(object, &format!("{namespace}.port_id"))? @@ -250,3 +248,41 @@ impl TryFrom> for CrossChainQueryPacket { }) } } + +#[derive(Debug, Clone)] +pub struct RawObject<'a> { + pub height: Height, + pub action: String, + pub idx: usize, + pub events: &'a HashMap>, +} + +impl<'a> RawObject<'a> { + pub fn new( + height: Height, + action: String, + idx: usize, + events: &'a HashMap>, + ) -> RawObject<'a> { + RawObject { + height, + action, + idx, + events, + } + } +} + +pub fn extract_attribute(object: &RawObject<'_>, key: &str) -> Result { + let value = object + .events + .get(key) + .ok_or_else(|| EventError::missing_key(key.to_string()))?[object.idx] + .clone(); + + Ok(value) +} + +pub fn maybe_extract_attribute(object: &RawObject<'_>, key: &str) -> Option { + object.events.get(key).map(|tags| tags[object.idx].clone()) +} diff --git a/crates/relayer/src/chain/cosmos/types/events/connection.rs b/crates/relayer/src/chain/cosmos/types/events/connection.rs deleted file mode 100644 index d629ec5506..0000000000 --- a/crates/relayer/src/chain/cosmos/types/events/connection.rs +++ /dev/null @@ -1,68 +0,0 @@ -use ibc_relayer_types::core::ics03_connection::events::Attributes; -use ibc_relayer_types::core::ics03_connection::events::OpenAck; -use ibc_relayer_types::core::ics03_connection::events::OpenConfirm; -use ibc_relayer_types::core::ics03_connection::events::OpenInit; -use ibc_relayer_types::core::ics03_connection::events::OpenTry; -use ibc_relayer_types::core::ics04_channel::events::EventType; -use ibc_relayer_types::events::Error as EventError; - -use crate::chain::cosmos::types::events::raw_object::extract_attribute; -use crate::chain::cosmos::types::events::raw_object::maybe_extract_attribute; -use crate::chain::cosmos::types::events::raw_object::RawObject; - -fn extract_attributes(object: &RawObject<'_>, namespace: &str) -> Result { - Ok(Attributes { - client_id: extract_attribute(object, &format!("{namespace}.client_id"))? - .parse() - .map_err(EventError::parse)?, - counterparty_connection_id: maybe_extract_attribute( - object, - &format!("{namespace}.counterparty_connection_id"), - ) - .and_then(|v| v.parse().ok()), - counterparty_client_id: extract_attribute( - object, - &format!("{namespace}.counterparty_client_id"), - )? - .parse() - .map_err(EventError::parse)?, - connection_id: maybe_extract_attribute(object, &format!("{namespace}.connection_id")) - .and_then(|v| v.parse().ok()), - }) -} - -impl TryFrom> for OpenInit { - type Error = EventError; - - fn try_from(value: RawObject<'_>) -> Result { - let attributes = extract_attributes(&value, Self::event_type().as_str())?; - Ok(OpenInit(attributes)) - } -} - -impl TryFrom> for OpenTry { - type Error = EventError; - - fn try_from(value: RawObject<'_>) -> Result { - let attributes = extract_attributes(&value, Self::event_type().as_str())?; - Ok(OpenTry(attributes)) - } -} - -impl TryFrom> for OpenAck { - type Error = EventError; - - fn try_from(value: RawObject<'_>) -> Result { - let attributes = extract_attributes(&value, Self::event_type().as_str())?; - Ok(OpenAck(attributes)) - } -} - -impl TryFrom> for OpenConfirm { - type Error = EventError; - - fn try_from(value: RawObject<'_>) -> Result { - let attributes = extract_attributes(&value, Self::event_type().as_str())?; - Ok(OpenConfirm(attributes)) - } -} diff --git a/crates/relayer/src/chain/cosmos/types/events/mod.rs b/crates/relayer/src/chain/cosmos/types/events/mod.rs index a07702ad2c..e96cafdfca 100644 --- a/crates/relayer/src/chain/cosmos/types/events/mod.rs +++ b/crates/relayer/src/chain/cosmos/types/events/mod.rs @@ -4,9 +4,7 @@ use tendermint::abci; use crate::event::{ibc_event_try_from_abci_event, IbcEventWithHeight}; pub mod channel; -pub mod connection; pub mod fee; -pub mod raw_object; pub fn from_tx_response_event(height: Height, event: &abci::Event) -> Option { ibc_event_try_from_abci_event(event) diff --git a/crates/relayer/src/chain/cosmos/types/events/raw_object.rs b/crates/relayer/src/chain/cosmos/types/events/raw_object.rs deleted file mode 100644 index 670d4c96c1..0000000000 --- a/crates/relayer/src/chain/cosmos/types/events/raw_object.rs +++ /dev/null @@ -1,42 +0,0 @@ -use alloc::collections::btree_map::BTreeMap as HashMap; - -use ibc_relayer_types::events::Error as EventError; -use ibc_relayer_types::Height; - -#[derive(Debug, Clone)] -pub struct RawObject<'a> { - pub height: Height, - pub action: String, - pub idx: usize, - pub events: &'a HashMap>, -} - -impl<'a> RawObject<'a> { - pub fn new( - height: Height, - action: String, - idx: usize, - events: &'a HashMap>, - ) -> RawObject<'a> { - RawObject { - height, - action, - idx, - events, - } - } -} - -pub fn extract_attribute(object: &RawObject<'_>, key: &str) -> Result { - let value = object - .events - .get(key) - .ok_or_else(|| EventError::missing_key(key.to_string()))?[object.idx] - .clone(); - - Ok(value) -} - -pub fn maybe_extract_attribute(object: &RawObject<'_>, key: &str) -> Option { - object.events.get(key).map(|tags| tags[object.idx].clone()) -} diff --git a/crates/relayer/src/chain/cosmos/types/gas.rs b/crates/relayer/src/chain/cosmos/types/gas.rs index b8944d373f..e472eb91af 100644 --- a/crates/relayer/src/chain/cosmos/types/gas.rs +++ b/crates/relayer/src/chain/cosmos/types/gas.rs @@ -48,11 +48,6 @@ pub fn max_gas_from_config(config: &CosmosSdkConfig) -> u64 { config.max_gas.unwrap_or(DEFAULT_MAX_GAS) } -/// The maximum amount of gas the relayer is willing to pay for a transaction -pub fn max_gas_from_config_opt(config: &CosmosSdkConfig) -> Option { - config.max_gas -} - /// The gas multiplier pub fn gas_multiplier_from_config(config: &CosmosSdkConfig) -> f64 { config.gas_multiplier.unwrap_or_default().to_f64() diff --git a/crates/relayer/src/chain/cosmos/version.rs b/crates/relayer/src/chain/cosmos/version.rs index d9c2b3b658..5db1b56961 100644 --- a/crates/relayer/src/chain/cosmos/version.rs +++ b/crates/relayer/src/chain/cosmos/version.rs @@ -9,8 +9,6 @@ use tracing::trace; use ibc_proto::cosmos::base::tendermint::v1beta1::{Module, VersionInfo}; -use crate::chain::version::ConsensusVersion; - /// Specifies the SDK, IBC-go, and Tendermint modules path, as expected /// to appear in the application version information of a /// Cosmos-SDK network. @@ -29,6 +27,12 @@ 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(Clone, Debug, PartialEq, Eq)] pub struct Specs { @@ -52,7 +56,8 @@ impl Display for Specs { .unwrap_or_else(|| "UNKNOWN".to_string()); let consensus = match self.consensus { - Some(ref v) => v.to_string(), + Some(ConsensusVersion::Tendermint(ref v)) => format!("Tendermint {v}"), + Some(ConsensusVersion::Comet(ref v)) => format!("CometBFT {v}"), None => "Tendermint: UNKNOWN, CometBFT: UNKNOWN".to_string(), }; diff --git a/crates/relayer/src/chain/cosmos/wait.rs b/crates/relayer/src/chain/cosmos/wait.rs index 06d2b3f3b6..9ff26b2cce 100644 --- a/crates/relayer/src/chain/cosmos/wait.rs +++ b/crates/relayer/src/chain/cosmos/wait.rs @@ -117,7 +117,7 @@ async fn update_tx_sync_result( Ok(()) } -pub fn all_tx_results_found(tx_sync_results: &[TxSyncResult]) -> bool { +fn all_tx_results_found(tx_sync_results: &[TxSyncResult]) -> bool { tx_sync_results .iter() .all(|r| matches!(r.status, TxStatus::ReceivedResponse)) diff --git a/crates/relayer/src/chain/endpoint.rs b/crates/relayer/src/chain/endpoint.rs index ff33a4b815..387ff0b8d6 100644 --- a/crates/relayer/src/chain/endpoint.rs +++ b/crates/relayer/src/chain/endpoint.rs @@ -36,10 +36,10 @@ use tendermint_rpc::endpoint::broadcast::tx_sync::Response as TxResponse; use crate::account::Balance; use crate::chain::client::ClientSettings; +use crate::chain::cosmos::version::Specs; use crate::chain::handle::Subscription; use crate::chain::requests::*; use crate::chain::tracking::TrackedMsgs; -use crate::chain::version::Specs; use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; use crate::config::ChainConfig; use crate::connection::ConnectionMsgType; diff --git a/crates/relayer/src/chain/handle.rs b/crates/relayer/src/chain/handle.rs index bd356fb030..b4aae48916 100644 --- a/crates/relayer/src/chain/handle.rs +++ b/crates/relayer/src/chain/handle.rs @@ -48,10 +48,10 @@ use crate::{ use super::{ client::ClientSettings, + cosmos::version::Specs, endpoint::{ChainStatus, HealthCheck}, requests::*, tracking::TrackedMsgs, - version::Specs, }; mod base; diff --git a/crates/relayer/src/chain/handle/base.rs b/crates/relayer/src/chain/handle/base.rs index 00f54c6faf..64d7d7d30e 100644 --- a/crates/relayer/src/chain/handle/base.rs +++ b/crates/relayer/src/chain/handle/base.rs @@ -34,8 +34,8 @@ use ibc_relayer_types::{ use crate::{ account::Balance, chain::{ - client::ClientSettings, endpoint::ChainStatus, requests::*, tracking::TrackedMsgs, - version::Specs, + client::ClientSettings, cosmos::version::Specs, endpoint::ChainStatus, requests::*, + tracking::TrackedMsgs, }, client_state::{AnyClientState, IdentifiedAnyClientState}, config::ChainConfig, diff --git a/crates/relayer/src/chain/handle/cache.rs b/crates/relayer/src/chain/handle/cache.rs index 0c692424e4..403fee0bb2 100644 --- a/crates/relayer/src/chain/handle/cache.rs +++ b/crates/relayer/src/chain/handle/cache.rs @@ -30,11 +30,11 @@ use ibc_relayer_types::Height; use crate::account::Balance; use crate::cache::{Cache, CacheStatus}; use crate::chain::client::ClientSettings; +use crate::chain::cosmos::version::Specs; use crate::chain::endpoint::{ChainStatus, HealthCheck}; use crate::chain::handle::{ChainHandle, ChainRequest, Subscription}; use crate::chain::requests::*; use crate::chain::tracking::TrackedMsgs; -use crate::chain::version::Specs; use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; use crate::config::ChainConfig; use crate::connection::ConnectionMsgType; diff --git a/crates/relayer/src/chain/handle/counting.rs b/crates/relayer/src/chain/handle/counting.rs index 886372ca4f..4fe7685a9e 100644 --- a/crates/relayer/src/chain/handle/counting.rs +++ b/crates/relayer/src/chain/handle/counting.rs @@ -31,11 +31,11 @@ use ibc_relayer_types::Height; use crate::account::Balance; use crate::chain::client::ClientSettings; +use crate::chain::cosmos::version::Specs; use crate::chain::endpoint::{ChainStatus, HealthCheck}; use crate::chain::handle::{ChainHandle, ChainRequest, Subscription}; use crate::chain::requests::*; use crate::chain::tracking::TrackedMsgs; -use crate::chain::version::Specs; use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; use crate::config::ChainConfig; use crate::connection::ConnectionMsgType; diff --git a/crates/relayer/src/chain/namada.rs b/crates/relayer/src/chain/namada.rs deleted file mode 100644 index 4a362764d1..0000000000 --- a/crates/relayer/src/chain/namada.rs +++ /dev/null @@ -1,1408 +0,0 @@ -use alloc::sync::Arc; -use core::str::FromStr; -use prost::Message; -use std::thread; -use tracing::debug; - -use core::time::Duration; - -use ibc_proto::ibc::applications::fee::v1::{ - QueryIncentivizedPacketRequest, QueryIncentivizedPacketResponse, -}; -use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; -use ibc_relayer_types::applications::ics28_ccv::msgs::{ConsumerChain, ConsumerId}; -use ibc_relayer_types::applications::ics31_icq::response::CrossChainQueryResponse; -use ibc_relayer_types::clients::ics07_tendermint::client_state::{ - AllowUpdate, ClientState as TmClientState, -}; -use ibc_relayer_types::clients::ics07_tendermint::consensus_state::ConsensusState as TmConsensusState; -use ibc_relayer_types::clients::ics07_tendermint::header::Header as TmHeader; -use ibc_relayer_types::core::ics02_client::events::UpdateClient; -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::packet::Sequence; -use ibc_relayer_types::core::ics04_channel::upgrade::{ErrorReceipt, 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::{ - ChainId, ChannelId, ClientId, ConnectionId, PortId, -}; -use ibc_relayer_types::core::ics24_host::path::{ - AcksPath, ChannelEndsPath, ChannelUpgradeErrorPath, ChannelUpgradePath, - ClientConsensusStatePath, ClientStatePath, CommitmentsPath, ConnectionsPath, ReceiptsPath, - SeqRecvsPath, -}; -use ibc_relayer_types::signer::Signer; -use ibc_relayer_types::Height as ICSHeight; -use namada_sdk::address::{Address, InternalAddress}; -use namada_sdk::borsh::BorshDeserialize; -use namada_sdk::ibc::core::host::types::path::UPGRADED_IBC_STATE; -use namada_sdk::ibc::{storage, COMMITMENT_PREFIX}; -use namada_sdk::io::NullIo; -use namada_sdk::io::{Client, NamadaIo}; -use namada_sdk::masp::fs::FsShieldedUtils; -use namada_sdk::parameters::{storage as param_storage, EpochDuration}; -use namada_sdk::proof_of_stake::storage_key as pos_storage_key; -use namada_sdk::proof_of_stake::OwnedPosParams; -use namada_sdk::state::ics23_specs::ibc_proof_specs; -use namada_sdk::state::Sha256Hasher; -use namada_sdk::storage::{Key, KeySeg, PrefixValue}; -use namada_sdk::token::storage_key::{balance_key, denom_key, is_any_token_balance_key}; -use namada_sdk::token::{Amount, DenominatedAmount, Denomination}; -use namada_sdk::wallet::Store; -use namada_sdk::wallet::Wallet; -use namada_sdk::{rpc, Namada, NamadaImpl}; -use namada_tendermint::block::Height as TmHeight; -use namada_tendermint::{node, Time}; -use namada_tendermint_rpc::client::CompatMode; -use namada_tendermint_rpc::endpoint::broadcast::tx_sync::Response; -use namada_tendermint_rpc::{HttpClient, Url}; -use tendermint_proto::Protobuf as TmProtobuf; -use tokio::runtime::Runtime as TokioRuntime; - -use crate::account::Balance; -use crate::chain::client::ClientSettings; -use crate::chain::cosmos::batch::response_to_tx_sync_result; -use crate::chain::cosmos::config::CosmosSdkConfig; -use crate::chain::endpoint::{ChainEndpoint, ChainStatus, HealthCheck}; -use crate::chain::handle::Subscription; -use crate::chain::requests::*; -use crate::chain::tracking::TrackedMsgs; -use crate::chain::version::{ConsensusVersion, Specs}; -use crate::client_state::{AnyClientState, IdentifiedAnyClientState}; -use crate::config::error::Error as ConfigError; -use crate::config::ChainConfig; -use crate::consensus_state::AnyConsensusState; -use crate::denom::DenomTrace; -use crate::error::Error; -use crate::event::source::{EventSource, TxEventSourceCmd}; -use crate::event::IbcEventWithHeight; -use crate::keyring::{KeyRing, NamadaKeyPair, SigningKeyPair}; -use crate::light_client::tendermint::LightClient as TmLightClient; -use crate::light_client::{LightClient, Verified}; -use crate::misbehaviour::MisbehaviourEvidence; - -use self::error::Error as NamadaError; - -pub mod error; -pub mod key; -mod query; -mod tx; -pub mod version; -pub mod wallet; - -pub struct NamadaChain { - /// Reuse CosmosSdkConfig for tendermint's light clients - config: CosmosSdkConfig, - /// Namada context - ctx: NamadaImpl, - compat_mode: CompatMode, - light_client: TmLightClient, - rt: Arc, - keybase: KeyRing, - tx_monitor_cmd: Option, -} - -impl NamadaChain { - fn init_event_source(&mut self) -> Result { - crate::time!( - "init_event_source", - { - "src_chain": self.config.id.to_string(), - } - ); - - use crate::config::EventSourceMode as Mode; - let http_client = tendermint_rpc::HttpClient::new(self.config.rpc_addr.clone()) - .map_err(|e| Error::rpc(self.config.rpc_addr.clone(), e))?; - let compat_mode = self - .compat_mode - .to_string() - .parse() - .map_err(|e| Error::rpc(self.config.rpc_addr.clone(), e))?; - let (event_source, monitor_tx) = match &self.config.event_source { - Mode::Push { url, batch_delay } => EventSource::websocket( - self.config.id.clone(), - url.clone(), - compat_mode, - *batch_delay, - self.rt.clone(), - ), - Mode::Pull { - interval, - max_retries, - } => EventSource::rpc( - self.config.id.clone(), - http_client, - *interval, - *max_retries, - self.rt.clone(), - ), - } - .map_err(Error::event_source)?; - - thread::spawn(move || event_source.run()); - - Ok(monitor_tx) - } - - fn get_unbonding_time(&self) -> Result { - let key = pos_storage_key::params_key(); - let (value, _) = self.query(key, QueryHeight::Latest, IncludeProof::No)?; - let pos_params = - OwnedPosParams::try_from_slice(&value[..]).map_err(NamadaError::borsh_decode)?; - - let key = param_storage::get_epoch_duration_storage_key(); - let (value, _) = self.query(key, QueryHeight::Latest, IncludeProof::No)?; - let epoch_duration = - EpochDuration::try_from_slice(&value[..]).map_err(NamadaError::borsh_decode)?; - let unbonding_period = pos_params.pipeline_len * epoch_duration.min_duration.0; - Ok(Duration::from_secs(unbonding_period)) - } - - fn get_latest_block_time(&self) -> Result { - let status = self - .rt - .block_on(Client::status(self.ctx.client())) - .map_err(|e| NamadaError::rpc(self.config.rpc_addr.clone(), e))?; - let time = - tendermint::Time::parse_from_rfc3339(&status.sync_info.latest_block_time.to_rfc3339()) - .expect("Time should be parsable"); - Ok(time) - } -} - -impl ChainEndpoint for NamadaChain { - type LightBlock = tendermint_light_client::types::LightBlock; - type Header = TmHeader; - type ConsensusState = TmConsensusState; - type ClientState = TmClientState; - type Time = Time; - type SigningKeyPair = NamadaKeyPair; - - fn id(&self) -> &ChainId { - &self.config.id - } - - fn config(&self) -> ChainConfig { - ChainConfig::Namada(self.config.clone()) - } - - fn bootstrap(config: ChainConfig, rt: Arc) -> Result { - #[allow(irrefutable_let_patterns)] - let ChainConfig::Namada(config) = config - else { - return Err(Error::config(ConfigError::wrong_type())); - }; - - let rpc_addr = Url::from_str(&config.rpc_addr.to_string()) - .map_err(|e| NamadaError::rpc(config.rpc_addr.clone(), e))?; - let mut rpc_client = - HttpClient::new(rpc_addr).map_err(|e| NamadaError::rpc(config.rpc_addr.clone(), e))?; - let node_info = rt.block_on(fetch_node_info(&rpc_client, &config))?; - let compat_mode = CompatMode::from_version(node_info.version) - .ok() - .or_else(|| { - config.compat_mode.map(|mode| { - mode.to_string() - .parse() - .expect("compatMode should be parsable") - }) - }) - .unwrap_or(CompatMode::V0_37); - rpc_client.set_compat_mode(compat_mode); - - let node_info = rt.block_on(fetch_node_info(&rpc_client, &config))?; - let node_id = tendermint_light_client_verifier::types::PeerId::new( - node_info - .id - .as_bytes() - .try_into() - .expect("node ID should be able to converted"), - ); - let light_client = TmLightClient::from_cosmos_sdk_config(&config, node_id)?; - - let keybase = - KeyRing::new_namada(config.key_store_type, &config.id, &config.key_store_folder) - .map_err(Error::key_base)?; - - let shielded_dir = dirs_next::home_dir() - .expect("No home directory") - .join(".hermes/shielded") - .join(config.id.to_string()); - std::fs::create_dir_all(&shielded_dir).map_err(Error::io)?; - let shielded_ctx = FsShieldedUtils::new(shielded_dir); - - let mut store = Store::default(); - let key = keybase - .get_key(&config.key_name) - .map_err(|e| Error::key_not_found(config.key_name.clone(), e))?; - store.insert_keypair::( - config.key_name.clone().into(), - key.secret_key, - None, - Some(key.address), - None, - true, - ); - let wallet = Wallet::new(wallet::NullWalletUtils, store); - - let native_token = rt - .block_on(rpc::query_native_token(&rpc_client)) - .map_err(NamadaError::namada)?; - - // overwrite the proof spec - let config = CosmosSdkConfig { - proof_specs: Some(ibc_proof_specs::().into()), - ..config - }; - - let ctx = NamadaImpl::native_new(rpc_client, wallet, shielded_ctx, NullIo, native_token); - - Ok(Self { - config, - ctx, - compat_mode, - light_client, - rt, - keybase, - tx_monitor_cmd: None, - }) - } - - fn shutdown(self) -> Result<(), Error> { - if let Some(monitor_tx) = self.tx_monitor_cmd { - monitor_tx.shutdown().map_err(Error::event_source)?; - } - - Ok(()) - } - - fn health_check(&mut self) -> Result { - self.rt - .block_on(Client::health(self.ctx.client())) - .map_err(|e| { - NamadaError::health_check_json_rpc( - self.config.id.clone(), - self.config.rpc_addr.to_string(), - "/health".to_string(), - e, - ) - })?; - - Ok(HealthCheck::Healthy) - } - - fn subscribe(&mut self) -> Result { - let tx_monitor_cmd = match &self.tx_monitor_cmd { - Some(tx_monitor_cmd) => tx_monitor_cmd, - None => { - let tx_monitor_cmd = self.init_event_source()?; - self.tx_monitor_cmd = Some(tx_monitor_cmd); - self.tx_monitor_cmd.as_ref().unwrap() - } - }; - - let subscription = tx_monitor_cmd.subscribe().map_err(Error::event_source)?; - Ok(subscription) - } - - fn keybase(&self) -> &KeyRing { - &self.keybase - } - - fn keybase_mut(&mut self) -> &mut KeyRing { - &mut self.keybase - } - - fn get_key(&self) -> Result { - self.keybase - .get_key(&self.config.key_name) - .map_err(|e| Error::key_not_found(self.config.key_name.clone(), e)) - } - - fn get_signer(&self) -> Result { - let key = self - .keybase - .get_key(&self.config.key_name) - .map_err(|e| Error::key_not_found(self.config.key_name.clone(), e))?; - Ok(Signer::from_str(&key.account()).expect("The key name shouldn't be empty")) - } - - fn version_specs(&self) -> Result { - let status = self - .rt - .block_on(Client::status(self.ctx.client())) - .map_err(|e| NamadaError::rpc(self.config.rpc_addr.clone(), e))?; - - let cometbft_version = status.node_info.version.to_string(); - let cometbft_version = cometbft_version - .parse() - .map_err(|_| NamadaError::version(cometbft_version))?; - - let moniker = &status.node_info.moniker; - let namada_version = moniker - .to_string() - .split_once('-') - .and_then(|(_, version)| version.strip_prefix('v')) - .ok_or_else(|| NamadaError::version(moniker.to_string()))? - .parse() - .map_err(|_| NamadaError::version(moniker.to_string()))?; - - let specs = version::Specs { - namada: Some(namada_version), - consensus: Some(ConsensusVersion::Comet(cometbft_version)), - }; - Ok(Specs::Namada(specs)) - } - - fn send_messages_and_wait_commit( - &mut self, - tracked_msgs: TrackedMsgs, - ) -> Result, Error> { - crate::time!("send_messages_and_wait_commit"); - - let proto_msgs = tracked_msgs.messages(); - if proto_msgs.is_empty() { - return Ok(vec![]); - } - let max_msg_num = self.config.max_msg_num.to_usize(); - let msg_chunks = proto_msgs.chunks(max_msg_num); - let mut tx_sync_results = vec![]; - for msg_chunk in msg_chunks { - let response = self.batch_txs(msg_chunk)?; - tx_sync_results.push(response_to_tx_sync_result( - &self.config.id, - msg_chunk.len(), - into_tm_response(response), - )); - if self.config.sequential_batch_tx { - self.wait_for_block_commits(&mut tx_sync_results)?; - } - } - if !self.config.sequential_batch_tx { - self.wait_for_block_commits(&mut tx_sync_results)?; - } - - let events: Vec = tx_sync_results - .into_iter() - .flat_map(|el| el.events) - .collect(); - let mut dedup_events = vec![]; - for event in events { - if !dedup_events.contains(&event) { - dedup_events.push(event); - } - } - - Ok(dedup_events) - } - - fn send_messages_and_wait_check_tx( - &mut self, - tracked_msgs: TrackedMsgs, - ) -> Result, Error> { - crate::time!("send_messages_and_wait_check_tx"); - - let proto_msgs = tracked_msgs.messages(); - if proto_msgs.is_empty() { - return Ok(vec![]); - } - - let max_msg_num = self.config.max_msg_num.to_usize(); - let msg_chunks = proto_msgs.chunks(max_msg_num); - let mut responses = vec![]; - for msg_chunk in msg_chunks { - let resp = self.batch_txs(msg_chunk)?; - let response = into_tm_response(resp); - if response.code.is_err() { - return Err(Error::send_tx(response.log)); - } - responses.push(response); - } - - Ok(responses) - } - - fn verify_header( - &mut self, - trusted: ICSHeight, - target: ICSHeight, - client_state: &AnyClientState, - ) -> Result { - crate::time!( - "verify_header", - { - "src_chain": self.config.id.to_string(), - } - ); - - let now = self.get_latest_block_time()?; - self.light_client - .verify(trusted, target, client_state, now) - .map(|v| v.target) - } - - fn check_misbehaviour( - &mut self, - update: &UpdateClient, - client_state: &AnyClientState, - ) -> Result, Error> { - crate::time!( - "check_misbehaviour", - { - "src_chain": self.config.id.to_string(), - } - ); - - let now = self.get_latest_block_time()?; - self.light_client - .detect_misbehaviour(update, client_state, now) - } - - fn query_balance(&self, key_name: Option<&str>, denom: Option<&str>) -> Result { - // Given key_name and denom should be raw Namada addresses - let default_owner = self.get_signer()?; - let owner = key_name.unwrap_or(default_owner.as_ref()); - let owner = - Address::decode(owner).map_err(|_| NamadaError::address_decode(owner.to_string()))?; - - let default_token = self.ctx.native_token().to_string(); - let denom = denom.unwrap_or(&default_token); - let token = - Address::decode(denom).map_err(|_| NamadaError::address_decode(denom.to_string()))?; - - let balance_key = balance_key(&token, &owner); - let (value, _) = self.query(balance_key, QueryHeight::Latest, IncludeProof::No)?; - if value.is_empty() { - return Ok(Balance { - amount: "0".to_string(), - denom: denom.to_string(), - }); - } - let amount = Amount::try_from_slice(&value[..]).map_err(NamadaError::borsh_decode)?; - let denom_key = denom_key(&token); - let (value, _) = self.query(denom_key, QueryHeight::Latest, IncludeProof::No)?; - let denominated_amount = if value.is_empty() { - DenominatedAmount::new(amount, 0.into()) - } else { - let token_denom = - Denomination::try_from_slice(&value[..]).map_err(NamadaError::borsh_decode)?; - DenominatedAmount::new(amount, token_denom) - }; - - Ok(Balance { - amount: denominated_amount.to_string(), - denom: denom.to_string(), - }) - } - - fn query_all_balances(&self, key_name: Option<&str>) -> Result, Error> { - let default_owner = self.get_signer()?; - let owner = key_name.unwrap_or(default_owner.as_ref()); - let owner = - Address::decode(owner).map_err(|_| NamadaError::address_decode(owner.to_string()))?; - - let mut balances = vec![]; - let prefix = Key::from(Address::Internal(InternalAddress::Multitoken).to_db_key()); - for PrefixValue { key, value } in self.query_prefix(prefix)? { - if let Some([token, bal_owner]) = is_any_token_balance_key(&key) { - if owner == *bal_owner { - let amount = - Amount::try_from_slice(&value[..]).map_err(NamadaError::borsh_decode)?; - let denom_key = denom_key(token); - let (value, _) = - self.query(denom_key, QueryHeight::Latest, IncludeProof::No)?; - let denominated_amount = if value.is_empty() { - DenominatedAmount::new(amount, 0.into()) - } else { - let namada_denom = Denomination::try_from_slice(&value[..]) - .map_err(NamadaError::borsh_decode)?; - DenominatedAmount::new(amount, namada_denom) - }; - let balance = Balance { - amount: denominated_amount.to_string(), - denom: token.to_string(), - }; - balances.push(balance); - } - } - } - Ok(balances) - } - - // Query the denom trace with "{IbcToken}" address which has a hashed denom. - fn query_denom_trace(&self, hash: String) -> Result { - let denom = self.query_denom(hash)?; - match denom.rsplit_once('/') { - Some((path, base_denom)) => Ok(DenomTrace { - path: path.to_string(), - base_denom: base_denom.to_string(), - }), - None => Err(Error::query(format!( - "The denom is not a PrefixedDenom: denom {}", - denom - ))), - } - } - - fn query_commitment_prefix(&self) -> Result { - crate::time!( - "query_commitment_prefix", - { - "src_chain": self.config.id.to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_commitment_prefix"); - - CommitmentPrefix::try_from(b"ibc".to_vec()).map_err(Error::ics23) - } - - fn query_application_status(&self) -> Result { - crate::time!( - "query_application_status", - { - "src_chain": self.config.id.to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_application_status"); - - let status = self - .rt - .block_on(Client::status(self.ctx.client())) - .map_err(|e| NamadaError::rpc(self.config.rpc_addr.clone(), e))?; - - if status.sync_info.catching_up { - return Err(Error::chain_not_caught_up( - self.config.rpc_addr.to_string(), - self.config.id.clone(), - )); - } - - let time = self.get_latest_block_time()?; - let height = ICSHeight::new( - ChainId::chain_version(status.node_info.network.as_str()), - u64::from(status.sync_info.latest_block_height), - ) - .map_err(Error::ics02)?; - - Ok(ChainStatus { - height, - timestamp: time.into(), - }) - } - - fn query_clients( - &self, - _request: QueryClientStatesRequest, - ) -> Result, Error> { - crate::time!( - "query_clients", - { - "src_chain": self.config.id.to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_clients"); - - let prefix = storage::ibc_key("clients").expect("the path should be parsable"); - let mut states = vec![]; - for prefix_value in self.query_prefix(prefix)? { - let PrefixValue { key, value } = prefix_value; - if key.to_string().ends_with("clientState") { - let client_id = - storage::client_id(&key).map_err(|e| Error::query(e.to_string()))?; - let client_id = ClientId::from_str(&client_id.to_string()) - .expect("ibc-rs ClientId should be parsable with the relayer-types one"); - let client_state = AnyClientState::decode_vec(&value).map_err(Error::decode)?; - states.push(IdentifiedAnyClientState::new(client_id, client_state)); - } - } - - Ok(states) - } - - fn query_client_state( - &self, - request: QueryClientStateRequest, - include_proof: IncludeProof, - ) -> Result<(AnyClientState, Option), Error> { - crate::time!( - "query_client_state", - { - "src_chain": self.config.id.to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_client_state"); - - let path = ClientStatePath(request.client_id); - let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); - let (value, proof) = self.query(key, request.height, include_proof)?; - let client_state = AnyClientState::decode_vec(&value).map_err(Error::decode)?; - - Ok((client_state, proof)) - } - - fn query_consensus_state( - &self, - request: QueryConsensusStateRequest, - include_proof: IncludeProof, - ) -> Result<(AnyConsensusState, Option), Error> { - crate::time!( - "query_consensus_state", - { - "src_chain": self.config.id.to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_consensus_state"); - - let path = ClientConsensusStatePath { - client_id: request.client_id, - epoch: request.consensus_height.revision_number(), - height: request.consensus_height.revision_height(), - }; - let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); - let (value, proof) = self.query(key, request.query_height, include_proof)?; - let consensus_state = AnyConsensusState::decode_vec(&value).map_err(Error::decode)?; - Ok((consensus_state, proof)) - } - - fn query_consensus_state_heights( - &self, - request: QueryConsensusStateHeightsRequest, - ) -> Result, Error> { - let prefix = storage::ibc_key(format!("clients/{}", request.client_id)) - .expect("the path should be parsable"); - let mut heights = vec![]; - for prefix_value in self.query_prefix(prefix)? { - let PrefixValue { key, value: _ } = prefix_value; - match storage::consensus_height(&key) { - Ok(h) => { - let height = ICSHeight::new(h.revision_number(), h.revision_height()) - .expect("ibc-rs height should be parsable with the relayer-types one"); - heights.push(height); - } - Err(_) => { - debug!("The key {key} is not for a consensus state"); - continue; - } - } - } - Ok(heights) - } - - fn query_upgraded_client_state( - &self, - request: QueryUpgradedClientStateRequest, - ) -> Result<(AnyClientState, MerkleProof), Error> { - crate::time!( - "query_upgraded_client_state", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_upgraded_client_state"); - - let height = request - .upgrade_height - .to_string() - .parse() - .expect("height conversion is infallible"); - let query_height = request - .upgrade_height - .decrement() - .map_err(|_| Error::invalid_height_no_source())?; - let key = namada_sdk::ibc::storage::upgraded_client_state_key(height); - let (value, proof) = - self.query(key, QueryHeight::Specific(query_height), IncludeProof::Yes)?; - if let Some(proof) = proof { - let client_state = AnyClientState::decode_vec(&value).map_err(Error::decode)?; - Ok((client_state, proof)) - } else { - Err(Error::queried_proof_not_found()) - } - } - - fn query_upgraded_consensus_state( - &self, - request: QueryUpgradedConsensusStateRequest, - ) -> Result<(AnyConsensusState, MerkleProof), Error> { - crate::time!( - "query_upgraded_consensus_state", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_upgraded_consensus_state"); - - let height = request - .upgrade_height - .to_string() - .parse() - .expect("height conversion is infallible"); - let query_height = request - .upgrade_height - .decrement() - .map_err(|_| Error::invalid_height_no_source())?; - let key = namada_sdk::ibc::storage::upgraded_consensus_state_key(height); - let (value, proof) = - self.query(key, QueryHeight::Specific(query_height), IncludeProof::Yes)?; - if let Some(proof) = proof { - let client_state = AnyConsensusState::decode_vec(&value).map_err(Error::decode)?; - Ok((client_state, proof)) - } else { - Err(Error::queried_proof_not_found()) - } - } - - fn query_connections( - &self, - _request: QueryConnectionsRequest, - ) -> Result, Error> { - crate::time!( - "query_connections", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_connections"); - - let prefix = storage::ibc_key("connections").expect("the path should be parsable"); - let mut connections = vec![]; - for prefix_value in self.query_prefix(prefix)? { - let PrefixValue { key, value } = prefix_value; - // "connections/counter" should be skipped - if key == storage::connection_counter_key() { - continue; - } - let conn_id = storage::connection_id(&key).map_err(|e| Error::query(e.to_string()))?; - let connection_id = conn_id - .as_str() - .parse() - .expect("The connection ID should be parsable"); - let connection = ConnectionEnd::decode_vec(&value).map_err(Error::decode)?; - connections.push(IdentifiedConnectionEnd::new(connection_id, connection)); - } - - Ok(connections) - } - - fn query_client_connections( - &self, - request: QueryClientConnectionsRequest, - ) -> Result, Error> { - crate::time!( - "query_client_connections", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_client_connections"); - - let query_request = QueryConnectionsRequest { pagination: None }; - let connections = self.query_connections(query_request)?; - let ids = connections - .iter() - .filter(|c| *c.connection_end.client_id() == request.client_id) - .map(|c| c.connection_id.clone()) - .collect(); - Ok(ids) - } - - fn query_connection( - &self, - request: QueryConnectionRequest, - include_proof: IncludeProof, - ) -> Result<(ConnectionEnd, Option), Error> { - crate::time!( - "query_connection", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_connection"); - - let path = ConnectionsPath(request.connection_id); - let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); - let (value, proof) = self.query(key, request.height, include_proof)?; - let connection_end = ConnectionEnd::decode_vec(&value).map_err(Error::decode)?; - Ok((connection_end, proof)) - } - - fn query_connection_channels( - &self, - request: QueryConnectionChannelsRequest, - ) -> Result, Error> { - crate::time!( - "query_connection_channels", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_connection_channels"); - - let hops = vec![request.connection_id]; - let query_request = QueryChannelsRequest { pagination: None }; - let channels = self - .query_channels(query_request)? - .into_iter() - .filter(|c| c.channel_end.connection_hops_matches(&hops)) - .collect(); - - Ok(channels) - } - - fn query_channels( - &self, - _request: QueryChannelsRequest, - ) -> Result, Error> { - crate::time!( - "query_channels", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_channels"); - - let prefix = storage::ibc_key("channelEnds").expect("the path should be parsable"); - let mut channels = vec![]; - for prefix_value in self.query_prefix(prefix)? { - let PrefixValue { key, value } = prefix_value; - // "channelEnds/counter" should be skipped - if key == storage::channel_counter_key() { - continue; - } - let (port_id, channel_id) = - storage::port_channel_id(&key).map_err(|e| Error::query(e.to_string()))?; - let port_id = port_id - .as_ref() - .parse() - .expect("ibc-rs PortId should be parsable with the relayer-types one"); - let channel_id = channel_id - .as_ref() - .parse() - .expect("ibc-rs ChannelId should be parsable with the relayer-types one"); - let channel = ChannelEnd::decode_vec(&value).map_err(Error::decode)?; - channels.push(IdentifiedChannelEnd::new(port_id, channel_id, channel)) - } - - Ok(channels) - } - - fn query_channel( - &self, - request: QueryChannelRequest, - include_proof: IncludeProof, - ) -> Result<(ChannelEnd, Option), Error> { - crate::time!( - "query_channel", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_channel"); - - let path = ChannelEndsPath(request.port_id, request.channel_id); - let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); - let (value, proof) = self.query(key, request.height, include_proof)?; - let channel_end = ChannelEnd::decode_vec(&value).map_err(Error::decode)?; - Ok((channel_end, proof)) - } - - fn query_channel_client_state( - &self, - request: QueryChannelClientStateRequest, - ) -> Result, Error> { - crate::time!( - "query_channel_client_state", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_channel_client_state"); - - let request = QueryChannelRequest { - port_id: request.port_id, - channel_id: request.channel_id, - height: QueryHeight::Latest, - }; - let (channel_end, _) = self.query_channel(request, IncludeProof::No)?; - let connection_id = channel_end - .connection_hops() - .first() - .ok_or_else(|| Error::query("no connection ID in the channel end".to_string()))? - .clone(); - let request = QueryConnectionRequest { - connection_id, - height: QueryHeight::Latest, - }; - let (connection_end, _) = self.query_connection(request, IncludeProof::No)?; - let client_id = connection_end.client_id().clone(); - let request = QueryClientStateRequest { - client_id: client_id.clone(), - height: QueryHeight::Latest, - }; - let (client_state, _) = self.query_client_state(request, IncludeProof::No)?; - - Ok(Some(IdentifiedAnyClientState { - client_id, - client_state, - })) - } - - fn query_packet_commitment( - &self, - request: QueryPacketCommitmentRequest, - include_proof: IncludeProof, - ) -> Result<(Vec, Option), Error> { - let path = CommitmentsPath { - port_id: request.port_id, - channel_id: request.channel_id, - sequence: request.sequence, - }; - let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); - self.query(key, request.height, include_proof) - } - - fn query_packet_commitments( - &self, - request: QueryPacketCommitmentsRequest, - ) -> Result<(Vec, ICSHeight), Error> { - crate::time!( - "query_packet_commitments", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_packet_commitments"); - - let path = format!( - "commitments/ports/{}/channels/{}/sequences", - request.port_id, request.channel_id - ); - let prefix = storage::ibc_key(path).expect("the path should be parsable"); - let mut sequences = vec![]; - for prefix_value in self.query_prefix(prefix)? { - let PrefixValue { key, value: _ } = prefix_value; - let (_, _, sequence) = - storage::port_channel_sequence_id(&key).map_err(|e| Error::query(e.to_string()))?; - let sequence = u64::from(sequence).into(); - sequences.push(sequence); - } - - // NOTE the height might be mismatched with the previous query - let status = self.query_application_status()?; - - Ok((sequences, status.height)) - } - - fn query_packet_receipt( - &self, - request: QueryPacketReceiptRequest, - include_proof: IncludeProof, - ) -> Result<(Vec, Option), Error> { - let path = ReceiptsPath { - port_id: request.port_id, - channel_id: request.channel_id, - sequence: request.sequence, - }; - let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); - self.query(key, request.height, include_proof) - } - - fn query_unreceived_packets( - &self, - request: QueryUnreceivedPacketsRequest, - ) -> Result, Error> { - crate::time!( - "query_unreceived_packets", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_unreceived_packets"); - - let path = format!( - "receipts/ports/{}/channels/{}/sequences", - request.port_id, request.channel_id - ); - let prefix = storage::ibc_key(path).expect("the path should be parsable"); - let mut received_seqs = vec![]; - for prefix_value in self.query_prefix(prefix)? { - let (_, _, sequence) = storage::port_channel_sequence_id(&prefix_value.key) - .map_err(|e| Error::query(e.to_string()))?; - let sequence = u64::from(sequence).into(); - received_seqs.push(sequence) - } - - let unreceived_seqs = request - .packet_commitment_sequences - .into_iter() - .filter(|seq| !received_seqs.contains(seq)) - .collect(); - - Ok(unreceived_seqs) - } - - fn query_packet_acknowledgement( - &self, - request: QueryPacketAcknowledgementRequest, - include_proof: IncludeProof, - ) -> Result<(Vec, Option), Error> { - let path = AcksPath { - port_id: request.port_id, - channel_id: request.channel_id, - sequence: request.sequence, - }; - let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); - self.query(key, request.height, include_proof) - } - - fn query_packet_acknowledgements( - &self, - request: QueryPacketAcknowledgementsRequest, - ) -> Result<(Vec, ICSHeight), Error> { - crate::time!( - "query_packet_acknowledgements", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_packet_acknowledgements"); - - let path = format!( - "acks/ports/{}/channels/{}/sequences", - request.port_id, request.channel_id - ); - let prefix = storage::ibc_key(path).expect("the path should be parsable"); - let mut sequences = vec![]; - for prefix_value in self.query_prefix(prefix)? { - let PrefixValue { key, value: _ } = prefix_value; - let (_, _, sequence) = - storage::port_channel_sequence_id(&key).map_err(|e| Error::query(e.to_string()))?; - let sequence = u64::from(sequence).into(); - if request.packet_commitment_sequences.contains(&sequence) { - sequences.push(sequence); - } - } - - // NOTE the height might be mismatched with the previous query - let status = self.query_application_status()?; - Ok((sequences, status.height)) - } - - fn query_unreceived_acknowledgements( - &self, - request: QueryUnreceivedAcksRequest, - ) -> Result, Error> { - crate::time!( - "query_unreceived_acknowledgements", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_unreceived_acknowledgements"); - - let path = format!( - "commitments/ports/{}/channels/{}/sequences", - request.port_id, request.channel_id - ); - let prefix = storage::ibc_key(path).expect("the path should be parsable"); - let mut unreceived_seqs = vec![]; - for prefix_value in self.query_prefix(prefix)? { - let PrefixValue { key, value: _ } = prefix_value; - let (_, _, sequence) = - storage::port_channel_sequence_id(&key).map_err(|e| Error::query(e.to_string()))?; - let sequence = u64::from(sequence).into(); - if request.packet_ack_sequences.contains(&sequence) { - unreceived_seqs.push(sequence); - } - } - Ok(unreceived_seqs) - } - - fn query_next_sequence_receive( - &self, - request: QueryNextSequenceReceiveRequest, - include_proof: IncludeProof, - ) -> Result<(Sequence, Option), Error> { - crate::time!( - "query_next_sequence_receive", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_next_sequence_receive"); - - let path = SeqRecvsPath(request.port_id, request.channel_id); - let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); - let (value, proof) = self.query(key, request.height, include_proof)?; - - // As ibc-go, the sequence index is encoded with big-endian - let index: [u8; 8] = value - .try_into() - .map_err(|_| Error::query("Encoding u64 failed".to_owned()))?; - let sequence = u64::from_be_bytes(index).into(); - - Ok((sequence, proof)) - } - - fn query_txs(&self, request: QueryTxRequest) -> Result, Error> { - crate::time!("query_txs", - { - "src_chain": self.id().to_string(), - }); - crate::telemetry!(query, self.id(), "query_txs"); - - match request { - QueryTxRequest::Client(request) => { - crate::time!("query_txs: single client update event"); - match self.query_update_event(&request)? { - Some(event) => Ok(vec![event]), - None => Ok(vec![]), - } - } - QueryTxRequest::Transaction(tx) => { - let tm_hash = namada_tendermint::Hash::from_bytes( - namada_tendermint::hash::Algorithm::Sha256, - tx.0.as_bytes(), - ) - .expect("hash should be converted"); - - self.query_tx_events(&tm_hash) - } - } - } - - fn query_packet_events( - &self, - request: QueryPacketEventDataRequest, - ) -> Result, Error> { - crate::time!( - "query_packet_events", - { - "src_chain": self.id().to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_packet_events"); - self.query_packet_events_from_block(&request) - } - - fn query_host_consensus_state( - &self, - request: QueryHostConsensusStateRequest, - ) -> Result { - let height = match request.height { - QueryHeight::Latest => TmHeight::from(0u32), - QueryHeight::Specific(ibc_height) => TmHeight::try_from(ibc_height.revision_height()) - .map_err(NamadaError::invalid_height)?, - }; - - let rpc_call = match height.value() { - 0 => Client::latest_block(self.ctx.client()), - _ => Client::block(self.ctx.client(), height), - }; - let response = self - .rt - .block_on(rpc_call) - .map_err(|e| NamadaError::rpc(self.config.rpc_addr.clone(), e))?; - let raw_header = namada_tendermint_proto::v0_37::types::Header::from(response.block.header); - let encoded_header = raw_header.encode_to_vec(); - let raw_header: tendermint_proto::v0_37::types::Header = - prost::Message::decode(&encoded_header[..]) - .map_err(|e| Error::protobuf_decode("TmBlockHeader".to_string(), e))?; - let header: tendermint::block::Header = - raw_header.try_into().expect("header should be converted"); - Ok(Self::ConsensusState::from(header)) - } - - fn build_client_state( - &self, - height: ICSHeight, - settings: ClientSettings, - ) -> Result { - let ClientSettings::Tendermint(settings) = settings; - let unbonding_period = self.get_unbonding_time()?; - let trusting_period = settings.trusting_period.unwrap_or_else(|| { - self.config - .trusting_period - .unwrap_or(2 * unbonding_period / 3) - }); - TmClientState::new( - self.id().clone(), - settings.trust_threshold, - trusting_period, - unbonding_period, - settings.max_clock_drift, - height, - self.config - .proof_specs - .clone() - .expect("ProofSpecs should be set"), - vec![ - COMMITMENT_PREFIX.to_string(), - UPGRADED_IBC_STATE.to_string(), - ], - AllowUpdate { - after_expiry: true, - after_misbehaviour: true, - }, - ) - .map_err(Error::ics07) - } - - fn build_consensus_state( - &self, - light_block: Self::LightBlock, - ) -> Result { - crate::time!( - "build_consensus_state", - { - "src_chain": self.id().to_string(), - } - ); - - Ok(TmConsensusState::from(light_block.signed_header.header)) - } - - fn build_header( - &mut self, - trusted_height: ICSHeight, - target_height: ICSHeight, - client_state: &AnyClientState, - ) -> Result<(Self::Header, Vec), Error> { - crate::time!( - "build_header", - { - "src_chain": self.id().to_string(), - } - ); - - let now = self.get_latest_block_time()?; - // Get the light block at target_height from chain. - let Verified { target, supporting } = self.light_client.header_and_minimal_set( - trusted_height, - target_height, - client_state, - now, - )?; - - Ok((target, supporting)) - } - - fn maybe_register_counterparty_payee( - &mut self, - _channel_id: &ChannelId, - _port_id: &PortId, - _counterparty_payee: &Signer, - ) -> Result<(), Error> { - // not supported - unimplemented!() - } - - fn cross_chain_query( - &self, - _requests: Vec, - ) -> Result, Error> { - // not supported - unimplemented!() - } - - fn query_incentivized_packet( - &self, - _request: QueryIncentivizedPacketRequest, - ) -> Result { - // not supported - unimplemented!() - } - - fn query_consumer_chains(&self) -> Result, Error> { - // not supported - unimplemented!() - } - - fn query_upgrade( - &self, - request: QueryUpgradeRequest, - height: ICSHeight, - 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 path = ChannelUpgradePath { - port_id, - channel_id, - }; - let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); - let (value, proof) = self.query(key, QueryHeight::Specific(height), include_proof)?; - - let upgrade = Upgrade::decode_vec(&value).map_err(Error::decode)?; - - Ok((upgrade, proof)) - } - - fn query_upgrade_error( - &self, - request: QueryUpgradeErrorRequest, - height: ICSHeight, - 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 path = ChannelUpgradeErrorPath { - port_id, - channel_id, - }; - let key = storage::ibc_key(path.to_string()).expect("the path should be parsable"); - let (value, proof) = self.query(key, QueryHeight::Specific(height), include_proof)?; - - let error_receipt = ErrorReceipt::decode_vec(&value).map_err(Error::decode)?; - - Ok((error_receipt, proof)) - } - - fn query_ccv_consumer_id(&self, _client_id: ClientId) -> Result { - // not supported - unimplemented!() - } -} - -/// Fetch the node info -async fn fetch_node_info( - rpc_client: &HttpClient, - config: &CosmosSdkConfig, -) -> Result { - crate::time!("fetch_node_info", - { - "src_chain": config.id.to_string(), - }); - - Client::status(rpc_client) - .await - .map(|s| s.node_info) - .map_err(|e| NamadaError::rpc(config.rpc_addr.clone(), e)) -} - -fn into_tm_response(response: Response) -> tendermint_rpc::endpoint::broadcast::tx_sync::Response { - let code = match response.code { - namada_tendermint::abci::Code::Ok => tendermint::abci::Code::Ok, - namada_tendermint::abci::Code::Err(c) => tendermint::abci::Code::Err(c), - }; - let hash = tendermint::Hash::from_bytes( - tendermint::hash::Algorithm::Sha256, - response.hash.as_bytes(), - ) - .expect("hash should be converted"); - tendermint_rpc::endpoint::broadcast::tx_sync::Response { - codespace: response.codespace, - code, - data: response.data, - log: response.log, - hash, - } -} diff --git a/crates/relayer/src/chain/namada/error.rs b/crates/relayer/src/chain/namada/error.rs deleted file mode 100644 index aa938dd154..0000000000 --- a/crates/relayer/src/chain/namada/error.rs +++ /dev/null @@ -1,71 +0,0 @@ -use flex_error::{define_error, DisplayOnly, TraceError}; -use ibc_relayer_types::core::ics24_host::identifier::ChainId; -use namada_tendermint::Error as TendermintError; -use namada_tendermint_proto::Error as TendermintProtoError; -use namada_tendermint_rpc::Error as TendermintRpcError; - -define_error! { - Error { - AddressDecode - { raw: String } - |e| { format!("Namada address decoding failed for {}", e.raw) }, - - DenomNotFound - { denom: String } - |e| { format!("No denom for {}", e.denom) }, - - Namada - [ TraceError ] - |_| { "Namada error" }, - - Rpc - { url: tendermint_rpc::Url } - [ TendermintRpcError ] - |e| { format!("RPC error to endpoint {}", e.url) }, - - HealthCheckJsonRpc - { - chain_id: ChainId, - address: String, - endpoint: String, - } - [ DisplayOnly ] - |e| { - format!("health check failed for endpoint {0} on the JSON-RPC interface of chain {1}:{2}", - e.endpoint, e.chain_id, e.address) - }, - - InvalidHeight - [ TendermintError ] - |_| { "invalid height" }, - - Decode - [ TendermintProtoError ] - |_| { "error decoding protobuf" }, - - Query - [ TraceError ] - |_| { "Query error" }, - - BorshDecode - [ TraceError ] - |_| { "borsh decoding failed" }, - - DryRun - { tx_result: namada_sdk::tx::data::TxResult } - |e| { format!("Dry run to simulate a transaction failed: {:?}", e.tx_result) }, - - Upgrade - |_| { "Namada doesn't support `MsgIbcSoftwareUpgrade` and `UpgradeProposal`" }, - - Version - { version: String } - |e| { format!("Parsing the version string failed: {}", e.version) }, - } -} - -impl From for crate::error::Error { - fn from(error: Error) -> Self { - Self::namada(error) - } -} diff --git a/crates/relayer/src/chain/namada/key.rs b/crates/relayer/src/chain/namada/key.rs deleted file mode 100644 index 9f8486dc52..0000000000 --- a/crates/relayer/src/chain/namada/key.rs +++ /dev/null @@ -1,47 +0,0 @@ -use core::any::Any; - -use namada_sdk::address::Address; -use namada_sdk::key::common::SecretKey; - -use crate::config::AddressType; -use crate::keyring::errors::Error; -use crate::keyring::{KeyFile, KeyType, SigningKeyPair}; -use hdpath::StandardHDPath; -use serde::{Deserialize, Serialize}; - -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct NamadaKeyPair { - pub alias: String, - pub address: Address, - pub secret_key: SecretKey, -} - -impl SigningKeyPair for NamadaKeyPair { - const KEY_TYPE: KeyType = KeyType::Secp256k1; - type KeyFile = KeyFile; - - fn from_key_file(_key_file: Self::KeyFile, _hd_path: &StandardHDPath) -> Result { - unimplemented!("Namada key can't be restored from a KeyFile") - } - - fn from_mnemonic( - _mnemonic: &str, - _hd_path: &StandardHDPath, - _address_type: &AddressType, - _account_prefix: &str, - ) -> Result { - unimplemented!("Namada key can't be restored from a KeyFile") - } - - fn account(&self) -> String { - self.address.to_string() - } - - fn sign(&self, _message: &[u8]) -> Result, Error> { - unimplemented!("don't use this to sign a Namada transaction") - } - - fn as_any(&self) -> &dyn Any { - self - } -} diff --git a/crates/relayer/src/chain/namada/query.rs b/crates/relayer/src/chain/namada/query.rs deleted file mode 100644 index 8953ac80a3..0000000000 --- a/crates/relayer/src/chain/namada/query.rs +++ /dev/null @@ -1,346 +0,0 @@ -use ibc_relayer_types::core::ics04_channel::packet::Sequence; -use ibc_relayer_types::core::ics23_commitment::merkle::convert_tm_to_ics_merkle_proof; -use ibc_relayer_types::core::ics23_commitment::merkle::MerkleProof; -use ibc_relayer_types::events::IbcEvent; -use ibc_relayer_types::Height as ICSHeight; -use namada_sdk::address::{Address, InternalAddress}; -use namada_sdk::borsh::BorshDeserialize; -use namada_sdk::events::extend::Height as HeightAttr; -use namada_sdk::events::Event as NamadaEvent; -use namada_sdk::ibc::storage::{ibc_trace_key_prefix, is_ibc_trace_key}; -use namada_sdk::io::Client; -use namada_sdk::io::NamadaIo; -use namada_sdk::queries::RPC; -use namada_sdk::rpc; -use namada_sdk::storage::{BlockHeight, Epoch, Key, PrefixValue}; -use namada_sdk::tx::data::ResultCode; -use namada_sdk::tx::event::{Batch as BatchAttr, Code as CodeAttr}; -use namada_tendermint::block::Height as TmHeight; -use namada_tendermint::merkle::proof::ProofOps; -use namada_tendermint::Hash as TmHash; -use namada_tendermint_proto::v0_37::abci::Event as TmEvent; - -use crate::chain::endpoint::ChainEndpoint; -use crate::chain::requests::{ - IncludeProof, QueryClientEventRequest, QueryHeight, QueryPacketEventDataRequest, -}; -use crate::error::Error; -use crate::event::{ibc_event_try_from_abci_event, IbcEventWithHeight}; - -use super::error::Error as NamadaError; -use super::NamadaChain; - -impl NamadaChain { - pub fn query( - &self, - key: Key, - height: QueryHeight, - include_proof: IncludeProof, - ) -> Result<(Vec, Option), Error> { - let height = match height { - QueryHeight::Latest => None, - QueryHeight::Specific(h) => Some(BlockHeight(h.revision_height())), - }; - let is_proven = matches!(include_proof, IncludeProof::Yes); - let (value, proof) = self - .rt - .block_on(rpc::query_storage_value_bytes( - self.ctx.client(), - &key, - height, - is_proven, - )) - .map_err(NamadaError::namada)?; - - let proof = if is_proven { - let proof_ops = proof.ok_or_else(Error::empty_response_proof)?; - let tm_proof_ops = into_tm_proof(proof_ops); - let proof = convert_tm_to_ics_merkle_proof(&tm_proof_ops).map_err(Error::ics23)?; - Some(proof) - } else { - None - }; - // return an empty data for non-existence proof - Ok((value.unwrap_or_default(), proof)) - } - - pub fn query_prefix(&self, prefix: Key) -> Result, Error> { - let response = self - .rt - .block_on( - // We can't use rpc::query_storage_prefix` because we need byte data - RPC.shell() - .storage_prefix(self.ctx.client(), None, None, false, &prefix), - ) - .map_err(NamadaError::query)?; - Ok(response.data) - } - - pub fn query_epoch(&self) -> Result { - self.rt - .block_on(rpc::query_epoch(self.ctx.client())) - .map_err(|e| Error::namada(NamadaError::namada(e))) - } - - pub fn query_update_event( - &self, - request: &QueryClientEventRequest, - ) -> Result, Error> { - let height = BlockHeight(request.consensus_height.revision_height()); - let event = self - .rt - .block_on(RPC.shell().ibc_client_update( - self.ctx.client(), - &request.client_id.as_str().parse().unwrap(), - &height, - )) - .map_err(NamadaError::query)?; - match event { - Some(event) => { - let h = event - .read_attribute::() - .map_err(|_| Error::invalid_height_no_source())?; - let height = ICSHeight::new(self.config.id.version(), h.0) - .map_err(|_| Error::invalid_height_no_source())?; - let pb_abci_event = TmEvent::from(event); - let abci_event = into_abci_event(pb_abci_event); - match ibc_event_try_from_abci_event(&abci_event) { - Ok(event) => Ok(Some(IbcEventWithHeight { event, height })), - // non IBC event - Err(_) => Ok(None), - } - } - None => Ok(None), - } - } - - /// Get all IBC events when the tx has been applied - pub fn query_tx_events(&self, tx_hash: &TmHash) -> Result, Error> { - match self.query_applied_event(tx_hash)? { - Some(applied) => { - let h = applied - .read_attribute::() - .map_err(|_| Error::invalid_height_no_source())?; - let height = ICSHeight::new(self.config.id.version(), h.0) - .map_err(|_| Error::invalid_height_no_source())?; - // Check if the tx is valid - let tx_result = applied - .read_attribute::>() - .expect("The batch attribute should exist"); - let code = applied - .read_attribute::() - .expect("The code attribute should exist"); - if code != ResultCode::Ok { - return Ok(vec![IbcEventWithHeight::new( - IbcEvent::ChainError(format!( - "The transaction was invalid: TxResult {tx_result}", - )), - height, - )]); - } - let events = tx_result.iter().filter_map(|(_, r)| { - r.as_ref().map(|batched_tx_result| { - // Get IBC events when the transaction was accepted - if batched_tx_result.is_accepted() { - batched_tx_result.events.iter().filter_map(|event| { - let pb_abci_event = TmEvent::from(event.clone()); - let abci_event = into_abci_event(pb_abci_event); - ibc_event_try_from_abci_event(&abci_event).ok() - }).map(|ibc_event| IbcEventWithHeight::new(ibc_event, height)).collect() - } else { - vec![IbcEventWithHeight::new( - IbcEvent::ChainError(format!( - "The transaction was invalid: BatchedTxResult {batched_tx_result}", - )), - height, - )] - } - }).ok() - }).flatten().collect(); - Ok(events) - } - None => Ok(vec![]), - } - } - - fn query_applied_event(&self, tx_hash: &TmHash) -> Result, Error> { - self.rt - .block_on(RPC.shell().applied( - self.ctx.client(), - &tx_hash.as_ref().try_into().expect("Invalid tx hash"), - )) - .map_err(|e| Error::namada(NamadaError::query(e))) - } - - /// Get IBC packet events - pub fn query_packet_events_from_block( - &self, - request: &QueryPacketEventDataRequest, - ) -> Result, Error> { - let mut block_events = vec![]; - for seq in &request.sequences { - if let Some(response_height) = self.query_packet_height(request, *seq)? { - if let QueryHeight::Specific(query_height) = request.height.get() { - if response_height > query_height { - continue; - } - } - let events = self.query_events(response_height)?; - let mut packet_events = events - .into_iter() - .filter(|e| { - let packet = match &e.event { - IbcEvent::SendPacket(send_event) => &send_event.packet, - IbcEvent::WriteAcknowledgement(write_ack_event) => { - &write_ack_event.packet - } - _ => return false, - }; - !block_events.contains(e) - && packet.source_port == request.source_port_id - && packet.source_channel == request.source_channel_id - && packet.destination_port == request.destination_port_id - && packet.destination_channel == request.destination_channel_id - && packet.sequence == *seq - }) - .collect(); - block_events.append(&mut packet_events); - } - } - Ok(block_events) - } - - /// Get the height at which the packet event has been emitted - fn query_packet_height( - &self, - request: &QueryPacketEventDataRequest, - sequence: Sequence, - ) -> Result, Error> { - match self - .rt - .block_on( - RPC.shell().ibc_packet( - self.ctx.client(), - &request - .event_id - .as_str() - .parse() - .expect("invalid event type"), - &request - .source_port_id - .as_str() - .parse() - .expect("PortId should be parsable"), - &request - .source_channel_id - .as_str() - .parse() - .expect("ChannelId should be parsable"), - &request - .destination_port_id - .as_str() - .parse() - .expect("PortId should be parsable"), - &request - .destination_channel_id - .as_str() - .parse() - .expect("ChannelId should be parsable"), - &u64::from(sequence).into(), - ), - ) - .map_err(NamadaError::query)? - { - Some(event) => { - let h = event - .read_attribute::() - .map_err(|_| Error::invalid_height_no_source())?; - let height = ICSHeight::new(self.config.id.version(), h.0) - .map_err(|_| Error::invalid_height_no_source())?; - Ok(Some(height)) - } - None => Ok(None), - } - } - - /// Get IBC events at the given height - fn query_events(&self, height: ICSHeight) -> Result, Error> { - crate::time!( - "query_blocks: query block packet events", - { - "src_chain": self.config.id.to_string(), - } - ); - crate::telemetry!(query, self.id(), "query_block"); - - let tm_height = TmHeight::try_from(height.revision_height()) - .map_err(|_| Error::invalid_height_no_source())?; - let response = self - .rt - .block_on(Client::block_results(self.ctx.client(), tm_height)) - .map_err(|e| NamadaError::rpc(self.config.rpc_addr.clone(), e))?; - - let events = response - .end_block_events - .ok_or_else(|| Error::query("No transaction result was found".to_string()))?; - let mut ibc_events = vec![]; - for event in events { - let pb_abci_event = TmEvent::from(event); - let abci_event = into_abci_event(pb_abci_event); - if let Ok(ibc_event) = ibc_event_try_from_abci_event(&abci_event) { - ibc_events.push(IbcEventWithHeight::new(ibc_event, height)) - } - } - Ok(ibc_events) - } - - /// Get IBC denom - pub fn query_denom(&self, raw_addr: String) -> Result { - let token = Address::decode(&raw_addr) - .map_err(|_| NamadaError::address_decode(raw_addr.to_string()))?; - let hash = match &token { - Address::Internal(InternalAddress::IbcToken(hash)) => hash.to_string(), - _ => return Err(NamadaError::denom_not_found(raw_addr).into()), - }; - - let prefix = ibc_trace_key_prefix(None); - let pairs = self.query_prefix(prefix)?; - let pair = pairs - .iter() - .find(|PrefixValue { key, value: _ }| { - if let Some((_, token_hash)) = is_ibc_trace_key(key) { - token_hash == *hash - } else { - false - } - }) - .ok_or(NamadaError::denom_not_found(raw_addr))?; - - String::try_from_slice(&pair.value).map_err(|e| Error::namada(NamadaError::borsh_decode(e))) - } -} - -fn into_tm_proof(proof_ops: ProofOps) -> tendermint::merkle::proof::ProofOps { - let ops = proof_ops - .ops - .into_iter() - .map(|op| tendermint::merkle::proof::ProofOp { - field_type: op.field_type, - key: op.key, - data: op.data, - }) - .collect(); - tendermint::merkle::proof::ProofOps { ops } -} - -fn into_abci_event(event: TmEvent) -> tendermint::abci::Event { - let attributes = event - .attributes - .into_iter() - .map(|attribute| (attribute.key, attribute.value).into()) - .collect(); - tendermint::abci::Event { - kind: event.r#type, - attributes, - } -} diff --git a/crates/relayer/src/chain/namada/tx.rs b/crates/relayer/src/chain/namada/tx.rs deleted file mode 100644 index 4dc7f25e84..0000000000 --- a/crates/relayer/src/chain/namada/tx.rs +++ /dev/null @@ -1,384 +0,0 @@ -use core::str::FromStr; -use core::time::Duration; -use std::path::PathBuf; -use std::thread; -use std::time::Instant; - -use ibc_proto::google::protobuf::Any; -use itertools::Itertools; -use namada_sdk::address::{Address, ImplicitAddress}; -use namada_sdk::args::TxBuilder; -use namada_sdk::args::{Tx as TxArgs, TxCustom}; -use namada_sdk::chain::ChainId; -use namada_sdk::io::NamadaIo; -use namada_sdk::tx::{prepare_tx, ProcessTxResponse}; -use namada_sdk::{rpc, signing, tx, Namada}; -use namada_tendermint_rpc::endpoint::broadcast::tx_sync::Response; -use tracing::{debug, debug_span, trace, warn}; - -use crate::chain::cosmos::gas::{adjust_estimated_gas, AdjustGas}; -use crate::chain::cosmos::types::gas::max_gas_from_config_opt; -use crate::chain::cosmos::types::tx::{TxStatus, TxSyncResult}; -use crate::chain::cosmos::wait::all_tx_results_found; -use crate::chain::endpoint::ChainEndpoint; -use crate::error::{Error, ErrorDetail}; - -use super::error::{Error as NamadaError, ErrorDetail as NamadaErrorDetail}; -use super::NamadaChain; - -const WAIT_BACKOFF: Duration = Duration::from_millis(300); - -impl NamadaChain { - pub fn batch_txs(&mut self, msgs: &[Any]) -> Result { - if msgs.is_empty() { - return Err(Error::send_tx("No message to be batched".to_string())); - } - - let tx_args = self.make_tx_args()?; - - let relayer_key = self.get_key()?; - let relayer_addr = relayer_key.address; - - let rt = self.rt.clone(); - rt.block_on(self.submit_reveal_aux(&tx_args, &relayer_addr))?; - - let args = TxCustom { - tx: tx_args.clone(), - code_path: Some(PathBuf::from(tx::TX_IBC_WASM)), - data_path: None, - serialized_tx: None, - owner: Some(relayer_addr.clone()), - }; - let mut txs = Vec::new(); - for msg in msgs { - let (mut tx, signing_data) = rt - .block_on(args.build(&self.ctx)) - .map_err(NamadaError::namada)?; - self.set_tx_data(&mut tx, msg)?; - txs.push((tx, signing_data.expect("signing_data should exist"))); - } - let (mut tx, signing_data) = tx::build_batch(txs).map_err(NamadaError::namada)?; - // This is fine, as only the relayers is signing the transactions - let signing_data = signing_data.first().expect("SigningData should exist"); - - // Estimate the fee with dry-run - match self.estimate_fee(tx.clone(), &tx_args, signing_data) { - // Set the estimated fee - Ok(Some((fee_token, gas_limit, fee_amount))) => { - self.prepare_tx_with_gas(&mut tx, &tx_args, &fee_token, gas_limit, fee_amount)? - } - Ok(None) => { - // the default gas limit will be used - } - Err(err) => match err.detail() { - ErrorDetail::Namada(namada_err) => { - match namada_err.source { - NamadaErrorDetail::DryRun(ref tx_results) => { - warn!("Simulation failed: {tx_results}"); - // Return the failure response to avoid the actual request. - // The response will be converted to `TxSyncResult`. - let response = Response { - codespace: Default::default(), - // the code value isn't used, but it should be non-zero to - // recognize the transaction failed - code: 1.into(), - data: Default::default(), - log: format!("Simulation failed: Results {tx_results}"), - hash: Default::default(), - }; - return Ok(response); - } - _ => return Err(err), - } - } - _ => return Err(err), - }, - } - - rt.block_on(self.ctx.sign( - &mut tx, - &tx_args, - signing_data.clone(), - signing::default_sign, - (), - )) - .map_err(NamadaError::namada)?; - - let tx_header_hash = tx.header_hash().to_string(); - let response = rt - .block_on(self.ctx.submit(tx, &tx_args)) - .map_err(NamadaError::namada)?; - - match response { - tx::ProcessTxResponse::Broadcast(mut response) => { - // overwrite the tx decrypted hash for the tx query - response.hash = tx_header_hash.parse().expect("invalid hash"); - Ok(response) - } - _ => unreachable!("The response type was unexpected"), - } - } - - fn make_tx_args(&mut self) -> Result { - let chain_id = ChainId::from_str(self.config.id.as_str()).expect("invalid chain ID"); - - let namada_key = self.get_key()?; - let relayer_public_key = namada_key.secret_key.to_public(); - - let tx_args = self.ctx.tx_builder(); - let tx_args = tx_args.chain_id(chain_id); - let tx_args = tx_args.signing_keys(vec![relayer_public_key]); - // Confirm the transaction later - let mut tx_args = tx_args.broadcast_only(true); - - let memo = self - .config - .memo_overwrite - .as_ref() - .unwrap_or(&self.config.memo_prefix); - let memo = if !memo.as_str().is_empty() { - Some(memo.as_str().to_string().as_bytes().to_vec()) - } else { - None - }; - tx_args.memo = memo; - - Ok(tx_args) - } - - fn set_tx_data(&self, tx: &mut tx::Tx, proto_msg: &Any) -> Result<(), Error> { - let mut tx_data = vec![]; - prost::Message::encode(proto_msg, &mut tx_data) - .map_err(|e| Error::protobuf_encode(String::from("Encoding the message failed"), e))?; - tx.add_serialized_data(tx_data); - Ok(()) - } - - fn estimate_fee( - &self, - mut tx: tx::Tx, - args: &TxArgs, - signing_data: &signing::SigningTxData, - ) -> Result, Error> { - let chain_id = self.config.id.clone(); - let fee_token_str = self.config.gas_price.denom.clone(); - let fee_token = Address::from_str(&fee_token_str) - .map_err(|_| NamadaError::address_decode(fee_token_str.clone()))?; - let gas_price = self.config.gas_price.price; - - let max_block_gas_key = namada_sdk::parameters::storage::get_max_block_gas_key(); - let max_block_gas: u64 = self - .rt - .block_on(rpc::query_storage_value( - self.ctx.client(), - &max_block_gas_key, - )) - .map_err(NamadaError::namada)?; - let max_gas = max_gas_from_config_opt(&self.config).unwrap_or(max_block_gas); - - let args = args.clone().dry_run_wrapper(true); - // Set the max gas to the gas limit for the simulation - self.prepare_tx_with_gas(&mut tx, &args, &fee_token, max_block_gas, gas_price)?; - - self.rt - .block_on(self.ctx.sign( - &mut tx, - &args, - signing_data.clone(), - signing::default_sign, - (), - )) - .map_err(NamadaError::namada)?; - - let response = match self.rt.block_on(self.ctx.submit(tx, &args)) { - Ok(resp) => resp, - Err(e) => { - warn!( - id = %chain_id, - "send_tx: gas estimation failed, using the default gas limit. Error: {}", - e - ); - return Ok(None); - } - }; - - let estimated_gas = match response { - ProcessTxResponse::DryRun(result) => { - if result - .0 - .iter() - .all(|(_, r)| matches!(&r, Ok(result) if result.is_accepted())) - { - result.1.into() - } else { - // All or some of requests will fail - return Err(NamadaError::dry_run(result.0).into()); - } - } - _ => unreachable!("Unexpected response"), - }; - if estimated_gas > max_gas { - debug!( - id = %chain_id, estimated = ?estimated_gas, max_gas, - "send_tx: estimated gas is higher than max gas" - ); - - return Err(Error::tx_simulate_gas_estimate_exceeded( - chain_id, - estimated_gas, - max_gas, - )); - } - - let gas_multiplier = self.config.gas_multiplier.unwrap_or_default().to_f64(); - - let adjusted_gas = adjust_estimated_gas(AdjustGas { - gas_multiplier, - max_gas, - gas_amount: estimated_gas, - }); - - debug!( - id = %chain_id, - "send_tx: using {} gas, gas_price {:?}", - estimated_gas, - gas_price, - ); - - Ok(Some((fee_token, adjusted_gas, gas_price))) - } - - fn prepare_tx_with_gas( - &self, - tx: &mut tx::Tx, - args: &TxArgs, - fee_token: &Address, - gas_limit: u64, - fee_amount: f64, - ) -> Result<(), Error> { - let relayer_key = self.get_key()?; - let relayer_public_key = relayer_key.secret_key.to_public(); - - let args = args - .clone() - .fee_token(fee_token.clone()) - .gas_limit(gas_limit.into()) - .fee_amount( - fee_amount - .to_string() - .parse() - .expect("Fee should be parsable"), - ); - let fee_amount = self - .rt - .block_on(signing::validate_fee(&self.ctx, &args)) - .map_err(NamadaError::namada)?; - self.rt - .block_on(prepare_tx(&args, tx, fee_amount, relayer_public_key)) - .map_err(NamadaError::namada)?; - - Ok(()) - } - - pub fn wait_for_block_commits( - &self, - tx_sync_results: &mut [TxSyncResult], - ) -> Result<(), Error> { - if all_tx_results_found(tx_sync_results) { - return Ok(()); - } - - let chain_id = &self.id(); - crate::time!( - "wait_for_block_commits", - { - "src_chain": chain_id, - } - ); - let _span = debug_span!("wait_for_block_commits", id = %chain_id).entered(); - - let start_time = Instant::now(); - - let hashes = tx_sync_results - .iter() - .map(|res| res.response.hash.to_string()) - .join(", "); - - debug!("waiting for commit of tx hashes(s) {}", hashes); - - loop { - let elapsed = start_time.elapsed(); - - if all_tx_results_found(tx_sync_results) { - trace!( - "retrieved {} tx results after {} ms", - tx_sync_results.len(), - elapsed.as_millis(), - ); - - return Ok(()); - } else if elapsed > self.config.rpc_timeout { - debug!("timed out after {} ms", elapsed.as_millis()); - return Err(Error::tx_no_confirmation()); - } else { - thread::sleep(WAIT_BACKOFF); - - for tx_sync_result in tx_sync_results.iter_mut() { - if let Err(e) = self.update_tx_sync_result(tx_sync_result) { - debug!("update_tx_sync_result failed. It will be retried: {e}"); - } - } - } - } - } - - fn update_tx_sync_result(&self, tx_sync_result: &mut TxSyncResult) -> Result<(), Error> { - if let TxStatus::Pending { .. } = tx_sync_result.status { - let tm_hash = namada_tendermint::Hash::from_bytes( - namada_tendermint::hash::Algorithm::Sha256, - tx_sync_result.response.hash.as_bytes(), - ) - .expect("tendermint hash should be converted"); - // If the transaction failed, query_txs returns the IbcEvent::ChainError, - // so that we don't attempt to resolve the transaction later on. - let events = self.query_tx_events(&tm_hash)?; - // If we get events back, progress was made, so we replace the events - // with the new ones. in both cases we will check in the next iteration - // whether or not the transaction was fully committed. - if !events.is_empty() { - tx_sync_result.events = events; - tx_sync_result.status = TxStatus::ReceivedResponse; - } - } - Ok(()) - } - - async fn submit_reveal_aux(&mut self, args: &TxArgs, address: &Address) -> Result<(), Error> { - if let Address::Implicit(ImplicitAddress(pkh)) = address { - let public_key = self - .ctx - .wallet() - .await - .find_public_key(pkh.to_string()) - .map_err(|e| NamadaError::namada(namada_sdk::error::Error::Other(e.to_string())))?; - - if tx::is_reveal_pk_needed(self.ctx.client(), address) - .await - .map_err(NamadaError::namada)? - { - let (mut tx, signing_data) = tx::build_reveal_pk(&self.ctx, args, &public_key) - .await - .map_err(NamadaError::namada)?; - self.ctx - .sign(&mut tx, args, signing_data, signing::default_sign, ()) - .await - .map_err(NamadaError::namada)?; - self.ctx - .submit(tx, args) - .await - .map_err(NamadaError::namada)?; - } - } - Ok(()) - } -} diff --git a/crates/relayer/src/chain/namada/version.rs b/crates/relayer/src/chain/namada/version.rs deleted file mode 100644 index 295ae16393..0000000000 --- a/crates/relayer/src/chain/namada/version.rs +++ /dev/null @@ -1,27 +0,0 @@ -use core::fmt::{Display, Error as FmtError, Formatter}; - -use crate::chain::version::ConsensusVersion; - -/// Captures the version(s) specification of different modules of a network. -#[derive(Clone, Debug, PartialEq, Eq)] -pub struct Specs { - pub namada: Option, - pub consensus: Option, -} - -impl Display for Specs { - fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { - let namada = self - .namada - .as_ref() - .map(|v| v.to_string()) - .unwrap_or_else(|| "UNKNOWN".to_string()); - - let consensus = match self.consensus { - Some(ref v) => v.to_string(), - None => "Tendermint: UNKNOWN, CometBFT: UNKNOWN".to_string(), - }; - - write!(f, "Namada {}, {}", namada, consensus) - } -} diff --git a/crates/relayer/src/chain/namada/wallet.rs b/crates/relayer/src/chain/namada/wallet.rs deleted file mode 100644 index c30742f489..0000000000 --- a/crates/relayer/src/chain/namada/wallet.rs +++ /dev/null @@ -1,65 +0,0 @@ -use std::path::PathBuf; -use std::{env, fs}; - -use namada_sdk::wallet::fs::FsWalletStorage; -use namada_sdk::wallet::{LoadStoreError, Store, Wallet, WalletIo, WalletStorage}; -use namada_sdk::zeroize::Zeroizing; -use signature::rand_core::OsRng; - -/// Wallet utils for Namada context -#[derive(Clone)] -pub(super) struct NullWalletUtils; - -impl WalletIo for NullWalletUtils { - type Rng = OsRng; -} - -// Namada wallet never accesses the storage. It reads the keys added in the bootstrap from the store. -impl WalletStorage for NullWalletUtils { - fn save(&self, _wallet: &Wallet) -> Result<(), LoadStoreError> { - Ok(()) - } - - fn load(&self, _wallet: &mut Wallet) -> Result<(), LoadStoreError> { - Ok(()) - } -} - -/// For Namada wallet for adding a key with a password -#[derive(Clone)] -pub struct CliWalletUtils { - store_dir: PathBuf, -} - -impl CliWalletUtils { - pub fn new(store_dir: PathBuf) -> Wallet { - Wallet::new(Self { store_dir }, Store::default()) - } -} - -impl FsWalletStorage for CliWalletUtils { - fn store_dir(&self) -> &PathBuf { - &self.store_dir - } -} - -impl WalletIo for CliWalletUtils { - type Rng = OsRng; - - fn read_password(_confirm: bool, _target_key: Option<&str>) -> Zeroizing { - match env::var("NAMADA_WALLET_PASSWORD_FILE") { - Ok(path) => Zeroizing::new( - fs::read_to_string(path).expect("Something went wrong reading the file"), - ), - Err(_) => match env::var("NAMADA_WALLET_PASSWORD") { - Ok(password) => Zeroizing::new(password), - Err(_) => { - let prompt = "Enter your decryption password: "; - rpassword::read_password_from_tty(Some(prompt)) - .map(Zeroizing::new) - .expect("Failed reading password from tty.") - } - }, - } - } -} diff --git a/crates/relayer/src/chain/runtime.rs b/crates/relayer/src/chain/runtime.rs index 9c6a4a17fe..0aff1cb248 100644 --- a/crates/relayer/src/chain/runtime.rs +++ b/crates/relayer/src/chain/runtime.rs @@ -48,11 +48,11 @@ use crate::{ use super::{ client::ClientSettings, + cosmos::version::Specs, endpoint::{ChainEndpoint, ChainStatus, HealthCheck}, handle::{ChainHandle, ChainRequest, ReplyTo, Subscription}, requests::*, tracking::TrackedMsgs, - version::Specs, }; pub struct Threads { diff --git a/crates/relayer/src/chain/version.rs b/crates/relayer/src/chain/version.rs deleted file mode 100644 index 0a43f51381..0000000000 --- a/crates/relayer/src/chain/version.rs +++ /dev/null @@ -1,27 +0,0 @@ -use core::fmt::{Display, Error as FmtError, Formatter}; - -use crate::chain::cosmos::version::Specs as CosmosSpecs; -use crate::chain::namada::version::Specs as NamadaSpecs; - -#[derive(Clone, Debug, PartialEq, Eq)] -pub enum ConsensusVersion { - Tendermint(semver::Version), - Comet(semver::Version), -} - -impl Display for ConsensusVersion { - fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), FmtError> { - let consensus = match self { - ConsensusVersion::Tendermint(ref v) => format!("Tendermint {v}"), - ConsensusVersion::Comet(ref v) => format!("CometBFT {v}"), - }; - write!(f, "{consensus}") - } -} - -/// Captures the version(s) specification of different modules of a network. -#[derive(Clone, Debug, PartialEq, Eq)] -pub enum Specs { - Cosmos(CosmosSpecs), - Namada(NamadaSpecs), -} diff --git a/crates/relayer/src/config.rs b/crates/relayer/src/config.rs index 584d0cf347..fa4725a6d2 100644 --- a/crates/relayer/src/config.rs +++ b/crates/relayer/src/config.rs @@ -322,7 +322,7 @@ impl Config { } match chain_config { - ChainConfig::CosmosSdk(cosmos_config) | ChainConfig::Namada(cosmos_config) => { + ChainConfig::CosmosSdk(cosmos_config) => { cosmos_config .validate() .map_err(Into::>::into)?; @@ -655,43 +655,36 @@ pub enum EventSourceMode { #[serde(tag = "type")] pub enum ChainConfig { CosmosSdk(CosmosSdkConfig), - // Reuse CosmosSdkConfig for tendermint light clients - Namada(CosmosSdkConfig), } impl ChainConfig { pub fn id(&self) -> &ChainId { match self { Self::CosmosSdk(config) => &config.id, - Self::Namada(config) => &config.id, } } pub fn packet_filter(&self) -> &PacketFilter { match self { Self::CosmosSdk(config) => &config.packet_filter, - Self::Namada(config) => &config.packet_filter, } } pub fn max_block_time(&self) -> Duration { match self { Self::CosmosSdk(config) => config.max_block_time, - Self::Namada(config) => config.max_block_time, } } pub fn key_name(&self) -> &String { match self { Self::CosmosSdk(config) => &config.key_name, - Self::Namada(config) => &config.key_name, } } pub fn set_key_name(&mut self, key_name: String) { match self { Self::CosmosSdk(config) => config.key_name = key_name, - Self::Namada(config) => config.key_name = key_name, } } @@ -710,15 +703,6 @@ impl ChainConfig { .map(|(key_name, keys)| (key_name, keys.into())) .collect() } - ChainConfig::Namada(config) => { - let keyring = - KeyRing::new_namada(Store::Test, &config.id, &config.key_store_folder)?; - keyring - .keys()? - .into_iter() - .map(|(key_name, keys)| (key_name, keys.into())) - .collect() - } }; Ok(keys) @@ -726,27 +710,25 @@ impl ChainConfig { pub fn clear_interval(&self) -> Option { match self { - Self::CosmosSdk(config) | Self::Namada(config) => config.clear_interval, + Self::CosmosSdk(config) => config.clear_interval, } } pub fn query_packets_chunk_size(&self) -> usize { match self { - Self::CosmosSdk(config) | Self::Namada(config) => config.query_packets_chunk_size, + Self::CosmosSdk(config) => config.query_packets_chunk_size, } } pub fn set_query_packets_chunk_size(&mut self, query_packets_chunk_size: usize) { match self { - Self::CosmosSdk(config) | Self::Namada(config) => { - config.query_packets_chunk_size = query_packets_chunk_size - } + 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) | Self::Namada(config) => config + Self::CosmosSdk(config) => config .excluded_sequences .map .get(channel_id) @@ -757,7 +739,7 @@ impl ChainConfig { pub fn allow_ccq(&self) -> bool { match self { - Self::CosmosSdk(config) | Self::Namada(config) => config.allow_ccq, + Self::CosmosSdk(config) => config.allow_ccq, } } } @@ -786,9 +768,7 @@ 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}"))), - "Namada" => CosmosSdkConfig::deserialize(value) - .map(Self::Namada) - .map_err(|e| serde::de::Error::custom(format!("invalid Namada config: {e}"))), + // // <-- Add new chain types here --> // @@ -947,9 +927,6 @@ mod tests { super::ChainConfig::CosmosSdk(_) => { // all good } - super::ChainConfig::Namada(_) => { - panic!("Default chain is expected to be CosmosSDK not Namada") - } } } @@ -976,15 +953,11 @@ mod tests { let config = load(path).expect("could not parse config"); let excluded_sequences1 = match config.chains.first().unwrap() { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { - chain_config.excluded_sequences.clone() - } + ChainConfig::CosmosSdk(chain_config) => chain_config.excluded_sequences.clone(), }; let excluded_sequences2 = match config.chains.last().unwrap() { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { - chain_config.excluded_sequences.clone() - } + ChainConfig::CosmosSdk(chain_config) => chain_config.excluded_sequences.clone(), }; assert_eq!(excluded_sequences1, excluded_sequences2); diff --git a/crates/relayer/src/error.rs b/crates/relayer/src/error.rs index 9059195537..c8ac6d656d 100644 --- a/crates/relayer/src/error.rs +++ b/crates/relayer/src/error.rs @@ -36,7 +36,6 @@ use ibc_relayer_types::proofs::ProofError; use crate::chain::cosmos::version; use crate::chain::cosmos::BLOCK_MAX_BYTES_MAX_FRACTION; -use crate::chain::namada::error::Error as NamadaError; use crate::config::Error as ConfigError; use crate::event::source; use crate::keyring::{errors::Error as KeyringError, KeyType}; @@ -643,10 +642,6 @@ define_error! { Ics24HostValidationError [ ValidationError ] |_| { "ICS24 host validation error" }, - - Namada - [ NamadaError ] - |_| { "Namada error" }, } } diff --git a/crates/relayer/src/event.rs b/crates/relayer/src/event.rs index 0b59747dba..f5219f4750 100644 --- a/crates/relayer/src/event.rs +++ b/crates/relayer/src/event.rs @@ -39,7 +39,7 @@ pub mod bus; pub mod error; pub mod source; -#[derive(Clone, Debug, Serialize, PartialEq)] +#[derive(Clone, Debug, Serialize)] pub struct IbcEventWithHeight { pub event: IbcEvent, pub height: Height, diff --git a/crates/relayer/src/event/source/websocket/extract.rs b/crates/relayer/src/event/source/websocket/extract.rs index 8e0539b144..ddc692054d 100644 --- a/crates/relayer/src/event/source/websocket/extract.rs +++ b/crates/relayer/src/event/source/websocket/extract.rs @@ -6,12 +6,11 @@ use tendermint_rpc::{event::Event as RpcEvent, event::EventData as RpcEventData} use ibc_relayer_types::applications::ics31_icq::events::CrossChainQueryPacket; use ibc_relayer_types::core::ics02_client::{events as ClientEvents, height::Height}; -use ibc_relayer_types::core::ics03_connection::events as ConnectionEvents; use ibc_relayer_types::core::ics04_channel::events as ChannelEvents; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use ibc_relayer_types::events::IbcEvent; -use crate::chain::cosmos::types::events::raw_object::RawObject; +use crate::chain::cosmos::types::events::channel::RawObject; use crate::event::source::queries; use crate::telemetry; @@ -301,36 +300,6 @@ fn extract_block_events( } let mut events: Vec = vec![]; - append_events::( - &mut events, - extract_events( - height, - block_events, - "connection_open_init", - "connection_id", - ), - height, - ); - append_events::( - &mut events, - extract_events(height, block_events, "connection_open_try", "connection_id"), - height, - ); - append_events::( - &mut events, - extract_events(height, block_events, "connection_open_ack", "connection_id"), - height, - ); - append_events::( - &mut events, - extract_events( - height, - block_events, - "connection_open_confirm", - "connection_id", - ), - height, - ); append_events::( &mut events, extract_events(height, block_events, "channel_open_init", "channel_id"), @@ -361,11 +330,6 @@ fn extract_block_events( extract_events(height, block_events, "send_packet", "packet_data_hex"), height, ); - append_events::( - &mut events, - extract_events(height, block_events, "write_acknowledgement", "packet_ack"), - height, - ); append_events::( &mut events, extract_events(height, block_events, "channel_close_init", "channel_id"), diff --git a/crates/relayer/src/foreign_client.rs b/crates/relayer/src/foreign_client.rs index fab20454db..1120ee2dda 100644 --- a/crates/relayer/src/foreign_client.rs +++ b/crates/relayer/src/foreign_client.rs @@ -906,9 +906,7 @@ impl ForeignClient { - config.client_refresh_rate - } + ChainConfig::CosmosSdk(config) => config.client_refresh_rate, }; let refresh_period = client_state @@ -1760,9 +1758,7 @@ impl ForeignClient { - config.ccv_consumer_chain - } + ChainConfig::CosmosSdk(config) => config.ccv_consumer_chain, }; let mut msgs = vec![]; diff --git a/crates/relayer/src/keyring.rs b/crates/relayer/src/keyring.rs index 446ba7b039..1260de235e 100644 --- a/crates/relayer/src/keyring.rs +++ b/crates/relayer/src/keyring.rs @@ -5,8 +5,6 @@ pub use key_type::KeyType; pub use secp256k1_key_pair::Secp256k1KeyPair; pub use signing_key_pair::{SigningKeyPair, SigningKeyPairSized}; -pub use crate::chain::namada::key::NamadaKeyPair; - mod any_signing_key_pair; mod ed25519_key_pair; mod key_type; @@ -288,15 +286,7 @@ impl KeyRing { } } -impl KeyRing { - pub fn new_namada( - store: Store, - chain_id: &ChainId, - ks_folder: &Option, - ) -> Result { - Self::new(store, "", chain_id, ks_folder) - } -} +// Why is this not a method on `ChainConfig`? fn disk_store_path(folder_name: &str, keystore_folder: &Option) -> Result { let ks_folder = match keystore_folder { diff --git a/crates/relayer/src/keyring/any_signing_key_pair.rs b/crates/relayer/src/keyring/any_signing_key_pair.rs index 3bd57177a2..f6aa27bd0b 100644 --- a/crates/relayer/src/keyring/any_signing_key_pair.rs +++ b/crates/relayer/src/keyring/any_signing_key_pair.rs @@ -1,13 +1,12 @@ use serde::Serialize; -use super::{Ed25519KeyPair, KeyType, NamadaKeyPair, Secp256k1KeyPair, SigningKeyPair}; +use super::{Ed25519KeyPair, KeyType, Secp256k1KeyPair, SigningKeyPair}; #[derive(Clone, Debug, Serialize)] #[serde(untagged)] pub enum AnySigningKeyPair { Secp256k1(Secp256k1KeyPair), Ed25519(Ed25519KeyPair), - Namada(NamadaKeyPair), } impl AnySigningKeyPair { @@ -15,7 +14,6 @@ impl AnySigningKeyPair { match self { Self::Secp256k1(key_pair) => key_pair.account(), Self::Ed25519(key_pair) => key_pair.account(), - Self::Namada(key_pair) => key_pair.account(), } } @@ -23,7 +21,6 @@ impl AnySigningKeyPair { match self { Self::Secp256k1(_) => Secp256k1KeyPair::KEY_TYPE, Self::Ed25519(_) => Ed25519KeyPair::KEY_TYPE, - Self::Namada(_) => NamadaKeyPair::KEY_TYPE, } } @@ -31,7 +28,6 @@ impl AnySigningKeyPair { match self { Self::Secp256k1(key_pair) => key_pair.as_any(), Self::Ed25519(key_pair) => key_pair.as_any(), - Self::Namada(key_pair) => key_pair.as_any(), } .downcast_ref::() .cloned() @@ -49,9 +45,3 @@ impl From for AnySigningKeyPair { Self::Ed25519(key_pair) } } - -impl From for AnySigningKeyPair { - fn from(key_pair: NamadaKeyPair) -> Self { - Self::Namada(key_pair) - } -} diff --git a/crates/relayer/src/light_client/tendermint.rs b/crates/relayer/src/light_client/tendermint.rs index 4628517b51..808c616235 100644 --- a/crates/relayer/src/light_client/tendermint.rs +++ b/crates/relayer/src/light_client/tendermint.rs @@ -153,12 +153,12 @@ impl super::LightClient for LightClient { )) })?; - let update_header = match any_header { - AnyHeader::Tendermint(header) => Ok::<_, Error>(header), + let update_header: &TmHeader = match any_header { + AnyHeader::Tendermint(header) => Ok(header), }?; let client_state = match client_state { - AnyClientState::Tendermint(client_state) => Ok::<_, Error>(client_state), + AnyClientState::Tendermint(client_state) => Ok(client_state), }?; let next_validators = self @@ -322,7 +322,7 @@ impl LightClient { let scheduler = components::scheduler::basic_bisecting_schedule; let client_state = match client_state { - AnyClientState::Tendermint(client_state) => Ok::<_, Error>(client_state), + AnyClientState::Tendermint(client_state) => Ok(client_state), }?; Ok(TmLightClient::new( diff --git a/crates/relayer/src/spawn.rs b/crates/relayer/src/spawn.rs index f791fddabc..113ac1f6a7 100644 --- a/crates/relayer/src/spawn.rs +++ b/crates/relayer/src/spawn.rs @@ -6,9 +6,7 @@ use tokio::runtime::Runtime as TokioRuntime; use ibc_relayer_types::core::ics24_host::identifier::ChainId; use crate::{ - chain::{ - cosmos::CosmosSdkChain, handle::ChainHandle, namada::NamadaChain, runtime::ChainRuntime, - }, + chain::{cosmos::CosmosSdkChain, handle::ChainHandle, runtime::ChainRuntime}, config::{ChainConfig, Config}, error::Error as RelayerError, }; @@ -84,7 +82,6 @@ pub fn spawn_chain_runtime_with_config( ) -> Result { let handle = match config { ChainConfig::CosmosSdk(_) => ChainRuntime::::spawn(config, rt), - ChainConfig::Namada(_) => ChainRuntime::::spawn(config, rt), } .map_err(SpawnError::relayer)?; diff --git a/crates/relayer/src/upgrade_chain.rs b/crates/relayer/src/upgrade_chain.rs index f6a7277120..318f35130b 100644 --- a/crates/relayer/src/upgrade_chain.rs +++ b/crates/relayer/src/upgrade_chain.rs @@ -22,7 +22,6 @@ use tracing::warn; use crate::chain::handle::ChainHandle; use crate::chain::requests::{IncludeProof, QueryClientStateRequest, QueryHeight}; use crate::chain::tracking::TrackedMsgs; -use crate::chain::version::Specs; use crate::client_state::AnyClientState; use crate::error::Error; @@ -77,7 +76,7 @@ pub fn build_and_send_ibc_upgrade_proposal( src_chain: impl ChainHandle, // the source chain; supplies a client state for building the upgrade plan opts: &UpgradePlanOptions, ) -> Result { - let any_msg = if requires_legacy_upgrade_proposal(dst_chain.clone())? { + let any_msg = if requires_legacy_upgrade_proposal(dst_chain.clone()) { build_legacy_upgrade_proposal(dst_chain.clone(), src_chain, opts) } else { build_upgrade_proposal(dst_chain.clone(), src_chain, opts) @@ -99,22 +98,10 @@ pub fn build_and_send_ibc_upgrade_proposal( /// 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, 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, -) -> Result { +pub fn requires_legacy_upgrade_proposal(dst_chain: impl ChainHandle) -> bool { let Ok(version_specs) = dst_chain.version_specs() else { warn!("failed to get version specs, assuming legacy upgrade proposal is required"); - return Ok(true); - }; - - let version_specs = match version_specs { - Specs::Cosmos(v) => v, - Specs::Namada(_) => { - return Err(UpgradeChainError::submit( - dst_chain.id(), - crate::chain::namada::error::Error::upgrade().into(), - )) - } + return true; }; let sdk_before_50 = version_specs @@ -123,7 +110,7 @@ pub fn requires_legacy_upgrade_proposal( .map(|s| s.minor < 50) .unwrap_or(true); - Ok(match version_specs.ibc_go { + 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 @@ -136,7 +123,7 @@ pub fn requires_legacy_upgrade_proposal( ibc_version.major < 8 } } - }) + } } /// Ibc-go versions up to v7.x.x use the deprecated `UpgradeProposal` to upgrade a chain diff --git a/crates/relayer/src/util/compat_mode.rs b/crates/relayer/src/util/compat_mode.rs index 104026e70e..c637d5a247 100644 --- a/crates/relayer/src/util/compat_mode.rs +++ b/crates/relayer/src/util/compat_mode.rs @@ -2,7 +2,7 @@ use tracing::warn; use tendermint::Version; -use crate::chain::version::ConsensusVersion; +use crate::chain::cosmos::version::ConsensusVersion; use crate::config::compat_mode::CompatMode; use crate::error::Error; diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index abd1761784..eb22530255 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.79.0" +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 9bacc19498..77b9d86c61 100644 --- a/tools/integration-test/Cargo.toml +++ b/tools/integration-test/Cargo.toml @@ -2,7 +2,7 @@ name = "ibc-integration-test" version = "0.29.4" edition = "2021" -rust-version = "1.79.0" +rust-version = "1.76.0" license = "Apache-2.0" readme = "README.md" keywords = ["blockchain", "consensus", "cosmos", "ibc", "tendermint"] @@ -50,7 +50,6 @@ new-register-interchain-account = [] authz = [] benchmark = [] no-denom-trace = [] -namada = [] [[bin]] name = "test_setup_with_binary_channel" 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 85565698e2..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 @@ -43,7 +43,7 @@ impl TestOverrides for Test { fn modify_relayer_config(&self, config: &mut Config) { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { // Modify the key store type to `Store::Test` so that the wallet // keys are stored to ~/.hermes/keys so that we can use them // with external relayer commands. 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 39b749c3bf..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 @@ -44,7 +44,7 @@ impl TestOverrides for Test { fn modify_relayer_config(&self, config: &mut Config) { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { // Modify the key store type to `Store::Test` so that the wallet // keys are stored to ~/.hermes/keys so that we can use them // with external relayer commands. 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 b11f77634d..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 @@ -43,7 +43,7 @@ impl TestOverrides for Test { fn modify_relayer_config(&self, config: &mut Config) { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { // Modify the key store type to `Store::Test` so that the wallet // keys are stored to ~/.hermes/keys so that we can use them // with external relayer commands. 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 bce4a2c69b..493d034b1a 100644 --- a/tools/integration-test/src/tests/async_icq/simple_query.rs +++ b/tools/integration-test/src/tests/async_icq/simple_query.rs @@ -2,7 +2,7 @@ use std::env; use ibc_relayer::channel::version::Version; use ibc_relayer::config::ChainConfig; -use ibc_test_framework::chain::config::cosmos::{ +use ibc_test_framework::chain::config::{ add_allow_message_interchainquery, set_floor_gas_price, set_max_deposit_period, set_min_deposit_amount, set_voting_period, }; @@ -70,7 +70,7 @@ impl BinaryConnectionTest for AsyncIcqTest { connection: ConnectedConnection, ) -> Result<(), Error> { let fee_denom_b: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); + 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( @@ -217,7 +217,7 @@ impl BinaryConnectionTest for FailedAsyncIcqTest { connection: ConnectedConnection, ) -> Result<(), Error> { let fee_denom_b: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); + 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( @@ -336,7 +336,7 @@ fn assert_eventual_async_icq_success( relayer: &RelayerDriver, ) -> Result<(), Error> { let rpc_addr = match relayer.config.chains.first().unwrap() { - ChainConfig::CosmosSdk(c) | ChainConfig::Namada(c) => c.rpc_addr.clone(), + ChainConfig::CosmosSdk(c) => c.rpc_addr.clone(), }; let mut rpc_client = HttpClient::new(rpc_addr).unwrap(); @@ -371,7 +371,7 @@ fn assert_eventual_async_icq_error( relayer: &RelayerDriver, ) -> Result<(), Error> { let rpc_addr = match relayer.config.chains.first().unwrap() { - ChainConfig::CosmosSdk(c) | ChainConfig::Namada(c) => c.rpc_addr.clone(), + ChainConfig::CosmosSdk(c) => c.rpc_addr.clone(), }; let mut rpc_client = HttpClient::new(rpc_addr).unwrap(); diff --git a/tools/integration-test/src/tests/authz.rs b/tools/integration-test/src/tests/authz.rs index 9a661a9a6a..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_token(0), config.native_token(0))); + MonoTagged::new(Denom::base(config.native_token(0))); let wallet_b = chains.node_b.wallets().user1().cloned(); let a_to_b_amount = 12345u64; @@ -75,7 +75,6 @@ impl BinaryChannelTest for AuthzTest { .query_balance(&chains.node_a.wallets().user2().address(), &denom_a)?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, @@ -121,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_token(0), config.native_token(0))); + MonoTagged::new(Denom::base(config.native_token(0))); let wallet_b = chains.node_b.wallets().user1().cloned(); let a_to_b_amount = 12345u64; @@ -141,7 +140,6 @@ impl BinaryChannelTest for NoAuthzTest { .to_string(); let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/channel_upgrade/flushing.rs b/tools/integration-test/src/tests/channel_upgrade/flushing.rs index 3b2777f733..0e4bdf7143 100644 --- a/tools/integration-test/src/tests/channel_upgrade/flushing.rs +++ b/tools/integration-test/src/tests/channel_upgrade/flushing.rs @@ -10,7 +10,7 @@ use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeigh 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::cosmos::{set_max_deposit_period, set_voting_period}; +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, @@ -166,7 +166,6 @@ impl BinaryChannelTest for ChannelUpgradeFlushing { relayer.with_supervisor(|| { let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, @@ -385,7 +384,6 @@ impl BinaryChannelTest for ChannelUpgradeHandshakeFlushPackets { // and move channel ends to `FLUSH_COMPLETE` relayer.with_supervisor(|| { let ibc_denom_a = derive_ibc_denom( - &chains.node_a.chain_driver().value().chain_type, &channels.port_a.as_ref(), &channels.channel_id_a.as_ref(), &denom_b, @@ -397,7 +395,6 @@ impl BinaryChannelTest for ChannelUpgradeHandshakeFlushPackets { )?; let ibc_denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/channel_upgrade/ica.rs b/tools/integration-test/src/tests/channel_upgrade/ica.rs index c2f1846f48..8ddd4fb5c7 100644 --- a/tools/integration-test/src/tests/channel_upgrade/ica.rs +++ b/tools/integration-test/src/tests/channel_upgrade/ica.rs @@ -32,7 +32,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::cosmos::{ +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_ordered_interchain_account; @@ -91,8 +91,8 @@ impl BinaryConnectionTest for ChannelUpgradeICACloseChannel { connection: ConnectedConnection, ) -> Result<(), Error> { let fee_denom_host: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); - let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); + 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 let (wallet, ica_address, controller_channel_id, controller_port_id) = relayer @@ -315,7 +315,7 @@ impl TestOverrides for ChannelUpgradeICAUnordered { for chain in &mut config.chains { match chain { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.packet_filter = self.packet_filter.clone(); } } @@ -344,8 +344,8 @@ impl BinaryConnectionTest for ChannelUpgradeICAUnordered { connection: ConnectedConnection, ) -> Result<(), Error> { let fee_denom_host: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); - let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); + MonoTagged::new(Denom::base(config.native_token(1))); + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); info!("Will register interchain account..."); diff --git a/tools/integration-test/src/tests/channel_upgrade/ics29.rs b/tools/integration-test/src/tests/channel_upgrade/ics29.rs index 95db144604..02f90b2745 100644 --- a/tools/integration-test/src/tests/channel_upgrade/ics29.rs +++ b/tools/integration-test/src/tests/channel_upgrade/ics29.rs @@ -7,7 +7,7 @@ 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::cosmos::{set_max_deposit_period, set_voting_period}; +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, @@ -202,7 +202,6 @@ impl BinaryChannelTest for ChannelUpgradeICS29 { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/channel_upgrade/timeout.rs b/tools/integration-test/src/tests/channel_upgrade/timeout.rs index ed391391f1..42bdd288ed 100644 --- a/tools/integration-test/src/tests/channel_upgrade/timeout.rs +++ b/tools/integration-test/src/tests/channel_upgrade/timeout.rs @@ -27,7 +27,7 @@ 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::cosmos::{set_max_deposit_period, set_voting_period}; +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, @@ -992,7 +992,6 @@ impl BinaryChannelTest for ChannelUpgradeHandshakeTimeoutOnPacketAck { // and move channel ends to `FLUSH_COMPLETE` relayer.with_supervisor(|| { let ibc_denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs b/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs index 2929bf649a..1a8dbe27ed 100644 --- a/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs +++ b/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake.rs @@ -11,7 +11,7 @@ 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::cosmos::{set_max_deposit_period, set_voting_period}; +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, 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 index c295ab55e4..31b665bc9a 100644 --- a/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake_steps.rs +++ b/tools/integration-test/src/tests/channel_upgrade/upgrade_handshake_steps.rs @@ -29,7 +29,7 @@ use ibc_relayer::chain::requests::{IncludeProof, QueryChannelRequest, QueryHeigh 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::cosmos::{set_max_deposit_period, set_voting_period}; +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, diff --git a/tools/integration-test/src/tests/clear_packet.rs b/tools/integration-test/src/tests/clear_packet.rs index d45fab572d..cf09b6dbad 100644 --- a/tools/integration-test/src/tests/clear_packet.rs +++ b/tools/integration-test/src/tests/clear_packet.rs @@ -122,11 +122,8 @@ impl BinaryChannelTest for DisabledClearPacketTest { sleep(Duration::from_secs(1)); - let amount_b = amount2.transfer( - &chains.node_b.chain_driver().value().chain_type, - &channel.port_b.as_ref(), - &channel.channel_id_b.as_ref(), - )?; + let amount_b = + amount2.transfer(&channel.port_b.as_ref(), &channel.channel_id_b.as_ref())?; // Wallet on chain A should have both amount deducted. chains.node_a.chain_driver().assert_eventual_wallet_amount( @@ -165,7 +162,7 @@ impl BinaryChannelTest for ClearPacketRecoveryTest { channel: ConnectedChannel, ) -> Result<(), Error> { let fee_denom_b: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); + MonoTagged::new(Denom::base(config.native_token(1))); let denom_a = chains.node_a.denom(); let denom_b1 = chains.node_b.denom(); @@ -193,7 +190,6 @@ impl BinaryChannelTest for ClearPacketRecoveryTest { )?; let denom_b2 = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -237,10 +233,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], - &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(); @@ -261,7 +254,6 @@ impl BinaryChannelTest for ClearPacketNoScanTest { )?; let denom_b2 = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -342,9 +334,7 @@ impl TestOverrides for ClearPacketOverrideTest { for chain_config in config.chains.iter_mut() { match chain_config { // Use a small clear interval in the chain configurations to override the global high interval - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { - chain_config.clear_interval = Some(10) - } + ChainConfig::CosmosSdk(chain_config) => chain_config.clear_interval = Some(10), } } } @@ -363,10 +353,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], - &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(); @@ -387,7 +374,6 @@ impl BinaryChannelTest for ClearPacketOverrideTest { )?; let denom_b2 = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -671,11 +657,8 @@ impl BinaryChannelTest for LimitedClearPacketTest { // Spawn the supervisor only after the first IBC transfer relayer.with_supervisor(|| { - let amount_b = cleared_amount.transfer( - &chains.node_b.chain_driver().value().chain_type, - &channel.port_b.as_ref(), - &channel.channel_id_b.as_ref(), - )?; + 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"); diff --git a/tools/integration-test/src/tests/client_expiration.rs b/tools/integration-test/src/tests/client_expiration.rs index 234bea6b1c..082cacf70a 100644 --- a/tools/integration-test/src/tests/client_expiration.rs +++ b/tools/integration-test/src/tests/client_expiration.rs @@ -7,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::chain::chain_type::ChainType; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::channel::{ assert_eventually_channel_established, init_channel, query_channel_end, @@ -114,7 +113,7 @@ impl TestOverrides for ExpirationTestOverrides { for chain_config in config.chains.iter_mut() { match chain_config { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.trusting_period = Some(CLIENT_EXPIRY); } } @@ -213,16 +212,8 @@ impl BinaryChainTest for ChannelExpirationTest { }, // From simapp version v7.1.0 if `ConnOpenInit` is sent while the client // is expired, an error will be returned. - Err(e) => match chains.node_b.chain_driver().value().chain_type { - ChainType::Namada => { - // See https://github.com/cosmos/ibc-rs/blob/v0.53.0/ibc-core/ics02-client/types/src/error.rs#L22 - assert!(e.to_string().contains("client is not active. Status=`Expired`")) - } - _ => { - // See https://github.com/cosmos/ibc-go/blob/v7.1.0/modules/core/03-connection/keeper/handshake.go#L40 - assert!(e.to_string().contains("status is Expired: client state is not active")) - } - } + // See https://github.com/cosmos/ibc-go/blob/v7.1.0/modules/core/03-connection/keeper/handshake.go#L40 + Err(e) => assert!(e.to_string().contains("status is Expired: client state is not active")), } } @@ -322,7 +313,6 @@ impl BinaryChainTest for PacketExpirationTest { let denom_a = chains.node_a.denom(); let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/client_refresh.rs b/tools/integration-test/src/tests/client_refresh.rs index 32d5ce067e..e29adbb821 100644 --- a/tools/integration-test/src/tests/client_refresh.rs +++ b/tools/integration-test/src/tests/client_refresh.rs @@ -19,7 +19,6 @@ fn test_client_fail_refresh() -> Result<(), Error> { run_binary_chain_test(&ClientFailsTest) } -#[allow(dead_code)] struct ClientFailsTest; struct ClientDefaultsTest; @@ -127,24 +126,12 @@ impl BinaryChainTest for ClientFailsTest { chains, |config| { { - match &mut config.chains[0] { - ChainConfig::CosmosSdk(config_chain_a) => { - config_chain_a.gas_multiplier = Some(GasMultiplier::unsafe_new(0.8)); - } - ChainConfig::Namada(config_chain_a) => { - config_chain_a.gas_multiplier = Some(GasMultiplier::unsafe_new(0.8)); - } - } + let ChainConfig::CosmosSdk(config_chain_a) = &mut config.chains[0]; + config_chain_a.gas_multiplier = Some(GasMultiplier::unsafe_new(0.8)); } - match &mut config.chains[1] { - ChainConfig::CosmosSdk(config_chain_b) => { - config_chain_b.gas_multiplier = Some(GasMultiplier::unsafe_new(0.8)); - } - ChainConfig::Namada(config_chain_b) => { - config_chain_b.gas_multiplier = Some(GasMultiplier::unsafe_new(0.8)); - } - } + let ChainConfig::CosmosSdk(config_chain_b) = &mut config.chains[1]; + config_chain_b.gas_multiplier = Some(GasMultiplier::unsafe_new(0.8)); }, config, )?; @@ -173,7 +160,6 @@ impl BinaryChainTest for ClientFailsTest { } } -#[allow(dead_code)] fn override_connected_chains( chains: ConnectedChains, config_modifier: impl FnOnce(&mut Config), @@ -216,7 +202,6 @@ where Ok(chains) } -#[allow(dead_code)] fn restore_foreign_client_pair( chain_a: &ChainA, chain_b: &ChainB, diff --git a/tools/integration-test/src/tests/client_settings.rs b/tools/integration-test/src/tests/client_settings.rs index ccaee68b41..0a3c7656a4 100644 --- a/tools/integration-test/src/tests/client_settings.rs +++ b/tools/integration-test/src/tests/client_settings.rs @@ -26,7 +26,7 @@ struct ClientOptionsTest; impl TestOverrides for ClientDefaultsTest { fn modify_relayer_config(&self, config: &mut Config) { match &mut config.chains[0] { - ChainConfig::CosmosSdk(chain_config_a) | ChainConfig::Namada(chain_config_a) => { + ChainConfig::CosmosSdk(chain_config_a) => { chain_config_a.clock_drift = Duration::from_secs(3); chain_config_a.max_block_time = Duration::from_secs(5); chain_config_a.trusting_period = Some(Duration::from_secs(120_000)); @@ -35,7 +35,7 @@ impl TestOverrides for ClientDefaultsTest { } match &mut config.chains[1] { - ChainConfig::CosmosSdk(chain_config_b) | ChainConfig::Namada(chain_config_b) => { + ChainConfig::CosmosSdk(chain_config_b) => { chain_config_b.clock_drift = Duration::from_secs(6); chain_config_b.max_block_time = Duration::from_secs(15); chain_config_b.trusting_period = Some(Duration::from_secs(340_000)); diff --git a/tools/integration-test/src/tests/client_upgrade.rs b/tools/integration-test/src/tests/client_upgrade.rs index b420c481a5..9480a4a105 100644 --- a/tools/integration-test/src/tests/client_upgrade.rs +++ b/tools/integration-test/src/tests/client_upgrade.rs @@ -21,7 +21,7 @@ use ibc_relayer::chain::requests::QueryHeight; use ibc_relayer::client_state::AnyClientState; use ibc_relayer::upgrade_chain::{build_and_send_ibc_upgrade_proposal, UpgradePlanOptions}; use ibc_relayer_types::core::ics02_client::height::Height; -use ibc_test_framework::chain::config::cosmos::{ +use ibc_test_framework::chain::config::{ set_max_deposit_period, set_min_deposit_amount, set_voting_period, }; use ibc_test_framework::chain::ext::bootstrap::ChainBootstrapMethodsExt; @@ -82,10 +82,8 @@ impl BinaryChainTest for ClientUpgradeTest { chains: ibc_test_framework::prelude::ConnectedChains, ) -> 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], - &config.native_tokens[0], - )); + let fee_denom_a: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(0))); let foreign_clients = chains.clone().foreign_clients; // Create and send an chain upgrade proposal @@ -243,10 +241,8 @@ impl BinaryChainTest for HeightTooHighClientUpgradeTest { chains: ibc_test_framework::prelude::ConnectedChains, ) -> 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], - &config.native_tokens[0], - )); + let fee_denom_a: MonoTagged = + MonoTagged::new(Denom::base(config.native_token(0))); let foreign_clients = chains.clone().foreign_clients; // Create and send an chain upgrade proposal @@ -343,10 +339,8 @@ impl BinaryChainTest for HeightTooLowClientUpgradeTest { chains: ibc_test_framework::prelude::ConnectedChains, ) -> 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], - &config.native_tokens[0], - )); + let fee_denom_a: MonoTagged = + 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)?; @@ -438,10 +432,8 @@ fn create_upgrade_plan( chains: &ibc_test_framework::prelude::ConnectedChains, upgraded_chain_id: &ChainId, ) -> Result { - let fee_denom_a: MonoTagged = MonoTagged::new(Denom::base( - &config.native_tokens[0], - &config.native_tokens[0], - )); + let fee_denom_a: MonoTagged = + 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/connection_delay.rs b/tools/integration-test/src/tests/connection_delay.rs index 43f034f45e..0c8ca19e57 100644 --- a/tools/integration-test/src/tests/connection_delay.rs +++ b/tools/integration-test/src/tests/connection_delay.rs @@ -58,7 +58,6 @@ impl BinaryChannelTest for ConnectionDelayTest { let time1 = OffsetDateTime::now_utc(); let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/consensus_states.rs b/tools/integration-test/src/tests/consensus_states.rs index b94045d666..bfd0891679 100644 --- a/tools/integration-test/src/tests/consensus_states.rs +++ b/tools/integration-test/src/tests/consensus_states.rs @@ -1,13 +1,9 @@ -use ibc_relayer::{ - chain::{ - cosmos::query::consensus_state::query_consensus_states, - requests::{PageRequest, QueryConsensusStateHeightsRequest, QueryConsensusStatesRequest}, - }, - config::ChainConfig, +use ibc_relayer::chain::{ + cosmos::query::consensus_state::query_consensus_states, + requests::{PageRequest, QueryConsensusStateHeightsRequest, QueryConsensusStatesRequest}, }; use ibc_test_framework::prelude::*; -use ibc_test_framework::util::namada; #[test] fn test_consensus_state_heights() -> Result<(), Error> { @@ -52,42 +48,29 @@ impl BinaryChainTest for ConsensusStateHeights { &CONSENSUS_STATES_COUNT, )?; - let states = match chains.handle_b().config().expect("Config should exist") { - ChainConfig::Namada(config) => chains.node_b.value().chain_driver.runtime.block_on( - namada::query_consensus_states( - config - .rpc_addr - .to_string() - .parse() - .expect("RPC address should be converted"), - chains.client_id_b().value(), - ), - )?, - _ => { - let grpc_address = chains - .node_b - .value() - .chain_driver - .grpc_address() - .as_str() - .parse() - .unwrap(); + let grpc_address = chains + .node_b + .value() + .chain_driver + .grpc_address() + .as_str() + .parse() + .unwrap(); - chains - .node_b - .value() - .chain_driver - .runtime - .block_on(query_consensus_states( - chains.node_b.chain_id().value(), - &grpc_address, - QueryConsensusStatesRequest { - client_id: (*chains.client_id_b().value()).clone(), - pagination: Some(PageRequest::all()), - }, - ))? - } - }; + let states = + chains + .node_b + .value() + .chain_driver + .runtime + .block_on(query_consensus_states( + chains.node_b.chain_id().value(), + &grpc_address, + QueryConsensusStatesRequest { + client_id: (*chains.client_id_b().value()).clone(), + pagination: Some(PageRequest::all()), + }, + ))?; assert_eq( "did not find the expected number of consensus states", diff --git a/tools/integration-test/src/tests/denom_trace.rs b/tools/integration-test/src/tests/denom_trace.rs index 50dbbd4aa8..3c56efbdcb 100644 --- a/tools/integration-test/src/tests/denom_trace.rs +++ b/tools/integration-test/src/tests/denom_trace.rs @@ -40,7 +40,6 @@ impl BinaryChannelTest for IbcDenomTraceTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -84,8 +83,7 @@ impl BinaryChannelTest for IbcDenomTraceTest { assert_eq( "Denom returned by denom_trace query should be the same as denom_a", &denom_trace.base_denom, - // check the raw address - &denom_a.value().hash_only(), + &denom_a.value().as_str().to_string(), )?; Ok(()) diff --git a/tools/integration-test/src/tests/dynamic_gas_fee.rs b/tools/integration-test/src/tests/dynamic_gas_fee.rs index 950e8b9617..3e30ec468d 100644 --- a/tools/integration-test/src/tests/dynamic_gas_fee.rs +++ b/tools/integration-test/src/tests/dynamic_gas_fee.rs @@ -52,7 +52,6 @@ impl TestOverrides for DynamicGasTest { 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); } - ChainConfig::Namada(_) => {} } match &mut config.chains[1] { @@ -62,7 +61,6 @@ impl TestOverrides for DynamicGasTest { chain_config_b.dynamic_gas_price = DynamicGasPrice::unsafe_new(self.dynamic_gas_enabled, 1.1, 0.6); } - ChainConfig::Namada(_) => {} } } @@ -86,38 +84,15 @@ impl BinaryChannelTest for DynamicGasTest { let a_to_b_amount = 12345u64; let denom_a_to_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, )?; - let gas_denom_str_a = match relayer - .config - .chains - .first() - .ok_or_else(|| eyre!("chain configuration is empty"))? - { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { - chain_config.gas_price.denom.clone() - } - }; - - let gas_denom_str_b: String = match relayer - .config - .chains - .get(1) - .ok_or_else(|| eyre!("chain configuration is empty"))? - { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { - chain_config.gas_price.denom.clone() - } - }; - let gas_denom_a: MonoTagged = - MonoTagged::new(Denom::base(&gas_denom_str_a, &gas_denom_str_a)); + MonoTagged::new(Denom::Base("stake".to_owned())); let gas_denom_b: MonoTagged = - MonoTagged::new(Denom::base(&gas_denom_str_b, &gas_denom_str_b)); + 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(), @@ -173,7 +148,6 @@ impl BinaryChannelTest for DynamicGasTest { let denom_b = chains.node_b.denom(); let denom_b_to_a = derive_ibc_denom( - &chains.node_a.chain_driver().value().chain_type, &channel.port_a.as_ref(), &channel.channel_id_a.as_ref(), &denom_b, diff --git a/tools/integration-test/src/tests/error_events.rs b/tools/integration-test/src/tests/error_events.rs index af054aac26..24602d0122 100644 --- a/tools/integration-test/src/tests/error_events.rs +++ b/tools/integration-test/src/tests/error_events.rs @@ -1,6 +1,5 @@ use ibc_relayer::chain::tracking::TrackedMsgs; use ibc_relayer_types::events::IbcEvent; -use ibc_test_framework::chain::chain_type::ChainType; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::transfer::build_transfer_message; @@ -37,36 +36,24 @@ impl BinaryChannelTest for ErrorEventsTest { let balance_a_amount: u128 = balance_a.value().amount.0.as_u128(); - let mut transfer_messages = Vec::new(); - for i in 0..4 { - let transfer_message = build_transfer_message( - &channel.port_a.as_ref(), - &channel.channel_id_a.as_ref(), - &wallet_a.as_ref(), - &wallet_b.address(), - &denom_a.with_amount((balance_a_amount / 3) + 1).as_ref(), - Duration::from_secs(30), - // Namada batch transaction can't have the exact same message - Some(i.to_string()), - )?; - transfer_messages.push(transfer_message); - } + let transfer_message = build_transfer_message( + &channel.port_a.as_ref(), + &channel.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount((balance_a_amount / 3) + 1).as_ref(), + Duration::from_secs(30), + None, + )?; - let messages = TrackedMsgs::new_static(transfer_messages, "test_error_events"); + let messages = TrackedMsgs::new_static(vec![transfer_message; 4], "test_error_events"); let events = chains.handle_a().send_messages_and_wait_commit(messages)?; - if matches!( - chains.node_a.chain_driver().value().chain_type, - ChainType::Namada - ) { - // Requested the messages with a batched transaction - assert_eq!(events.len(), 1); - } else { - // We expect 4 error events to be returned, corresponding to the - // 4 messages sent. - assert_eq!(events.len(), 4); - } + // We expect 4 error events to be returned, corresponding to the + // 4 messages sent. + + assert_eq!(events.len(), 4); for event_with_height in events { match event_with_height.event { 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 e5aad208ce..ca120394a5 100644 --- a/tools/integration-test/src/tests/fee/auto_forward_relayer.rs +++ b/tools/integration-test/src/tests/fee/auto_forward_relayer.rs @@ -76,7 +76,6 @@ impl BinaryChannelTest for AutoForwardRelayerTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/fee/filter_fees.rs b/tools/integration-test/src/tests/fee/filter_fees.rs index b257f66bfd..963e93e2d8 100644 --- a/tools/integration-test/src/tests/fee/filter_fees.rs +++ b/tools/integration-test/src/tests/fee/filter_fees.rs @@ -22,8 +22,6 @@ struct FilterIncentivizedFeesRelayerTest; impl TestOverrides for FilterIncentivizedFeesRelayerTest { fn modify_relayer_config(&self, config: &mut Config) { - config.mode.packets.clear_on_start = false; - config.mode.packets.clear_interval = 0; config.mode.packets.auto_register_counterparty_payee = true; let recv_fee = MinFee::new(50, Some("samoleans".to_owned())); let fees_filters = FeePolicy::new(vec![recv_fee]); @@ -32,7 +30,7 @@ impl TestOverrides for FilterIncentivizedFeesRelayerTest { let packet_filter = PacketFilter::new(ChannelPolicy::default(), min_fees); for chain_config in config.chains.iter_mut() { match chain_config { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.packet_filter = packet_filter.clone(); } } @@ -94,7 +92,6 @@ impl BinaryChannelTest for FilterIncentivizedFeesRelayerTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -144,7 +141,6 @@ impl BinaryChannelTest for FilterIncentivizedFeesRelayerTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -184,7 +180,7 @@ impl TestOverrides for FilterByChannelIncentivizedFeesRelayerTest { let packet_filter = PacketFilter::new(ChannelPolicy::default(), min_fees); for chain_config in config.chains.iter_mut() { match chain_config { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.packet_filter = packet_filter.clone(); } } @@ -231,7 +227,6 @@ impl BinaryChannelTest for FilterByChannelIncentivizedFeesRelayerTest { let balance_a2 = balance_a1.clone() - send_amount; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/fee/forward_relayer.rs b/tools/integration-test/src/tests/fee/forward_relayer.rs index ca91aef498..daa5bcf317 100644 --- a/tools/integration-test/src/tests/fee/forward_relayer.rs +++ b/tools/integration-test/src/tests/fee/forward_relayer.rs @@ -115,7 +115,6 @@ impl BinaryChannelTest for ForwardRelayerTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, 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 13683f9cfe..8b840640e8 100644 --- a/tools/integration-test/src/tests/fee/no_forward_relayer.rs +++ b/tools/integration-test/src/tests/fee/no_forward_relayer.rs @@ -93,7 +93,6 @@ impl BinaryChannelTest for NoForwardRelayerTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -180,7 +179,6 @@ impl BinaryChannelTest for InvalidForwardRelayerTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, 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 e2c8c44c6a..b7b026ae3a 100644 --- a/tools/integration-test/src/tests/fee/non_fee_channel.rs +++ b/tools/integration-test/src/tests/fee/non_fee_channel.rs @@ -93,7 +93,6 @@ impl BinaryChannelTest for NonFeeChannelTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, 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 73f5ae7e55..dc8f5a816d 100644 --- a/tools/integration-test/src/tests/fee/pay_fee_async.rs +++ b/tools/integration-test/src/tests/fee/pay_fee_async.rs @@ -254,7 +254,6 @@ impl BinaryChannelTest for PayPacketFeeAsyncTest { } let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/fee/register_payee.rs b/tools/integration-test/src/tests/fee/register_payee.rs index 9ddab19fe0..638800c846 100644 --- a/tools/integration-test/src/tests/fee/register_payee.rs +++ b/tools/integration-test/src/tests/fee/register_payee.rs @@ -130,7 +130,6 @@ impl BinaryChannelTest for ForwardRelayerTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/fee_grant.rs b/tools/integration-test/src/tests/fee_grant.rs index 2a0a8aa272..a936c02e20 100644 --- a/tools/integration-test/src/tests/fee_grant.rs +++ b/tools/integration-test/src/tests/fee_grant.rs @@ -42,10 +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], - &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 @@ -73,7 +70,6 @@ impl BinaryChannelTest for FeeGrantTest { thread::sleep(Duration::from_secs(5)); let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, @@ -85,13 +81,10 @@ impl BinaryChannelTest for FeeGrantTest { .first() .ok_or_else(|| eyre!("chain configuration is empty"))? { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { - chain_config.gas_price.denom.clone() - } + ChainConfig::CosmosSdk(chain_config) => chain_config.gas_price.denom.clone(), }; - let gas_denom: MonoTagged = - MonoTagged::new(Denom::base(&gas_denom_str, &gas_denom_str)); + let gas_denom: MonoTagged = MonoTagged::new(Denom::Base(gas_denom_str)); let balance_user1_before = chains .node_a @@ -111,7 +104,7 @@ impl BinaryChannelTest for FeeGrantTest { .for_each(|chain_config| { if chain_config.id() == chains.node_a.chain_id().0 { match chain_config { - ChainConfig::CosmosSdk(c) | ChainConfig::Namada(c) => { + ChainConfig::CosmosSdk(c) => { c.fee_granter = Some("user2".to_owned()); } } @@ -192,10 +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], - &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 @@ -223,7 +213,6 @@ impl BinaryChannelTest for NoFeeGrantTest { thread::sleep(Duration::from_secs(5)); let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, @@ -235,13 +224,10 @@ impl BinaryChannelTest for NoFeeGrantTest { .first() .ok_or_else(|| eyre!("chain configuration is empty"))? { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { - chain_config.gas_price.denom.clone() - } + ChainConfig::CosmosSdk(chain_config) => chain_config.gas_price.denom.clone(), }; - let gas_denom: MonoTagged = - MonoTagged::new(Denom::base(&gas_denom_str, &gas_denom_str)); + let gas_denom: MonoTagged = MonoTagged::new(Denom::Base(gas_denom_str)); let balance_user1_before = chains .node_a 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 b86211233d..f42376c5b7 100644 --- a/tools/integration-test/src/tests/forward/forward_hop_transfer.rs +++ b/tools/integration-test/src/tests/forward/forward_hop_transfer.rs @@ -67,28 +67,24 @@ impl NaryChannelTest<4> for IbcForwardHopTransferTest { let denom_a = connected_chains.node_a.denom(); let denom_b = derive_ibc_denom( - &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_b = derive_ibc_denom( - &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_c = derive_ibc_denom( - &node_c.chain_driver().value().chain_type, &channel_b_to_c.port_b.as_ref(), &channel_b_to_c.channel_id_b.as_ref(), &denom_b.as_ref(), )?; let denom_a_to_d = derive_ibc_denom( - &node_d.chain_driver().value().chain_type, &channel_c_to_d.port_b.as_ref(), &channel_c_to_d.channel_id_b.as_ref(), &denom_a_to_c.as_ref(), @@ -192,28 +188,24 @@ impl NaryChannelTest<4> for AtomicIbcForwardHopTransferTest { let denom_a = connected_chains.node_a.denom(); let denom_b = derive_ibc_denom( - &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_b = derive_ibc_denom( - &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_c = derive_ibc_denom( - &node_c.chain_driver().value().chain_type, &channel_b_to_c.port_b.as_ref(), &channel_b_to_c.channel_id_b.as_ref(), &denom_b.as_ref(), )?; let denom_a_to_d = derive_ibc_denom( - &node_d.chain_driver().value().chain_type, &channel_c_to_d.port_b.as_ref(), &channel_c_to_d.channel_id_b.as_ref(), &denom_a_to_c.as_ref(), diff --git a/tools/integration-test/src/tests/forward/forward_transfer.rs b/tools/integration-test/src/tests/forward/forward_transfer.rs index acef77d626..a9569c8528 100644 --- a/tools/integration-test/src/tests/forward/forward_transfer.rs +++ b/tools/integration-test/src/tests/forward/forward_transfer.rs @@ -85,21 +85,18 @@ impl NaryChannelTest<3> for IbcForwardTransferTest { let denom_a = connected_chains.node_a.denom(); let denom_b = derive_ibc_denom( - &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_b = derive_ibc_denom( - &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_c = derive_ibc_denom( - &node_c.chain_driver().value().chain_type, &channel_b_to_c.port_b.as_ref(), &channel_b_to_c.channel_id_b.as_ref(), &denom_b.as_ref(), @@ -191,21 +188,18 @@ impl NaryChannelTest<3> for MisspelledMemoFieldsIbcForwardTransferTest { let denom_a = connected_chains.node_a.denom(); let denom_b = derive_ibc_denom( - &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_b = derive_ibc_denom( - &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_c = derive_ibc_denom( - &node_c.chain_driver().value().chain_type, &channel_b_to_c.port_b.as_ref(), &channel_b_to_c.channel_id_b.as_ref(), &denom_b.as_ref(), @@ -440,21 +434,18 @@ impl NaryChannelTest<3> for MisspelledMemoContentIbcForwardTransferTest { let denom_a = connected_chains.node_a.denom(); let denom_b = derive_ibc_denom( - &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_b = derive_ibc_denom( - &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, )?; let denom_a_to_c = derive_ibc_denom( - &node_c.chain_driver().value().chain_type, &channel_b_to_c.port_b.as_ref(), &channel_b_to_c.channel_id_b.as_ref(), &denom_b.as_ref(), diff --git a/tools/integration-test/src/tests/ica.rs b/tools/integration-test/src/tests/ica.rs index a6fb40408f..0fe90d43ad 100644 --- a/tools/integration-test/src/tests/ica.rs +++ b/tools/integration-test/src/tests/ica.rs @@ -17,7 +17,7 @@ use ibc_relayer_types::timestamp::Timestamp; use ibc_relayer_types::tx_msg::Msg; use ibc_test_framework::chain::{ - config::cosmos::add_allow_message_interchainaccounts, + config::add_allow_message_interchainaccounts, ext::ica::{register_ordered_interchain_account, register_unordered_interchain_account}, }; use ibc_test_framework::prelude::*; @@ -71,7 +71,7 @@ impl TestOverrides for IcaFilterTestAllow { for chain in &mut config.chains { match chain { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.packet_filter = self.packet_filter.clone(); } } @@ -95,7 +95,7 @@ impl BinaryConnectionTest for IcaFilterTestAllow { connection: ConnectedConnection, ) -> Result<(), Error> { let fee_denom_host: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); + 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) = @@ -115,7 +115,7 @@ impl BinaryConnectionTest for IcaFilterTestAllow { .chain_driver() .query_interchain_account(&wallet.address(), &connection.connection_id_a.as_ref())?; - let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); chains.node_b.chain_driver().assert_eventual_wallet_amount( &ica_address.as_ref(), @@ -188,7 +188,7 @@ impl TestOverrides for IcaFilterTestDeny { for chain in &mut config.chains { match chain { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.packet_filter.channel_policy = ChannelPolicy::Deny(ChannelFilters::new(vec![( FilterPattern::Wildcard("ica*".parse().unwrap()), @@ -252,8 +252,8 @@ impl BinaryConnectionTest for ICACloseChannelTest { connection: ConnectedConnection, ) -> Result<(), Error> { let fee_denom_host: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); - let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); + 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(|| { // Register an interchain account on behalf of diff --git a/tools/integration-test/src/tests/ics20_filter/memo.rs b/tools/integration-test/src/tests/ics20_filter/memo.rs index ca696ec150..0ec207af37 100644 --- a/tools/integration-test/src/tests/ics20_filter/memo.rs +++ b/tools/integration-test/src/tests/ics20_filter/memo.rs @@ -71,7 +71,6 @@ impl BinaryChannelTest for IbcMemoFilterTest { info!("Assert that the IBC transfer was filtered"); let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/ics31.rs b/tools/integration-test/src/tests/ics31.rs index 54e7408e78..33065dc091 100644 --- a/tools/integration-test/src/tests/ics31.rs +++ b/tools/integration-test/src/tests/ics31.rs @@ -13,7 +13,7 @@ use ibc_relayer::config::{self, ModeConfig}; use ibc_test_framework::chain::{ cli::host_zone::register_host_zone, - config::cosmos::{ + config::{ set_crisis_denom, set_mint_mint_denom, set_staking_bond_denom, set_staking_max_entries, set_voting_period, }, @@ -101,7 +101,6 @@ impl BinaryChannelTest for ICS31Test { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, 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 index e45d3dfd78..3d2f217554 100644 --- a/tools/integration-test/src/tests/interchain_security/dynamic_gas_fee.rs +++ b/tools/integration-test/src/tests/interchain_security/dynamic_gas_fee.rs @@ -80,7 +80,7 @@ impl TestOverrides for DynamicGasTest { update_relayer_config_for_consumer_chain(config); match &mut config.chains[0] { - ChainConfig::CosmosSdk(chain_config_a) | ChainConfig::Namada(chain_config_a) => { + ChainConfig::CosmosSdk(chain_config_a) => { chain_config_a.gas_price = GasPrice::new(0.3, chain_config_a.gas_price.denom.clone()); @@ -89,7 +89,7 @@ impl TestOverrides for DynamicGasTest { } match &mut config.chains[1] { - ChainConfig::CosmosSdk(chain_config_b) | ChainConfig::Namada(chain_config_b) => { + ChainConfig::CosmosSdk(chain_config_b) => { chain_config_b.gas_price = GasPrice::new(0.3, chain_config_b.gas_price.denom.clone()); @@ -121,14 +121,15 @@ impl BinaryChannelTest for DynamicGasTest { let a_to_b_amount = 12345u64; let denom_a_to_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, )?; - let gas_denom_a: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); - let gas_denom_b: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); + 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(), @@ -184,7 +185,6 @@ impl BinaryChannelTest for DynamicGasTest { let denom_b = chains.node_b.denom(); let denom_b_to_a = derive_ibc_denom( - &chains.node_a.chain_driver().value().chain_type, &channel.port_a.as_ref(), &channel.channel_id_a.as_ref(), &denom_b, 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 651a96f404..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 @@ -17,7 +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::cosmos::add_allow_message_interchainaccounts; +use ibc_test_framework::chain::config::add_allow_message_interchainaccounts; 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::*; @@ -72,7 +72,7 @@ impl BinaryChannelTest for IcaOrderedChannelTest { channel: ConnectedChannel, ) -> Result<(), Error> { let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(0), config.native_token(0))); + MonoTagged::new(Denom::base(config.native_token(0))); let connection_b_to_a = channel.connection.clone().flip(); let (wallet, channel_id, port_id) = register_ordered_interchain_account( &chains.node_b, @@ -104,7 +104,7 @@ impl BinaryChannelTest for IcaOrderedChannelTest { &channel.connection.connection_id_b.as_ref(), )?; - let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); chains.node_a.chain_driver().assert_eventual_wallet_amount( &ica_address.as_ref(), 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 dfedfc9951..ec12f6b591 100644 --- a/tools/integration-test/src/tests/interchain_security/ica_transfer.rs +++ b/tools/integration-test/src/tests/interchain_security/ica_transfer.rs @@ -11,7 +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::cosmos::add_allow_message_interchainaccounts; +use ibc_test_framework::chain::config::add_allow_message_interchainaccounts; 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::*; @@ -55,7 +55,7 @@ impl BinaryChannelTest for InterchainSecurityIcaTransferTest { channel: ConnectedChannel, ) -> Result<(), Error> { let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(0), config.native_token(0))); + MonoTagged::new(Denom::base(config.native_token(0))); let connection_b_to_a = channel.connection.clone().flip(); let (wallet, channel_id, port_id) = register_unordered_interchain_account( &chains.node_b, @@ -77,7 +77,7 @@ impl BinaryChannelTest for InterchainSecurityIcaTransferTest { &channel.connection.connection_id_b.as_ref(), )?; - let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake", "stake")); + let stake_denom: MonoTagged = MonoTagged::new(Denom::base("stake")); chains.node_a.chain_driver().assert_eventual_wallet_amount( &ica_address.as_ref(), diff --git a/tools/integration-test/src/tests/interchain_security/icq.rs b/tools/integration-test/src/tests/interchain_security/icq.rs index 5e940b7055..19f2a84efb 100644 --- a/tools/integration-test/src/tests/interchain_security/icq.rs +++ b/tools/integration-test/src/tests/interchain_security/icq.rs @@ -11,7 +11,7 @@ use ibc_relayer::config::ChainConfig; use ibc_test_framework::chain::cli::host_zone::register_host_zone; -use ibc_test_framework::chain::config::cosmos::{ +use ibc_test_framework::chain::config::{ set_crisis_denom, set_mint_mint_denom, set_staking_bond_denom, set_staking_max_entries, set_voting_period, }; @@ -92,7 +92,7 @@ impl TestOverrides for InterchainSecurityIcqTest { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.allow_ccq = self.allow_ccq; } } @@ -130,7 +130,6 @@ impl BinaryChannelTest for InterchainSecurityIcqTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, 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 1d6afed1e5..05317917ed 100644 --- a/tools/integration-test/src/tests/interchain_security/simple_transfer.rs +++ b/tools/integration-test/src/tests/interchain_security/simple_transfer.rs @@ -69,7 +69,6 @@ impl BinaryChannelTest for InterchainSecurityTransferTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/manual/simulation.rs b/tools/integration-test/src/tests/manual/simulation.rs index 827f4ba969..30c801bfcf 100644 --- a/tools/integration-test/src/tests/manual/simulation.rs +++ b/tools/integration-test/src/tests/manual/simulation.rs @@ -29,7 +29,7 @@ impl TestOverrides for SimulationTest { fn modify_relayer_config(&self, config: &mut Config) { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.max_msg_num = MaxMsgNum::new(MAX_MSGS).unwrap(); } } diff --git a/tools/integration-test/src/tests/memo.rs b/tools/integration-test/src/tests/memo.rs index 79483127ef..cf59bb712d 100644 --- a/tools/integration-test/src/tests/memo.rs +++ b/tools/integration-test/src/tests/memo.rs @@ -6,7 +6,6 @@ use ibc_relayer::config::types::Memo; use ibc_relayer::config::ChainConfig; -use ibc_test_framework::util::namada::query_receive_tx_memo; use serde_json as json; use ibc_test_framework::prelude::*; @@ -36,7 +35,7 @@ impl TestOverrides for MemoTest { fn modify_relayer_config(&self, config: &mut Config) { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.memo_prefix = self.memo.clone(); } } @@ -70,7 +69,6 @@ impl BinaryChannelTest for MemoTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -81,7 +79,12 @@ impl BinaryChannelTest for MemoTest { &denom_b.with_amount(a_to_b_amount).as_ref(), )?; - assert_tx_memo_equals(&chains, &channel, self.memo.as_str())?; + let tx_info = chains + .node_b + .chain_driver() + .query_recipient_transactions(&chains.node_b.wallets().user1().address())?; + + assert_tx_memo_equals(&tx_info, self.memo.as_str())?; Ok(()) } @@ -95,7 +98,7 @@ 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) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.memo_prefix = self.memo.clone(); chain_config.memo_overwrite = Some(Memo::new(OVERWRITE_MEMO).unwrap()) } @@ -130,7 +133,6 @@ impl BinaryChannelTest for MemoOverwriteTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -141,13 +143,18 @@ impl BinaryChannelTest for MemoOverwriteTest { &denom_b.with_amount(a_to_b_amount).as_ref(), )?; - assert_tx_memo_equals(&chains, &channel, OVERWRITE_MEMO)?; + 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 get_tx_memo(tx_info: &json::Value) -> Result { +fn assert_tx_memo_equals(tx_info: &json::Value, expected_memo: &str) -> Result<(), Error> { debug!("comparing memo field from json value {}", tx_info); let memo_field = &tx_info["txs"][0]["tx"]["body"]["memo"]; @@ -158,44 +165,7 @@ fn get_tx_memo(tx_info: &json::Value) -> Result { .as_str() .ok_or_else(|| eyre!("expect memo string field to be present in JSON"))?; - Ok(memo_str.to_string()) -} - -fn assert_tx_memo_equals( - chains: &ConnectedChains, - channel: &ConnectedChannel, - expected_memo: &str, -) -> Result<(), Error> { - let memo = match chains.handle_b().config().expect("Config should exist") { - ChainConfig::Namada(config) => { - chains - .node_b - .chain_driver() - .value() - .runtime - .block_on(query_receive_tx_memo( - config - .rpc_addr - .to_string() - .parse() - .expect("RPC address should be converted"), - channel.port_a.value(), - channel.channel_id_a.value(), - channel.port_b.value(), - channel.channel_id_b.value(), - 1.into(), - ))? - } - _ => { - let tx_info = chains - .node_b - .chain_driver() - .query_recipient_transactions(&chains.node_b.wallets().user1().address())?; - - get_tx_memo(&tx_info)? - } - }; - assert_eq!(memo, expected_memo); + assert_eq!(memo_str, expected_memo); Ok(()) } diff --git a/tools/integration-test/src/tests/mod.rs b/tools/integration-test/src/tests/mod.rs index d5e6411d8f..e8812377d6 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 = "namada")))] +#[cfg(not(feature = "celestia"))] pub mod client_upgrade; pub mod connection_delay; pub mod consensus_states; @@ -21,12 +21,13 @@ pub mod execute_schedule; pub mod handshake_on_start; pub mod ics20_filter; pub mod memo; -#[cfg(not(feature = "namada"))] pub mod python; pub mod query_packet; +#[cfg(not(feature = "celestia"))] +pub mod sequence_filter; pub mod supervisor; pub mod tendermint; -#[cfg(not(any(feature = "celestia")))] +#[cfg(not(feature = "celestia"))] pub mod ternary_transfer; pub mod transfer; diff --git a/tools/integration-test/src/tests/ordered_channel.rs b/tools/integration-test/src/tests/ordered_channel.rs index 1d9b3b99da..a72126d3f2 100644 --- a/tools/integration-test/src/tests/ordered_channel.rs +++ b/tools/integration-test/src/tests/ordered_channel.rs @@ -94,7 +94,6 @@ impl BinaryChannelTest for OrderedChannelTest { sleep(Duration::from_secs(1)); let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/ordered_channel_clear.rs b/tools/integration-test/src/tests/ordered_channel_clear.rs index f687196419..ed6e124e64 100644 --- a/tools/integration-test/src/tests/ordered_channel_clear.rs +++ b/tools/integration-test/src/tests/ordered_channel_clear.rs @@ -51,7 +51,7 @@ impl TestOverrides for OrderedChannelClearTest { { let chain_a = &mut config.chains[0]; match chain_a { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.sequential_batch_tx = self.sequential_batch_tx; } } @@ -59,7 +59,7 @@ impl TestOverrides for OrderedChannelClearTest { let chain_b = &mut config.chains[1]; match chain_b { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.sequential_batch_tx = self.sequential_batch_tx; } } @@ -157,7 +157,6 @@ impl BinaryChannelTest for OrderedChannelClearTest { sleep(Duration::from_secs(10)); let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, @@ -197,7 +196,7 @@ impl TestOverrides for OrderedChannelClearEqualCLITest { { let chain_a = &mut config.chains[0]; match chain_a { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.sequential_batch_tx = true; chain_config.max_msg_num = MaxMsgNum::new(3).unwrap(); } @@ -206,7 +205,7 @@ impl TestOverrides for OrderedChannelClearEqualCLITest { let chain_b = &mut config.chains[1]; match chain_b { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.sequential_batch_tx = true; chain_config.max_msg_num = MaxMsgNum::new(3).unwrap(); } diff --git a/tools/integration-test/src/tests/python.rs b/tools/integration-test/src/tests/python.rs index 96c77e8ba1..29d6457885 100644 --- a/tools/integration-test/src/tests/python.rs +++ b/tools/integration-test/src/tests/python.rs @@ -10,7 +10,7 @@ impl TestOverrides for PythonTest { fn modify_relayer_config(&self, config: &mut Config) { for chain in config.chains.iter_mut() { match chain { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { // Modify the key store type to `Store::Test` so that the wallet // keys are stored to ~/.hermes/keys so that we can use them // with external relayer commands. diff --git a/tools/integration-test/src/tests/sequence_filter.rs b/tools/integration-test/src/tests/sequence_filter.rs index 52e80d8f5a..a880f7720e 100644 --- a/tools/integration-test/src/tests/sequence_filter.rs +++ b/tools/integration-test/src/tests/sequence_filter.rs @@ -52,7 +52,7 @@ impl TestOverrides for FilterClearOnStartTest { excluded_sequences.insert(ChannelId::new(2), vec![2.into()]); let chain_a = &mut config.chains[0]; match chain_a { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.excluded_sequences = ExcludedSequences::new(excluded_sequences); } } @@ -89,7 +89,7 @@ impl TestOverrides for FilterClearIntervalTest { excluded_sequences.insert(ChannelId::new(2), vec![2.into()]); let chain_a = &mut config.chains[0]; match chain_a { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.excluded_sequences = ExcludedSequences::new(excluded_sequences); } } @@ -248,7 +248,7 @@ impl TestOverrides for StandardRelayingNoFilterTest { excluded_sequences.insert(ChannelId::new(2), vec![2.into()]); let chain_a = &mut config.chains[0]; match chain_a { - ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { + ChainConfig::CosmosSdk(chain_config) => { chain_config.excluded_sequences = ExcludedSequences::new(excluded_sequences); } } diff --git a/tools/integration-test/src/tests/supervisor.rs b/tools/integration-test/src/tests/supervisor.rs index 5ff051962c..17ee1b5af7 100644 --- a/tools/integration-test/src/tests/supervisor.rs +++ b/tools/integration-test/src/tests/supervisor.rs @@ -56,9 +56,9 @@ impl BinaryChainTest for SupervisorTest { chains: ConnectedChains, ) -> Result<(), Error> { let fee_denom_a: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(0), config.native_token(0))); + MonoTagged::new(Denom::base(config.native_token(0))); let fee_denom_b: MonoTagged = - MonoTagged::new(Denom::base(config.native_token(1), config.native_token(1))); + MonoTagged::new(Denom::base(config.native_token(1))); let (connection_id_b, _) = init_connection( &chains.handle_a, &chains.handle_b, @@ -95,12 +95,7 @@ impl BinaryChainTest for SupervisorTest { let denom_a = chains.node_a.denom(); - let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, - &port_b.as_ref(), - &channel_id_b.as_ref(), - &denom_a, - )?; + let denom_b = derive_ibc_denom(&port_b.as_ref(), &channel_id_b.as_ref(), &denom_a)?; // Use the same wallet as the relayer to perform token transfer. // This will cause an account sequence mismatch error. @@ -204,13 +199,9 @@ 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], - &config.native_tokens[0], - )); + let fee_denom_a = MonoTagged::new(Denom::base(config.native_token(0))); let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channels.port_b.as_ref(), &channels.channel_id_b.as_ref(), &denom_a, diff --git a/tools/integration-test/src/tests/tendermint/sequential.rs b/tools/integration-test/src/tests/tendermint/sequential.rs index 6bd106dc53..be9d254873 100644 --- a/tools/integration-test/src/tests/tendermint/sequential.rs +++ b/tools/integration-test/src/tests/tendermint/sequential.rs @@ -3,7 +3,6 @@ use std::time::Instant; use ibc_relayer::chain::tracking::TrackedMsgs; use ibc_relayer::config::types::max_msg_num::MaxMsgNum; use ibc_relayer::config::ChainConfig; -use ibc_test_framework::chain::chain_type::ChainType; use ibc_test_framework::chain::config; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::transfer::build_transfer_message; @@ -23,20 +22,11 @@ pub struct SequentialCommitTest; impl TestOverrides for SequentialCommitTest { fn modify_node_config(&self, config: &mut toml::Value) -> Result<(), Error> { - let config = if let Some(config) = config.get_mut("ledger") { - // Namada - config - .get_mut("cometbft") - .ok_or_else(|| eyre!("expect cometbft section"))? - } else { - config - }; - - config::cosmos::set_timeout_commit(config, BLOCK_TIME)?; - config::cosmos::set_timeout_propose(config, BLOCK_TIME)?; + config::set_timeout_commit(config, BLOCK_TIME)?; + config::set_timeout_propose(config, BLOCK_TIME)?; // Enable priority mempool - config::cosmos::set_mempool_version(config, "v1")?; + config::set_mempool_version(config, "v1")?; Ok(()) } @@ -44,14 +34,14 @@ impl TestOverrides for SequentialCommitTest { fn modify_relayer_config(&self, config: &mut Config) { // Use sequential batching for chain A, and default parallel batching for chain B match &mut config.chains[0] { - ChainConfig::CosmosSdk(chain_config_a) | ChainConfig::Namada(chain_config_a) => { + ChainConfig::CosmosSdk(chain_config_a) => { chain_config_a.max_msg_num = MaxMsgNum::new(MESSAGES_PER_BATCH).unwrap(); chain_config_a.sequential_batch_tx = true; } }; match &mut config.chains[1] { - ChainConfig::CosmosSdk(chain_config_b) | ChainConfig::Namada(chain_config_b) => { + ChainConfig::CosmosSdk(chain_config_b) => { chain_config_b.max_msg_num = MaxMsgNum::new(MESSAGES_PER_BATCH).unwrap(); chain_config_b.sequential_batch_tx = false; } @@ -77,22 +67,20 @@ impl BinaryChannelTest for SequentialCommitTest { { let denom_a = chains.node_a.denom(); - let mut transfer_messages = Vec::new(); - for i in 0..TOTAL_MESSAGES { - let transfer_message = build_transfer_message( - &channel.port_a.as_ref(), - &channel.channel_id_a.as_ref(), - &wallet_a.as_ref(), - &wallet_b.address(), - &denom_a.with_amount(100u64).as_ref(), - Duration::from_secs(30), - // Namada batch transaction can't have the exact same message - Some(i.to_string()), - )?; - transfer_messages.push(transfer_message); - } - - let messages = TrackedMsgs::new_static(transfer_messages, "test_sequential_commit"); + let transfer_message = build_transfer_message( + &channel.port_a.as_ref(), + &channel.channel_id_a.as_ref(), + &wallet_a.as_ref(), + &wallet_b.address(), + &denom_a.with_amount(100u64).as_ref(), + Duration::from_secs(30), + None, + )?; + + let messages = TrackedMsgs::new_static( + vec![transfer_message; TOTAL_MESSAGES], + "test_error_events", + ); let start = Instant::now(); @@ -107,49 +95,35 @@ impl BinaryChannelTest for SequentialCommitTest { TOTAL_MESSAGES, duration ); - let (min_duration, max_duration) = match chains.node_a.chain_driver().value().chain_type - { - ChainType::Namada => ( - Duration::from_millis((BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) - 1000), - Duration::from_millis( - (BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64 * 2) + 1000, - ), - ), - _ => { - // Time taken for submitting sequential batches should be around number of transactions * block time - ( - Duration::from_millis( - (BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) - 1000, - ), - Duration::from_millis( - (BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) + 1000, - ), - ) - } - }; - assert!(duration > min_duration); - assert!(duration < max_duration); + // Time taken for submitting sequential batches should be around number of transactions * block time + + assert!( + duration + > Duration::from_millis((BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) - 1000) + ); + assert!( + duration + < Duration::from_millis((BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) + 1000) + ); } { let denom_b = chains.node_b.denom(); - let mut transfer_messages = Vec::new(); - for i in 0..TOTAL_MESSAGES { - let transfer_message = build_transfer_message( - &channel.port_b.as_ref(), - &channel.channel_id_b.as_ref(), - &wallet_b.as_ref(), - &wallet_a.address(), - &denom_b.with_amount(100u64).as_ref(), - Duration::from_secs(30), - // Namada batch transaction can't have the exact same message - Some(i.to_string()), - )?; - transfer_messages.push(transfer_message); - } - - let messages = TrackedMsgs::new_static(transfer_messages, "test_sequential_commit"); + let transfer_message = build_transfer_message( + &channel.port_b.as_ref(), + &channel.channel_id_b.as_ref(), + &wallet_b.as_ref(), + &wallet_a.address(), + &denom_b.with_amount(100u64).as_ref(), + Duration::from_secs(30), + None, + )?; + + let messages = TrackedMsgs::new_static( + vec![transfer_message; TOTAL_MESSAGES], + "test_error_events", + ); let start = Instant::now(); @@ -167,14 +141,7 @@ impl BinaryChannelTest for SequentialCommitTest { TOTAL_MESSAGES, duration ); - let max_duration = match chains.node_b.chain_driver().value().chain_type { - ChainType::Namada => { - // Shorter than the sequential batches - Duration::from_millis(BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64 * 2) - } - _ => Duration::from_millis(BLOCK_TIME_MILLIS * 2), - }; - assert!(duration < max_duration); + assert!(duration < Duration::from_millis(BLOCK_TIME_MILLIS * 2)); } Ok(()) diff --git a/tools/integration-test/src/tests/ternary_transfer.rs b/tools/integration-test/src/tests/ternary_transfer.rs index 945c1e8417..527c085629 100644 --- a/tools/integration-test/src/tests/ternary_transfer.rs +++ b/tools/integration-test/src/tests/ternary_transfer.rs @@ -66,7 +66,6 @@ impl NaryChannelTest<3> for TernaryIbcTransferTest { )?; let denom_a_to_b = derive_ibc_denom( - &node_b.chain_driver().value().chain_type, &channel_a_to_b.port_b.as_ref(), &channel_a_to_b.channel_id_b.as_ref(), &denom_a, @@ -98,7 +97,6 @@ impl NaryChannelTest<3> for TernaryIbcTransferTest { let channel_b_to_c = channels.channel_at::<1, 2>()?; let denom_a_to_c = derive_ibc_denom( - &node_c.chain_driver().value().chain_type, &channel_b_to_c.port_b.as_ref(), &channel_b_to_c.channel_id_b.as_ref(), &denom_a_to_b.as_ref(), @@ -136,7 +134,6 @@ impl NaryChannelTest<3> for TernaryIbcTransferTest { let channel_c_to_a = channels.channel_at::<2, 0>()?; let denom_a_to_c_to_a = derive_ibc_denom( - &node_a.chain_driver().value().chain_type, &channel_c_to_a.port_b.as_ref(), &channel_c_to_a.channel_id_b.as_ref(), &denom_a_to_c.as_ref(), diff --git a/tools/integration-test/src/tests/transfer.rs b/tools/integration-test/src/tests/transfer.rs index 3e2a4cf014..f117dc742f 100644 --- a/tools/integration-test/src/tests/transfer.rs +++ b/tools/integration-test/src/tests/transfer.rs @@ -69,7 +69,7 @@ impl BinaryChannelTest for IbcTransferTest { chains.chain_id_a(), chains.chain_id_b(), a_to_b_amount, - denom_a, + denom_a ); chains.node_a.chain_driver().ibc_transfer_token( @@ -81,15 +81,14 @@ impl BinaryChannelTest for IbcTransferTest { )?; let denom_b = derive_ibc_denom( - &chains.node_b.chain_driver().value().chain_type, &channel.port_b.as_ref(), &channel.channel_id_b.as_ref(), &denom_a, )?; info!( - "Waiting for user on chain B to receive IBC transferred amount of {} {}", - a_to_b_amount, denom_b, + "Waiting for user on chain B to receive IBC transferred amount of {}", + a_to_b_amount ); chains.node_a.chain_driver().assert_eventual_wallet_amount( @@ -116,11 +115,10 @@ impl BinaryChannelTest for IbcTransferTest { let b_to_a_amount = random_u128_range(500, a_to_b_amount); info!( - "Sending IBC transfer from chain {} to chain {} with amount of {} {}", + "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( @@ -131,12 +129,6 @@ impl BinaryChannelTest for IbcTransferTest { &denom_b.with_amount(b_to_a_amount).as_ref(), )?; - info!( - "Waiting for user on chain A to receive IBC transferred amount of {} {}", - b_to_a_amount, - balance_c.denom(), - ); - chains.node_b.chain_driver().assert_eventual_wallet_amount( &wallet_b.address(), &denom_b.with_amount(a_to_b_amount - b_to_a_amount).as_ref(), diff --git a/tools/test-framework/Cargo.toml b/tools/test-framework/Cargo.toml index 8c83399bf9..50839dfd63 100644 --- a/tools/test-framework/Cargo.toml +++ b/tools/test-framework/Cargo.toml @@ -18,14 +18,8 @@ ibc-relayer-types = { workspace = true } ibc-relayer = { workspace = true } ibc-relayer-cli = { workspace = true } ibc-proto = { workspace = true, features = ["serde"] } -namada_sdk = { workspace = true } -tendermint = { workspace = true } tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } -# for Namada -namada-tendermint = { workspace = true } -namada-tendermint-rpc = { workspace = true, features = ["http-client", "websocket-client"] } - color-eyre = { workspace = true } crossbeam-channel = { workspace = true } eyre = { workspace = true } diff --git a/tools/test-framework/src/bootstrap/binary/chain.rs b/tools/test-framework/src/bootstrap/binary/chain.rs index 750c56d794..365c079e8c 100644 --- a/tools/test-framework/src/bootstrap/binary/chain.rs +++ b/tools/test-framework/src/bootstrap/binary/chain.rs @@ -67,9 +67,6 @@ pub fn bootstrap_chains_with_full_nodes( let registry = new_registry(config.clone()); - // Wait before spawning the chain handle - std::thread::sleep(Duration::from_secs(10)); - // Pass in unique closure expressions `||{}` as the first argument so that // the returned chains are considered different types by Rust. // See [`spawn_chain_handle`] for more details. @@ -214,7 +211,7 @@ pub fn add_key_to_chain_handle( chain: &Chain, wallet: &Wallet, ) -> Result<(), Error> { - let res = chain.add_key(wallet.id.0.clone(), wallet.key.clone()); + let res = chain.add_key(wallet.id.0.clone(), wallet.key.clone().into()); // Ignore error if chain handle already have the given key match res { diff --git a/tools/test-framework/src/bootstrap/consumer.rs b/tools/test-framework/src/bootstrap/consumer.rs index e5acabc87a..c473ab6c28 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; @@ -26,9 +25,9 @@ pub fn bootstrap_consumer_node( provider_chain_driver: &ChainDriver, provider_fee: &String, ) -> Result { - let stake_denom = Denom::base("stake", "stake"); + let stake_denom = Denom::base("stake"); - let denom = Denom::base("samoleans", "samoleans"); + let denom = Denom::base("samoleans"); let initial_amount = random_u128_range(1_000_000_000_000_000_000, 2_000_000_000_000_000_000); @@ -86,34 +85,34 @@ pub fn bootstrap_consumer_node( } ]); chain_driver.update_genesis_file("genesis.json", |genesis| { - config::cosmos::set_soft_opt_out_threshold(genesis, "0.05")?; - config::cosmos::consensus_params_max_gas(genesis, "3000000")?; - config::cosmos::globalfee_minimum_gas_prices(genesis, globalfee_minimum_gas)?; - config::cosmos::set_retry_delay_period(genesis, "100s")?; + 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(()) })?; let log_level = std::env::var("CHAIN_LOG_LEVEL").unwrap_or_else(|_| "info".to_string()); - chain_driver.update_chain_config("config/config.toml", |config| { - config::cosmos::set_log_level(config, &log_level)?; - config::cosmos::set_rpc_port(config, chain_driver.rpc_port)?; - config::cosmos::set_p2p_port(config, chain_driver.p2p_port)?; - config::cosmos::set_pprof_port(config, chain_driver.pprof_port)?; - config::cosmos::set_timeout_commit(config, Duration::from_secs(1))?; - config::cosmos::set_timeout_propose(config, Duration::from_secs(1))?; - config::cosmos::set_mode(config, "validator")?; + chain_driver.update_chain_config("config.toml", |config| { + config::set_log_level(config, &log_level)?; + config::set_rpc_port(config, chain_driver.rpc_port)?; + config::set_p2p_port(config, chain_driver.p2p_port)?; + config::set_pprof_port(config, chain_driver.pprof_port)?; + config::set_timeout_commit(config, Duration::from_secs(1))?; + config::set_timeout_propose(config, Duration::from_secs(1))?; + config::set_mode(config, "validator")?; config_modifier(config)?; Ok(()) })?; - chain_driver.update_chain_config("config/app.toml", |config| { - config::cosmos::set_grpc_port(config, chain_driver.grpc_port)?; - config::cosmos::disable_grpc_web(config)?; - config::cosmos::disable_api(config)?; - config::cosmos::set_minimum_gas_price(config, "0stake")?; + chain_driver.update_chain_config("app.toml", |config| { + config::set_grpc_port(config, chain_driver.grpc_port)?; + config::disable_grpc_web(config)?; + config::disable_api(config)?; + config::set_minimum_gas_price(config, "0stake")?; Ok(()) })?; diff --git a/tools/test-framework/src/bootstrap/mod.rs b/tools/test-framework/src/bootstrap/mod.rs index b31132f5b6..17216d9455 100644 --- a/tools/test-framework/src/bootstrap/mod.rs +++ b/tools/test-framework/src/bootstrap/mod.rs @@ -14,6 +14,5 @@ pub mod binary; pub mod consumer; pub mod init; -pub mod namada; pub mod nary; pub mod single; diff --git a/tools/test-framework/src/bootstrap/namada.rs b/tools/test-framework/src/bootstrap/namada.rs deleted file mode 100644 index 608a35f6ce..0000000000 --- a/tools/test-framework/src/bootstrap/namada.rs +++ /dev/null @@ -1,328 +0,0 @@ -/*! - Helper functions for bootstrapping a single full node. -*/ -use core::time::Duration; -use eyre::eyre; -use std::env; -use std::path::PathBuf; -use std::sync::{Arc, RwLock}; -use toml; - -use ibc_relayer::chain::namada::wallet::CliWalletUtils; -use ibc_relayer::keyring::{KeyRing, NamadaKeyPair, Store}; -use ibc_relayer_types::core::ics24_host::identifier::ChainId; - -use crate::chain::builder::ChainBuilder; -use crate::chain::config; -use crate::chain::exec::{simple_exec, simple_exec_with_envs}; -use crate::chain::ext::bootstrap::ChainBootstrapMethodsExt; -use crate::error::Error; -use crate::ibc::denom::Denom; -use crate::prelude::{TestWallets, Wallet}; -use crate::types::single::node::FullNode; -use crate::util::namada::get_namada_denom_address; - -use std::fs; -use std::process::{Command, Stdio}; -use std::str; -use std::thread::sleep; - -use crate::types::process::ChildProcess; -use crate::util::file::pipe_to_file; - -/** - Bootstrap a single Namada full node with the provided [`ChainBuilder`] and - a prefix for the chain ID. - - The bootstrap function follows the commands and configurations done in the - the setup-namada-single-node script found in the scripts/ directory. -*/ -pub fn bootstrap_namada_node( - builder: &ChainBuilder, - prefix: &str, - use_random_id: bool, - config_modifier: impl FnOnce(&mut toml::Value) -> Result<(), Error>, - _genesis_modifier: impl FnOnce(&mut serde_json::Value) -> Result<(), Error>, - parameters_modifier: impl FnOnce(&mut toml::Value) -> Result<(), Error>, - chain_number: usize, -) -> Result { - let namada_repo_path = env::var("NAMADA_REPO_PATH") - .map_err(|_| Error::generic(eyre!("missing environment variable `NAMADA_REPO_PATH")))?; - let chain_driver = builder.new_chain(prefix, use_random_id, chain_number)?; - let home_path = &chain_driver.home_path; - let templates_path = &format!("{home_path}/templates"); - fs::create_dir_all(templates_path)?; - - // Copy templates - let copy_loop = format!("for file in {namada_repo_path}/genesis/localnet/*.toml; do cp \"$file\" {templates_path}; done"); - simple_exec("namada", "sh", &["-c", ©_loop])?; - - chain_driver.update_chain_config("templates/parameters.toml", |parameters| { - config::namada::set_default_mint_limit(parameters, i64::MAX)?; - config::namada::set_epochs_per_year(parameters, 31536)?; - config::namada::set_default_per_epoch_throughput_limit(parameters, i64::MAX)?; - config::namada::set_pipeline_len(parameters, 2000)?; - - parameters_modifier(parameters)?; - - Ok(()) - })?; - - let pre_genesis_path = &format!("{home_path}/pre-genesis"); - fs::create_dir_all(pre_genesis_path)?; - - // Copy pre-genesis - let copy_loop = format!("for file in {namada_repo_path}/genesis/localnet/src/pre-genesis/*; do cp \"$file\" {pre_genesis_path}; done"); - simple_exec("namada", "sh", &["-c", ©_loop])?; - simple_exec( - "namada", - "cp", - &[ - "-r", - &format!("{namada_repo_path}/genesis/localnet/src/pre-genesis/validator-0"), - pre_genesis_path, - ], - )?; - - let genesis_path = &format!("{home_path}/genesis"); - fs::create_dir_all(genesis_path)?; - - let wasm_dir = &format!("{namada_repo_path}/wasm"); - let wasm_checksum = &format!("{wasm_dir}/checksums.json"); - - // Init network - let output = simple_exec_with_envs( - "namada", - "namadac", - &[ - "utils", - "init-network", - "--chain-prefix", - &chain_driver.chain_id.to_string(), - "--genesis-time", - "2023-01-01T00:00:00.000000000+00:00", - "--templates-path", - templates_path, - "--wasm-checksums-path", - wasm_checksum, - "--archive-dir", - genesis_path, - "--wasm-dir", - wasm_dir, - ], - &[("NAMADA_BASE_DIR", home_path)], - )?; - - let chain_id = extract_chain_id(output.stdout)?; - - let validator_base_dir = &format!("{home_path}/setup/validator-0"); - let pre_genesis_path = &format!("{home_path}/pre-genesis/validator-0"); - - // TODO: workaround a bug of specifying the wasm directory in Namada v0.43.0 - let cur_dir = std::env::current_dir()?; - std::env::set_current_dir(&namada_repo_path)?; - simple_exec_with_envs( - &chain_id, - "namadac", - &[ - "--base-dir", - validator_base_dir, - "utils", - "join-network", - "--chain-id", - &chain_id, - "--genesis-validator", - "validator-0", - "--pre-genesis-path", - pre_genesis_path, - ], - &[("NAMADA_NETWORK_CONFIGS_DIR", genesis_path)], - )?; - - let chain_dir = &format!("{home_path}/{chain_id}"); - simple_exec("namada", "rm", &["-rf", chain_dir])?; - - simple_exec_with_envs( - &chain_id, - "namadac", - &[ - "--base-dir", - home_path, - "utils", - "join-network", - "--chain-id", - &chain_id, - ], - &[("NAMADA_NETWORK_CONFIGS_DIR", genesis_path)], - )?; - std::env::set_current_dir(cur_dir)?; - - let config_path = format!("{home_path}/setup/validator-0/{chain_id}/config.toml"); - - chain_driver.update_chain_config(&config_path, |config| { - config::namada::set_rpc_port(config, chain_driver.rpc_port)?; - config::namada::set_p2p_port(config, chain_driver.p2p_port)?; - config::namada::set_proxy_app_port(config, chain_driver.pprof_port)?; - config::namada::set_block_cache_bytes(config, 268435456)?; - - config_modifier(config)?; - - Ok(()) - })?; - - let base_args = ["--base-dir", validator_base_dir, "ledger", "run"]; - - let args: Vec<&str> = base_args.to_vec(); - - let mut child = Command::new("namadan") - .args(&args) - .stdin(Stdio::null()) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()) - .spawn()?; - - let stdout = child - .stdout - .take() - .ok_or_else(|| eyre!("expected stdout to be present in child process"))?; - - let stderr = child - .stderr - .take() - .ok_or_else(|| eyre!("expected stderr to be present in child process"))?; - - let stderr_path = format!("{home_path}/stdout.log"); - let stdout_path = format!("{home_path}/stderr.log"); - - pipe_to_file(stdout, &stdout_path)?; - pipe_to_file(stderr, &stderr_path)?; - - // Wait for a while and check if the child process exited immediately. - // If so, return error since we expect the full node to be running in the background. - - sleep(Duration::from_millis(2000)); - - let status = child - .try_wait() - .map_err(|e| eyre!("error try waiting for child status: {}", e))?; - - let process = match status { - None => ChildProcess::new(child), - Some(status) => { - let stdout_output = fs::read_to_string(stdout_path)?; - let stderr_output = fs::read_to_string(stderr_path)?; - - return Err(eyre!( - "expected full node process to be running, but it exited immediately with exit status {} and output: {}\n{}", - status, - stdout_output, - stderr_output, - ).into()); - } - }; - - let ks_folder = Some(format!("{}/hermes_keyring", builder.base_store_dir).into()); - - let albert_key = add_namada_key(home_path, &chain_id, "albert-key", "albert", &ks_folder)?; - let bertha_key = add_namada_key(home_path, &chain_id, "bertha-key", "bertha", &ks_folder)?; - let christel_key = - add_namada_key(home_path, &chain_id, "christel-key", "christel", &ks_folder)?; - let daewon_key = add_namada_key(home_path, &chain_id, "daewon", "daewon", &ks_folder)?; - - let albert = Wallet::new_namada( - "albert".to_string(), - albert_key.address.to_string(), - albert_key, - ); - let bertha = Wallet::new_namada( - "bertha".to_string(), - bertha_key.address.to_string(), - bertha_key, - ); - let christel = Wallet::new_namada( - "christel".to_string(), - christel_key.address.to_string(), - christel_key, - ); - let daewon = Wallet::new_namada( - "daewon".to_string(), - daewon_key.address.to_string(), - daewon_key, - ); - - let wallets = TestWallets { - validator: albert, - relayer: bertha, - user1: christel, - user2: daewon, - }; - - sleep(Duration::from_secs(10)); - - let mut updated_chain_driver = chain_driver.clone(); - updated_chain_driver.chain_id = ChainId::from_string(&chain_id); - - let denom_str = get_namada_denom_address(&chain_id, home_path, "nam")?; - let denom = Denom::base("nam", &denom_str); - - let node = FullNode { - chain_driver: updated_chain_driver, - denom, - wallets, - process: Arc::new(RwLock::new(process)), - }; - - Ok(node) -} - -fn extract_chain_id(output: String) -> Result { - let words: Vec<&str> = output.split_whitespace().collect(); - - if let Some(derived_index) = words.iter().position(|&w| w == "Derived") { - if let Some(&chain_id) = words.get(derived_index + 3) { - return Ok(chain_id.to_owned()); - } - return Err(Error::generic(eyre!( - "chain id is not 3 words after `Derived`: {output}" - ))); - } - Err(Error::generic(eyre!( - "could not find `Derived` in output: {output}" - ))) -} - -fn add_namada_key( - home_path: &str, - chain_id: &str, - key_name: &str, - address_name: &str, - ks_folder: &Option, -) -> Result { - let chain_id = ChainId::from_string(chain_id); - let mut keyring = KeyRing::new_namada(Store::Test, &chain_id, ks_folder) - .map_err(|e| Error::generic(eyre!("error creating keyring: {e}")))?; - - let key_file: PathBuf = format!("{home_path}/{chain_id}").into(); - - let mut wallet = CliWalletUtils::new(key_file.to_path_buf()); - wallet - .load() - .map_err(|e| eyre!("error loading Namada wallet: {e}"))?; - - let secret_key = wallet - .find_secret_key(key_name, None) - .map_err(|e| eyre!("error loading the key from Namada wallet: {e}"))?; - let address = wallet - .find_address(address_name) - .ok_or_else(|| eyre!("error loading the address from Namada wallet"))?; - let namada_key = NamadaKeyPair { - alias: address_name.to_string(), - address: address.into_owned(), - secret_key: secret_key.clone(), - }; - keyring - .add_key(address_name, namada_key.clone()) - .map_err(|e| Error::generic(eyre!("error adding Namada key: {e}")))?; - - Ok(namada_key) -} diff --git a/tools/test-framework/src/bootstrap/single.rs b/tools/test-framework/src/bootstrap/single.rs index 62764be9be..df87589b35 100644 --- a/tools/test-framework/src/bootstrap/single.rs +++ b/tools/test-framework/src/bootstrap/single.rs @@ -46,13 +46,12 @@ pub fn bootstrap_single_node( ) -> Result { let native_token_number = chain_number % builder.native_tokens.len(); let native_token = &builder.native_tokens[native_token_number]; - let native_denom = Denom::base(native_token, native_token); + let native_denom = Denom::base(native_token); let denom = if use_random_id { - let random_coin = format!("coin{:x}", random_u32()); - Denom::base(&random_coin, &random_coin) + Denom::base(&format!("coin{:x}", random_u32())) } else { - Denom::base("samoleans", "samoleans") + Denom::base("samoleans") }; // Evmos requires of at least 1_000_000_000_000_000_000 or else there will be the @@ -96,16 +95,16 @@ pub fn bootstrap_single_node( let log_level = std::env::var("CHAIN_LOG_LEVEL").unwrap_or_else(|_| "info".to_string()); - chain_driver.update_chain_config("config/config.toml", |config| { - config::cosmos::set_log_level(config, &log_level)?; - config::cosmos::set_rpc_port(config, chain_driver.rpc_port)?; - config::cosmos::set_p2p_port(config, chain_driver.p2p_port)?; - config::cosmos::set_pprof_port(config, chain_driver.pprof_port)?; - config::cosmos::set_block_sync(config, true)?; - config::cosmos::set_timeout_commit(config, Duration::from_secs(1))?; - config::cosmos::set_timeout_propose(config, Duration::from_secs(1))?; - config::cosmos::set_mode(config, "validator")?; - config::cosmos::set_indexer(config, "kv")?; + chain_driver.update_chain_config("config.toml", |config| { + config::set_log_level(config, &log_level)?; + config::set_rpc_port(config, chain_driver.rpc_port)?; + config::set_p2p_port(config, chain_driver.p2p_port)?; + config::set_pprof_port(config, chain_driver.pprof_port)?; + config::set_block_sync(config, true)?; + config::set_timeout_commit(config, Duration::from_secs(1))?; + config::set_timeout_propose(config, Duration::from_secs(1))?; + config::set_mode(config, "validator")?; + config::set_indexer(config, "kv")?; config_modifier(config)?; @@ -113,16 +112,16 @@ pub fn bootstrap_single_node( })?; let minimum_gas = format!("0{}", native_token); - chain_driver.update_chain_config("config/app.toml", |config| { + chain_driver.update_chain_config("app.toml", |config| { if builder.ipv6_grpc { - config::cosmos::set_grpc_port_ipv6(config, chain_driver.grpc_port)?; + config::set_grpc_port_ipv6(config, chain_driver.grpc_port)?; } else { - config::cosmos::set_grpc_port(config, chain_driver.grpc_port)?; + config::set_grpc_port(config, chain_driver.grpc_port)?; } - config::cosmos::enable_grpc(config)?; - config::cosmos::disable_grpc_web(config)?; - config::cosmos::disable_api(config)?; - config::cosmos::set_minimum_gas_price(config, &minimum_gas)?; + config::enable_grpc(config)?; + config::disable_grpc_web(config)?; + config::disable_api(config)?; + config::set_minimum_gas_price(config, &minimum_gas)?; Ok(()) })?; diff --git a/tools/test-framework/src/chain/chain_type.rs b/tools/test-framework/src/chain/chain_type.rs index 84dfd7d2a1..309a91b00e 100644 --- a/tools/test-framework/src/chain/chain_type.rs +++ b/tools/test-framework/src/chain/chain_type.rs @@ -8,7 +8,6 @@ use crate::util::random::{random_u32, random_unused_tcp_port}; const COSMOS_HD_PATH: &str = "m/44'/118'/0'/0/0"; const EVMOS_HD_PATH: &str = "m/44'/60'/0'/0/0"; const PROVENANCE_HD_PATH: &str = "m/44'/505'/0'/0/0"; -const NAMADA_HD_PATH: &str = "m/44'/877'/0'/0'/0'"; #[derive(Clone, Debug)] pub enum ChainType { @@ -17,7 +16,6 @@ pub enum ChainType { Evmos, Provenance, Injective, - Namada, } impl ChainType { @@ -26,7 +24,6 @@ impl ChainType { Self::Cosmos { dynamic_fee: _ } | Self::Osmosis => COSMOS_HD_PATH, Self::Evmos | Self::Injective => EVMOS_HD_PATH, Self::Provenance => PROVENANCE_HD_PATH, - Self::Namada => NAMADA_HD_PATH, } } @@ -49,7 +46,6 @@ impl ChainType { 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}")), - Self::Namada => ChainId::from_string(&format!("namada-{prefix}")), } } @@ -58,8 +54,7 @@ impl ChainType { let mut res = vec![]; let json_rpc_port = random_unused_tcp_port(); match self { - Self::Cosmos { dynamic_fee: _ } | Self::Injective | Self::Provenance | Self::Namada => { - } + Self::Cosmos { dynamic_fee: _ } | Self::Injective | Self::Provenance => {} Self::Osmosis => { res.push("--reject-config-defaults".to_owned()); } @@ -75,11 +70,7 @@ impl ChainType { pub fn extra_add_genesis_account_args(&self, chain_id: &ChainId) -> Vec { let mut res = vec![]; match self { - Self::Cosmos { dynamic_fee: _ } - | Self::Osmosis - | Self::Evmos - | Self::Provenance - | Self::Namada => {} + Self::Cosmos { dynamic_fee: _ } | Self::Osmosis | Self::Evmos | Self::Provenance => {} Self::Injective => { res.push("--chain-id".to_owned()); res.push(format!("{chain_id}")); @@ -90,7 +81,7 @@ impl ChainType { pub fn address_type(&self) -> AddressType { match self { - Self::Cosmos { dynamic_fee: _ } | Self::Osmosis | Self::Provenance | Self::Namada => { + Self::Cosmos { dynamic_fee: _ } | Self::Osmosis | Self::Provenance => { AddressType::default() } Self::Evmos => AddressType::Ethermint { @@ -119,7 +110,6 @@ impl FromStr for ChainType { name if name.contains("injectived") => Ok(ChainType::Injective), name if name.contains("provenanced") => Ok(ChainType::Provenance), name if name.contains("osmosisd") => Ok(ChainType::Osmosis), - name if name.contains("namada") => Ok(ChainType::Namada), _ => Ok(ChainType::Cosmos { dynamic_fee: false }), } } diff --git a/tools/test-framework/src/chain/cli/query.rs b/tools/test-framework/src/chain/cli/query.rs index d4cd140a24..9c662a7161 100644 --- a/tools/test-framework/src/chain/cli/query.rs +++ b/tools/test-framework/src/chain/cli/query.rs @@ -8,7 +8,6 @@ use tracing::debug; use crate::chain::exec::simple_exec; use crate::error::{handle_generic_error, Error}; -use crate::prelude::*; pub fn query_balance( chain_id: &str, @@ -103,58 +102,6 @@ pub fn query_balance( } } -pub fn query_namada_balance( - chain_id: &str, - _command_path: &str, - home_path: &str, - denom: &Denom, - wallet_id: &str, - rpc_listen_address: &str, -) -> Result { - let output = simple_exec( - chain_id, - "namadac", - &[ - "--base-dir", - home_path, - "balance", - "--owner", - wallet_id, - "--token", - &denom.hash_only(), - "--node", - rpc_listen_address, - ], - )?; - - let words: Vec<&str> = output.stdout.split_whitespace().collect(); - let raw_addr = &format!("{}:", denom.hash_only()); - - if let Some(derived_index) = words.iter().position(|&w| w.contains(raw_addr)) { - if let Some(&amount_str) = words.get(derived_index + 1) { - return Amount::from_str(amount_str).map_err(handle_generic_error); - } - Err(Error::generic(eyre!( - "chain id is not 1 words after `{raw_addr}`: raw output `{}` split output `{words:#?}`", - output.stdout - ))) - } else { - let denom_display_name = &format!("{}:", denom.namada_display_name()); - if let Some(derived_index) = words.iter().position(|&w| w.contains(denom_display_name)) { - if let Some(&amount_str) = words.get(derived_index + 1) { - return Amount::from_str(amount_str).map_err(handle_generic_error); - } - Err(Error::generic(eyre!( - "chain id is not 1 words after `{denom_display_name}`: raw output `{}` split output `{words:#?}`", - output.stdout - ))) - } else { - debug!("Denom `{denom_display_name}` not found when querying for balance, will return 0{denom}"); - Ok(Amount::from_str("0").map_err(handle_generic_error)?) - } - } -} - /** Query for the transactions related to a wallet on `Chain` receiving token transfer from others. diff --git a/tools/test-framework/src/chain/config/cosmos.rs b/tools/test-framework/src/chain/config.rs similarity index 100% rename from tools/test-framework/src/chain/config/cosmos.rs rename to tools/test-framework/src/chain/config.rs diff --git a/tools/test-framework/src/chain/config/mod.rs b/tools/test-framework/src/chain/config/mod.rs deleted file mode 100644 index 5cffe3a80f..0000000000 --- a/tools/test-framework/src/chain/config/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod cosmos; -pub mod namada; diff --git a/tools/test-framework/src/chain/config/namada.rs b/tools/test-framework/src/chain/config/namada.rs deleted file mode 100644 index 27f3bef64e..0000000000 --- a/tools/test-framework/src/chain/config/namada.rs +++ /dev/null @@ -1,144 +0,0 @@ -use eyre::{eyre, Report as Error}; -use toml::Value; - -/// Set the `rpc` field in the full node config. -pub fn set_rpc_port(config: &mut Value, port: u16) -> Result<(), Error> { - config - .get_mut("ledger") - .ok_or_else(|| eyre!("expect ledger section"))? - .get_mut("cometbft") - .ok_or_else(|| eyre!("expect cometbft section"))? - .get_mut("rpc") - .ok_or_else(|| eyre!("expect cometbft rpc"))? - .as_table_mut() - .ok_or_else(|| eyre!("expect object"))? - .insert( - "laddr".to_string(), - format!("tcp://0.0.0.0:{}", port).into(), - ); - - Ok(()) -} - -/// Set the `p2p` field in the full node config. -pub fn set_p2p_port(config: &mut Value, port: u16) -> Result<(), Error> { - config - .get_mut("ledger") - .ok_or_else(|| eyre!("expect ledger section"))? - .get_mut("cometbft") - .ok_or_else(|| eyre!("expect cometbft section"))? - .get_mut("p2p") - .ok_or_else(|| eyre!("expect cometbft p2p"))? - .as_table_mut() - .ok_or_else(|| eyre!("expect object"))? - .insert( - "laddr".to_string(), - format!("tcp://0.0.0.0:{}", port).into(), - ); - - Ok(()) -} - -/// Set the `proxy_app` field in the full node config. -pub fn set_proxy_app_port(config: &mut Value, port: u16) -> Result<(), Error> { - config - .get_mut("ledger") - .ok_or_else(|| eyre!("expect ledger section"))? - .get_mut("cometbft") - .ok_or_else(|| eyre!("expect cometbft section"))? - .as_table_mut() - .ok_or_else(|| eyre!("expect object"))? - .insert( - "proxy_app".to_string(), - format!("tcp://0.0.0.0:{}", port).into(), - ); - - Ok(()) -} - -/// Set the `block_cache_bytes` field in the full node config. -pub fn set_block_cache_bytes(config: &mut Value, block_cache_bytes: i64) -> Result<(), Error> { - config - .get_mut("ledger") - .ok_or_else(|| eyre!("expect ledger section"))? - .get_mut("shell") - .ok_or_else(|| eyre!("expect shell section"))? - .as_table_mut() - .ok_or_else(|| eyre!("expect object"))? - .insert( - "block_cache_bytes".to_string(), - Value::Integer(block_cache_bytes), - ); - - Ok(()) -} - -pub fn set_unbonding_len(parameters: &mut Value, unbonding_len: i64) -> Result<(), Error> { - parameters - .get_mut("pos_params") - .ok_or_else(|| eyre!("expect pos_params section"))? - .as_table_mut() - .ok_or_else(|| eyre!("expect object"))? - .insert("unbonding_len".to_string(), Value::Integer(unbonding_len)); - - Ok(()) -} - -pub fn set_pipeline_len(parameters: &mut Value, pipeline_len: i64) -> Result<(), Error> { - parameters - .get_mut("pos_params") - .ok_or_else(|| eyre!("expect pos_params section"))? - .as_table_mut() - .ok_or_else(|| eyre!("expect object"))? - .insert("pipeline_len".to_string(), Value::Integer(pipeline_len)); - - Ok(()) -} - -pub fn set_default_mint_limit( - parameters: &mut Value, - default_mint_limit: i64, -) -> Result<(), Error> { - parameters - .get_mut("ibc_params") - .ok_or_else(|| eyre!("expect ibc_params section"))? - .as_table_mut() - .ok_or_else(|| eyre!("expect object"))? - .insert( - "default_mint_limit".to_string(), - Value::String(default_mint_limit.to_string()), - ); - - Ok(()) -} - -pub fn set_default_per_epoch_throughput_limit( - parameters: &mut Value, - default_per_epoch_throughput_limit: i64, -) -> Result<(), Error> { - parameters - .get_mut("ibc_params") - .ok_or_else(|| eyre!("expect ibc_params section"))? - .as_table_mut() - .ok_or_else(|| eyre!("expect object"))? - .insert( - "default_per_epoch_throughput_limit".to_string(), - Value::String(default_per_epoch_throughput_limit.to_string()), - ); - - Ok(()) -} - -pub fn set_epochs_per_year(parameters: &mut Value, epochs_per_year: i64) -> Result<(), Error> { - parameters - .get_mut("parameters") - .ok_or_else(|| eyre!("expect parameters section"))? - .as_table_mut() - .ok_or_else(|| eyre!("expect object"))? - .insert( - "epochs_per_year".to_string(), - Value::Integer(epochs_per_year), - ); - - Ok(()) -} diff --git a/tools/test-framework/src/chain/driver.rs b/tools/test-framework/src/chain/driver.rs index a1348f5855..bd4aba6543 100644 --- a/tools/test-framework/src/chain/driver.rs +++ b/tools/test-framework/src/chain/driver.rs @@ -23,8 +23,6 @@ use crate::types::env::{EnvWriter, ExportEnv}; use crate::types::wallet::WalletAddress; use crate::util::retry::assert_eventually_succeed; -use super::cli::query::query_namada_balance; - /** Number of times (seconds) to try and query a wallet to reach the target amount, as used by [`assert_eventual_wallet_amount`]. @@ -190,11 +188,7 @@ impl ChainDriver { as it requires the `"tcp://"` scheme. */ pub fn rpc_listen_address(&self) -> String { - if self.command_path == "namada" { - format!("http://localhost:{}", self.rpc_port) - } else { - format!("tcp://localhost:{}", self.rpc_port) - } + format!("tcp://localhost:{}", self.rpc_port) } /** @@ -216,23 +210,13 @@ impl ChainDriver { Query for the balances for a given wallet address and denomination */ pub fn query_balance(&self, wallet_id: &WalletAddress, denom: &Denom) -> Result { - match self.chain_type { - ChainType::Namada => query_namada_balance( - self.chain_id.as_str(), - &self.command_path, - &self.home_path, - denom, - &wallet_id.0, - &self.rpc_listen_address(), - ), - _ => query_balance( - self.chain_id.as_str(), - &self.command_path, - &self.rpc_listen_address(), - &wallet_id.0, - &denom.to_string(), - ), - } + query_balance( + self.chain_id.as_str(), + &self.command_path, + &self.rpc_listen_address(), + &wallet_id.0, + &denom.to_string(), + ) } /** diff --git a/tools/test-framework/src/chain/exec.rs b/tools/test-framework/src/chain/exec.rs index 1ca6134d8b..c9b958de3f 100644 --- a/tools/test-framework/src/chain/exec.rs +++ b/tools/test-framework/src/chain/exec.rs @@ -49,54 +49,3 @@ pub fn simple_exec(desc: &str, command_path: &str, args: &[&str]) -> Result Result { - debug!( - "Executing command for {}: {} {}", - desc, - command_path, - itertools::join(args, " ") - ); - - let mut cmd = Command::new(command_path); - - for (key, value) in envs { - cmd.env(key, value); - } - - let output = cmd - .args(args) - .output() - .map_err(handle_exec_error(command_path))?; - - if output.status.success() { - let stdout = str::from_utf8(&output.stdout) - .map_err(handle_generic_error)? - .to_string(); - - let stderr = str::from_utf8(&output.stderr) - .map_err(handle_generic_error)? - .to_string(); - - trace!( - "command executed successfully with stdout: {}, stderr: {}", - stdout, - stderr - ); - - Ok(ExecOutput { stdout, stderr }) - } else { - let message = str::from_utf8(&output.stderr).map_err(handle_generic_error)?; - - Err(Error::generic(eyre!( - "command exited with error status {:?} and message: {}", - output.status.code(), - message - ))) - } -} diff --git a/tools/test-framework/src/chain/ext/bootstrap.rs b/tools/test-framework/src/chain/ext/bootstrap.rs index 60033b6752..07103fcd05 100644 --- a/tools/test-framework/src/chain/ext/bootstrap.rs +++ b/tools/test-framework/src/chain/ext/bootstrap.rs @@ -182,7 +182,9 @@ impl ChainBootstrapMethodsExt for ChainDriver { file: &str, cont: impl FnOnce(&mut toml::Value) -> Result<(), Error>, ) -> Result<(), Error> { - let config1 = self.read_file(file)?; + let config_path = format!("config/{file}"); + + let config1 = self.read_file(&config_path)?; let mut config2 = toml::from_str(&config1).map_err(handle_generic_error)?; @@ -190,7 +192,7 @@ impl ChainBootstrapMethodsExt for ChainDriver { let config3 = toml::to_string_pretty(&config2).map_err(handle_generic_error)?; - self.write_file(file, &config3)?; + self.write_file(&config_path, &config3)?; Ok(()) } @@ -243,11 +245,7 @@ impl ChainBootstrapMethodsExt for ChainDriver { let key = Secp256k1KeyPair::from_seed_file(&seed_content, &hd_path) .map_err(handle_generic_error)?; - Ok(Wallet::new_secp256( - wallet_id.to_string(), - wallet_address, - key, - )) + Ok(Wallet::new(wallet_id.to_string(), wallet_address, key)) } fn add_genesis_account(&self, wallet: &WalletAddress, amounts: &[&Token]) -> Result<(), Error> { diff --git a/tools/test-framework/src/chain/ext/ica.rs b/tools/test-framework/src/chain/ext/ica.rs index f335774d31..427acd8003 100644 --- a/tools/test-framework/src/chain/ext/ica.rs +++ b/tools/test-framework/src/chain/ext/ica.rs @@ -88,25 +88,24 @@ pub fn register_unordered_interchain_account { sender: &MonoTagged, recipient: &MonoTagged, token: &TaggedTokenRef, - ) -> Result<(), Error>; + ) -> Result; fn ibc_transfer_token_with_memo_and_timeout( &self, @@ -56,7 +53,7 @@ pub trait ChainTransferMethodsExt { token: &TaggedTokenRef, memo: Option, timeout: Option, - ) -> Result<(), Error>; + ) -> Result; fn ibc_transfer_token_multiple( &self, @@ -97,34 +94,19 @@ impl ChainTransferMethodsExt for MonoTagged, recipient: &MonoTagged, token: &TaggedTokenRef, - ) -> Result<(), Error> { - match self.value().chain_type { - crate::chain::chain_type::ChainType::Namada => ibc_namada_token_transfer( - &self.value().home_path, - &sender.value().id.to_string(), - recipient.value().as_str(), - token.value().denom.as_str(), - &token.value().amount.to_string(), - &channel_id.to_string(), - &self.value().rpc_port.to_string(), - None, - None, - ), - _ => { - let rpc_client = self.rpc_client()?; - self.value().runtime.block_on(ibc_token_transfer( - rpc_client.as_ref(), - &self.tx_config(), - port_id, - channel_id, - sender, - recipient, - token, - None, - None, - )) - } - } + ) -> Result { + let rpc_client = self.rpc_client()?; + self.value().runtime.block_on(ibc_token_transfer( + rpc_client.as_ref(), + &self.tx_config(), + port_id, + channel_id, + sender, + recipient, + token, + None, + None, + )) } fn ibc_transfer_token_with_memo_and_timeout( @@ -136,39 +118,19 @@ impl ChainTransferMethodsExt for MonoTagged, memo: Option, timeout: Option, - ) -> Result<(), Error> { - match self.value().chain_type { - ChainType::Namada => { - let denom = token.value().denom.to_string(); - let amount = token.value().amount.to_string(); - let rpc_port = self.value().rpc_port.to_string(); - ibc_namada_token_transfer( - &self.value().home_path, - &sender.value().id.to_string(), - recipient.value().as_str(), - &denom, - &amount, - channel_id.value().as_ref(), - &rpc_port, - memo, - timeout, - ) - } - _ => { - let rpc_client = self.rpc_client()?; - self.value().runtime.block_on(ibc_token_transfer( - rpc_client.as_ref(), - &self.tx_config(), - port_id, - channel_id, - sender, - recipient, - token, - memo, - timeout, - )) - } - } + ) -> Result { + let rpc_client = self.rpc_client()?; + self.value().runtime.block_on(ibc_token_transfer( + rpc_client.as_ref(), + &self.tx_config(), + port_id, + channel_id, + sender, + recipient, + token, + memo, + timeout, + )) } fn ibc_transfer_token_multiple( @@ -181,42 +143,18 @@ impl ChainTransferMethodsExt for MonoTagged, ) -> Result<(), Error> { - match self.value().chain_type { - ChainType::Namada => { - let denom = token.value().denom.to_string(); - let amount = token.value().amount.to_string(); - let rpc_port = self.value().rpc_port.to_string(); - // Namada CLI doesn't support batching transactions - for _ in 0..num_msgs { - ibc_namada_token_transfer( - &self.value().home_path, - &sender.value().id.to_string(), - recipient.value().as_str(), - &denom, - &amount, - &channel_id.to_string(), - &rpc_port, - memo.clone(), - None, - )?; - } - Ok(()) - } - _ => { - let rpc_client = self.rpc_client()?; - self.value().runtime.block_on(batched_ibc_token_transfer( - rpc_client.as_ref(), - &self.tx_config(), - port_id, - channel_id, - sender, - recipient, - token, - num_msgs, - memo, - )) - } - } + let rpc_client = self.rpc_client()?; + self.value().runtime.block_on(batched_ibc_token_transfer( + rpc_client.as_ref(), + &self.tx_config(), + port_id, + channel_id, + sender, + recipient, + token, + num_msgs, + memo, + )) } fn local_transfer_token( @@ -227,31 +165,16 @@ impl ChainTransferMethodsExt for MonoTagged, ) -> Result<(), Error> { let driver = *self.value(); - match driver.chain_type { - ChainType::Namada => { - let denom = token.value().denom.to_string(); - let amount = token.value().amount.to_string(); - let rpc_port = self.value().rpc_port.to_string(); - local_namada_token_transfer( - &driver.home_path, - &sender.value().id.to_string(), - recipient.value().as_str(), - &denom, - &amount, - &rpc_port, - ) - } - _ => local_transfer_token( - driver.chain_id.as_str(), - &driver.command_path, - &driver.home_path, - &driver.rpc_listen_address(), - sender.value().address.as_str(), - recipient.value().as_str(), - &token.value().to_string(), - &fees.value().to_string(), - ), - } + local_transfer_token( + driver.chain_id.as_str(), + &driver.command_path, + &driver.home_path, + &driver.rpc_listen_address(), + sender.value().address.as_str(), + recipient.value().as_str(), + &token.value().to_string(), + &fees.value().to_string(), + ) } fn transfer_from_chain( @@ -265,39 +188,19 @@ impl ChainTransferMethodsExt for MonoTagged Result<(), Error> { let driver = *self.value(); - match driver.chain_type { - ChainType::Namada => { - let denom = token.value().denom.to_string(); - let amount = token.value().amount.to_string(); - let rpc_port = self.value().rpc_port.to_string(); - ibc_namada_token_transfer( - &driver.home_path, - &sender.value().id.to_string(), - recipient.value().as_str(), - &denom, - &amount, - channel.as_ref(), - &rpc_port, - None, - None, - ) - } - _ => { - let timeout_height_str = timeout_height.revision_height() + 100; - transfer_from_chain( - driver.chain_id.as_str(), - &driver.command_path, - &driver.home_path, - &driver.rpc_listen_address(), - sender.value().address.as_str(), - port.as_ref(), - channel.as_ref(), - recipient.value().as_str(), - &token.value().to_string(), - &fees.value().to_string(), - &timeout_height_str.to_string(), - ) - } - } + let timeout_height_str = timeout_height.revision_height() + 100; + transfer_from_chain( + driver.chain_id.as_str(), + &driver.command_path, + &driver.home_path, + &driver.rpc_listen_address(), + sender.value().address.as_str(), + port.as_ref(), + channel.as_ref(), + recipient.value().as_str(), + &token.value().to_string(), + &fees.value().to_string(), + &timeout_height_str.to_string(), + ) } } diff --git a/tools/test-framework/src/chain/tagged.rs b/tools/test-framework/src/chain/tagged.rs index 8f324bf922..d6f2f510ad 100644 --- a/tools/test-framework/src/chain/tagged.rs +++ b/tools/test-framework/src/chain/tagged.rs @@ -1,8 +1,6 @@ /*! Methods for tagged version of the chain driver. */ -use eyre::eyre; -use serde_json as json; use ibc_proto::google::protobuf::Any; use ibc_relayer::chain::cosmos::tx::simple_send_tx; @@ -10,6 +8,7 @@ use ibc_relayer::chain::cosmos::types::config::TxConfig; use ibc_relayer::config::compat_mode::CompatMode; use ibc_relayer::event::IbcEventWithHeight; use ibc_relayer_types::core::ics24_host::identifier::ChainId; +use serde_json as json; use tendermint_rpc::client::{Client, HttpClient}; use tendermint_rpc::Url; use tracing::warn; @@ -145,18 +144,12 @@ impl TaggedChainDriverExt for MonoTagged Result, Error> { let rpc_client = self.rpc_client()?; - let key = &wallet - .value() - .key - .downcast() - .ok_or_else(|| eyre!("unable to downcast key")) - .map_err(Error::generic)?; self.value() .runtime .block_on(simple_send_tx( rpc_client.as_ref().into_value(), &self.value().tx_config, - key, + &wallet.value().key, messages, )) .map_err(Error::relayer) diff --git a/tools/test-framework/src/docs/walkthroughs/memo.rs b/tools/test-framework/src/docs/walkthroughs/memo.rs index 336bc5d874..7c0887a76c 100644 --- a/tools/test-framework/src/docs/walkthroughs/memo.rs +++ b/tools/test-framework/src/docs/walkthroughs/memo.rs @@ -10,7 +10,8 @@ //! //! ```no_run //! # use serde_json as json; -//! # use ibc_relayer::config::{types::Memo, Config, ChainConfig}; +//! # 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}; @@ -31,9 +32,9 @@ //! fn modify_relayer_config(&self, config: &mut Config) { //! for mut chain in config.chains.iter_mut() { //! match chain { -//! ChainConfig::CosmosSdk(chain_config) | ChainConfig::Namada(chain_config) => { +//! ChainConfig::CosmosSdk(chain_config) => { //! chain_config.memo_prefix = self.memo.clone(); -//! } +//! }, //! } //! } //! } @@ -60,7 +61,6 @@ //! )?; //! //! let denom_b = derive_ibc_denom( -//! &chains.node_b.chain_driver().value().chain_type, //! &channel.port_b.as_ref(), //! &channel.channel_id_b.as_ref(), //! &denom_a, diff --git a/tools/test-framework/src/docs/walkthroughs/ordered_channel.rs b/tools/test-framework/src/docs/walkthroughs/ordered_channel.rs index 6f717d436e..36c04807a6 100644 --- a/tools/test-framework/src/docs/walkthroughs/ordered_channel.rs +++ b/tools/test-framework/src/docs/walkthroughs/ordered_channel.rs @@ -95,7 +95,6 @@ //! sleep(Duration::from_secs(1)); //! //! let denom_b = derive_ibc_denom( -//! &chains.node_b.chain_driver().value().chain_type, //! &channel.port_b.as_ref(), //! &channel.channel_id_b.as_ref(), //! &denom_a, diff --git a/tools/test-framework/src/framework/binary/chain.rs b/tools/test-framework/src/framework/binary/chain.rs index 2c753f2c5a..5e58a2ef58 100644 --- a/tools/test-framework/src/framework/binary/chain.rs +++ b/tools/test-framework/src/framework/binary/chain.rs @@ -13,8 +13,8 @@ use crate::error::Error; use crate::framework::base::{HasOverrides, TestConfigOverride}; use crate::framework::binary::ics::InterchainSecurityChainTest; use crate::framework::binary::node::{ - run_binary_node_test, run_single_node_test, BinaryNodeTest, NamadaParametersOverride, - NodeConfigOverride, NodeGenesisOverride, + run_binary_node_test, run_single_node_test, BinaryNodeTest, NodeConfigOverride, + NodeGenesisOverride, }; use crate::framework::supervisor::{RunWithSupervisor, SupervisorOverride}; use crate::relayer::driver::RelayerDriver; @@ -39,8 +39,7 @@ where + RelayerConfigOverride + ClientOptionsOverride + SupervisorOverride - + TestConfigOverride - + NamadaParametersOverride, + + TestConfigOverride, { run_binary_chain_test(&RunTwoWayBinaryChainTest::new(test)) } @@ -57,8 +56,7 @@ where + RelayerConfigOverride + ClientOptionsOverride + SupervisorOverride - + TestConfigOverride - + NamadaParametersOverride, + + TestConfigOverride, { run_binary_node_test(&RunBinaryChainTest::new(&RunWithSupervisor::new(test))) } @@ -76,8 +74,7 @@ where + NodeGenesisOverride + RelayerConfigOverride + ClientOptionsOverride - + TestConfigOverride - + NamadaParametersOverride, + + TestConfigOverride, { run_single_node_test(&RunBinaryChainTest::new(test)) } diff --git a/tools/test-framework/src/framework/binary/channel.rs b/tools/test-framework/src/framework/binary/channel.rs index 3f3d964da2..6aef65d90c 100644 --- a/tools/test-framework/src/framework/binary/channel.rs +++ b/tools/test-framework/src/framework/binary/channel.rs @@ -24,7 +24,7 @@ use crate::framework::binary::connection::{ }; use crate::framework::binary::ics::run_binary_interchain_security_node_test; use crate::framework::binary::node::{ - run_binary_node_test, NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, + run_binary_node_test, NodeConfigOverride, NodeGenesisOverride, }; use crate::framework::supervisor::{RunWithSupervisor, SupervisorOverride}; use crate::relayer::driver::RelayerDriver; @@ -54,8 +54,7 @@ where + ConnectionDelayOverride + PortsOverride + ChannelOrderOverride - + ChannelVersionOverride - + NamadaParametersOverride, + + ChannelVersionOverride, { run_binary_channel_test(&RunTwoWayBinaryChannelTest::new(test)) } @@ -76,8 +75,7 @@ where + ConnectionDelayOverride + PortsOverride + ChannelOrderOverride - + ChannelVersionOverride - + NamadaParametersOverride, + + ChannelVersionOverride, { run_binary_node_test(&RunBinaryChainTest::new(&RunBinaryConnectionTest::new( &RunBinaryChannelTest::new(&RunWithSupervisor::new(test)), diff --git a/tools/test-framework/src/framework/binary/connection.rs b/tools/test-framework/src/framework/binary/connection.rs index 0f01082f98..e0f999b50d 100644 --- a/tools/test-framework/src/framework/binary/connection.rs +++ b/tools/test-framework/src/framework/binary/connection.rs @@ -16,7 +16,7 @@ use crate::framework::binary::chain::{ BinaryChainTest, ClientOptionsOverride, RelayerConfigOverride, RunBinaryChainTest, }; use crate::framework::binary::node::{ - run_binary_node_test, NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, + run_binary_node_test, NodeConfigOverride, NodeGenesisOverride, }; use crate::framework::supervisor::{RunWithSupervisor, SupervisorOverride}; use crate::relayer::driver::RelayerDriver; @@ -41,8 +41,7 @@ where + RelayerConfigOverride + ClientOptionsOverride + SupervisorOverride - + ConnectionDelayOverride - + NamadaParametersOverride, + + ConnectionDelayOverride, { run_binary_connection_test(&RunTwoWayBinaryConnectionTest::new(test)) } @@ -60,8 +59,7 @@ where + RelayerConfigOverride + ClientOptionsOverride + SupervisorOverride - + ConnectionDelayOverride - + NamadaParametersOverride, + + ConnectionDelayOverride, { run_binary_node_test(&RunBinaryChainTest::new(&RunBinaryConnectionTest::new( &RunWithSupervisor::new(test), diff --git a/tools/test-framework/src/framework/binary/node.rs b/tools/test-framework/src/framework/binary/node.rs index 528a4dd021..cea2cb1832 100644 --- a/tools/test-framework/src/framework/binary/node.rs +++ b/tools/test-framework/src/framework/binary/node.rs @@ -3,14 +3,8 @@ running without setting up the relayer. */ -use std::str::FromStr; - -use toml; - -use crate::bootstrap::namada::bootstrap_namada_node; use crate::bootstrap::single::bootstrap_single_node; use crate::chain::builder::ChainBuilder; -use crate::chain::chain_type::ChainType; use crate::error::Error; use crate::framework::base::HasOverrides; use crate::framework::base::{run_basic_test, BasicTest, TestConfigOverride}; @@ -24,8 +18,7 @@ pub fn run_binary_node_test(test: &Test) -> Result<(), Error> where Test: BinaryNodeTest, Test: HasOverrides, - Overrides: - NodeConfigOverride + NodeGenesisOverride + TestConfigOverride + NamadaParametersOverride, + Overrides: NodeConfigOverride + NodeGenesisOverride + TestConfigOverride, { run_basic_test(&RunBinaryNodeTest { test }) } @@ -34,8 +27,7 @@ pub fn run_single_node_test(test: &Test) -> Result<(), Error> where Test: BinaryNodeTest, Test: HasOverrides, - Overrides: - NodeConfigOverride + NodeGenesisOverride + TestConfigOverride + NamadaParametersOverride, + Overrides: NodeConfigOverride + NodeGenesisOverride + TestConfigOverride, { run_basic_test(&RunSingleNodeTest { test }) } @@ -95,10 +87,6 @@ pub trait NodeGenesisOverride { fn modify_genesis_file(&self, genesis: &mut serde_json::Value) -> Result<(), Error>; } -pub trait NamadaParametersOverride { - fn namada_modify_parameter_file(&self, parameter: &mut toml::Value) -> Result<(), Error>; -} - /** A wrapper type that lifts a test case that implements [`BinaryNodeTest`] into a test case that implements [`BasicTest`]. @@ -117,59 +105,26 @@ impl BasicTest for RunBinaryNodeTest<'_, Test> where Test: BinaryNodeTest, Test: HasOverrides, - Overrides: NodeConfigOverride + NodeGenesisOverride + NamadaParametersOverride, + Overrides: NodeConfigOverride + NodeGenesisOverride, { fn run(&self, config: &TestConfig, builder: &ChainBuilder) -> Result<(), Error> { - let command_paths_len = builder.command_paths.len(); - let node_a_type = ChainType::from_str(&builder.command_paths[0 % command_paths_len])?; - let node_a = match node_a_type { - ChainType::Namada => bootstrap_namada_node( - builder, - "a", - false, - |config| self.test.get_overrides().modify_node_config(config), - |genesis| self.test.get_overrides().modify_genesis_file(genesis), - |parameters| { - self.test - .get_overrides() - .namada_modify_parameter_file(parameters) - }, - 0, - ), - _ => bootstrap_single_node( - builder, - "1", - config.bootstrap_with_random_ids, - |config| self.test.get_overrides().modify_node_config(config), - |genesis| self.test.get_overrides().modify_genesis_file(genesis), - 0, - ), - }?; - let node_b_type = ChainType::from_str(&builder.command_paths[1 % command_paths_len])?; - - let node_b = match node_b_type { - ChainType::Namada => bootstrap_namada_node( - builder, - "b", - false, - |config| self.test.get_overrides().modify_node_config(config), - |genesis| self.test.get_overrides().modify_genesis_file(genesis), - |parameters| { - self.test - .get_overrides() - .namada_modify_parameter_file(parameters) - }, - 1, - ), - _ => bootstrap_single_node( - builder, - "2", - config.bootstrap_with_random_ids, - |config| self.test.get_overrides().modify_node_config(config), - |genesis| self.test.get_overrides().modify_genesis_file(genesis), - 1, - ), - }?; + let node_a = bootstrap_single_node( + builder, + "1", + config.bootstrap_with_random_ids, + |config| self.test.get_overrides().modify_node_config(config), + |genesis| self.test.get_overrides().modify_genesis_file(genesis), + 0, + )?; + + let node_b = bootstrap_single_node( + builder, + "2", + config.bootstrap_with_random_ids, + |config| self.test.get_overrides().modify_node_config(config), + |genesis| self.test.get_overrides().modify_genesis_file(genesis), + 1, + )?; let _node_process_a = node_a.process.clone(); let _node_process_b = node_b.process.clone(); @@ -184,34 +139,17 @@ impl BasicTest for RunSingleNodeTest<'_, Test> where Test: BinaryNodeTest, Test: HasOverrides, - Overrides: NodeConfigOverride + NodeGenesisOverride + NamadaParametersOverride, + Overrides: NodeConfigOverride + NodeGenesisOverride, { fn run(&self, config: &TestConfig, builder: &ChainBuilder) -> Result<(), Error> { - let command_paths_len = builder.command_paths.len(); - let node_type = ChainType::from_str(&builder.command_paths[0 % command_paths_len])?; - let node = match node_type { - ChainType::Namada => bootstrap_namada_node( - builder, - "a", - false, - |config| self.test.get_overrides().modify_node_config(config), - |genesis| self.test.get_overrides().modify_genesis_file(genesis), - |parameters| { - self.test - .get_overrides() - .namada_modify_parameter_file(parameters) - }, - 0, - ), - _ => bootstrap_single_node( - builder, - "1", - config.bootstrap_with_random_ids, - |config| self.test.get_overrides().modify_node_config(config), - |genesis| self.test.get_overrides().modify_genesis_file(genesis), - 0, - ), - }?; + let node = bootstrap_single_node( + builder, + "1", + config.bootstrap_with_random_ids, + |config| self.test.get_overrides().modify_node_config(config), + |genesis| self.test.get_overrides().modify_genesis_file(genesis), + 0, + )?; let _node_process = node.process.clone(); diff --git a/tools/test-framework/src/framework/nary/chain.rs b/tools/test-framework/src/framework/nary/chain.rs index 19fff4dc00..7667ac42e4 100644 --- a/tools/test-framework/src/framework/nary/chain.rs +++ b/tools/test-framework/src/framework/nary/chain.rs @@ -12,9 +12,7 @@ use crate::bootstrap::nary::chain::{ use crate::error::Error; use crate::framework::base::{HasOverrides, TestConfigOverride}; use crate::framework::binary::chain::{RelayerConfigOverride, TopologyOverride}; -use crate::framework::binary::node::{ - NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, -}; +use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; use crate::framework::nary::node::{run_nary_node_test, NaryNodeTest}; use crate::framework::supervisor::{RunWithSupervisor, SupervisorOverride}; use crate::relayer::driver::RelayerDriver; @@ -51,7 +49,6 @@ where + NodeGenesisOverride + RelayerConfigOverride + SupervisorOverride - + NamadaParametersOverride + TopologyOverride, { run_nary_node_test(&RunNaryChainTest::new(&RunWithSupervisor::new(test))) @@ -82,7 +79,6 @@ where + NodeGenesisOverride + RelayerConfigOverride + SupervisorOverride - + NamadaParametersOverride + TopologyOverride, { run_nary_node_test(&RunSelfConnectedNaryChainTest::new( diff --git a/tools/test-framework/src/framework/nary/channel.rs b/tools/test-framework/src/framework/nary/channel.rs index c48f728fd7..0f4fe189dd 100644 --- a/tools/test-framework/src/framework/nary/channel.rs +++ b/tools/test-framework/src/framework/nary/channel.rs @@ -14,9 +14,7 @@ use crate::framework::base::{HasOverrides, TestConfigOverride}; 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::{ - NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, -}; +use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; use crate::framework::nary::chain::RunNaryChainTest; use crate::framework::nary::connection::{NaryConnectionTest, RunNaryConnectionTest}; use crate::framework::nary::node::run_nary_node_test; @@ -41,7 +39,6 @@ where + ConnectionDelayOverride + PortsOverride + ChannelOrderOverride - + NamadaParametersOverride + TopologyOverride, { run_nary_node_test(&RunNaryChainTest::new(&RunNaryConnectionTest::new( @@ -61,7 +58,6 @@ where + ConnectionDelayOverride + PortsOverride<2> + ChannelOrderOverride - + NamadaParametersOverride + TopologyOverride, { run_nary_channel_test(&RunBinaryAsNaryChannelTest::new(test)) diff --git a/tools/test-framework/src/framework/nary/connection.rs b/tools/test-framework/src/framework/nary/connection.rs index 646ffdbd2e..48f611eb89 100644 --- a/tools/test-framework/src/framework/nary/connection.rs +++ b/tools/test-framework/src/framework/nary/connection.rs @@ -12,9 +12,7 @@ use crate::error::Error; use crate::framework::base::{HasOverrides, TestConfigOverride}; use crate::framework::binary::chain::{RelayerConfigOverride, TopologyOverride}; use crate::framework::binary::connection::{BinaryConnectionTest, ConnectionDelayOverride}; -use crate::framework::binary::node::{ - NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, -}; +use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; use crate::framework::nary::chain::{NaryChainTest, RunNaryChainTest}; use crate::framework::nary::node::run_nary_node_test; use crate::framework::supervisor::{RunWithSupervisor, SupervisorOverride}; @@ -37,7 +35,6 @@ where + RelayerConfigOverride + SupervisorOverride + ConnectionDelayOverride - + NamadaParametersOverride + TopologyOverride, { run_nary_node_test(&RunNaryChainTest::new(&RunNaryConnectionTest::new( diff --git a/tools/test-framework/src/framework/nary/node.rs b/tools/test-framework/src/framework/nary/node.rs index e5c0d7a5fe..2ea2379e25 100644 --- a/tools/test-framework/src/framework/nary/node.rs +++ b/tools/test-framework/src/framework/nary/node.rs @@ -3,15 +3,12 @@ running without setting up the relayer. */ -use crate::bootstrap::namada::bootstrap_namada_node; use crate::bootstrap::single::bootstrap_single_node; use crate::chain::builder::ChainBuilder; use crate::error::Error; use crate::framework::base::HasOverrides; use crate::framework::base::{run_basic_test, BasicTest, TestConfigOverride}; -use crate::framework::binary::node::{ - NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, -}; +use crate::framework::binary::node::{NodeConfigOverride, NodeGenesisOverride}; use crate::types::config::TestConfig; use crate::types::single::node::FullNode; use crate::util::array::try_into_array; @@ -20,8 +17,7 @@ pub fn run_nary_node_test(test: &Test) -> Re where Test: NaryNodeTest, Test: HasOverrides, - Overrides: - NodeConfigOverride + NodeGenesisOverride + TestConfigOverride + NamadaParametersOverride, + Overrides: NodeConfigOverride + NodeGenesisOverride + TestConfigOverride, { run_basic_test(&RunNaryNodeTest { test }) } @@ -53,39 +49,21 @@ impl BasicTest for RunNaryNodeTest<'_, Test, where Test: NaryNodeTest, Test: HasOverrides, - Overrides: NodeConfigOverride + NodeGenesisOverride + NamadaParametersOverride, + Overrides: NodeConfigOverride + NodeGenesisOverride, { fn run(&self, config: &TestConfig, builder: &ChainBuilder) -> Result<(), Error> { let mut nodes = Vec::new(); let mut node_processes = Vec::new(); for i in 0..SIZE { - let is_namada = builder.command_paths == vec!["namada".to_string()] - || builder.command_paths.get(i) == Some(&"namada".to_string()); - let node = if is_namada { - bootstrap_namada_node( - builder, - &format!("{}", i + 1), - config.bootstrap_with_random_ids, - |config| self.test.get_overrides().modify_node_config(config), - |genesis| self.test.get_overrides().modify_genesis_file(genesis), - |parameters| { - self.test - .get_overrides() - .namada_modify_parameter_file(parameters) - }, - i, - )? - } else { - bootstrap_single_node( - builder, - &format!("{}", i + 1), - config.bootstrap_with_random_ids, - |config| self.test.get_overrides().modify_node_config(config), - |genesis| self.test.get_overrides().modify_genesis_file(genesis), - i, - )? - }; + let node = bootstrap_single_node( + builder, + &format!("{}", i + 1), + config.bootstrap_with_random_ids, + |config| self.test.get_overrides().modify_node_config(config), + |genesis| self.test.get_overrides().modify_genesis_file(genesis), + i, + )?; node_processes.push(node.process.clone()); nodes.push(node); diff --git a/tools/test-framework/src/framework/overrides.rs b/tools/test-framework/src/framework/overrides.rs index bf08d8c06d..70398de376 100644 --- a/tools/test-framework/src/framework/overrides.rs +++ b/tools/test-framework/src/framework/overrides.rs @@ -18,9 +18,7 @@ use crate::framework::binary::channel::{ ChannelOrderOverride, ChannelVersionOverride, PortsOverride, }; use crate::framework::binary::connection::ConnectionDelayOverride; -use crate::framework::binary::node::{ - NamadaParametersOverride, NodeConfigOverride, NodeGenesisOverride, -}; +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; @@ -83,10 +81,6 @@ pub trait TestOverrides { // No modification by default } - fn namada_modify_parameter_file(&self, _parameter: &mut toml::Value) -> Result<(), Error> { - Ok(()) - } - /// Returns the settings for the foreign client on the first chain for the /// second chain. The defaults are for a client connecting two Cosmos chains /// with no custom settings. @@ -186,12 +180,6 @@ impl NodeGenesisOverride for Test { } } -impl NamadaParametersOverride for Test { - fn namada_modify_parameter_file(&self, parameter: &mut toml::Value) -> Result<(), Error> { - TestOverrides::namada_modify_parameter_file(self, parameter) - } -} - impl RelayerConfigOverride for Test { fn modify_relayer_config(&self, config: &mut Config) { TestOverrides::modify_relayer_config(self, config) diff --git a/tools/test-framework/src/ibc/denom.rs b/tools/test-framework/src/ibc/denom.rs index d0301b9e15..965a56b1b7 100644 --- a/tools/test-framework/src/ibc/denom.rs +++ b/tools/test-framework/src/ibc/denom.rs @@ -8,7 +8,6 @@ use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, PortId}; use sha2::{Digest, Sha256}; use subtle_encoding::hex; -use crate::chain::chain_type::ChainType; use crate::types::id::{TaggedChannelIdRef, TaggedPortIdRef}; use crate::types::tagged::*; @@ -17,16 +16,11 @@ use crate::types::tagged::*; */ #[derive(Debug, Clone)] pub enum Denom { - Base { - display_name: String, - raw_address: String, - token_denom: u8, - }, + Base(String), Ibc { path: String, - denom: Box, + denom: String, hashed: String, - token_denom: u8, }, } @@ -57,18 +51,6 @@ pub type TaggedDenomRef<'a, Chain> = MonoTagged; Returns the derived denomination on `ChainB`. */ pub fn derive_ibc_denom( - chain_type: &ChainType, - port_id: &TaggedPortIdRef, - channel_id: &TaggedChannelIdRef, - denom: &TaggedDenomRef, -) -> Result, Error> { - match chain_type { - ChainType::Namada => derive_namada_ibc_denom(port_id, channel_id, denom), - _ => derive_cosmos_ibc_denom(port_id, channel_id, denom), - } -} - -fn derive_cosmos_ibc_denom( port_id: &TaggedPortIdRef, channel_id: &TaggedChannelIdRef, denom: &TaggedDenomRef, @@ -95,26 +77,16 @@ fn derive_cosmos_ibc_denom( } match denom.value() { - Denom::Base { - raw_address, - token_denom, - .. - } => { - let hashed = derive_denom(port_id.value(), channel_id.value(), raw_address)?; + Denom::Base(denom) => { + let hashed = derive_denom(port_id.value(), channel_id.value(), denom)?; Ok(MonoTagged::new(Denom::Ibc { path: format!("{port_id}/{channel_id}"), - denom: Box::new((*denom.value()).clone()), + denom: denom.clone(), hashed, - token_denom: *token_denom, })) } - Denom::Ibc { - path, - denom, - token_denom, - .. - } => { + Denom::Ibc { path, denom, .. } => { let new_path = format!("{port_id}/{channel_id}/{path}"); let hashed = derive_denom_with_path(&format!("{new_path}/{denom}"))?; @@ -122,65 +94,19 @@ fn derive_cosmos_ibc_denom( path: new_path, denom: denom.clone(), hashed, - token_denom: *token_denom, - })) - } - } -} - -fn derive_namada_ibc_denom( - port_id: &TaggedPortIdRef, - channel_id: &TaggedChannelIdRef, - denom: &TaggedDenomRef, -) -> Result, Error> { - match denom.value() { - Denom::Base { - raw_address, - token_denom, - .. - } => { - let path = format!("{port_id}/{channel_id}"); - let ibc_token_addr = namada_sdk::ibc::trace::ibc_token(format!("{path}/{raw_address}")); - - Ok(MonoTagged::new(Denom::Ibc { - path, - denom: Box::new((*denom.value()).clone()), - hashed: ibc_token_addr.to_string(), - token_denom: *token_denom, - })) - } - Denom::Ibc { - path, - denom, - token_denom, - .. - } => { - let new_path = format!("{port_id}/{channel_id}/{path}"); - let ibc_token_addr = - namada_sdk::ibc::trace::ibc_token(format!("{new_path}/{}", denom.hash_only())); - - Ok(MonoTagged::new(Denom::Ibc { - path: new_path, - denom: denom.clone(), - hashed: ibc_token_addr.to_string(), - token_denom: *token_denom, })) } } } impl Denom { - pub fn base(display_name: &str, raw_address: &str) -> Self { - Denom::Base { - display_name: display_name.to_owned(), - raw_address: raw_address.to_owned(), - token_denom: if display_name == "nam" { 6 } else { 0 }, - } + pub fn base(denom: &str) -> Self { + Denom::Base(denom.to_string()) } pub fn hash_only(&self) -> String { match self { - Denom::Base { raw_address, .. } => raw_address.to_string(), + Denom::Base(denom) => denom.to_string(), Denom::Ibc { hashed, .. } => match hashed.find('/') { Some(index) => hashed[index + 1..].to_string(), None => hashed.to_string(), @@ -188,23 +114,9 @@ impl Denom { } } - pub fn display_name(&self) -> String { - match self { - Denom::Base { display_name, .. } => display_name.to_string(), - Denom::Ibc { hashed, .. } => hashed.to_string(), - } - } - - pub fn namada_display_name(&self) -> String { - match self { - Denom::Base { display_name, .. } => display_name.to_string(), - Denom::Ibc { path, denom, .. } => format!("{path}/{}", denom.namada_display_name()), - } - } - pub fn as_str(&self) -> &str { match self { - Denom::Base { display_name, .. } => display_name, + Denom::Base(denom) => denom, Denom::Ibc { hashed, .. } => hashed, } } @@ -213,8 +125,8 @@ impl Denom { impl Display for Denom { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { match self { - Denom::Base { raw_address, .. } => { - write!(f, "{raw_address}") + Denom::Base(denom) => { + write!(f, "{denom}") } Denom::Ibc { hashed, .. } => { write!(f, "{hashed}") @@ -226,32 +138,19 @@ impl Display for Denom { impl PartialEq for Denom { fn eq(&self, other: &Self) -> bool { match (self, other) { - ( - Self::Base { - display_name: d1, - raw_address: a1, - token_denom: td1, - }, - Self::Base { - display_name: d2, - raw_address: a2, - token_denom: td2, - }, - ) => (d1 == d2) && (a1 == a2) && (td1 == td2), + (Self::Base(d1), Self::Base(d2)) => d1 == d2, ( Self::Ibc { path: p1, denom: d1, hashed: h1, - token_denom: td1, }, Self::Ibc { path: p2, denom: d2, hashed: h2, - token_denom: td2, }, - ) => p1 == p2 && d1 == d2 && h1 == h2 && (td1 == td2), + ) => p1 == p2 && d1 == d2 && h1 == h2, _ => self.as_str() == other.as_str(), } } diff --git a/tools/test-framework/src/ibc/token.rs b/tools/test-framework/src/ibc/token.rs index e7ece52fc0..7300304d18 100644 --- a/tools/test-framework/src/ibc/token.rs +++ b/tools/test-framework/src/ibc/token.rs @@ -1,9 +1,7 @@ use core::ops::{Add, Sub}; use ibc_relayer_types::applications::transfer::amount::Amount; use ibc_relayer_types::applications::transfer::coin::{Coin, RawCoin}; -use ibc_relayer_types::bigint::U256; -use crate::chain::chain_type::ChainType; use crate::error::Error; use crate::ibc::denom::{derive_ibc_denom, Denom, TaggedDenom, TaggedDenomRef}; use crate::types::id::{TaggedChannelIdRef, TaggedPortIdRef}; @@ -23,7 +21,6 @@ pub trait TaggedTokenExt { fn transfer( &self, - chain_type: &ChainType, port_id: &TaggedPortIdRef, channel_id: &TaggedChannelIdRef, ) -> Result, Error>; @@ -48,11 +45,10 @@ impl TaggedTokenExt for TaggedToken { fn transfer( &self, - chain_type: &ChainType, port_id: &TaggedPortIdRef, channel_id: &TaggedChannelIdRef, ) -> Result, Error> { - let denom = derive_ibc_denom(chain_type, port_id, channel_id, &self.denom())?; + let denom = derive_ibc_denom(port_id, channel_id, &self.denom())?; Ok(denom.with_amount(self.value().amount)) } @@ -73,11 +69,10 @@ impl TaggedTokenExt for TaggedTokenRef<'_, Chain> { fn transfer( &self, - chain_type: &ChainType, port_id: &TaggedPortIdRef, channel_id: &TaggedChannelIdRef, ) -> Result, Error> { - let denom = derive_ibc_denom(chain_type, port_id, channel_id, &self.denom())?; + let denom = derive_ibc_denom(port_id, channel_id, &self.denom())?; Ok(denom.with_amount(self.value().amount)) } @@ -85,32 +80,18 @@ impl TaggedTokenExt for TaggedTokenRef<'_, Chain> { impl TaggedDenomExt for TaggedDenom { fn with_amount(&self, amount: impl Into) -> TaggedToken { - let amount: Amount = match self.value() { - Denom::Base { .. } => amount.into(), - Denom::Ibc { token_denom, .. } => { - let amount: Amount = amount.into(); - (amount.0 * U256::from(10).pow(U256::from(*token_denom))).into() - } - }; self.map(|denom| Token { denom: denom.clone(), - amount, + amount: amount.into(), }) } } impl TaggedDenomExt for TaggedDenomRef<'_, Chain> { fn with_amount(&self, amount: impl Into) -> TaggedToken { - let amount: Amount = match self.value() { - Denom::Base { .. } => amount.into(), - Denom::Ibc { token_denom, .. } => { - let amount: Amount = amount.into(); - (amount.0 * U256::from(10).pow(U256::from(*token_denom))).into() - } - }; self.map(|denom| Token { denom: (*denom).clone(), - amount, + amount: amount.into(), }) } } diff --git a/tools/test-framework/src/relayer/chain.rs b/tools/test-framework/src/relayer/chain.rs index 1308d49d5a..4d98354aea 100644 --- a/tools/test-framework/src/relayer/chain.rs +++ b/tools/test-framework/src/relayer/chain.rs @@ -22,7 +22,7 @@ use crossbeam_channel as channel; use ibc_proto::ibc::core::channel::v1::{QueryUpgradeErrorRequest, QueryUpgradeRequest}; -use ibc_relayer::chain::version::Specs; +use ibc_relayer::chain::cosmos::version::Specs; use ibc_relayer_types::applications::ics28_ccv::msgs::{ConsumerChain, ConsumerId}; use ibc_relayer_types::core::ics04_channel::upgrade::{ErrorReceipt, Upgrade}; use tracing::Span; diff --git a/tools/test-framework/src/relayer/fee.rs b/tools/test-framework/src/relayer/fee.rs index e4a2a92bd4..51b1ff6814 100644 --- a/tools/test-framework/src/relayer/fee.rs +++ b/tools/test-framework/src/relayer/fee.rs @@ -1,5 +1,3 @@ -use eyre::eyre; - use core::time::Duration; use http::uri::Uri; use ibc_relayer::chain::cosmos::query::fee::{ @@ -65,13 +63,13 @@ pub async fn ibc_token_transfer_with_fee( let messages = vec![pay_message, transfer_message]; - let key = &sender - .value() - .key - .downcast() - .ok_or_else(|| eyre!("unable to downcast key")) - .map_err(Error::generic)?; - let events = simple_send_tx(rpc_client.value(), tx_config.value(), key, messages).await?; + let events = simple_send_tx( + rpc_client.value(), + tx_config.value(), + &sender.value().key, + messages, + ) + .await?; Ok(events) } @@ -103,15 +101,14 @@ pub async fn pay_packet_fee( ) .map_err(handle_generic_error)?; - let key = &payer - .value() - .key - .downcast() - .ok_or_else(|| eyre!("unable to downcast key")) - .map_err(Error::generic)?; - let events = simple_send_tx(rpc_client.value(), tx_config.value(), key, vec![message]) - .await - .map_err(Error::relayer)?; + let events = simple_send_tx( + rpc_client.value(), + tx_config.value(), + &payer.value().key, + vec![message], + ) + .await + .map_err(Error::relayer)?; Ok(events) } @@ -143,13 +140,13 @@ pub async fn register_counterparty_payee( let messages = vec![message]; - let key = &wallet - .value() - .key - .downcast() - .ok_or_else(|| eyre!("unable to downcast key")) - .map_err(Error::generic)?; - simple_send_tx(rpc_client.value(), tx_config.value(), key, messages).await?; + simple_send_tx( + rpc_client.value(), + tx_config.value(), + &wallet.value().key, + messages, + ) + .await?; Ok(()) } @@ -177,13 +174,13 @@ pub async fn register_payee( let messages = vec![message]; - let key = &wallet - .value() - .key - .downcast() - .ok_or_else(|| eyre!("unable to downcast key")) - .map_err(Error::generic)?; - simple_send_tx(rpc_client.value(), tx_config.value(), key, messages).await?; + simple_send_tx( + rpc_client.value(), + tx_config.value(), + &wallet.value().key, + messages, + ) + .await?; Ok(()) } diff --git a/tools/test-framework/src/relayer/transfer.rs b/tools/test-framework/src/relayer/transfer.rs index 43a379ee29..26595051a5 100644 --- a/tools/test-framework/src/relayer/transfer.rs +++ b/tools/test-framework/src/relayer/transfer.rs @@ -6,6 +6,7 @@ use core::ops::Add; use core::time::Duration; use eyre::eyre; +use ibc_relayer_types::core::ics04_channel::packet::Packet; use ibc_relayer_types::events::IbcEvent; use ibc_proto::google::protobuf::Any; @@ -19,7 +20,6 @@ use ibc_relayer_types::core::ics04_channel::timeout::TimeoutHeight; use ibc_relayer_types::timestamp::Timestamp; use tendermint_rpc::HttpClient; -use crate::chain::exec::simple_exec; use crate::error::{handle_generic_error, Error}; use crate::ibc::token::TaggedTokenRef; use crate::types::id::{TaggedChannelIdRef, TaggedPortIdRef}; @@ -92,7 +92,7 @@ pub async fn ibc_token_transfer( token: &TaggedTokenRef<'_, SrcChain>, memo: Option, timeout: Option, -) -> Result<(), Error> { +) -> Result { let message = build_transfer_message( port_id, channel_id, @@ -103,21 +103,15 @@ pub async fn ibc_token_transfer( memo.clone(), )?; - let key = &sender - .value() - .key - .downcast() - .ok_or_else(|| eyre!("unable to downcast key")) - .map_err(Error::generic)?; let events = simple_send_tx( rpc_client.into_value(), tx_config.value(), - key, + &sender.value().key, vec![message], ) .await?; - let _packet = events + let packet = events .into_iter() .find_map(|event| match event.event { IbcEvent::SendPacket(ev) => Some(ev.packet), @@ -125,95 +119,7 @@ pub async fn ibc_token_transfer( }) .ok_or_else(|| eyre!("failed to find send packet event"))?; - Ok(()) -} - -pub fn local_namada_token_transfer( - home_path: &str, - sender: &str, - recipient: &str, - denom: &str, - amount: &str, - rpc_port: &str, -) -> Result<(), Error> { - simple_exec( - "namada local transfer", - "namadac", - &[ - "--base-dir", - home_path, - "transparent-transfer", - "--source", - sender, - "--target", - recipient, - "--token", - denom, - "--amount", - amount, - "--signing-keys", - &format!("{sender}-key"), - "--gas-limit", - "150000", - "--node", - &format!("http://127.0.0.1:{rpc_port}"), - ], - )?; - - Ok(()) -} - -pub fn ibc_namada_token_transfer( - home_path: &str, - sender: &str, - receiver: &str, - denom: &str, - amount: &str, - channel_id: &str, - rpc_port: &str, - memo: Option, - timeout: Option, -) -> Result<(), Error> { - let signing_key = format!("{sender}-key"); - let node = format!("http://127.0.0.1:{rpc_port}"); - let mut args = vec![ - "--base-dir", - home_path, - "ibc-transfer", - "--source", - sender, - "--receiver", - receiver, - "--token", - denom, - "--amount", - amount, - "--signing-keys", - &signing_key, - "--channel-id", - channel_id, - "--gas-limit", - "150000", - "--node", - &node, - ]; - - let memo_str = memo.clone().unwrap_or_default(); - if memo.is_some() { - args.push("--ibc-memo"); - args.push(&memo_str); - } - - let timeout_str; - if let Some(timeout) = timeout { - args.push("--timeout-sec-offset"); - timeout_str = timeout.as_secs().to_string(); - args.push(&timeout_str); - } - - simple_exec("namada transfer", "namadac", &args)?; - - Ok(()) + Ok(packet) } pub async fn batched_ibc_token_transfer( @@ -241,13 +147,13 @@ pub async fn batched_ibc_token_transfer( .take(num_msgs) .collect::, _>>()?; - let key = &sender - .value() - .key - .downcast() - .ok_or_else(|| eyre!("unable to downcast key")) - .map_err(Error::generic)?; - batched_send_tx(rpc_client.value(), tx_config.value(), key, messages).await?; + batched_send_tx( + rpc_client.value(), + tx_config.value(), + &sender.value().key, + messages, + ) + .await?; Ok(()) } diff --git a/tools/test-framework/src/types/single/node.rs b/tools/test-framework/src/types/single/node.rs index 51ab9499d3..4abdea72b8 100644 --- a/tools/test-framework/src/types/single/node.rs +++ b/tools/test-framework/src/types/single/node.rs @@ -21,7 +21,6 @@ use tendermint_rpc::WebSocketClientUrl; use crate::chain::chain_type::ChainType as TestedChainType; use crate::chain::driver::ChainDriver; -use crate::chain::exec::simple_exec; use crate::ibc::denom::Denom; use crate::prelude::TestConfig; use crate::types::env::{prefix_writer, EnvWriter, ExportEnv}; @@ -150,10 +149,6 @@ impl FullNode { TestedChainType::Provenance => { config::GasPrice::new(5000.0, test_config.native_token(chain_number).clone()) } - TestedChainType::Namada => { - let denom = get_denom(&self.chain_driver.home_path)?; - config::GasPrice::new(0.000003, denom) - } _ => config::GasPrice::new(0.003, test_config.native_token(chain_number).clone()), }; @@ -163,104 +158,51 @@ impl FullNode { DynamicGasPrice::disabled() }; - let chain_config = match chain_type { - TestedChainType::Cosmos { dynamic_fee: _ } - | TestedChainType::Provenance - | TestedChainType::Evmos - | TestedChainType::Osmosis - | TestedChainType::Injective => config::ChainConfig::CosmosSdk(CosmosSdkConfig { - 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())?, - event_source: config::EventSourceMode::Push { - url: WebSocketClientUrl::from_str(&self.chain_driver.websocket_address())?, - batch_delay: config::default::batch_delay(), - }, - rpc_timeout: config::default::rpc_timeout(), - trusted_node: false, - genesis_restart: None, - account_prefix: self.chain_driver.account_prefix.clone(), - key_name: self.wallets.relayer.id.0.clone(), - key_store_type: Store::Test, - key_store_folder: Some(hermes_keystore_dir.into()), - store_prefix: "ibc".to_string(), - default_gas: None, - max_gas: Some(3000000), - gas_adjustment: None, - gas_multiplier: Some(GasMultiplier::unsafe_new(1.5)), - dynamic_gas_price, - fee_granter: None, - max_msg_num: Default::default(), - max_tx_size: Default::default(), - max_grpc_decoding_size: config::default::max_grpc_decoding_size(), - query_packets_chunk_size: config::default::query_packets_chunk_size(), - max_block_time: Duration::from_secs(30), - clock_drift: Duration::from_secs(5), - trusting_period: Some(Duration::from_secs(14 * 24 * 3600)), - client_refresh_rate: config::default::client_refresh_rate(), - ccv_consumer_chain: false, - trust_threshold: Default::default(), - gas_price, - 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, - compat_mode, - clear_interval: None, - excluded_sequences: ExcludedSequences::new(BTreeMap::new()), - allow_ccq: true, - }), - TestedChainType::Namada => config::ChainConfig::Namada(CosmosSdkConfig { - 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())?, - event_source: config::EventSourceMode::Push { - url: WebSocketClientUrl::from_str(&self.chain_driver.websocket_address())?, - batch_delay: config::default::batch_delay(), - }, - rpc_timeout: config::default::rpc_timeout(), - trusted_node: false, - genesis_restart: None, - account_prefix: "".to_owned(), - key_name: self.wallets.relayer.id.0.clone(), - key_store_type: Store::Test, - key_store_folder: Some(hermes_keystore_dir.into()), - store_prefix: "ibc".to_string(), - default_gas: None, - max_gas: Some(4000000), - gas_adjustment: None, - gas_multiplier: Some(GasMultiplier::unsafe_new(1.2)), - dynamic_gas_price: DynamicGasPrice::default(), - fee_granter: None, - max_msg_num: Default::default(), - max_tx_size: Default::default(), - max_grpc_decoding_size: config::default::max_grpc_decoding_size(), - query_packets_chunk_size: config::default::query_packets_chunk_size(), - max_block_time: Duration::from_secs(30), - clock_drift: Duration::from_secs(5), - trusting_period: Some(Duration::from_secs(1999)), - client_refresh_rate: config::default::client_refresh_rate(), - ccv_consumer_chain: false, - trust_threshold: Default::default(), - gas_price, - 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, - compat_mode, - clear_interval: None, - excluded_sequences: ExcludedSequences::new(BTreeMap::new()), - allow_ccq: false, - }), - }; - - Ok(chain_config) + Ok(config::ChainConfig::CosmosSdk(CosmosSdkConfig { + 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())?, + event_source: config::EventSourceMode::Push { + url: WebSocketClientUrl::from_str(&self.chain_driver.websocket_address())?, + batch_delay: config::default::batch_delay(), + }, + rpc_timeout: config::default::rpc_timeout(), + trusted_node: false, + genesis_restart: None, + account_prefix: self.chain_driver.account_prefix.clone(), + key_name: self.wallets.relayer.id.0.clone(), + key_store_type: Store::Test, + key_store_folder: Some(hermes_keystore_dir.into()), + store_prefix: "ibc".to_string(), + default_gas: None, + max_gas: Some(3000000), + gas_adjustment: None, + gas_multiplier: Some(GasMultiplier::unsafe_new(1.5)), + dynamic_gas_price, + fee_granter: None, + max_msg_num: Default::default(), + max_tx_size: Default::default(), + max_grpc_decoding_size: config::default::max_grpc_decoding_size(), + query_packets_chunk_size: config::default::query_packets_chunk_size(), + max_block_time: Duration::from_secs(30), + clock_drift: Duration::from_secs(5), + trusting_period: Some(Duration::from_secs(14 * 24 * 3600)), + client_refresh_rate: config::default::client_refresh_rate(), + ccv_consumer_chain: false, + trust_threshold: Default::default(), + gas_price, + 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, + compat_mode, + clear_interval: None, + excluded_sequences: ExcludedSequences::new(BTreeMap::new()), + allow_ccq: true, + })) } /** @@ -278,27 +220,6 @@ impl FullNode { } } -fn get_denom(home_path: &str) -> Result { - let output = simple_exec( - "namada", - "namadaw", - &["--base-dir", home_path, "find", "--alias", "nam"], - )? - .stdout; - - let words: Vec<&str> = output.split_whitespace().collect(); - - if let Some(derived_index) = words.iter().position(|&w| w == "Established:") { - if let Some(&denom) = words.get(derived_index + 1) { - return Ok(denom.to_owned()); - } - return Err(eyre!( - "chain id is not 3 words after `Established:`: {output}" - )); - } - Err(eyre!("could not find `Derived` in output: {output}")) -} - impl ExportEnv for FullNode { fn export_env(&self, writer: &mut impl EnvWriter) { self.chain_driver.export_env(writer); diff --git a/tools/test-framework/src/types/wallet.rs b/tools/test-framework/src/types/wallet.rs index 943ebb9aa3..89b75f5b82 100644 --- a/tools/test-framework/src/types/wallet.rs +++ b/tools/test-framework/src/types/wallet.rs @@ -3,7 +3,7 @@ */ use core::fmt::{self, Display}; -use ibc_relayer::keyring::{AnySigningKeyPair, NamadaKeyPair, Secp256k1KeyPair}; +use ibc_relayer::keyring::Secp256k1KeyPair; use crate::types::env::{prefix_writer, EnvWriter, ExportEnv}; use crate::types::tagged::*; @@ -36,7 +36,7 @@ pub struct Wallet { // TODO: Parameterize this type on `SigningKeyPair` /// The wallet key information in the form of `SigningKeyPair` /// that is used by the relayer. - pub key: AnySigningKeyPair, + pub key: Secp256k1KeyPair, } /** @@ -82,7 +82,7 @@ pub trait TaggedWallet { fn address(&self) -> MonoTagged; /// Get the `SigningKeyPair` tagged with the given `Chain`. - fn key(&self) -> MonoTagged; + fn key(&self) -> MonoTagged; } /** @@ -107,19 +107,11 @@ pub trait TaggedTestWalletsExt { impl Wallet { /// Create a new [`Wallet`] - pub fn new_secp256(id: String, address: String, secp256_key: Secp256k1KeyPair) -> Self { + pub fn new(id: String, address: String, key: Secp256k1KeyPair) -> Self { Self { id: WalletId(id), address: WalletAddress(address), - key: secp256_key.into(), - } - } - - pub fn new_namada(id: String, address: String, namada_key: NamadaKeyPair) -> Self { - Self { - id: WalletId(id), - address: WalletAddress(address), - key: namada_key.into(), + key, } } } @@ -139,7 +131,7 @@ impl TaggedWallet for MonoTagged { self.map_ref(|w| &w.address) } - fn key(&self) -> MonoTagged { + fn key(&self) -> MonoTagged { self.map_ref(|w| &w.key) } } @@ -153,7 +145,7 @@ impl TaggedWallet for MonoTagged { self.map_ref(|w| &w.address) } - fn key(&self) -> MonoTagged { + fn key(&self) -> MonoTagged { self.map_ref(|w| &w.key) } } diff --git a/tools/test-framework/src/util/interchain_security.rs b/tools/test-framework/src/util/interchain_security.rs index 70a0e5da39..ea66e12f4f 100644 --- a/tools/test-framework/src/util/interchain_security.rs +++ b/tools/test-framework/src/util/interchain_security.rs @@ -1,4 +1,4 @@ -use crate::chain::config::cosmos::set_voting_period; +use crate::chain::config::set_voting_period; use crate::prelude::*; use ibc_relayer::chain::tracking::TrackedMsgs; @@ -35,7 +35,7 @@ pub fn update_relayer_config_for_consumer_chain(config: &mut Config) { chain_config.ccv_consumer_chain = true; chain_config.trusting_period = Some(Duration::from_secs(99)); } - ChainConfig::CosmosSdk(_) | ChainConfig::Namada(_) => {} + ChainConfig::CosmosSdk(_) => {} } } } diff --git a/tools/test-framework/src/util/mod.rs b/tools/test-framework/src/util/mod.rs index 0e677c7d6f..7db62f867e 100644 --- a/tools/test-framework/src/util/mod.rs +++ b/tools/test-framework/src/util/mod.rs @@ -6,7 +6,6 @@ pub mod array; pub mod assert; pub mod file; pub mod interchain_security; -pub mod namada; pub mod proposal_status; pub mod random; pub mod retry; diff --git a/tools/test-framework/src/util/namada.rs b/tools/test-framework/src/util/namada.rs deleted file mode 100644 index 03d967b17e..0000000000 --- a/tools/test-framework/src/util/namada.rs +++ /dev/null @@ -1,176 +0,0 @@ -use ibc_proto::Protobuf; -use ibc_relayer::consensus_state::{AnyConsensusState, AnyConsensusStateWithHeight}; -use ibc_relayer_types::core::ics04_channel::packet::Sequence; -use ibc_relayer_types::core::ics24_host::identifier::{ChannelId, ClientId, PortId}; -use ibc_relayer_types::events::IbcEventType; -use ibc_relayer_types::Height; -use itertools::Itertools; -use namada_sdk::events::extend::Height as HeightAttr; -use namada_sdk::ibc::storage::{consensus_height, consensus_state_prefix}; -use namada_sdk::queries::RPC; -use namada_sdk::storage::{Key, PrefixValue}; -use namada_sdk::tx::Tx; -use namada_tendermint_rpc::{Client, HttpClient, Url}; -use std::fs::File; -use std::io::Read; -use toml::Value; - -use crate::prelude::*; - -pub fn get_namada_denom_address( - chain_id: &str, - home_path: &str, - denom: &str, -) -> Result { - let file_path = format!("{}/{}/wallet.toml", home_path, chain_id); - tracing::warn!("file path: {file_path}"); - let mut toml_content = String::new(); - let mut file = File::open(file_path).expect("Failed to open file"); - file.read_to_string(&mut toml_content) - .expect("Failed to read file"); - - // Parse the TOML content into a `toml::Value` object - let toml_value: Value = toml::from_str(&toml_content).expect("Failed to parse TOML"); - - // Extract a field from the TOML file - let denom_address = toml_value - .get("addresses") - .ok_or_else(|| eyre!("missing `addresses` field"))? - .get(denom) - .ok_or_else(|| eyre!("missing `{denom}` field"))? - .as_str() - .unwrap_or(denom) - .to_owned(); - - Ok(denom_address) -} - -pub async fn query_consensus_states( - rpc_address: Url, - client_id: &ClientId, -) -> Result, Error> { - // convert to that of ibc-rs - let client_id = client_id - .to_string() - .parse() - .expect("Client ID conversion shouldn't fail"); - let prefix = consensus_state_prefix(&client_id); - let mut states = vec![]; - for PrefixValue { key, value } in query_prefix(rpc_address, &prefix).await? { - let height = consensus_height(&key).expect("Key should have the height"); - let state = AnyConsensusStateWithHeight { - height: Height::new(height.revision_number(), height.revision_height()).unwrap(), - consensus_state: AnyConsensusState::decode_vec(&value) - .map_err(|_| Error::query_client())?, - }; - states.push(state); - } - Ok(states) -} - -async fn query_prefix(rpc_address: Url, prefix: &Key) -> Result, Error> { - let client = HttpClient::new(rpc_address).expect("Failed to make a RPC client"); - let response = RPC - .shell() - .storage_prefix(&client, None, None, false, prefix) - .await - .map_err(|e| eyre!("Namada query with prefix failed: {e}"))?; - Ok(response.data) -} - -pub async fn query_receive_tx_memo( - rpc_address: Url, - src_port_id: &PortId, - src_channel_id: &ChannelId, - dst_port_id: &PortId, - dst_channel_id: &ChannelId, - sequence: Sequence, -) -> Result { - let client = HttpClient::new(rpc_address).expect("Failed to make a RPC client"); - let height = query_write_ack_packet_height( - &client, - src_port_id, - src_channel_id, - dst_port_id, - dst_channel_id, - sequence, - ) - .await?; - - let height = namada_tendermint::block::Height::try_from(height.revision_height()) - .expect("Height should be converted"); - let response = client - .block(height) - .await - .map_err(|e| eyre!("Query a block failed: {e}"))?; - let memo: Vec = response - .block - .data - .iter() - .flat_map(|tx_bytes| { - let tx = Tx::try_from(&tx_bytes[..]) - .map_err(|e| e.to_string()) - .expect("Decoding tx failed"); - let memo: Vec = tx - .header() - .batch - .iter() - .filter_map(|cmt| { - tx.memo(cmt) - .map(|memo_bytes| String::from_utf8_lossy(&memo_bytes).to_string()) - }) - .collect(); - memo - }) - .collect(); - - // All memo should be the same for now - assert!(memo.iter().all_equal()); - - let memo = memo.first().ok_or_else(|| eyre!("No memo field"))?; - Ok(memo.to_string()) -} - -async fn query_write_ack_packet_height( - client: &HttpClient, - src_port_id: &PortId, - src_channel_id: &ChannelId, - dst_port_id: &PortId, - dst_channel_id: &ChannelId, - sequence: Sequence, -) -> Result { - let event = RPC - .shell() - .ibc_packet( - client, - &IbcEventType::WriteAck - .as_str() - .parse() - .expect("IbcEventType should be parsable"), - &src_port_id - .as_str() - .parse() - .expect("PortId should be parsable"), - &src_channel_id - .as_str() - .parse() - .expect("ChannelId should be parsable"), - &dst_port_id - .as_str() - .parse() - .expect("PortId should be parsable"), - &dst_channel_id - .as_str() - .parse() - .expect("ChannelId should be parsable"), - &u64::from(sequence).into(), - ) - .await - .map_err(|e| eyre!("Namada packet query failed: {e}"))? - .ok_or_else(|| eyre!("No write ack event"))?; - let height = event - .read_attribute::() - .expect("Height should exist"); - - Ok(Height::new(0, height.0).expect("Height conversion shouldn't fail")) -} From be0be09d930f337de1f277e6eec65826a3a5ea2a Mon Sep 17 00:00:00 2001 From: Romain Ruetschi Date: Fri, 13 Dec 2024 15:16:31 +0100 Subject: [PATCH 224/224] Release v1.10.5 (#4277) * Update CHANGELOG.md * Create unclog release * Bump versions * Update release to v1.10.5 * Fix uuid version --------- Co-authored-by: Luca Joss --- .../4203-update-juno-to-v25.md | 0 .../4263-collect-events-finalize-block.md | 0 .changelog/v1.10.5/summary.md | 3 + CHANGELOG.md | 15 + Cargo.lock | 411 +++++++++--------- 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 +- 19 files changed, 253 insertions(+), 220 deletions(-) rename .changelog/{unreleased => v1.10.5}/improvements/ibc-integration-test/4203-update-juno-to-v25.md (100%) rename .changelog/{unreleased => v1.10.5}/improvements/ibc-relayer/4263-collect-events-finalize-block.md (100%) create mode 100644 .changelog/v1.10.5/summary.md diff --git a/.changelog/unreleased/improvements/ibc-integration-test/4203-update-juno-to-v25.md b/.changelog/v1.10.5/improvements/ibc-integration-test/4203-update-juno-to-v25.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-integration-test/4203-update-juno-to-v25.md rename to .changelog/v1.10.5/improvements/ibc-integration-test/4203-update-juno-to-v25.md diff --git a/.changelog/unreleased/improvements/ibc-relayer/4263-collect-events-finalize-block.md b/.changelog/v1.10.5/improvements/ibc-relayer/4263-collect-events-finalize-block.md similarity index 100% rename from .changelog/unreleased/improvements/ibc-relayer/4263-collect-events-finalize-block.md rename to .changelog/v1.10.5/improvements/ibc-relayer/4263-collect-events-finalize-block.md diff --git a/.changelog/v1.10.5/summary.md b/.changelog/v1.10.5/summary.md new file mode 100644 index 0000000000..a959df702f --- /dev/null +++ b/.changelog/v1.10.5/summary.md @@ -0,0 +1,3 @@ +*December 13rd, 2024* + +This release addresses an issue with pull-mode event collection. The functionality has been enhanced to accurately retrieve events from `finalized_block_events`, ensuring more reliable event processing. \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6733c3d778..620a2d05a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # CHANGELOG +## v1.10.5 + +*December 13rd, 2024* + +This release addresses an issue with pull-mode event collection. The functionality has been enhanced to accurately retrieve events from `finalized_block_events`, ensuring more reliable event processing. + +### IMPROVEMENTS + +- [Relayer Library](relayer) + - Collect events from `finalized_block_events` when using `pull` mode + ([\#4263](https://github.com/informalsystems/hermes/issues/4263)) +- [Integration Test Framework](tools/test-framework) + - Update the version of Juno running the integration tests in the CI from `v24.0.0` + to `v25.0.0` ([\#4203](https://github.com/informalsystems/hermes/issues/4203)) + ## v1.10.4 *November 19th, 2024* diff --git a/Cargo.lock b/Cargo.lock index 55cd5f92ec..c3dd849ea3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -131,9 +131,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" [[package]] name = "arc-swap" @@ -172,7 +172,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -183,7 +183,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -215,7 +215,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi", "libc", "winapi", ] @@ -268,7 +268,7 @@ dependencies = [ "axum-core 0.4.5", "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", "itoa", @@ -279,8 +279,8 @@ dependencies = [ "pin-project-lite", "rustversion", "serde", - "sync_wrapper 1.0.1", - "tower 0.5.1", + "sync_wrapper 1.0.2", + "tower 0.5.2", "tower-layer", "tower-service", ] @@ -311,13 +311,13 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "http-body-util", "mime", "pin-project-lite", "rustversion", - "sync_wrapper 1.0.1", + "sync_wrapper 1.0.2", "tower-layer", "tower-service", ] @@ -431,9 +431,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82033247fd8e890df8f740e407ad4d038debb9eb1f40533fffb32e7d17dc6f7" +checksum = "b8ee0c1824c4dea5b5f81736aff91bae041d2c07ee1192bec91054e10e3e601e" dependencies = [ "arrayref", "arrayvec", @@ -493,9 +493,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" dependencies = [ "serde", ] @@ -508,9 +508,9 @@ checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" [[package]] name = "cc" -version = "1.2.1" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" dependencies = [ "shlex", ] @@ -523,9 +523,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -662,6 +662,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -683,9 +693,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -766,7 +776,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -834,7 +844,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -900,7 +910,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1039,12 +1049,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1059,9 +1069,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "ff" @@ -1178,7 +1188,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -1284,7 +1294,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.6.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -1293,17 +1303,17 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "http 1.1.0", - "indexmap 2.6.0", + "http 1.2.0", + "indexmap 2.7.0", "slab", "tokio", "tokio-util", @@ -1330,9 +1340,9 @@ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "hdpath" @@ -1358,12 +1368,6 @@ 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" @@ -1404,9 +1408,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -1431,7 +1435,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http 1.2.0", ] [[package]] @@ -1442,7 +1446,7 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", "pin-project-lite", ] @@ -1501,15 +1505,15 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.6", - "http 1.1.0", + "h2 0.4.7", + "http 1.2.0", "http-body 1.0.1", "httparse", "httpdate", @@ -1540,7 +1544,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" dependencies = [ - "hyper 1.5.0", + "hyper 1.5.1", "hyper-util", "pin-project-lite", "tokio", @@ -1556,9 +1560,9 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", + "http 1.2.0", "http-body 1.0.1", - "hyper 1.5.0", + "hyper 1.5.1", "pin-project-lite", "socket2", "tokio", @@ -1591,12 +1595,12 @@ dependencies = [ [[package]] name = "ibc-chain-registry" -version = "0.29.4" +version = "0.29.5" dependencies = [ "async-trait", "flex-error", "futures", - "http 1.1.0", + "http 1.2.0", "ibc-proto", "ibc-relayer", "ibc-relayer-types", @@ -1611,10 +1615,10 @@ dependencies = [ [[package]] name = "ibc-integration-test" -version = "0.29.4" +version = "0.29.5" dependencies = [ "byte-unit", - "http 1.1.0", + "http 1.2.0", "ibc-relayer", "ibc-relayer-types", "ibc-test-framework", @@ -1649,7 +1653,7 @@ dependencies = [ [[package]] name = "ibc-relayer" -version = "0.29.4" +version = "0.29.5" dependencies = [ "anyhow", "async-stream", @@ -1670,7 +1674,7 @@ dependencies = [ "generic-array", "hdpath", "hex", - "http 1.1.0", + "http 1.2.0", "humantime", "humantime-serde", "ibc-proto", @@ -1718,7 +1722,7 @@ dependencies = [ [[package]] name = "ibc-relayer-cli" -version = "1.10.4" +version = "1.10.5" dependencies = [ "abscissa_core", "clap", @@ -1732,7 +1736,7 @@ dependencies = [ "flex-error", "futures", "hdpath", - "http 1.1.0", + "http 1.2.0", "humantime", "ibc-chain-registry", "ibc-relayer", @@ -1759,7 +1763,7 @@ dependencies = [ [[package]] name = "ibc-relayer-rest" -version = "0.29.4" +version = "0.29.5" dependencies = [ "axum 0.6.20", "crossbeam-channel", @@ -1774,7 +1778,7 @@ dependencies = [ [[package]] name = "ibc-relayer-types" -version = "0.29.4" +version = "0.29.5" dependencies = [ "bytes", "derive_more", @@ -1805,7 +1809,7 @@ dependencies = [ [[package]] name = "ibc-telemetry" -version = "0.29.4" +version = "0.29.5" dependencies = [ "axum 0.6.20", "dashmap", @@ -1824,7 +1828,7 @@ dependencies = [ [[package]] name = "ibc-test-framework" -version = "0.29.4" +version = "0.29.5" dependencies = [ "chrono", "color-eyre", @@ -1833,7 +1837,7 @@ dependencies = [ "flex-error", "hdpath", "hex", - "http 1.1.0", + "http 1.2.0", "ibc-proto", "ibc-relayer", "ibc-relayer-cli", @@ -1990,7 +1994,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -2047,12 +2051,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.2", ] [[package]] @@ -2088,16 +2092,17 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -2130,9 +2135,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "libc" -version = "0.2.164" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libredox" @@ -2152,9 +2157,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "litemap" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" @@ -2210,11 +2215,10 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi 0.3.9", "libc", "wasi", "windows-sys 0.52.0", @@ -2496,7 +2500,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -2573,9 +2577,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -2597,9 +2601,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0487d90e047de87f984913713b85c601c05609aad5b0df4b4573fbf69aa13f" +checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec" dependencies = [ "bytes", "prost-derive", @@ -2607,15 +2611,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9552f850d5f0964a4e4d0bf306459ac29323ddfbae05e35a7c0d35cb0803cc5" +checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -2626,9 +2630,9 @@ checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" [[package]] name = "quanta" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" +checksum = "773ce68d0bb9bc7ef20be3536ffe94e223e1f365bd374108b2659fac0c65cfe6" dependencies = [ "crossbeam-utils", "libc", @@ -2689,9 +2693,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags 2.6.0", ] @@ -2855,15 +2859,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2894,9 +2898,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.17" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "log", "once_cell", @@ -2916,7 +2920,7 @@ dependencies = [ "openssl-probe", "rustls-pemfile 1.0.4", "schannel", - "security-framework", + "security-framework 2.11.1", ] [[package]] @@ -2929,20 +2933,19 @@ dependencies = [ "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 2.11.1", ] [[package]] name = "rustls-native-certs" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ "openssl-probe", - "rustls-pemfile 2.2.0", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 3.0.1", ] [[package]] @@ -3103,7 +3106,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.6.0", - "core-foundation", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1415a607e92bec364ea2cf9264646dcce0f91e6d65281bd6f2819cca3bf39c8" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.10.0", "core-foundation-sys", "libc", "security-framework-sys", @@ -3121,18 +3137,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] @@ -3158,13 +3174,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3197,7 +3213,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3227,7 +3243,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "itoa", "ryu", "serde", @@ -3256,7 +3272,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3377,9 +3393,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3438,7 +3454,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3475,9 +3491,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -3492,9 +3508,9 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" [[package]] name = "synstructure" @@ -3516,7 +3532,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3526,7 +3542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -3757,7 +3773,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3783,7 +3799,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3798,9 +3814,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "num-conv", @@ -3818,9 +3834,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", @@ -3881,9 +3897,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -3905,7 +3921,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -3931,20 +3947,19 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.17", - "rustls-pki-types", + "rustls 0.23.20", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -3953,9 +3968,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -4000,7 +4015,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.6.0", + "indexmap 2.7.0", "serde", "serde_spanned", "toml_datetime", @@ -4018,21 +4033,21 @@ dependencies = [ "axum 0.7.9", "base64 0.22.1", "bytes", - "h2 0.4.6", - "http 1.1.0", + "h2 0.4.7", + "http 1.2.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.0", + "hyper 1.5.1", "hyper-timeout", "hyper-util", "percent-encoding", "pin-project", "prost", - "rustls-native-certs 0.8.0", + "rustls-native-certs 0.8.1", "rustls-pemfile 2.2.0", "socket2", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls 0.26.1", "tokio-stream", "tower 0.4.13", "tower-layer", @@ -4062,14 +4077,14 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" dependencies = [ "futures-core", "futures-util", "pin-project-lite", - "sync_wrapper 0.1.2", + "sync_wrapper 1.0.2", "tower-layer", "tower-service", ] @@ -4088,9 +4103,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -4100,20 +4115,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -4121,9 +4136,9 @@ dependencies = [ [[package]] name = "tracing-error" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d686ec1c0f384b1277f097b2f279a2ecc11afe8c133c1aabf036a27cb4cd206e" +checksum = "8b1581020d7a273442f5b45074a6a57d5757ad0a47dac0e9f0bd57b81936f3db" dependencies = [ "tracing", "tracing-subscriber", @@ -4153,9 +4168,9 @@ dependencies = [ [[package]] name = "tracing-serde" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" dependencies = [ "serde", "tracing-core", @@ -4163,9 +4178,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "matchers", "nu-ansi-term", @@ -4203,7 +4218,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.1.0", + "http 1.2.0", "httparse", "log", "rand", @@ -4235,9 +4250,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" @@ -4274,9 +4289,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.3" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -4376,9 +4391,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -4387,36 +4402,36 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4424,28 +4439,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", @@ -4672,9 +4687,9 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "yoke" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", @@ -4684,13 +4699,13 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "synstructure 0.13.1", ] @@ -4712,27 +4727,27 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", "synstructure 0.13.1", ] @@ -4753,7 +4768,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] [[package]] @@ -4775,5 +4790,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.87", + "syn 2.0.90", ] diff --git a/Cargo.toml b/Cargo.toml index c7be1ceaaf..c634628408 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,14 +20,14 @@ exclude = [ [workspace.dependencies] # Hermes dependencies -ibc-relayer-cli = { version = "1.10.4", path = "crates/relayer-cli" } -ibc-relayer = { version = "0.29.4", path = "crates/relayer" } -ibc-relayer-rest = { version = "0.29.4", path = "crates/relayer-rest" } -ibc-relayer-types = { version = "0.29.4", path = "crates/relayer-types" } -ibc-chain-registry = { version = "0.29.4", path = "crates/chain-registry" } -ibc-telemetry = { version = "0.29.4", path = "crates/telemetry" } -ibc-test-framework = { version = "0.29.4", path = "tools/test-framework" } -ibc-integration-test = { version = "0.29.4", path = "tools/integration-test" } +ibc-relayer-cli = { version = "1.10.5", path = "crates/relayer-cli" } +ibc-relayer = { version = "0.29.5", path = "crates/relayer" } +ibc-relayer-rest = { version = "0.29.5", path = "crates/relayer-rest" } +ibc-relayer-types = { version = "0.29.5", path = "crates/relayer-types" } +ibc-chain-registry = { version = "0.29.5", path = "crates/chain-registry" } +ibc-telemetry = { version = "0.29.5", path = "crates/telemetry" } +ibc-test-framework = { version = "0.29.5", path = "tools/test-framework" } +ibc-integration-test = { version = "0.29.5", path = "tools/integration-test" } # IBC dependencies ibc-proto = "0.51.0" diff --git a/crates/chain-registry/Cargo.toml b/crates/chain-registry/Cargo.toml index 5968134be3..5d01bb6940 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.4" +version = "0.29.5" 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 fbdcd20d0d..47676af45e 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.4" +version = "1.10.5" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer-rest/Cargo.toml b/crates/relayer-rest/Cargo.toml index cf44344abf..134fb6c3e5 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.4" +version = "0.29.5" 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 301cce7c5a..1e78a77d7b 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.4".to_string(), + version: "0.29.5".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 7b0f1d1c28..9184537bc2 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.4" +version = "0.29.5" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/Cargo.toml b/crates/relayer/Cargo.toml index a5560a766c..5bda943405 100644 --- a/crates/relayer/Cargo.toml +++ b/crates/relayer/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-relayer" -version = "0.29.4" +version = "0.29.5" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/crates/relayer/src/lib.rs b/crates/relayer/src/lib.rs index 42d08089d9..48ed4cf9b1 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.4/ +//! [Hermes]: https://docs.rs/ibc-relayer-cli/1.10.5/ extern crate alloc; @@ -48,4 +48,4 @@ pub mod upgrade_chain; pub mod util; pub mod worker; -pub const HERMES_VERSION: &str = "1.10.4"; +pub const HERMES_VERSION: &str = "1.10.5"; diff --git a/crates/telemetry/Cargo.toml b/crates/telemetry/Cargo.toml index eb22530255..2a31d961f9 100644 --- a/crates/telemetry/Cargo.toml +++ b/crates/telemetry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ibc-telemetry" -version = "0.29.4" +version = "0.29.5" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/guide/README.md b/guide/README.md index 683e3133fc..e6cd915fda 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.4`. +Current version: `v1.10.5`. 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 8d8617b1d7..295d9abe26 100644 --- a/guide/src/SUMMARY.md +++ b/guide/src/SUMMARY.md @@ -1,6 +1,6 @@ # Summary -# Hermes v1.10.4 +# Hermes v1.10.5 --- - [Introduction](./index.md) diff --git a/guide/src/templates/hermes-version.md b/guide/src/templates/hermes-version.md index 66acda7a30..731c6c2cdb 100644 --- a/guide/src/templates/hermes-version.md +++ b/guide/src/templates/hermes-version.md @@ -1 +1 @@ -v1.10.4 +v1.10.5 diff --git a/tools/integration-test/Cargo.toml b/tools/integration-test/Cargo.toml index 77b9d86c61..f956b20c04 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.4" +version = "0.29.5" 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 50839dfd63..a4e2004906 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.4" +version = "0.29.5" edition = "2021" license = "Apache-2.0" readme = "README.md"