diff --git a/Cargo.lock b/Cargo.lock index 67eb577f1..4fc8b634a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -214,15 +214,16 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] @@ -1396,23 +1397,23 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.6" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", - "clap_derive 4.4.2", + "clap_derive 4.4.7", ] [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", - "clap_lex 0.5.1", + "clap_lex 0.6.0", "strsim", ] @@ -1440,9 +1441,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", @@ -1461,9 +1462,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "coarsetime" @@ -1482,7 +1483,7 @@ name = "codegen" version = "0.1.0" dependencies = [ "anyhow", - "clap 3.2.23", + "clap 4.4.18", "frame-metadata 15.1.0", "hex", "http 0.2.9", @@ -2016,7 +2017,7 @@ name = "cumulus-client-cli" version = "0.1.0" source = "git+https://github.com/paritytech/cumulus?branch=polkadot-v0.9.43#b8999fce0f61fb757f9e57e326cda48e70137019" dependencies = [ - "clap 4.4.6", + "clap 4.4.18", "parity-scale-codec", "sc-chain-spec", "sc-cli", @@ -3619,7 +3620,7 @@ dependencies = [ "Inflector", "array-bytes 4.2.0", "chrono", - "clap 4.4.6", + "clap 4.4.18", "comfy-table", "frame-benchmarking", "frame-support", @@ -4698,7 +4699,7 @@ name = "hyperspace" version = "0.1.0" dependencies = [ "anyhow", - "clap 3.2.23", + "clap 4.4.18", "hyperspace-core", "tokio", "toml 0.7.6", @@ -4710,7 +4711,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "clap 3.2.23", + "clap 4.4.18", "codegen", "derive_more", "env_logger 0.9.3", @@ -4719,6 +4720,7 @@ dependencies = [ "futures", "hex", "hyperspace-cosmos", + "hyperspace-macros", "hyperspace-metrics", "hyperspace-parachain", "hyperspace-primitives", @@ -4802,6 +4804,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "hyperspace-macros" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "hyperspace-metrics" version = "0.1.0" @@ -4827,7 +4838,7 @@ dependencies = [ "beefy-light-client", "beefy-light-client-primitives", "beefy-prover", - "clap 3.2.23", + "clap 4.4.18", "derive_more", "finality-grandpa", "frame-support", @@ -5580,6 +5591,7 @@ name = "ibc-rpc" version = "0.1.0" dependencies = [ "frame-system", + "hex", "ibc 0.15.0", "ibc-derive 0.1.0", "ibc-primitives 0.1.0", @@ -6129,6 +6141,12 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + [[package]] name = "itertools" version = "0.10.5" @@ -9166,7 +9184,7 @@ dependencies = [ name = "parachain-node" version = "0.1.0" dependencies = [ - "clap 4.4.6", + "clap 4.4.18", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", @@ -9710,7 +9728,7 @@ name = "polkadot-cli" version = "0.9.43" source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.43#ba42b9ce51d25bdaf52d2c61e0763a6e3da50d25" dependencies = [ - "clap 4.4.6", + "clap 4.4.18", "frame-benchmarking-cli", "futures", "log", @@ -12194,7 +12212,7 @@ source = "git+https://github.com/paritytech//substrate.git?branch=polkadot-v0.9. dependencies = [ "array-bytes 4.2.0", "chrono", - "clap 4.4.6", + "clap 4.4.18", "fdlimit", "futures", "libp2p-identity", @@ -13045,7 +13063,7 @@ name = "sc-storage-monitor" version = "0.1.0" source = "git+https://github.com/paritytech//substrate.git?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ - "clap 4.4.6", + "clap 4.4.18", "fs4", "futures", "log", @@ -16448,7 +16466,7 @@ version = "0.10.0-dev" source = "git+https://github.com/paritytech//substrate.git?branch=polkadot-v0.9.43#5e49f6e44820affccaf517fd22af564f4b495d40" dependencies = [ "async-trait", - "clap 4.4.6", + "clap 4.4.18", "frame-remote-externalities", "hex", "log", @@ -16551,7 +16569,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "digest 0.10.7", "rand 0.8.5", "static_assertions", diff --git a/contracts/pallet-ibc/rpc/Cargo.toml b/contracts/pallet-ibc/rpc/Cargo.toml index 6eb4d9314..8e5a2c606 100644 --- a/contracts/pallet-ibc/rpc/Cargo.toml +++ b/contracts/pallet-ibc/rpc/Cargo.toml @@ -27,6 +27,7 @@ sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot- sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } sp-trie = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } tendermint-proto = { git = "https://github.com/informalsystems/tendermint-rs", rev = "e81f7bf23d63ffbcd242381d1ce5e35da3515ff1", default-features = false } +hex = "0.4.3" [dependencies.ibc] path = "../../../ibc/modules" diff --git a/contracts/pallet-ibc/rpc/src/lib.rs b/contracts/pallet-ibc/rpc/src/lib.rs index 81ba81caa..3dc90ede3 100644 --- a/contracts/pallet-ibc/rpc/src/lib.rs +++ b/contracts/pallet-ibc/rpc/src/lib.rs @@ -136,6 +136,14 @@ pub struct PacketInfo { pub ack: Option>, } +impl Display for PacketInfo { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "PacketInfo {{ height: {}, seq: {}, src_chan: {}/{}, dst_chan: {}/{}, data: {}, timeout_height: {}-{}, timeout_timestamp: {}, ack: {} }}", + self.height.unwrap_or(0), self.sequence, self.source_port, self.source_channel, self.destination_port, self.destination_channel, + String::from_utf8(self.data.clone()).unwrap_or_else(|_| hex::encode(&self.data)), self.timeout_height.revision_number, self.timeout_height.revision_height, self.timeout_timestamp, self.ack.clone().map(|ack| String::from_utf8(ack.clone()).unwrap_or_else(|_| hex::encode(&ack))).unwrap_or_default()) + } +} + impl TryFrom for PacketInfo { type Error = (); diff --git a/hyperspace/Cargo.toml b/hyperspace/Cargo.toml index 6620abea0..66c70f809 100644 --- a/hyperspace/Cargo.toml +++ b/hyperspace/Cargo.toml @@ -6,7 +6,7 @@ authors = ["Seun Lanlege ", "David Salami , + /// Relayer chain B config path (mandatory). + #[clap(long, global = true)] + config_b: Option, + /// Relayer core config path (mandatory). + #[clap(long, global = true)] + config_core: Option, /// Port id for channel creation - #[clap(long)] + #[clap(long, global = true)] port_id: Option, /// Connection delay period in seconds - #[clap(long)] + #[clap(long, global = true)] delay_period: Option, /// Channel order - #[clap(long)] + #[clap(long, global = true)] order: Option, /// Channel version - #[clap(long)] + #[clap(long, global = true)] version: Option, /// New config path for A to avoid overriding existing configuration - #[clap(long)] + #[clap(long, global = true)] pub out_config_a: Option, /// New config path for B to avoid overriding existing configuration - #[clap(long)] + #[clap(long, global = true)] pub out_config_b: Option, } @@ -119,11 +138,17 @@ impl UploadWasmCmd { } impl Cmd { - async fn parse_config(&self) -> Result { + pub async fn parse_config(&self) -> Result { use tokio::fs::read_to_string; - let path_a: PathBuf = self.config_a.parse()?; - let path_b: PathBuf = self.config_b.parse()?; - let path_core: PathBuf = self.config_core.parse()?; + let config_a_opt = + self.config_a.clone().ok_or(anyhow::anyhow!("--config-a is mandatory"))?; + let path_a: PathBuf = config_a_opt.parse()?; + let config_b_opt = + self.config_b.clone().ok_or(anyhow::anyhow!("--config-b is mandatory"))?; + let path_b: PathBuf = config_b_opt.parse()?; + let config_core_opt = + self.config_core.clone().ok_or(anyhow::anyhow!("--config-core is mandatory"))?; + let path_core: PathBuf = config_core_opt.parse()?; let file_content = read_to_string(path_a).await?; let config_a: AnyConfig = toml::from_str(&file_content)?; let file_content = read_to_string(path_b).await?; @@ -268,13 +293,145 @@ impl Cmd { } pub async fn save_config(&self, new_config: &Config) -> Result<()> { - let path_a = self.out_config_a.as_ref().cloned().unwrap_or_else(|| self.config_a.clone()); - let path_b = self.out_config_b.as_ref().cloned().unwrap_or_else(|| self.config_b.clone()); + let path_a = self.out_config_a.as_ref().cloned().or_else(|| self.config_a.clone()) + .ok_or(anyhow::anyhow!("--config-a is mandatory"))?; + let path_b = self.out_config_b.as_ref().cloned().or_else(|| self.config_b.clone()) + .ok_or(anyhow::anyhow!("--config-b is mandatory"))?; write_config(path_a, &new_config.chain_a).await?; write_config(path_b, &new_config.chain_b).await } } +#[derive(Debug, Clone, Parser)] +pub enum QueryCmd { + /// Query packets + #[command(subcommand)] + Packets(QueryPacketsCmd), +} + +impl QueryCmd { + pub async fn run(&self, config: Config) -> anyhow::Result<()> { + let chain_a = config.chain_a.into_client().await?; + let chain_b = config.chain_b.into_client().await?; + + match self { + QueryCmd::Packets(query) => query.run(chain_a, chain_b).await, + } + } +} + +#[derive(Debug, Clone, clap::Subcommand)] +pub enum QueryPacketsCmd { + /// Trace packets + Trace(TracePacketsCmd), +} + +impl QueryPacketsCmd { + pub(crate) async fn run(&self, chain_a: AnyChain, chain_b: AnyChain) -> anyhow::Result<()> { + let name_a = chain_a.name(); + let name_b = chain_b.name(); + let (height_a, _) = chain_a.latest_height_and_timestamp().await?; + let (_height_b, _) = chain_b.latest_height_and_timestamp().await?; + + match self { + QueryPacketsCmd::Trace(cmd) => { + let sequence = cmd.sequence; + let set = chain_a.channel_whitelist(); + if set.is_empty() { + println!("No channels found on {name_a}"); + return Ok(()) + } + for (channel_id, port_id) in set { + let channel_response = + chain_a.query_channel_end(height_a, channel_id, port_id.clone()).await?; + let channel_end = + ChannelEnd::try_from(channel_response.channel.ok_or_else(|| { + Error::Custom("ChannelEnd not could not be decoded".to_string()) + })?) + .map_err(|e| Error::Custom(e.to_string()))?; + let counterparty_channel_id = + channel_end.counterparty().channel_id.ok_or_else(|| { + Error::Custom("Expected counterparty channel id".to_string()) + })?; + let counterparty_port_id = channel_end.counterparty().port_id.clone(); + + let maybe_received = chain_b + .query_received_packets( + counterparty_channel_id.clone(), + counterparty_port_id.clone(), + vec![sequence], + ) + .await? + .pop(); + + if let Some(received) = maybe_received { + println!("Packet {sequence} was received on {name_b}: {received}"); + let unreceived_acks = chain_a + .query_unreceived_acknowledgements( + height_a, + channel_id.clone(), + port_id.clone(), + vec![sequence], + ) + .await?; + if unreceived_acks.is_empty() { + println!("Packet {sequence} was acknowledged on {name_a}"); + } else { + println!("Packet {sequence} was not acknowledged on {name_a}"); + } + continue + } + let sent_packets = chain_a + .query_send_packets(channel_id.clone(), port_id.clone(), vec![sequence]) + .await?; + if sent_packets.is_empty() { + println!("Packet {sequence} not found"); + continue + } + for packet_info in sent_packets { + let seq = packet_info.sequence; + println!("Sent packet {} ({name_a}->{name_b}): {}", seq, packet_info); + let received = chain_b + .query_received_packets( + packet_info.destination_channel.parse()?, + packet_info.destination_port.parse()?, + vec![seq], + ) + .await? + .pop(); + if received.is_none() { + println!("Packet {seq} ({name_a}->{name_b}) was not received"); + continue + } + + println!("Received packet {seq} ({name_a}->{name_b}) {received:?}"); + + let ack = chain_a + .query_unreceived_acknowledgements( + height_a, + channel_id.clone(), + port_id.clone(), + vec![seq], + ) + .await?; + if ack.is_empty() { + println!("Packet {seq} ({name_a}->{name_b}) was acknowledged"); + } else { + println!("Packet {seq} ({name_a}->{name_b}) was not acknowledged"); + } + } + } + Ok(()) + }, + } + } +} + +#[derive(Debug, Clone, Args)] +pub struct TracePacketsCmd { + pub sequence: u64, +} + async fn write_config(path: String, config: &AnyConfig) -> Result<()> { tokio::fs::write(path.parse::()?, toml::to_string(config)?) .await diff --git a/hyperspace/core/src/macros.rs b/hyperspace/core/src/macros.rs index fff0ab73f..6106eaf78 100644 --- a/hyperspace/core/src/macros.rs +++ b/hyperspace/core/src/macros.rs @@ -62,13 +62,14 @@ macro_rules! chains { } #[derive(Error, Debug)] + #[hyperspace_macros::any_error] pub enum AnyError { $( $(#[$($meta)*])* - #[error("{0}")] + #[error(" error: {0}")] $name(<$client as IbcProvider>::Error), )* - #[error("{0}")] + #[error(" error: {0}")] Other(String), } diff --git a/hyperspace/macros/Cargo.toml b/hyperspace/macros/Cargo.toml new file mode 100644 index 000000000..46c08b043 --- /dev/null +++ b/hyperspace/macros/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "hyperspace-macros" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" + +[dependencies] +syn = { version = "1.0.99", features = ["extra-traits", "full", "derive", "parsing"] } +quote = "1.0.21" +proc-macro2 = "1.0.43" + +[lib] +proc-macro = true diff --git a/hyperspace/macros/src/lib.rs b/hyperspace/macros/src/lib.rs new file mode 100644 index 000000000..e0909a91b --- /dev/null +++ b/hyperspace/macros/src/lib.rs @@ -0,0 +1,70 @@ +// Copyright 2022 ComposableFi +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![allow(clippy::all)] + +use proc_macro::{Span, TokenStream}; +use proc_macro2::{Ident, TokenTree}; +use quote::{quote, ToTokens}; + +use syn::{ + buffer::TokenBuffer, parse_macro_input, Attribute, Data, DeriveInput, Generics, ItemEnum, Meta, + NestedMeta::Lit, Path, Type, TypePath, +}; + +#[proc_macro_attribute] +pub fn any_error(_attr: TokenStream, item: TokenStream) -> TokenStream { + let mut input = parse_macro_input!(item as ItemEnum); + input.variants = input + .variants + .into_iter() + .map(|mut var| { + var.attrs = var + .attrs + .into_iter() + .map(|mut attr| { + if attr.path.segments.len() == 1 && attr.path.segments[0].ident == "error" { + let mut meta = attr.parse_meta().unwrap(); + match &mut meta { + Meta::List(ref mut list) => match &mut list.nested[0] { + Lit(syn::Lit::Str(s)) => { + let var_name = var.ident.to_string(); + let new_msg = format!("{var_name}{}", s.value()); + attr = syn::parse_quote!(#[error(#new_msg)]); + }, + _ => { + panic!("error attribute must be a string literal") + }, + }, + _ => { + panic!("error attribute must be a string literal") + }, + } + attr + } else { + attr + } + }) + .collect(); + var + }) + .collect(); + input.to_token_stream().into() +} + +#[proc_macro_derive(AnyError, attributes(error))] +pub fn derive_client_message(input: TokenStream) -> TokenStream { + println!("input: \"{}\"", input.to_string()); + input +} diff --git a/hyperspace/parachain/Cargo.toml b/hyperspace/parachain/Cargo.toml index 5ea2ecf7d..ea8ba3551 100644 --- a/hyperspace/parachain/Cargo.toml +++ b/hyperspace/parachain/Cargo.toml @@ -92,7 +92,7 @@ sp-weights = { git = "https://github.com/paritytech/substrate", branch = "polkad [dev-dependencies] derive_more = "0.99.17" -clap = { version = "3.2.0", features = ["derive"] } +clap = { version = "4.4.11", features = ["derive"] } state-machine = { package = "sp-state-machine", git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.43" } prost = "0.11" primitives = { path = "../primitives", package = "hyperspace-primitives", features = [ diff --git a/hyperspace/parachain/src/chain.rs b/hyperspace/parachain/src/chain.rs index 3cf422a22..71292323a 100644 --- a/hyperspace/parachain/src/chain.rs +++ b/hyperspace/parachain/src/chain.rs @@ -332,7 +332,7 @@ where } else { error.to_string() }; - log::debug!(target: "hyperspace", "Handling error: {err_str}"); + log::debug!(target: "hyperspace_parachain", "Handling error: {err_str}"); if err_str.contains("MaxSlotsExceeded") { self.common_state.rpc_call_delay = self.common_state.rpc_call_delay * 2; @@ -366,7 +366,7 @@ where self.relay_client = relay_client; self.para_client = para_client; - log::info!(target: "hyperspace", "Reconnected to relay chain and parachain"); + log::info!(target: "hyperspace_parachain", "Reconnected to relay chain and parachain"); Ok(()) } diff --git a/hyperspace/parachain/src/finality_protocol.rs b/hyperspace/parachain/src/finality_protocol.rs index f8e7dc5c6..233b5efcd 100644 --- a/hyperspace/parachain/src/finality_protocol.rs +++ b/hyperspace/parachain/src/finality_protocol.rs @@ -384,13 +384,13 @@ where ::AccountId: Send + Sync, ::Address: Send + Sync, { - log::debug!(target: "hyperspace", "Trying to find next justification in blocks {from}..{to}"); + log::debug!(target: "hyperspace_parachain", "Trying to find next justification in blocks {from}..{to}"); let mut join_set: JoinSet> = JoinSet::new(); let heights = (from..to).collect::>(); for heights in heights.chunks(PROCESS_BLOCKS_BATCH_SIZE) { for height in heights.to_owned() { if height % 100 == 0 { - log::debug!(target: "hyperspace", "Looking for a closer proof {height}/{to}..."); + log::debug!(target: "hyperspace_parachain", "Looking for a closer proof {height}/{to}..."); } let relay_client = prover.relay_client.clone(); let delay = prover.rpc_call_delay.as_millis(); @@ -405,7 +405,7 @@ where }; let Some(justifications) = block.justifications else { return Ok(None) }; for (id, justification) in justifications { - log::info!(target: "hyperspace", "Found closer justification at {height} (suggested {to})"); + log::info!(target: "hyperspace_parachain", "Found closer justification at {height} (suggested {to})"); if id == GRANDPA_ENGINE_ID { let decoded_justification = GrandpaJustification::::decode(&mut &justification[..])?; @@ -614,7 +614,7 @@ where .collect::>(), &channel_and_port_ids, ); - log::trace!(target: "hyperspace", "Filtering event: {:?}: {f}", e.event_type()); + log::trace!(target: "hyperspace_parachain", "Filtering event: {:?}: {f}", e.event_type()); f }) .collect(); diff --git a/hyperspace/parachain/src/light_client_sync.rs b/hyperspace/parachain/src/light_client_sync.rs index e4e614c11..3a2d453a5 100644 --- a/hyperspace/parachain/src/light_client_sync.rs +++ b/hyperspace/parachain/src/light_client_sync.rs @@ -209,7 +209,7 @@ where let mut count = 0; while session_end_block <= latest_finalized_height && count < limit { log::debug!( - target: "hyperspace", + target: "hyperspace_parachain", "Getting message for session end block: #{} (finalized #{}) ({}/{})", session_end_block, latest_finalized_height, count + 1, limit ); diff --git a/hyperspace/parachain/src/parachain.rs b/hyperspace/parachain/src/parachain.rs index e5e907ff0..49c3d446d 100644 --- a/hyperspace/parachain/src/parachain.rs +++ b/hyperspace/parachain/src/parachain.rs @@ -48,7 +48,7 @@ impl Decode for UncheckedExtrinsic { let signature = is_signed.then(|| Decode::decode(input)).transpose()?; let function = Decode::decode(input).map_err(|e| { - log::error!(target: "hyperspace", "Failed to decode extrinsic: {:?}.\nCheck that the chain's SignedExtra is correct", e); + log::error!(target: "hyperspace_parachain", "Failed to decode extrinsic: {:?}.\nCheck that the chain's SignedExtra is correct", e); e })?; diff --git a/hyperspace/src/main.rs b/hyperspace/src/main.rs index e09b143e8..2e8b459dd 100644 --- a/hyperspace/src/main.rs +++ b/hyperspace/src/main.rs @@ -42,5 +42,10 @@ async fn main() -> Result<()> { cmd.save_config(&new_config).await }, Subcommand::Fish(cmd) => cmd.fish().await, + Subcommand::Query { cmd, query } => { + let config = cmd.parse_config().await?; + query.run(config).await?; + Ok(()) + }, } } diff --git a/light-clients/ics10-grandpa-cw/src/contract.rs b/light-clients/ics10-grandpa-cw/src/contract.rs index 4589e6400..cb1919635 100644 --- a/light-clients/ics10-grandpa-cw/src/contract.rs +++ b/light-clients/ics10-grandpa-cw/src/contract.rs @@ -18,9 +18,10 @@ use crate::{ error::ContractError, log, msg::{ - CheckForMisbehaviourMsg, ContractResult, ExportMetadataMsg, QueryMsg, QueryResponse, - StatusMsg, SudoMsg, UpdateStateMsg, UpdateStateOnMisbehaviourMsg, VerifyClientMessage, - VerifyMembershipMsg, VerifyNonMembershipMsg, VerifyUpgradeAndUpdateStateMsg, + CheckForMisbehaviourMsg, CheckSubstituteAndUpdateStateMsg, ContractResult, ExecuteMsg, + ExportMetadataMsg, InstantiateMsg, QueryMsg, QueryResponse, StatusMsg, UpdateStateMsg, + UpdateStateOnMisbehaviourMsg, VerifyClientMessage, VerifyMembershipMsg, MigrateMsg, + VerifyNonMembershipMsg, VerifyUpgradeAndUpdateStateMsg }, state::{get_client_state, get_consensus_state}, Bytes, diff --git a/utils/parachain-node/Cargo.toml b/utils/parachain-node/Cargo.toml index c73bcd188..0d1a4c71a 100644 --- a/utils/parachain-node/Cargo.toml +++ b/utils/parachain-node/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" build = "build.rs" [dependencies] -clap = { version = "4.0.22", features = ["derive"] } +clap = { version = "4.4.11", features = ["derive"] } derive_more = "0.99.2" log = "0.4.17" codec = { package = "parity-scale-codec", version = "3.0.0" } diff --git a/utils/subxt/codegen/Cargo.toml b/utils/subxt/codegen/Cargo.toml index 4697d8cf3..a7b8315e4 100644 --- a/utils/subxt/codegen/Cargo.toml +++ b/utils/subxt/codegen/Cargo.toml @@ -11,7 +11,7 @@ path = "bin/main.rs" [dependencies] tokio = { version = "1.32.0", features = ["full"] } anyhow = "1.0.66" -clap = { version = "3.2.22", features = ["derive", "env"] } +clap = { version = "4.4.11", features = ["derive", "env"] } serde_json = "1.0.91" http = "0.2.9" subxt-codegen = { git = "https://github.com/paritytech/subxt", tag = "v0.29.0" }