Skip to content

Commit

Permalink
Fix node startup panic after clap upgrade to v4 (#161)
Browse files Browse the repository at this point in the history
After the [recent substrate
update](728ad51)
to `polkadot-v0.9.31` which contains `clap` major version upgrade from
`3` to `4` the node panics at the startup.

There are similar changes as we have here in the diff for
`substrate-node`:
https://github.com/paritytech/substrate/compare/polkadot-v0.9.30..polkadot-v0.9.31#diff-11f6080619429c3df8cc5afa5767fba0c3ae8ab867a163e782ae7e30df1082e3R23

Co-authored-by: Rakan Al-Huneiti <[email protected]>
  • Loading branch information
khssnv and rakanalh authored Nov 27, 2023
1 parent 8fff559 commit 9f390f4
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
#[allow(missing_docs)]
#[derive(Debug, clap::Parser)]
pub struct Cli {
#[clap(subcommand)]
#[command(subcommand)]
pub subcommand: Option<Subcommand>,
#[clap(flatten)]
pub run: RunCmd,
}

#[allow(missing_docs)]
#[derive(Debug, clap::Parser)]
#[group(skip)]
pub struct RunCmd {
#[clap(flatten)]
pub base: sc_cli::RunCmd,

/// Enable DDC validation (disabled by default). Works only on validator nodes with enabled
/// offchain workers.
#[clap(long, requires = "dac-url")]
#[arg(long, requires = "dac_url")]
pub enable_ddc_validation: bool,

/// DAC DataModel HTTP endpoint to retrieve DDC activity data for validation.
#[clap(long, requires = "enable-ddc-validation", value_parser = url::Url::parse)]
#[arg(long, requires = "enable_ddc_validation", value_parser = url::Url::parse)]
pub dac_url: Option<String>,

/// Force using Cere Dev runtime.
#[clap(long = "force-cere-dev")]
#[arg(long = "force-cere-dev")]
pub force_cere_dev: bool,

/// Disable automatic hardware benchmarks.
Expand All @@ -33,15 +34,15 @@ pub struct RunCmd {
///
/// The results are then printed out in the logs, and also sent as part of
/// telemetry, if telemetry is enabled.
#[clap(long)]
#[arg(long)]
pub no_hardware_benchmarks: bool,
}

#[allow(missing_docs)]
#[derive(Debug, clap::Subcommand)]
pub enum Subcommand {
/// Key management cli utilities
#[clap(subcommand)]
#[command(subcommand)]
Key(sc_cli::KeySubcommand),

/// Build a chain specification.
Expand All @@ -66,7 +67,7 @@ pub enum Subcommand {
Revert(sc_cli::RevertCmd),

/// Sub-commands concerned with benchmarking.
#[clap(subcommand)]
#[command(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// Try some command against runtime state.
Expand Down

0 comments on commit 9f390f4

Please sign in to comment.