Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
456 changes: 93 additions & 363 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 5 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ collectives-westend-runtime = { path = "cumulus/parachains/runtimes/collectives/
color-eyre = { version = "0.6.3", default-features = false }
color-print = { version = "0.3.4" }
colored = { version = "2.0.4" }
comfy-table = { version = "7.1.0", default-features = false }
comfy-table = { version = "7.1.4", default-features = false }
console = { version = "0.15.8" }
const-hex = { version = "1.10.0", default-features = false }
coretime-rococo-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo" }
Expand Down Expand Up @@ -876,7 +876,7 @@ mixnet = { version = "0.7.0" }
mmr-gadget = { path = "substrate/client/merkle-mountain-range", default-features = false }
mmr-lib = { version = "0.5.2", package = "ckb-merkle-mountain-range" }
mmr-rpc = { path = "substrate/client/merkle-mountain-range/rpc", default-features = false }
mockall = { version = "0.11.3" }
mockall = { version = "0.13.1" }
multiaddr = { version = "0.18.1" }
multihash = { version = "0.19.1", default-features = false }
multihash-codetable = { version = "0.1.1" }
Expand Down Expand Up @@ -1123,8 +1123,8 @@ prometheus-endpoint = { path = "substrate/utils/prometheus", default-features =
prometheus-parse = { version = "0.2.2" }
prost = { version = "0.12.4" }
prost-build = { version = "0.13.2" }
pyroscope = { version = "0.5.7" }
pyroscope_pprofrs = { version = "0.2.7" }
pyroscope = { version = "0.5.8" }
pyroscope_pprofrs = { version = "0.2.8" }
quick_cache = { version = "0.3" }
quickcheck = { version = "1.0.3", default-features = false }
quote = { version = "1.0.37" }
Expand Down Expand Up @@ -1318,7 +1318,6 @@ ssz_rs = { version = "0.9.0", default-features = false }
ssz_rs_derive = { version = "0.9.0", default-features = false }
static_assertions = { version = "1.1.0", default-features = false }
static_init = { version = "1.0.3" }
structopt = { version = "0.3" }
strum = { version = "0.26.3", default-features = false }
subkey = { path = "substrate/bin/utils/subkey", default-features = false }
substrate-bip39 = { path = "substrate/utils/substrate-bip39", default-features = false }
Expand Down Expand Up @@ -1359,7 +1358,7 @@ tokio = { version = "1.40.0", default-features = false }
tokio-retry = { version = "0.3.0" }
tokio-stream = { version = "0.1.14" }
tokio-test = { version = "0.4.4" }
tokio-tungstenite = { version = "0.20.1" }
tokio-tungstenite = { version = "0.26.2" }
tokio-util = { version = "0.7.8" }
toml = { version = "0.8.12" }
toml_edit = { version = "0.19" }
Expand Down
2 changes: 1 addition & 1 deletion bridges/relays/lib-substrate-relay/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ workspace = true
anyhow = { workspace = true }
async-std = { workspace = true }
async-trait = { workspace = true }
clap = { workspace = true, features = ["derive"] }
codec = { workspace = true, default-features = true }
futures = { workspace = true }
hex = { workspace = true, default-features = true }
log = { workspace = true }
num-traits = { workspace = true, default-features = true }
rbtag = { workspace = true }
structopt = { workspace = true }
strum = { features = ["derive"], workspace = true, default-features = true }
thiserror = { workspace = true }

Expand Down
30 changes: 15 additions & 15 deletions bridges/relays/lib-substrate-relay/src/cli/chain_schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@

//! Primitives related to chain CLI options.

use clap::Parser;
use relay_substrate_client::{AccountKeyPairOf, ChainWithTransactions};
use structopt::StructOpt;
use strum::{EnumString, VariantNames};

use relay_substrate_client::{ChainRuntimeVersion, ChainWithRuntimeVersion, SimpleRuntimeVersion};

use crate::TransactionParams;

#[doc = "Runtime version params."]
#[derive(StructOpt, Debug, PartialEq, Eq, Clone, Copy, EnumString, VariantNames)]
#[derive(Debug, PartialEq, Eq, Clone, Copy, Parser, EnumString, VariantNames)]
pub enum RuntimeVersionType {
/// Auto query version from chain
Auto,
Expand All @@ -41,16 +41,16 @@ macro_rules! declare_chain_runtime_version_params_cli_schema {
($chain:ident, $chain_prefix:ident) => {
bp_runtime::paste::item! {
#[doc = $chain " runtime version params."]
#[derive(StructOpt, Debug, PartialEq, Eq, Clone, Copy)]
#[derive(Debug, PartialEq, Eq, Clone, Copy, Parser)]
pub struct [<$chain RuntimeVersionParams>] {
#[doc = "The type of runtime version for chain " $chain]
#[structopt(long, default_value = "Bundle")]
#[arg(long, default_value = "Bundle")]
pub [<$chain_prefix _version_mode>]: RuntimeVersionType,
#[doc = "The custom sepc_version for chain " $chain]
#[structopt(long)]
#[arg(long)]
pub [<$chain_prefix _spec_version>]: Option<u32>,
#[doc = "The custom transaction_version for chain " $chain]
#[structopt(long)]
#[arg(long)]
pub [<$chain_prefix _transaction_version>]: Option<u32>,
}

Expand Down Expand Up @@ -96,13 +96,13 @@ macro_rules! declare_chain_connection_params_cli_schema {
// remove all obsolete arguments (separate URI components)

#[doc = $chain " connection params."]
#[derive(StructOpt, Debug, PartialEq, Eq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone, Parser)]
pub struct [<$chain ConnectionParams>] {
#[doc = "WS endpoint of " $chain ": full URI."]
#[structopt(long)]
#[arg(long)]
pub [<$chain_prefix _uri>]: String,
#[doc = "Custom runtime version"]
#[structopt(flatten)]
#[command(flatten)]
pub [<$chain_prefix _runtime_version>]: [<$chain RuntimeVersionParams>],
}

Expand Down Expand Up @@ -133,24 +133,24 @@ macro_rules! declare_chain_signing_params_cli_schema {
($chain:ident, $chain_prefix:ident) => {
bp_runtime::paste::item! {
#[doc = $chain " signing params."]
#[derive(StructOpt, Debug, PartialEq, Eq, Clone)]
#[derive(Debug, PartialEq, Eq, Clone, Parser)]
pub struct [<$chain SigningParams>] {
#[doc = "The SURI of secret key to use when transactions are submitted to the " $chain " node."]
#[structopt(long)]
#[arg(long)]
pub [<$chain_prefix _signer>]: Option<String>,
#[doc = "The password for the SURI of secret key to use when transactions are submitted to the " $chain " node."]
#[structopt(long)]
#[arg(long)]
pub [<$chain_prefix _signer_password>]: Option<String>,

#[doc = "Path to the file, that contains SURI of secret key to use when transactions are submitted to the " $chain " node. Can be overridden with " $chain_prefix "_signer option."]
#[structopt(long)]
#[arg(long)]
pub [<$chain_prefix _signer_file>]: Option<std::path::PathBuf>,
#[doc = "Path to the file, that password for the SURI of secret key to use when transactions are submitted to the " $chain " node. Can be overridden with " $chain_prefix "_signer_password option."]
#[structopt(long)]
#[arg(long)]
pub [<$chain_prefix _signer_password_file>]: Option<std::path::PathBuf>,

#[doc = "Transactions mortality period, in blocks. MUST be a power of two in [4; 65536] range. MAY NOT be larger than `BlockHashCount` parameter of the chain system module."]
#[structopt(long)]
#[arg(long)]
pub [<$chain_prefix _transactions_mortality>]: Option<u32>,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ use crate::{
};

use async_trait::async_trait;
use clap::Parser;
use relay_substrate_client::{ChainWithTransactions, Client};
use structopt::StructOpt;

/// Start equivocation detection loop.
#[derive(StructOpt)]
#[derive(Parser)]
pub struct DetectEquivocationsParams {
#[structopt(flatten)]
#[command(flatten)]
source: SourceConnectionParams,
#[structopt(flatten)]
#[command(flatten)]
source_sign: SourceSigningParams,
#[structopt(flatten)]
#[command(flatten)]
target: TargetConnectionParams,
#[structopt(flatten)]
#[command(flatten)]
prometheus_params: PrometheusParams,
}

Expand Down
12 changes: 6 additions & 6 deletions bridges/relays/lib-substrate-relay/src/cli/init_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@ use crate::{
finality_base::engine::Engine,
};
use bp_runtime::Chain as ChainBase;
use clap::Parser;
use relay_substrate_client::{AccountKeyPairOf, Chain, UnsignedTransaction};
use sp_core::Pair;
use structopt::StructOpt;

/// Bridge initialization params.
#[derive(StructOpt)]
#[derive(Parser)]
pub struct InitBridgeParams {
#[structopt(flatten)]
#[command(flatten)]
source: SourceConnectionParams,
#[structopt(flatten)]
#[command(flatten)]
target: TargetConnectionParams,
#[structopt(flatten)]
#[command(flatten)]
target_sign: TargetSigningParams,
/// Generates all required data, but does not submit extrinsic
#[structopt(long)]
#[arg(long)]
dry_run: bool,
}

Expand Down
10 changes: 5 additions & 5 deletions bridges/relays/lib-substrate-relay/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

//! Deal with CLI args of substrate-to-substrate relay.

use clap::Parser;
use rbtag::BuildInfo;
use sp_runtime::traits::TryConvert;
use std::str::FromStr;
use structopt::StructOpt;

pub mod bridge;
pub mod chain_schema;
Expand Down Expand Up @@ -57,16 +57,16 @@ impl FromStr for HexLaneId {
}

/// Prometheus metrics params.
#[derive(Clone, Debug, PartialEq, StructOpt)]
#[derive(Clone, Debug, PartialEq, Parser)]
pub struct PrometheusParams {
/// Do not expose a Prometheus metric endpoint.
#[structopt(long)]
#[arg(long)]
pub no_prometheus: bool,
/// Expose Prometheus endpoint at given interface.
#[structopt(long, default_value = "127.0.0.1")]
#[arg(long, default_value = "127.0.0.1")]
pub prometheus_host: String,
/// Expose Prometheus endpoint at given port.
#[structopt(long, default_value = "9616")]
#[arg(long, default_value = "9616")]
pub prometheus_port: u16,
}

Expand Down
26 changes: 13 additions & 13 deletions bridges/relays/lib-substrate-relay/src/cli/relay_headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! Primitives for exposing the headers relaying functionality in the CLI.

use async_trait::async_trait;
use structopt::StructOpt;
use clap::Parser;

use relay_utils::{
metrics::{GlobalMetrics, StandaloneMetric},
Expand All @@ -32,38 +32,38 @@ use crate::{
use relay_substrate_client::Client;

/// Chain headers relaying params.
#[derive(StructOpt)]
#[derive(Parser)]
pub struct RelayHeadersParams {
/// If passed, only mandatory headers (headers that are changing the GRANDPA authorities set)
/// are relayed.
#[structopt(long)]
#[arg(long)]
only_mandatory_headers: bool,
/// If passed, only free headers (mandatory and every Nth header, if configured in runtime)
/// are relayed. Overrides `only_mandatory_headers`.
#[structopt(long)]
#[arg(long)]
only_free_headers: bool,
#[structopt(flatten)]
#[command(flatten)]
source: SourceConnectionParams,
#[structopt(flatten)]
#[command(flatten)]
target: TargetConnectionParams,
#[structopt(flatten)]
#[command(flatten)]
target_sign: TargetSigningParams,
#[structopt(flatten)]
#[command(flatten)]
prometheus_params: PrometheusParams,
}

/// Single header relaying params.
#[derive(StructOpt)]
#[derive(Parser)]
pub struct RelayHeaderParams {
#[structopt(flatten)]
#[command(flatten)]
source: SourceConnectionParams,
#[structopt(flatten)]
#[command(flatten)]
target: TargetConnectionParams,
#[structopt(flatten)]
#[command(flatten)]
target_sign: TargetSigningParams,
/// Number of the source chain header that we want to relay. It must have a persistent
/// storage proof at the [`Self::source`] node, otherwise the command will fail.
#[structopt(long)]
#[arg(long)]
number: u128,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ pub mod relay_to_relay;
pub mod relay_to_parachain;

use async_trait::async_trait;
use clap::Parser;
use std::{fmt::Debug, marker::PhantomData, sync::Arc};
use structopt::StructOpt;

use futures::{FutureExt, TryFutureExt};

Expand All @@ -55,20 +55,20 @@ use sp_core::Pair;
use sp_runtime::traits::TryConvert;

/// Parameters that have the same names across all bridges.
#[derive(Debug, PartialEq, StructOpt)]
#[derive(Debug, PartialEq, Parser)]
pub struct HeadersAndMessagesSharedParams {
/// Hex-encoded lane identifiers that should be served by the complex relay.
#[structopt(long)]
#[arg(long)]
pub lane: Vec<HexLaneId>,
/// If passed, only mandatory headers (headers that are changing the GRANDPA authorities set)
/// are relayed.
#[structopt(long)]
#[arg(long)]
pub only_mandatory_headers: bool,
/// If passed, only free headers (mandatory and every Nth header, if configured in runtime)
/// are relayed. Overrides `only_mandatory_headers`.
#[structopt(long)]
#[arg(long)]
pub only_free_headers: bool,
#[structopt(flatten)]
#[command(flatten)]
/// Prometheus metrics params.
pub prometheus_params: PrometheusParams,
}
Expand Down Expand Up @@ -413,7 +413,7 @@ mod tests {
Polkadot
);

let res = BridgeHubKusamaBridgeHubPolkadotHeadersAndMessages::from_iter(vec![
let res = BridgeHubKusamaBridgeHubPolkadotHeadersAndMessages::parse_from(vec![
"bridge-hub-kusama-bridge-hub-polkadot-headers-and-messages",
"--bridge-hub-kusama-uri",
"ws://bridge-hub-kusama-node-collator1:9944",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,28 @@ macro_rules! declare_parachain_to_parachain_bridge_schema {
($left_parachain:ident, $left_chain:ident, $right_parachain:ident, $right_chain:ident) => {
bp_runtime::paste::item! {
#[doc = $left_parachain ", " $left_chain ", " $right_parachain " and " $right_chain " headers+parachains+messages relay params."]
#[derive(Debug, PartialEq, StructOpt)]
#[derive(Debug, PartialEq, Parser)]
pub struct [<$left_parachain $right_parachain HeadersAndMessages>] {
// shared parameters
#[structopt(flatten)]
#[command(flatten)]
shared: HeadersAndMessagesSharedParams,

#[structopt(flatten)]
#[command(flatten)]
left: [<$left_parachain ConnectionParams>],
// default signer, which is always used to sign messages relay transactions on the left chain
#[structopt(flatten)]
#[command(flatten)]
left_sign: [<$left_parachain SigningParams>],

#[structopt(flatten)]
#[command(flatten)]
left_relay: [<$left_chain ConnectionParams>],

#[structopt(flatten)]
#[command(flatten)]
right: [<$right_parachain ConnectionParams>],
// default signer, which is always used to sign messages relay transactions on the right chain
#[structopt(flatten)]
#[command(flatten)]
right_sign: [<$right_parachain SigningParams>],

#[structopt(flatten)]
#[command(flatten)]
right_relay: [<$right_chain ConnectionParams>],
}

Expand Down
Loading
Loading