From d6c193ad39f5741ed026699dc6a33bb8b71fda25 Mon Sep 17 00:00:00 2001 From: Seemant Aggarwal Date: Mon, 24 Feb 2025 23:39:13 +0530 Subject: [PATCH 1/9] adding verbose rustdoc to diff between build-spec and chain-spec-builder --- cumulus/polkadot-omni-node/lib/src/cli.rs | 30 ++++++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 995a50b2e489f..9c644ea299b74 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -72,6 +72,16 @@ pub enum Subcommand { Key(sc_cli::KeySubcommand), /// Build a chain specification. + /// + /// The `build-spec` command generates a chain specification from existing + /// configurations. It is typically used for quickly creating a chainspec for + /// predefined chains such as `dev`, `local`, or a custom specification. + /// ## When to Use: + /// - **Quick and simple** chainspec generation. + /// - Suitable for **standard setups** where manual edits are acceptable. + /// - When you need a **basic template** that you can modify later. + /// - You don’t require extensive modifications or validation. + /// - You need a **quick** chain spec for a predefined network. BuildSpec(sc_cli::BuildSpecCmd), /// Validate blocks. @@ -90,11 +100,23 @@ pub enum Subcommand { Revert(sc_cli::RevertCmd), /// Subcommand for generating and managing chain specifications. + /// The `chain-spec-builder` command provides a more **interactive and flexible** + /// approach to chainspec creation. It allows for direct modification, validation, + /// and advanced configuration. + /// ## When to Use: + /// - When you need **fine-grained control** over the chain specification. + /// - If you want to **validate and modify** chainspecs before using them. + /// - Ideal for **parachains** or advanced network configurations. + /// - You need to **customize, validate, or interactively configure** the chain spec. + /// + /// # Summary: Choosing Between `build-spec` and `chain-spec-builder` + /// + /// | Command | When to Use | + /// |-----------------------|-------------| + /// | `build-spec` | If you need a quick, standard chain specification with minimal customization. | + /// | `chain-spec-builder` | If you need to interactively define, validate, or modify a chain spec with additional parameters. | /// - /// Unlike `build-spec`, which generates a chain specification based on existing - /// configurations, `chain-spec-builder` provides a more interactive and customizable approach - /// to defining a chain spec. It allows users to create specifications with additional - /// parameters and validation steps before finalizing the output. + /// --- ChainSpecBuilder(ChainSpecBuilder), /// Remove the whole chain. From d166320ac8bdcac804784e3facb3f08da0a961b5 Mon Sep 17 00:00:00 2001 From: seemantaggarwal <32275622+seemantaggarwal@users.noreply.github.com> Date: Sun, 2 Mar 2025 16:22:09 +0530 Subject: [PATCH 2/9] Update cumulus/polkadot-omni-node/lib/src/cli.rs Co-authored-by: Iulian Barbu <14218860+iulianbarbu@users.noreply.github.com> --- cumulus/polkadot-omni-node/lib/src/cli.rs | 25 ++++++++--------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 9c644ea299b74..aa16429c2d2ba 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -100,22 +100,15 @@ pub enum Subcommand { Revert(sc_cli::RevertCmd), /// Subcommand for generating and managing chain specifications. - /// The `chain-spec-builder` command provides a more **interactive and flexible** - /// approach to chainspec creation. It allows for direct modification, validation, - /// and advanced configuration. - /// ## When to Use: - /// - When you need **fine-grained control** over the chain specification. - /// - If you want to **validate and modify** chainspecs before using them. - /// - Ideal for **parachains** or advanced network configurations. - /// - You need to **customize, validate, or interactively configure** the chain spec. - /// - /// # Summary: Choosing Between `build-spec` and `chain-spec-builder` - /// - /// | Command | When to Use | - /// |-----------------------|-------------| - /// | `build-spec` | If you need a quick, standard chain specification with minimal customization. | - /// | `chain-spec-builder` | If you need to interactively define, validate, or modify a chain spec with additional parameters. | - /// + /// `chain-spec-builder` subcommand corresponds to the existing `chain-spec-builder` tool + /// (https://crates.io/crates/staging-chain-spec-builder), which can be used already standalone. + /// It provides the same functionality as the tool but bundled with `polkadot-omni-node` to enable + /// easier access to chain-spec generation, patching, converting to raw or validation, from a single + /// binary, which can be used as a parachain node too. + /// + /// For a detailed usage guide please check out the standalone tool's crates.io or docs.rs pages: + /// - https://crates.io/crates/staging-chain-spec-builder + /// - https://docs.rs/staging-chain-spec-builder/latest/staging_chain_spec_builder/ /// --- ChainSpecBuilder(ChainSpecBuilder), From 8365abb3e8a0498165d99ba307e599d355cb429f Mon Sep 17 00:00:00 2001 From: seemantaggarwal <32275622+seemantaggarwal@users.noreply.github.com> Date: Sun, 2 Mar 2025 16:23:31 +0530 Subject: [PATCH 3/9] Update cumulus/polkadot-omni-node/lib/src/cli.rs Co-authored-by: Iulian Barbu <14218860+iulianbarbu@users.noreply.github.com> --- cumulus/polkadot-omni-node/lib/src/cli.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index aa16429c2d2ba..94d60aa424068 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -73,15 +73,15 @@ pub enum Subcommand { /// Build a chain specification. /// - /// The `build-spec` command generates a chain specification from existing - /// configurations. It is typically used for quickly creating a chainspec for - /// predefined chains such as `dev`, `local`, or a custom specification. - /// ## When to Use: - /// - **Quick and simple** chainspec generation. - /// - Suitable for **standard setups** where manual edits are acceptable. - /// - When you need a **basic template** that you can modify later. - /// - You don’t require extensive modifications or validation. - /// - You need a **quick** chain spec for a predefined network. + /// The `build-spec` command relies on pre-existing chain specification described by + /// runtimes genesis presets, embedded in the nodes that support the `buid-spec` + /// command. Since `polkadot-omni-node` does not contain any embedded runtime, + /// and requires a `chain-spec` path to be passed to its `--chain` flag, the command + /// isn't bringing significant value as it does for other node binaries (e.g. the + /// `polkadot` binary). + /// + /// For a more versatile `chain-spec` manipulation experience please check out the + /// `polkadot-omni-node chain-spec-builder` subcommand. BuildSpec(sc_cli::BuildSpecCmd), /// Validate blocks. From 76127054821359710ce9e4a5dd136f7680aa171e Mon Sep 17 00:00:00 2001 From: Seemant Aggarwal Date: Sun, 2 Mar 2025 16:56:32 +0530 Subject: [PATCH 4/9] addressing comments --- cumulus/polkadot-omni-node/lib/src/cli.rs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 94d60aa424068..37006fbe7bb60 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -72,16 +72,16 @@ pub enum Subcommand { Key(sc_cli::KeySubcommand), /// Build a chain specification. - /// - /// The `build-spec` command relies on pre-existing chain specification described by - /// runtimes genesis presets, embedded in the nodes that support the `buid-spec` - /// command. Since `polkadot-omni-node` does not contain any embedded runtime, - /// and requires a `chain-spec` path to be passed to its `--chain` flag, the command + /// The `build-spec` command relies on the chain specification built (hard-coded) into the node + /// binary, and may utilize the genesis presets of the runtimes also embedded in the nodes + /// that support this command. Since `polkadot-omni-node` does not contain any embedded + /// runtime, and requires a `chain-spec` path to be passed to its `--chain` flag, the command /// isn't bringing significant value as it does for other node binaries (e.g. the /// `polkadot` binary). /// - /// For a more versatile `chain-spec` manipulation experience please check out the + /// For a more versatile `chain-spec` manipulation experience please check out the /// `polkadot-omni-node chain-spec-builder` subcommand. + /// #[deprecated(note = "build-spec will be removed after 1/06/2025. Use chain-spec-builder instead")] BuildSpec(sc_cli::BuildSpecCmd), /// Validate blocks. @@ -102,11 +102,11 @@ pub enum Subcommand { /// Subcommand for generating and managing chain specifications. /// `chain-spec-builder` subcommand corresponds to the existing `chain-spec-builder` tool /// (https://crates.io/crates/staging-chain-spec-builder), which can be used already standalone. - /// It provides the same functionality as the tool but bundled with `polkadot-omni-node` to enable - /// easier access to chain-spec generation, patching, converting to raw or validation, from a single - /// binary, which can be used as a parachain node too. - /// - /// For a detailed usage guide please check out the standalone tool's crates.io or docs.rs pages: + /// It provides the same functionality as the tool but bundled with `polkadot-omni-node` to + /// enable easier access to chain-spec generation, patching, converting to raw or validation, + /// from a single binary, which can be used as a parachain node tool + /// For a detailed usage guide please check out the standalone tool's crates.io or docs.rs + /// pages: /// - https://crates.io/crates/staging-chain-spec-builder /// - https://docs.rs/staging-chain-spec-builder/latest/staging_chain_spec_builder/ /// --- From 0d97dbe2e50ec766e2914423a3864f521a32224f Mon Sep 17 00:00:00 2001 From: Seemant Aggarwal Date: Tue, 4 Mar 2025 12:41:26 +0530 Subject: [PATCH 5/9] addressing comments, cleaning rustdoc --- cumulus/polkadot-omni-node/lib/src/cli.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 37006fbe7bb60..c1b65edaa37c9 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -72,6 +72,7 @@ pub enum Subcommand { Key(sc_cli::KeySubcommand), /// Build a chain specification. + /// /// The `build-spec` command relies on the chain specification built (hard-coded) into the node /// binary, and may utilize the genesis presets of the runtimes also embedded in the nodes /// that support this command. Since `polkadot-omni-node` does not contain any embedded @@ -100,7 +101,8 @@ pub enum Subcommand { Revert(sc_cli::RevertCmd), /// Subcommand for generating and managing chain specifications. - /// `chain-spec-builder` subcommand corresponds to the existing `chain-spec-builder` tool + /// + /// A `chain-spec-builder` subcommand corresponds to the existing `chain-spec-builder` tool /// (https://crates.io/crates/staging-chain-spec-builder), which can be used already standalone. /// It provides the same functionality as the tool but bundled with `polkadot-omni-node` to /// enable easier access to chain-spec generation, patching, converting to raw or validation, @@ -109,7 +111,6 @@ pub enum Subcommand { /// pages: /// - https://crates.io/crates/staging-chain-spec-builder /// - https://docs.rs/staging-chain-spec-builder/latest/staging_chain_spec_builder/ - /// --- ChainSpecBuilder(ChainSpecBuilder), /// Remove the whole chain. From 575b47ceea315e202f679dafee2f85ce45a8982c Mon Sep 17 00:00:00 2001 From: Seemant Aggarwal Date: Tue, 4 Mar 2025 21:09:38 +0530 Subject: [PATCH 6/9] fixing rustdoc hyperlinks --- cumulus/polkadot-omni-node/lib/src/cli.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index c1b65edaa37c9..1ef590d090fc5 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -103,14 +103,14 @@ pub enum Subcommand { /// Subcommand for generating and managing chain specifications. /// /// A `chain-spec-builder` subcommand corresponds to the existing `chain-spec-builder` tool - /// (https://crates.io/crates/staging-chain-spec-builder), which can be used already standalone. + /// (), which can be used already standalone. /// It provides the same functionality as the tool but bundled with `polkadot-omni-node` to /// enable easier access to chain-spec generation, patching, converting to raw or validation, /// from a single binary, which can be used as a parachain node tool /// For a detailed usage guide please check out the standalone tool's crates.io or docs.rs /// pages: - /// - https://crates.io/crates/staging-chain-spec-builder - /// - https://docs.rs/staging-chain-spec-builder/latest/staging_chain_spec_builder/ + /// - + /// - ChainSpecBuilder(ChainSpecBuilder), /// Remove the whole chain. From b5bbf6da2bd98b24c3e9d247ac89a78a0e3ce5b5 Mon Sep 17 00:00:00 2001 From: Seemant Aggarwal Date: Wed, 5 Mar 2025 01:35:50 +0530 Subject: [PATCH 7/9] fixing the deprecation notice and passing the failed test --- cumulus/polkadot-omni-node/lib/src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 1ef590d090fc5..8cde31d179d4e 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -82,7 +82,7 @@ pub enum Subcommand { /// /// For a more versatile `chain-spec` manipulation experience please check out the /// `polkadot-omni-node chain-spec-builder` subcommand. - /// #[deprecated(note = "build-spec will be removed after 1/06/2025. Use chain-spec-builder instead")] + #[deprecated(note = "build-spec will be removed after 1/06/2025. Use chain-spec-builder instead")] BuildSpec(sc_cli::BuildSpecCmd), /// Validate blocks. From 2ff27fbb58acf6bb120e9a8bc580e351378bd221 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Mar 2025 20:36:19 +0000 Subject: [PATCH 8/9] Update from seemantaggarwal running command 'fmt' --- cumulus/polkadot-omni-node/lib/src/cli.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 8cde31d179d4e..d481be72441b3 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -82,7 +82,9 @@ pub enum Subcommand { /// /// For a more versatile `chain-spec` manipulation experience please check out the /// `polkadot-omni-node chain-spec-builder` subcommand. - #[deprecated(note = "build-spec will be removed after 1/06/2025. Use chain-spec-builder instead")] + #[deprecated( + note = "build-spec will be removed after 1/06/2025. Use chain-spec-builder instead" + )] BuildSpec(sc_cli::BuildSpecCmd), /// Validate blocks. From 646b6689c1735e1d51f9770dbdd9782d8c0f94bc Mon Sep 17 00:00:00 2001 From: Seemant Aggarwal Date: Wed, 5 Mar 2025 03:10:34 +0530 Subject: [PATCH 9/9] adding #[allow(deprecated)] --- cumulus/polkadot-omni-node/lib/src/command.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/cumulus/polkadot-omni-node/lib/src/command.rs b/cumulus/polkadot-omni-node/lib/src/command.rs index b4d89b151bfd1..5b0e7ec69b1c3 100644 --- a/cumulus/polkadot-omni-node/lib/src/command.rs +++ b/cumulus/polkadot-omni-node/lib/src/command.rs @@ -103,6 +103,7 @@ pub fn run(cmd_config: RunConfig) -> Result<() let mut cli = Cli::::from_args(); cli.chain_spec_loader = Some(cmd_config.chain_spec_loader); + #[allow(deprecated)] match &cli.subcommand { Some(Subcommand::BuildSpec(cmd)) => { let runner = cli.create_runner(cmd)?;