Skip to content

Commit ec32daa

Browse files
jaslbkontur
andauthored
Upgrade deps to eliminate ancient dependencies (#7999)
Upgrading these crates would help to remove tons of outdated (and obsoleted) dependencies. In addition, a small group of crates do not use workspace deps, I correct these. --------- Co-authored-by: Branislav Kontur <[email protected]>
1 parent fd8b1d7 commit ec32daa

File tree

22 files changed

+220
-491
lines changed

22 files changed

+220
-491
lines changed

Cargo.lock

+93-363
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+5-6
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ collectives-westend-runtime = { path = "cumulus/parachains/runtimes/collectives/
701701
color-eyre = { version = "0.6.3", default-features = false }
702702
color-print = { version = "0.3.4" }
703703
colored = { version = "2.0.4" }
704-
comfy-table = { version = "7.1.0", default-features = false }
704+
comfy-table = { version = "7.1.4", default-features = false }
705705
console = { version = "0.15.8" }
706706
const-hex = { version = "1.10.0", default-features = false }
707707
coretime-rococo-emulated-chain = { path = "cumulus/parachains/integration-tests/emulated/chains/parachains/coretime/coretime-rococo" }
@@ -876,7 +876,7 @@ mixnet = { version = "0.7.0" }
876876
mmr-gadget = { path = "substrate/client/merkle-mountain-range", default-features = false }
877877
mmr-lib = { version = "0.5.2", package = "ckb-merkle-mountain-range" }
878878
mmr-rpc = { path = "substrate/client/merkle-mountain-range/rpc", default-features = false }
879-
mockall = { version = "0.11.3" }
879+
mockall = { version = "0.13.1" }
880880
multiaddr = { version = "0.18.1" }
881881
multihash = { version = "0.19.1", default-features = false }
882882
multihash-codetable = { version = "0.1.1" }
@@ -1123,8 +1123,8 @@ prometheus-endpoint = { path = "substrate/utils/prometheus", default-features =
11231123
prometheus-parse = { version = "0.2.2" }
11241124
prost = { version = "0.12.4" }
11251125
prost-build = { version = "0.13.2" }
1126-
pyroscope = { version = "0.5.7" }
1127-
pyroscope_pprofrs = { version = "0.2.7" }
1126+
pyroscope = { version = "0.5.8" }
1127+
pyroscope_pprofrs = { version = "0.2.8" }
11281128
quick_cache = { version = "0.3" }
11291129
quickcheck = { version = "1.0.3", default-features = false }
11301130
quote = { version = "1.0.37" }
@@ -1318,7 +1318,6 @@ ssz_rs = { version = "0.9.0", default-features = false }
13181318
ssz_rs_derive = { version = "0.9.0", default-features = false }
13191319
static_assertions = { version = "1.1.0", default-features = false }
13201320
static_init = { version = "1.0.3" }
1321-
structopt = { version = "0.3" }
13221321
strum = { version = "0.26.3", default-features = false }
13231322
subkey = { path = "substrate/bin/utils/subkey", default-features = false }
13241323
substrate-bip39 = { path = "substrate/utils/substrate-bip39", default-features = false }
@@ -1359,7 +1358,7 @@ tokio = { version = "1.40.0", default-features = false }
13591358
tokio-retry = { version = "0.3.0" }
13601359
tokio-stream = { version = "0.1.14" }
13611360
tokio-test = { version = "0.4.4" }
1362-
tokio-tungstenite = { version = "0.20.1" }
1361+
tokio-tungstenite = { version = "0.26.2" }
13631362
tokio-util = { version = "0.7.8" }
13641363
toml = { version = "0.8.12" }
13651364
toml_edit = { version = "0.19" }

bridges/relays/lib-substrate-relay/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ workspace = true
1414
anyhow = { workspace = true }
1515
async-std = { workspace = true }
1616
async-trait = { workspace = true }
17+
clap = { workspace = true, features = ["derive"] }
1718
codec = { workspace = true, default-features = true }
1819
futures = { workspace = true }
1920
hex = { workspace = true, default-features = true }
2021
log = { workspace = true }
2122
num-traits = { workspace = true, default-features = true }
2223
rbtag = { workspace = true }
23-
structopt = { workspace = true }
2424
strum = { features = ["derive"], workspace = true, default-features = true }
2525
thiserror = { workspace = true }
2626

bridges/relays/lib-substrate-relay/src/cli/chain_schema.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616

1717
//! Primitives related to chain CLI options.
1818
19+
use clap::Parser;
1920
use relay_substrate_client::{AccountKeyPairOf, ChainWithTransactions};
20-
use structopt::StructOpt;
2121
use strum::{EnumString, VariantNames};
2222

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

2525
use crate::TransactionParams;
2626

2727
#[doc = "Runtime version params."]
28-
#[derive(StructOpt, Debug, PartialEq, Eq, Clone, Copy, EnumString, VariantNames)]
28+
#[derive(Debug, PartialEq, Eq, Clone, Copy, Parser, EnumString, VariantNames)]
2929
pub enum RuntimeVersionType {
3030
/// Auto query version from chain
3131
Auto,
@@ -41,16 +41,16 @@ macro_rules! declare_chain_runtime_version_params_cli_schema {
4141
($chain:ident, $chain_prefix:ident) => {
4242
bp_runtime::paste::item! {
4343
#[doc = $chain " runtime version params."]
44-
#[derive(StructOpt, Debug, PartialEq, Eq, Clone, Copy)]
44+
#[derive(Debug, PartialEq, Eq, Clone, Copy, Parser)]
4545
pub struct [<$chain RuntimeVersionParams>] {
4646
#[doc = "The type of runtime version for chain " $chain]
47-
#[structopt(long, default_value = "Bundle")]
47+
#[arg(long, default_value = "Bundle")]
4848
pub [<$chain_prefix _version_mode>]: RuntimeVersionType,
4949
#[doc = "The custom sepc_version for chain " $chain]
50-
#[structopt(long)]
50+
#[arg(long)]
5151
pub [<$chain_prefix _spec_version>]: Option<u32>,
5252
#[doc = "The custom transaction_version for chain " $chain]
53-
#[structopt(long)]
53+
#[arg(long)]
5454
pub [<$chain_prefix _transaction_version>]: Option<u32>,
5555
}
5656

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

9898
#[doc = $chain " connection params."]
99-
#[derive(StructOpt, Debug, PartialEq, Eq, Clone)]
99+
#[derive(Debug, PartialEq, Eq, Clone, Parser)]
100100
pub struct [<$chain ConnectionParams>] {
101101
#[doc = "WS endpoint of " $chain ": full URI."]
102-
#[structopt(long)]
102+
#[arg(long)]
103103
pub [<$chain_prefix _uri>]: String,
104104
#[doc = "Custom runtime version"]
105-
#[structopt(flatten)]
105+
#[command(flatten)]
106106
pub [<$chain_prefix _runtime_version>]: [<$chain RuntimeVersionParams>],
107107
}
108108

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

145145
#[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."]
146-
#[structopt(long)]
146+
#[arg(long)]
147147
pub [<$chain_prefix _signer_file>]: Option<std::path::PathBuf>,
148148
#[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."]
149-
#[structopt(long)]
149+
#[arg(long)]
150150
pub [<$chain_prefix _signer_password_file>]: Option<std::path::PathBuf>,
151151

152152
#[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."]
153-
#[structopt(long)]
153+
#[arg(long)]
154154
pub [<$chain_prefix _transactions_mortality>]: Option<u32>,
155155
}
156156

bridges/relays/lib-substrate-relay/src/cli/detect_equivocations.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ use crate::{
2323
};
2424

2525
use async_trait::async_trait;
26+
use clap::Parser;
2627
use relay_substrate_client::{ChainWithTransactions, Client};
27-
use structopt::StructOpt;
2828

2929
/// Start equivocation detection loop.
30-
#[derive(StructOpt)]
30+
#[derive(Parser)]
3131
pub struct DetectEquivocationsParams {
32-
#[structopt(flatten)]
32+
#[command(flatten)]
3333
source: SourceConnectionParams,
34-
#[structopt(flatten)]
34+
#[command(flatten)]
3535
source_sign: SourceSigningParams,
36-
#[structopt(flatten)]
36+
#[command(flatten)]
3737
target: TargetConnectionParams,
38-
#[structopt(flatten)]
38+
#[command(flatten)]
3939
prometheus_params: PrometheusParams,
4040
}
4141

bridges/relays/lib-substrate-relay/src/cli/init_bridge.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,21 @@ use crate::{
2424
finality_base::engine::Engine,
2525
};
2626
use bp_runtime::Chain as ChainBase;
27+
use clap::Parser;
2728
use relay_substrate_client::{AccountKeyPairOf, Chain, UnsignedTransaction};
2829
use sp_core::Pair;
29-
use structopt::StructOpt;
3030

3131
/// Bridge initialization params.
32-
#[derive(StructOpt)]
32+
#[derive(Parser)]
3333
pub struct InitBridgeParams {
34-
#[structopt(flatten)]
34+
#[command(flatten)]
3535
source: SourceConnectionParams,
36-
#[structopt(flatten)]
36+
#[command(flatten)]
3737
target: TargetConnectionParams,
38-
#[structopt(flatten)]
38+
#[command(flatten)]
3939
target_sign: TargetSigningParams,
4040
/// Generates all required data, but does not submit extrinsic
41-
#[structopt(long)]
41+
#[arg(long)]
4242
dry_run: bool,
4343
}
4444

bridges/relays/lib-substrate-relay/src/cli/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
//! Deal with CLI args of substrate-to-substrate relay.
1818
19+
use clap::Parser;
1920
use rbtag::BuildInfo;
2021
use sp_runtime::traits::TryConvert;
2122
use std::str::FromStr;
22-
use structopt::StructOpt;
2323

2424
pub mod bridge;
2525
pub mod chain_schema;
@@ -57,16 +57,16 @@ impl FromStr for HexLaneId {
5757
}
5858

5959
/// Prometheus metrics params.
60-
#[derive(Clone, Debug, PartialEq, StructOpt)]
60+
#[derive(Clone, Debug, PartialEq, Parser)]
6161
pub struct PrometheusParams {
6262
/// Do not expose a Prometheus metric endpoint.
63-
#[structopt(long)]
63+
#[arg(long)]
6464
pub no_prometheus: bool,
6565
/// Expose Prometheus endpoint at given interface.
66-
#[structopt(long, default_value = "127.0.0.1")]
66+
#[arg(long, default_value = "127.0.0.1")]
6767
pub prometheus_host: String,
6868
/// Expose Prometheus endpoint at given port.
69-
#[structopt(long, default_value = "9616")]
69+
#[arg(long, default_value = "9616")]
7070
pub prometheus_port: u16,
7171
}
7272

bridges/relays/lib-substrate-relay/src/cli/relay_headers.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//! Primitives for exposing the headers relaying functionality in the CLI.
1818
1919
use async_trait::async_trait;
20-
use structopt::StructOpt;
20+
use clap::Parser;
2121

2222
use relay_utils::{
2323
metrics::{GlobalMetrics, StandaloneMetric},
@@ -32,38 +32,38 @@ use crate::{
3232
use relay_substrate_client::Client;
3333

3434
/// Chain headers relaying params.
35-
#[derive(StructOpt)]
35+
#[derive(Parser)]
3636
pub struct RelayHeadersParams {
3737
/// If passed, only mandatory headers (headers that are changing the GRANDPA authorities set)
3838
/// are relayed.
39-
#[structopt(long)]
39+
#[arg(long)]
4040
only_mandatory_headers: bool,
4141
/// If passed, only free headers (mandatory and every Nth header, if configured in runtime)
4242
/// are relayed. Overrides `only_mandatory_headers`.
43-
#[structopt(long)]
43+
#[arg(long)]
4444
only_free_headers: bool,
45-
#[structopt(flatten)]
45+
#[command(flatten)]
4646
source: SourceConnectionParams,
47-
#[structopt(flatten)]
47+
#[command(flatten)]
4848
target: TargetConnectionParams,
49-
#[structopt(flatten)]
49+
#[command(flatten)]
5050
target_sign: TargetSigningParams,
51-
#[structopt(flatten)]
51+
#[command(flatten)]
5252
prometheus_params: PrometheusParams,
5353
}
5454

5555
/// Single header relaying params.
56-
#[derive(StructOpt)]
56+
#[derive(Parser)]
5757
pub struct RelayHeaderParams {
58-
#[structopt(flatten)]
58+
#[command(flatten)]
5959
source: SourceConnectionParams,
60-
#[structopt(flatten)]
60+
#[command(flatten)]
6161
target: TargetConnectionParams,
62-
#[structopt(flatten)]
62+
#[command(flatten)]
6363
target_sign: TargetSigningParams,
6464
/// Number of the source chain header that we want to relay. It must have a persistent
6565
/// storage proof at the [`Self::source`] node, otherwise the command will fail.
66-
#[structopt(long)]
66+
#[arg(long)]
6767
number: u128,
6868
}
6969

bridges/relays/lib-substrate-relay/src/cli/relay_headers_and_messages/mod.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ pub mod relay_to_relay;
3131
pub mod relay_to_parachain;
3232

3333
use async_trait::async_trait;
34+
use clap::Parser;
3435
use std::{fmt::Debug, marker::PhantomData, sync::Arc};
35-
use structopt::StructOpt;
3636

3737
use futures::{FutureExt, TryFutureExt};
3838

@@ -55,20 +55,20 @@ use sp_core::Pair;
5555
use sp_runtime::traits::TryConvert;
5656

5757
/// Parameters that have the same names across all bridges.
58-
#[derive(Debug, PartialEq, StructOpt)]
58+
#[derive(Debug, PartialEq, Parser)]
5959
pub struct HeadersAndMessagesSharedParams {
6060
/// Hex-encoded lane identifiers that should be served by the complex relay.
61-
#[structopt(long)]
61+
#[arg(long)]
6262
pub lane: Vec<HexLaneId>,
6363
/// If passed, only mandatory headers (headers that are changing the GRANDPA authorities set)
6464
/// are relayed.
65-
#[structopt(long)]
65+
#[arg(long)]
6666
pub only_mandatory_headers: bool,
6767
/// If passed, only free headers (mandatory and every Nth header, if configured in runtime)
6868
/// are relayed. Overrides `only_mandatory_headers`.
69-
#[structopt(long)]
69+
#[arg(long)]
7070
pub only_free_headers: bool,
71-
#[structopt(flatten)]
71+
#[command(flatten)]
7272
/// Prometheus metrics params.
7373
pub prometheus_params: PrometheusParams,
7474
}
@@ -413,7 +413,7 @@ mod tests {
413413
Polkadot
414414
);
415415

416-
let res = BridgeHubKusamaBridgeHubPolkadotHeadersAndMessages::from_iter(vec![
416+
let res = BridgeHubKusamaBridgeHubPolkadotHeadersAndMessages::parse_from(vec![
417417
"bridge-hub-kusama-bridge-hub-polkadot-headers-and-messages",
418418
"--bridge-hub-kusama-uri",
419419
"ws://bridge-hub-kusama-node-collator1:9944",

bridges/relays/lib-substrate-relay/src/cli/relay_headers_and_messages/parachain_to_parachain.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -65,28 +65,28 @@ macro_rules! declare_parachain_to_parachain_bridge_schema {
6565
($left_parachain:ident, $left_chain:ident, $right_parachain:ident, $right_chain:ident) => {
6666
bp_runtime::paste::item! {
6767
#[doc = $left_parachain ", " $left_chain ", " $right_parachain " and " $right_chain " headers+parachains+messages relay params."]
68-
#[derive(Debug, PartialEq, StructOpt)]
68+
#[derive(Debug, PartialEq, Parser)]
6969
pub struct [<$left_parachain $right_parachain HeadersAndMessages>] {
7070
// shared parameters
71-
#[structopt(flatten)]
71+
#[command(flatten)]
7272
shared: HeadersAndMessagesSharedParams,
7373

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

80-
#[structopt(flatten)]
80+
#[command(flatten)]
8181
left_relay: [<$left_chain ConnectionParams>],
8282

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

89-
#[structopt(flatten)]
89+
#[command(flatten)]
9090
right_relay: [<$right_chain ConnectionParams>],
9191
}
9292

0 commit comments

Comments
 (0)