From 3c5e9c508068acacb078e902b3227d3f0715cc4f Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 14 Oct 2025 09:39:50 +0300 Subject: [PATCH 01/21] instant seal omninode --- .../polkadot-omni-node/lib/src/nodes/aura.rs | 89 ++++++++++++------- 1 file changed, 55 insertions(+), 34 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs index ec4eb36689dcc..da74215633d42 100644 --- a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs +++ b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs @@ -277,24 +277,6 @@ where None, ); - let (manual_seal_sink, manual_seal_stream) = futures::channel::mpsc::channel(1024); - let mut manual_seal_sink_clone = manual_seal_sink.clone(); - task_manager - .spawn_essential_handle() - .spawn("block_authoring", None, async move { - loop { - futures_timer::Delay::new(std::time::Duration::from_millis(block_time)).await; - manual_seal_sink_clone - .try_send(sc_consensus_manual_seal::EngineCommand::SealNewBlock { - create_empty: true, - finalize: true, - parent_hash: None, - sender: None, - }) - .unwrap(); - } - }); - // Note: Changing slot durations are currently not supported let slot_duration = sc_consensus_aura::slot_duration(&*client) .expect("slot_duration is always present; qed."); @@ -311,23 +293,62 @@ where slot_duration, ); - let params = sc_consensus_manual_seal::ManualSealParams { - block_import: client.clone(), - env: proposer, - client: client.clone(), - pool: transaction_pool.clone(), - select_chain: LongestChain::new(backend.clone()), - commands_stream: Box::pin(manual_seal_stream), - consensus_data_provider: Some(Box::new(aura_digest_provider)), - create_inherent_data_providers, - }; + if block_time == 0 { + // Instant seal mode + let params = sc_consensus_manual_seal::InstantSealParams { + block_import: client.clone(), + env: proposer, + client: client.clone(), + pool: transaction_pool.clone(), + select_chain: LongestChain::new(backend.clone()), + consensus_data_provider: Some(Box::new(aura_digest_provider)), + create_inherent_data_providers, + }; - let authorship_future = sc_consensus_manual_seal::run_manual_seal(params); - task_manager.spawn_essential_handle().spawn_blocking( - "manual-seal", - None, - authorship_future, - ); + let authorship_future = sc_consensus_manual_seal::run_instant_seal(params); + task_manager.spawn_essential_handle().spawn_blocking( + "instant-seal", + None, + authorship_future, + ); + } else { + // Manual seal mode with timer + let (manual_seal_sink, manual_seal_stream) = futures::channel::mpsc::channel(1024); + let mut manual_seal_sink_clone = manual_seal_sink.clone(); + task_manager + .spawn_essential_handle() + .spawn("block_authoring", None, async move { + loop { + futures_timer::Delay::new(std::time::Duration::from_millis(block_time)).await; + manual_seal_sink_clone + .try_send(sc_consensus_manual_seal::EngineCommand::SealNewBlock { + create_empty: true, + finalize: true, + parent_hash: None, + sender: None, + }) + .unwrap(); + } + }); + + let params = sc_consensus_manual_seal::ManualSealParams { + block_import: client.clone(), + env: proposer, + client: client.clone(), + pool: transaction_pool.clone(), + select_chain: LongestChain::new(backend.clone()), + commands_stream: Box::pin(manual_seal_stream), + consensus_data_provider: Some(Box::new(aura_digest_provider)), + create_inherent_data_providers, + }; + + let authorship_future = sc_consensus_manual_seal::run_manual_seal(params); + task_manager.spawn_essential_handle().spawn_blocking( + "manual-seal", + None, + authorship_future, + ); + } let rpc_extensions_builder = { let client = client.clone(); From 8b828d71af3441f9f4862e9fc277306ca1971570 Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 14 Oct 2025 09:42:56 +0300 Subject: [PATCH 02/21] Update cumulus/polkadot-omni-node/lib/src/nodes/aura.rs --- cumulus/polkadot-omni-node/lib/src/nodes/aura.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs index da74215633d42..5d4cb56c4a942 100644 --- a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs +++ b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs @@ -312,7 +312,7 @@ where authorship_future, ); } else { - // Manual seal mode with timer + // Manual seal mode let (manual_seal_sink, manual_seal_stream) = futures::channel::mpsc::channel(1024); let mut manual_seal_sink_clone = manual_seal_sink.clone(); task_manager From d2ef9af67f61bb96d465ac6efc608e755de2f503 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 14 Oct 2025 09:46:46 +0300 Subject: [PATCH 03/21] update docstring --- cumulus/polkadot-omni-node/lib/src/cli.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index af9f6c00dd7d8..a3ddcda878fdc 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -161,6 +161,9 @@ pub struct Cli { /// its own, running the wasm blob and artificially producing a block each `dev_block_time` ms, /// as if it was part of a parachain. /// + /// When `--dev-block-time 0` is passed, omni-node will run instant seal instead of manual + /// seal. + /// /// The `--dev` flag sets the `dev_block_time` to a default value of 3000ms unless explicitly /// provided. #[arg(long)] From 8d5b46963c036050103bb1158a0ca91df5841ab3 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 06:50:10 +0000 Subject: [PATCH 04/21] Update from github-actions[bot] running command 'prdoc --audience runtime_dev --bump patch' --- prdoc/pr_10008.prdoc | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 prdoc/pr_10008.prdoc diff --git a/prdoc/pr_10008.prdoc b/prdoc/pr_10008.prdoc new file mode 100644 index 0000000000000..7d327cfaeb2be --- /dev/null +++ b/prdoc/pr_10008.prdoc @@ -0,0 +1,10 @@ +title: Add instant seal to omni-node +doc: +- audience: Runtime Dev + description: |- + when `--dev-block-time 0` is passed omni-node will run instant seal instead of manual seal. + + fixes https://github.com/paritytech/polkadot-sdk/issues/9996 +crates: +- name: polkadot-omni-node-lib + bump: patch From 885be57e931c144d959d1c5b026931a0ec5d5dc0 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 06:59:49 +0000 Subject: [PATCH 05/21] Update from github-actions[bot] running command 'fmt' --- cumulus/polkadot-omni-node/lib/src/nodes/aura.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs index 5d4cb56c4a942..21611610b6bfd 100644 --- a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs +++ b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs @@ -319,7 +319,8 @@ where .spawn_essential_handle() .spawn("block_authoring", None, async move { loop { - futures_timer::Delay::new(std::time::Duration::from_millis(block_time)).await; + futures_timer::Delay::new(std::time::Duration::from_millis(block_time)) + .await; manual_seal_sink_clone .try_send(sc_consensus_manual_seal::EngineCommand::SealNewBlock { create_empty: true, From 9b61916919e319152a7e374bbf7c13e65ae81d91 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 14 Oct 2025 08:10:54 +0000 Subject: [PATCH 06/21] add cli option --- cumulus/polkadot-omni-node/lib/src/cli.rs | 19 ++- cumulus/polkadot-omni-node/lib/src/command.rs | 12 +- .../polkadot-omni-node/lib/src/common/spec.rs | 28 ++-- .../polkadot-omni-node/lib/src/nodes/aura.rs | 136 +++++++++--------- prdoc/pr_10008.prdoc | 4 +- 5 files changed, 113 insertions(+), 86 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index a3ddcda878fdc..acc5f7644e8cc 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -161,14 +161,25 @@ pub struct Cli { /// its own, running the wasm blob and artificially producing a block each `dev_block_time` ms, /// as if it was part of a parachain. /// - /// When `--dev-block-time 0` is passed, omni-node will run instant seal instead of manual - /// seal. - /// /// The `--dev` flag sets the `dev_block_time` to a default value of 3000ms unless explicitly /// provided. - #[arg(long)] + /// + /// Cannot be used together with `--instant-seal`. + #[arg(long, conflicts_with = "instant_seal")] pub dev_block_time: Option, + /// Start a dev node with instant seal. + /// + /// This is a dev option that enables instant sealing, meaning blocks are produced + /// immediately when transactions are received, rather than at fixed intervals. + /// Using this option won't result in starting or connecting to a parachain network. + /// The resulting node will work on its own, running the wasm blob and producing blocks + /// instantly upon receiving transactions. + /// + /// Cannot be used together with `--dev-block-time`. + #[arg(long, conflicts_with = "dev_block_time")] + pub instant_seal: bool, + /// DEPRECATED: This feature has been stabilized, pLease use `--authoring slot-based` instead. /// /// Use slot-based collator which can handle elastic scaling. diff --git a/cumulus/polkadot-omni-node/lib/src/command.rs b/cumulus/polkadot-omni-node/lib/src/command.rs index 22b27cd601543..31e76a7361100 100644 --- a/cumulus/polkadot-omni-node/lib/src/command.rs +++ b/cumulus/polkadot-omni-node/lib/src/command.rs @@ -22,7 +22,7 @@ use crate::{ AuraConsensusId, Consensus, Runtime, RuntimeResolver as RuntimeResolverT, RuntimeResolver, }, - spec::DynNodeSpec, + spec::{DevSealMode, DynNodeSpec}, types::Block, NodeBlock, NodeExtraArgs, }, @@ -303,16 +303,22 @@ where let node_spec = new_node_spec(&config, &cmd_config.runtime_resolver, &cli.node_extra_args())?; + if cli.instant_seal { + return node_spec + .start_dev_seal_node(config, DevSealMode::InstantSeal) + .map_err(Into::into); + } + if cli.run.base.is_dev()? { let dev_block_time = cli.dev_block_time.unwrap_or(DEFAULT_DEV_BLOCK_TIME_MS); return node_spec - .start_manual_seal_node(config, dev_block_time) + .start_dev_seal_node(config, DevSealMode::ManualSeal(dev_block_time)) .map_err(Into::into); } if let Some(dev_block_time) = cli.dev_block_time { return node_spec - .start_manual_seal_node(config, dev_block_time) + .start_dev_seal_node(config, DevSealMode::ManualSeal(dev_block_time)) .map_err(Into::into); } diff --git a/cumulus/polkadot-omni-node/lib/src/common/spec.rs b/cumulus/polkadot-omni-node/lib/src/common/spec.rs index 686e2cc4e1669..247c7d16f40e5 100644 --- a/cumulus/polkadot-omni-node/lib/src/common/spec.rs +++ b/cumulus/polkadot-omni-node/lib/src/common/spec.rs @@ -57,6 +57,16 @@ use sp_keystore::KeystorePtr; use sp_runtime::traits::AccountIdConversion; use std::{future::Future, pin::Pin, sync::Arc, time::Duration}; +/// Mode for development sealing (non-consensus block production). +#[derive(Debug, Clone, Copy)] +pub enum DevSealMode { + /// Instant seal mode - produces blocks immediately upon receiving transactions. + InstantSeal, + /// Manual seal mode - produces blocks at fixed time intervals. + /// The u64 parameter represents the block time in milliseconds. + ManualSeal(u64), +} + pub(crate) trait BuildImportQueue< Block: BlockT, RuntimeApi, @@ -300,11 +310,11 @@ pub(crate) trait NodeSpec: BaseNodeSpec { const SYBIL_RESISTANCE: CollatorSybilResistance; - fn start_manual_seal_node( + fn start_dev_seal_node( _config: Configuration, - _block_time: u64, + _mode: DevSealMode, ) -> sc_service::error::Result { - Err(sc_service::Error::Other("Manual seal not supported for this node type".into())) + Err(sc_service::Error::Other("Dev seal not supported for this node type".into())) } /// Start a node with the given parachain spec. @@ -557,11 +567,11 @@ pub(crate) trait NodeSpec: BaseNodeSpec { } pub(crate) trait DynNodeSpec: NodeCommandRunner { - /// Start node with manual-seal consensus. - fn start_manual_seal_node( + /// Start node with dev seal consensus. + fn start_dev_seal_node( self: Box, config: Configuration, - block_time: u64, + mode: DevSealMode, ) -> sc_service::error::Result; /// Start the node. @@ -579,12 +589,12 @@ impl DynNodeSpec for T where T: NodeSpec + NodeCommandRunner, { - fn start_manual_seal_node( + fn start_dev_seal_node( self: Box, config: Configuration, - block_time: u64, + mode: DevSealMode, ) -> sc_service::error::Result { - ::start_manual_seal_node(config, block_time) + ::start_dev_seal_node(config, mode) } fn start_node( diff --git a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs index 21611610b6bfd..ca854dc2e1525 100644 --- a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs +++ b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs @@ -20,8 +20,8 @@ use crate::{ aura::{AuraIdT, AuraRuntimeApi}, rpc::{BuildParachainRpcExtensions, BuildRpcExtensions}, spec::{ - BaseNodeSpec, BuildImportQueue, ClientBlockImport, DynNodeSpec, InitBlockImport, - NodeSpec, StartConsensus, + BaseNodeSpec, BuildImportQueue, ClientBlockImport, DevSealMode, DynNodeSpec, + InitBlockImport, NodeSpec, StartConsensus, }, types::{ AccountId, Balance, Hash, Nonce, ParachainBackend, ParachainBlockImport, @@ -211,9 +211,9 @@ where type StartConsensus = StartConsensus; const SYBIL_RESISTANCE: CollatorSybilResistance = CollatorSybilResistance::Resistant; - fn start_manual_seal_node( + fn start_dev_seal_node( mut config: Configuration, - block_time: u64, + mode: DevSealMode, ) -> sc_service::error::Result { let PartialComponents { client, @@ -287,68 +287,66 @@ where let para_id = Self::parachain_id(&client, &config).ok_or("Failed to retrieve the parachain id")?; - let create_inherent_data_providers = Self::create_manual_seal_inherent_data_providers( - client.clone(), - para_id, - slot_duration, - ); - - if block_time == 0 { - // Instant seal mode - let params = sc_consensus_manual_seal::InstantSealParams { - block_import: client.clone(), - env: proposer, - client: client.clone(), - pool: transaction_pool.clone(), - select_chain: LongestChain::new(backend.clone()), - consensus_data_provider: Some(Box::new(aura_digest_provider)), - create_inherent_data_providers, - }; - - let authorship_future = sc_consensus_manual_seal::run_instant_seal(params); - task_manager.spawn_essential_handle().spawn_blocking( - "instant-seal", - None, - authorship_future, - ); - } else { - // Manual seal mode - let (manual_seal_sink, manual_seal_stream) = futures::channel::mpsc::channel(1024); - let mut manual_seal_sink_clone = manual_seal_sink.clone(); - task_manager - .spawn_essential_handle() - .spawn("block_authoring", None, async move { - loop { - futures_timer::Delay::new(std::time::Duration::from_millis(block_time)) - .await; - manual_seal_sink_clone - .try_send(sc_consensus_manual_seal::EngineCommand::SealNewBlock { - create_empty: true, - finalize: true, - parent_hash: None, - sender: None, - }) - .unwrap(); - } - }); - - let params = sc_consensus_manual_seal::ManualSealParams { - block_import: client.clone(), - env: proposer, - client: client.clone(), - pool: transaction_pool.clone(), - select_chain: LongestChain::new(backend.clone()), - commands_stream: Box::pin(manual_seal_stream), - consensus_data_provider: Some(Box::new(aura_digest_provider)), - create_inherent_data_providers, - }; - - let authorship_future = sc_consensus_manual_seal::run_manual_seal(params); - task_manager.spawn_essential_handle().spawn_blocking( - "manual-seal", - None, - authorship_future, - ); + let create_inherent_data_providers = + Self::create_dev_seal_inherent_data_providers(client.clone(), para_id, slot_duration); + + match mode { + DevSealMode::InstantSeal => { + let params = sc_consensus_manual_seal::InstantSealParams { + block_import: client.clone(), + env: proposer, + client: client.clone(), + pool: transaction_pool.clone(), + select_chain: LongestChain::new(backend.clone()), + consensus_data_provider: Some(Box::new(aura_digest_provider)), + create_inherent_data_providers, + }; + + let authorship_future = sc_consensus_manual_seal::run_instant_seal(params); + task_manager.spawn_essential_handle().spawn_blocking( + "instant-seal", + None, + authorship_future, + ); + }, + DevSealMode::ManualSeal(block_time) => { + let (manual_seal_sink, manual_seal_stream) = futures::channel::mpsc::channel(1024); + let mut manual_seal_sink_clone = manual_seal_sink.clone(); + task_manager + .spawn_essential_handle() + .spawn("block_authoring", None, async move { + loop { + futures_timer::Delay::new(std::time::Duration::from_millis(block_time)) + .await; + manual_seal_sink_clone + .try_send(sc_consensus_manual_seal::EngineCommand::SealNewBlock { + create_empty: true, + finalize: true, + parent_hash: None, + sender: None, + }) + .unwrap(); + } + }); + + let params = sc_consensus_manual_seal::ManualSealParams { + block_import: client.clone(), + env: proposer, + client: client.clone(), + pool: transaction_pool.clone(), + select_chain: LongestChain::new(backend.clone()), + commands_stream: Box::pin(manual_seal_stream), + consensus_data_provider: Some(Box::new(aura_digest_provider)), + create_inherent_data_providers, + }; + + let authorship_future = sc_consensus_manual_seal::run_manual_seal(params); + task_manager.spawn_essential_handle().spawn_blocking( + "manual-seal", + None, + authorship_future, + ); + }, } let rpc_extensions_builder = { @@ -395,11 +393,11 @@ where RuntimeApi::RuntimeApi: AuraRuntimeApi, AuraId: AuraIdT + Sync, { - /// Creates the inherent data providers for manual seal consensus. + /// Creates the inherent data providers for dev seal consensus. /// /// This function sets up the timestamp and parachain validation data providers - /// required for manual seal block production in a parachain environment. - fn create_manual_seal_inherent_data_providers( + /// required for dev seal block production in a parachain environment. + fn create_dev_seal_inherent_data_providers( client: Arc>, para_id: ParaId, slot_duration: sp_consensus_aura::SlotDuration, diff --git a/prdoc/pr_10008.prdoc b/prdoc/pr_10008.prdoc index 7d327cfaeb2be..d9da04a4c5693 100644 --- a/prdoc/pr_10008.prdoc +++ b/prdoc/pr_10008.prdoc @@ -2,7 +2,9 @@ title: Add instant seal to omni-node doc: - audience: Runtime Dev description: |- - when `--dev-block-time 0` is passed omni-node will run instant seal instead of manual seal. + Adds a new `--instant-seal` CLI flag to enable instant seal mode in omni-node. When this flag + is passed, blocks are produced immediately upon receiving transactions, rather than at fixed + intervals. This flag cannot be used together with `--dev-block-time`. fixes https://github.com/paritytech/polkadot-sdk/issues/9996 crates: From 4890f31c4972e5cdb22118f5ce14b99d8f64c886 Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 14 Oct 2025 16:45:26 +0300 Subject: [PATCH 07/21] Apply suggestions from code review --- cumulus/polkadot-omni-node/lib/src/cli.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index acc5f7644e8cc..7560a88067c1d 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -163,8 +163,6 @@ pub struct Cli { /// /// The `--dev` flag sets the `dev_block_time` to a default value of 3000ms unless explicitly /// provided. - /// - /// Cannot be used together with `--instant-seal`. #[arg(long, conflicts_with = "instant_seal")] pub dev_block_time: Option, @@ -175,8 +173,6 @@ pub struct Cli { /// Using this option won't result in starting or connecting to a parachain network. /// The resulting node will work on its own, running the wasm blob and producing blocks /// instantly upon receiving transactions. - /// - /// Cannot be used together with `--dev-block-time`. #[arg(long, conflicts_with = "dev_block_time")] pub instant_seal: bool, From c52c1fbf7c6d06679dd6e2dac545071e3b4dbbe7 Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 14 Oct 2025 16:46:54 +0300 Subject: [PATCH 08/21] Update cumulus/polkadot-omni-node/lib/src/common/spec.rs --- cumulus/polkadot-omni-node/lib/src/common/spec.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/common/spec.rs b/cumulus/polkadot-omni-node/lib/src/common/spec.rs index 247c7d16f40e5..699bc76fd99b5 100644 --- a/cumulus/polkadot-omni-node/lib/src/common/spec.rs +++ b/cumulus/polkadot-omni-node/lib/src/common/spec.rs @@ -60,9 +60,9 @@ use std::{future::Future, pin::Pin, sync::Arc, time::Duration}; /// Mode for development sealing (non-consensus block production). #[derive(Debug, Clone, Copy)] pub enum DevSealMode { - /// Instant seal mode - produces blocks immediately upon receiving transactions. + /// Produces blocks immediately upon receiving transactions. InstantSeal, - /// Manual seal mode - produces blocks at fixed time intervals. + /// Produces blocks at fixed time intervals. /// The u64 parameter represents the block time in milliseconds. ManualSeal(u64), } From 6cd9b0a87494855133f95b512b94ec8b6158b4f9 Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 14 Oct 2025 16:47:35 +0300 Subject: [PATCH 09/21] Update cumulus/polkadot-omni-node/lib/src/nodes/aura.rs --- cumulus/polkadot-omni-node/lib/src/nodes/aura.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs index ca854dc2e1525..411f47e08632f 100644 --- a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs +++ b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs @@ -393,7 +393,7 @@ where RuntimeApi::RuntimeApi: AuraRuntimeApi, AuraId: AuraIdT + Sync, { - /// Creates the inherent data providers for dev seal consensus. + /// Creates the inherent data providers for manual and instant seal consensus. /// /// This function sets up the timestamp and parachain validation data providers /// required for dev seal block production in a parachain environment. From 374d3ced59d380d7a5d8e4d170e11ac7d2642ab0 Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 14 Oct 2025 16:51:44 +0300 Subject: [PATCH 10/21] Update cumulus/polkadot-omni-node/lib/src/common/spec.rs --- cumulus/polkadot-omni-node/lib/src/common/spec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulus/polkadot-omni-node/lib/src/common/spec.rs b/cumulus/polkadot-omni-node/lib/src/common/spec.rs index 699bc76fd99b5..314704733809a 100644 --- a/cumulus/polkadot-omni-node/lib/src/common/spec.rs +++ b/cumulus/polkadot-omni-node/lib/src/common/spec.rs @@ -567,7 +567,7 @@ pub(crate) trait NodeSpec: BaseNodeSpec { } pub(crate) trait DynNodeSpec: NodeCommandRunner { - /// Start node with dev seal consensus. + /// Start node with manual or instant seal consensus. fn start_dev_seal_node( self: Box, config: Configuration, From 89998664e8a1478f95582ec5dc64299f733f42a5 Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 14 Oct 2025 22:42:40 +0300 Subject: [PATCH 11/21] Update cumulus/polkadot-omni-node/lib/src/common/spec.rs Co-authored-by: Iulian Barbu <14218860+iulianbarbu@users.noreply.github.com> --- cumulus/polkadot-omni-node/lib/src/common/spec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulus/polkadot-omni-node/lib/src/common/spec.rs b/cumulus/polkadot-omni-node/lib/src/common/spec.rs index 314704733809a..79393a8d1e2c1 100644 --- a/cumulus/polkadot-omni-node/lib/src/common/spec.rs +++ b/cumulus/polkadot-omni-node/lib/src/common/spec.rs @@ -310,7 +310,7 @@ pub(crate) trait NodeSpec: BaseNodeSpec { const SYBIL_RESISTANCE: CollatorSybilResistance; - fn start_dev_seal_node( + fn start_dev_node( _config: Configuration, _mode: DevSealMode, ) -> sc_service::error::Result { From 0910c29e6af927429cdd6f391451ec4f7505f33e Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 14 Oct 2025 22:42:54 +0300 Subject: [PATCH 12/21] Update cumulus/polkadot-omni-node/lib/src/nodes/aura.rs Co-authored-by: Iulian Barbu <14218860+iulianbarbu@users.noreply.github.com> --- cumulus/polkadot-omni-node/lib/src/nodes/aura.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs index 411f47e08632f..92070a6089ee4 100644 --- a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs +++ b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs @@ -397,7 +397,7 @@ where /// /// This function sets up the timestamp and parachain validation data providers /// required for dev seal block production in a parachain environment. - fn create_dev_seal_inherent_data_providers( + fn create_dev_node_inherent_data_providers( client: Arc>, para_id: ParaId, slot_duration: sp_consensus_aura::SlotDuration, From e721f7fcc80f25182433abdc590987f1f5230eb8 Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 14 Oct 2025 20:09:43 +0000 Subject: [PATCH 13/21] PR review --- cumulus/polkadot-omni-node/lib/src/cli.rs | 26 +++++++++++++++++++ cumulus/polkadot-omni-node/lib/src/command.rs | 25 +++--------------- .../polkadot-omni-node/lib/src/common/spec.rs | 17 +++--------- .../polkadot-omni-node/lib/src/nodes/aura.rs | 8 +++--- 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 7560a88067c1d..008b26910058e 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -16,6 +16,9 @@ //! CLI options of the omni-node. See [`Command`]. +/// Default block time for dev mode when using `--dev` flag. +const DEFAULT_DEV_BLOCK_TIME_MS: u64 = 3000; + use crate::{ chain_spec::DiskChainSpecLoader, common::{ @@ -219,6 +222,16 @@ pub struct Cli { pub(crate) _phantom: PhantomData, } +/// Development sealing mode. +#[derive(Debug, Clone, Copy)] +pub enum DevSealMode { + /// Produces blocks immediately upon receiving transactions. + InstantSeal, + /// Produces blocks at fixed time intervals. + /// The u64 parameter represents the block time in milliseconds. + ManualSeal(u64), +} + /// Collator implementation to use. #[derive(PartialEq, Debug, ValueEnum, Clone, Copy)] pub enum AuthoringPolicy { @@ -252,6 +265,19 @@ impl Cli { enable_statement_store: self.enable_statement_store, } } + + /// Returns the dev seal mode if the node is in dev mode. + pub fn dev_mode(&self) -> sc_cli::Result> { + if self.instant_seal { + Ok(Some(DevSealMode::InstantSeal)) + } else if let Some(dev_block_time) = self.dev_block_time { + Ok(Some(DevSealMode::ManualSeal(dev_block_time))) + } else if self.run.base.is_dev()? { + Ok(Some(DevSealMode::ManualSeal(DEFAULT_DEV_BLOCK_TIME_MS))) + } else { + Ok(None) + } + } } impl SubstrateCli for Cli { diff --git a/cumulus/polkadot-omni-node/lib/src/command.rs b/cumulus/polkadot-omni-node/lib/src/command.rs index 31e76a7361100..e14a57ddeeb78 100644 --- a/cumulus/polkadot-omni-node/lib/src/command.rs +++ b/cumulus/polkadot-omni-node/lib/src/command.rs @@ -22,7 +22,7 @@ use crate::{ AuraConsensusId, Consensus, Runtime, RuntimeResolver as RuntimeResolverT, RuntimeResolver, }, - spec::{DevSealMode, DynNodeSpec}, + spec::DynNodeSpec, types::Block, NodeBlock, NodeExtraArgs, }, @@ -35,12 +35,10 @@ use clap::{CommandFactory, FromArgMatches}; use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions; use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; use log::info; -use sc_cli::{CliConfiguration, Result, SubstrateCli}; +use sc_cli::{Result, SubstrateCli}; #[cfg(feature = "runtime-benchmarks")] use sp_runtime::traits::HashingFor; -const DEFAULT_DEV_BLOCK_TIME_MS: u64 = 3000; - /// Structure that can be used in order to provide customizers for different functionalities of the /// node binary that is being built using this library. pub struct RunConfig { @@ -303,23 +301,8 @@ where let node_spec = new_node_spec(&config, &cmd_config.runtime_resolver, &cli.node_extra_args())?; - if cli.instant_seal { - return node_spec - .start_dev_seal_node(config, DevSealMode::InstantSeal) - .map_err(Into::into); - } - - if cli.run.base.is_dev()? { - let dev_block_time = cli.dev_block_time.unwrap_or(DEFAULT_DEV_BLOCK_TIME_MS); - return node_spec - .start_dev_seal_node(config, DevSealMode::ManualSeal(dev_block_time)) - .map_err(Into::into); - } - - if let Some(dev_block_time) = cli.dev_block_time { - return node_spec - .start_dev_seal_node(config, DevSealMode::ManualSeal(dev_block_time)) - .map_err(Into::into); + if let Some(dev_mode) = cli.dev_mode()? { + return node_spec.start_dev_node(config, dev_mode).map_err(Into::into); } // If Statemint (Statemine, Westmint, Rockmine) DB exists and we're using the diff --git a/cumulus/polkadot-omni-node/lib/src/common/spec.rs b/cumulus/polkadot-omni-node/lib/src/common/spec.rs index 79393a8d1e2c1..11498f013469d 100644 --- a/cumulus/polkadot-omni-node/lib/src/common/spec.rs +++ b/cumulus/polkadot-omni-node/lib/src/common/spec.rs @@ -16,6 +16,7 @@ use crate::{ chain_spec::Extensions, + cli::DevSealMode, common::{ command::NodeCommandRunner, rpc::BuildRpcExtensions, @@ -57,16 +58,6 @@ use sp_keystore::KeystorePtr; use sp_runtime::traits::AccountIdConversion; use std::{future::Future, pin::Pin, sync::Arc, time::Duration}; -/// Mode for development sealing (non-consensus block production). -#[derive(Debug, Clone, Copy)] -pub enum DevSealMode { - /// Produces blocks immediately upon receiving transactions. - InstantSeal, - /// Produces blocks at fixed time intervals. - /// The u64 parameter represents the block time in milliseconds. - ManualSeal(u64), -} - pub(crate) trait BuildImportQueue< Block: BlockT, RuntimeApi, @@ -568,7 +559,7 @@ pub(crate) trait NodeSpec: BaseNodeSpec { pub(crate) trait DynNodeSpec: NodeCommandRunner { /// Start node with manual or instant seal consensus. - fn start_dev_seal_node( + fn start_dev_node( self: Box, config: Configuration, mode: DevSealMode, @@ -589,12 +580,12 @@ impl DynNodeSpec for T where T: NodeSpec + NodeCommandRunner, { - fn start_dev_seal_node( + fn start_dev_node( self: Box, config: Configuration, mode: DevSealMode, ) -> sc_service::error::Result { - ::start_dev_seal_node(config, mode) + ::start_dev_node(config, mode) } fn start_node( diff --git a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs index 92070a6089ee4..9e6d796b80216 100644 --- a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs +++ b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs @@ -15,12 +15,12 @@ // limitations under the License. use crate::{ - cli::AuthoringPolicy, + cli::{AuthoringPolicy, DevSealMode}, common::{ aura::{AuraIdT, AuraRuntimeApi}, rpc::{BuildParachainRpcExtensions, BuildRpcExtensions}, spec::{ - BaseNodeSpec, BuildImportQueue, ClientBlockImport, DevSealMode, DynNodeSpec, + BaseNodeSpec, BuildImportQueue, ClientBlockImport, DynNodeSpec, InitBlockImport, NodeSpec, StartConsensus, }, types::{ @@ -211,7 +211,7 @@ where type StartConsensus = StartConsensus; const SYBIL_RESISTANCE: CollatorSybilResistance = CollatorSybilResistance::Resistant; - fn start_dev_seal_node( + fn start_dev_node( mut config: Configuration, mode: DevSealMode, ) -> sc_service::error::Result { @@ -288,7 +288,7 @@ where let para_id = Self::parachain_id(&client, &config).ok_or("Failed to retrieve the parachain id")?; let create_inherent_data_providers = - Self::create_dev_seal_inherent_data_providers(client.clone(), para_id, slot_duration); + Self::create_dev_node_inherent_data_providers(client.clone(), para_id, slot_duration); match mode { DevSealMode::InstantSeal => { From 9694554fd89600c63eac3ab565956489f8c524dd Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 14 Oct 2025 23:11:17 +0300 Subject: [PATCH 14/21] Update cumulus/polkadot-omni-node/lib/src/cli.rs --- cumulus/polkadot-omni-node/lib/src/cli.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 008b26910058e..783fd1547b0c0 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -267,15 +267,15 @@ impl Cli { } /// Returns the dev seal mode if the node is in dev mode. - pub fn dev_mode(&self) -> sc_cli::Result> { + pub fn dev_mode(&self) -> Option { if self.instant_seal { - Ok(Some(DevSealMode::InstantSeal)) + Some(DevSealMode::InstantSeal) } else if let Some(dev_block_time) = self.dev_block_time { - Ok(Some(DevSealMode::ManualSeal(dev_block_time))) + Some(DevSealMode::ManualSeal(dev_block_time)) } else if self.run.base.is_dev()? { - Ok(Some(DevSealMode::ManualSeal(DEFAULT_DEV_BLOCK_TIME_MS))) + Some(DevSealMode::ManualSeal(DEFAULT_DEV_BLOCK_TIME_MS)) } else { - Ok(None) + None } } } From 8bc0f48a60f74cd08e20010ad4e24c373ad7dd5d Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 14 Oct 2025 20:13:58 +0000 Subject: [PATCH 15/21] fixes --- cumulus/polkadot-omni-node/lib/src/cli.rs | 2 +- cumulus/polkadot-omni-node/lib/src/command.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 783fd1547b0c0..0b47f7adeb8b2 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -272,7 +272,7 @@ impl Cli { Some(DevSealMode::InstantSeal) } else if let Some(dev_block_time) = self.dev_block_time { Some(DevSealMode::ManualSeal(dev_block_time)) - } else if self.run.base.is_dev()? { + } else if self.run.base.is_dev().unwrap_or(false) { Some(DevSealMode::ManualSeal(DEFAULT_DEV_BLOCK_TIME_MS)) } else { None diff --git a/cumulus/polkadot-omni-node/lib/src/command.rs b/cumulus/polkadot-omni-node/lib/src/command.rs index e14a57ddeeb78..4ac7f6ef82bab 100644 --- a/cumulus/polkadot-omni-node/lib/src/command.rs +++ b/cumulus/polkadot-omni-node/lib/src/command.rs @@ -301,7 +301,7 @@ where let node_spec = new_node_spec(&config, &cmd_config.runtime_resolver, &cli.node_extra_args())?; - if let Some(dev_mode) = cli.dev_mode()? { + if let Some(dev_mode) = cli.dev_mode() { return node_spec.start_dev_node(config, dev_mode).map_err(Into::into); } From 7f73cfb04ff478485264c726e049ffef67264fae Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 14 Oct 2025 20:20:22 +0000 Subject: [PATCH 16/21] fix is_dev --- cumulus/polkadot-omni-node/lib/src/cli.rs | 2 +- substrate/client/cli/src/commands/run_cmd.rs | 2 +- substrate/client/cli/src/config.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 0b47f7adeb8b2..6255e19dceb77 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -272,7 +272,7 @@ impl Cli { Some(DevSealMode::InstantSeal) } else if let Some(dev_block_time) = self.dev_block_time { Some(DevSealMode::ManualSeal(dev_block_time)) - } else if self.run.base.is_dev().unwrap_or(false) { + } else if self.run.base.is_dev() { Some(DevSealMode::ManualSeal(DEFAULT_DEV_BLOCK_TIME_MS)) } else { None diff --git a/substrate/client/cli/src/commands/run_cmd.rs b/substrate/client/cli/src/commands/run_cmd.rs index f79e5b558e37e..b4de4e2c078de 100644 --- a/substrate/client/cli/src/commands/run_cmd.rs +++ b/substrate/client/cli/src/commands/run_cmd.rs @@ -291,7 +291,7 @@ impl CliConfiguration for RunCmd { } fn rpc_addr(&self, default_listen_port: u16) -> Result>> { - self.rpc_params.rpc_addr(self.is_dev()?, self.validator, default_listen_port) + self.rpc_params.rpc_addr(self.is_dev(), self.validator, default_listen_port) } fn rpc_methods(&self) -> Result { diff --git a/substrate/client/cli/src/config.rs b/substrate/client/cli/src/config.rs index d456a4072d0e0..8f217b7d7e54e 100644 --- a/substrate/client/cli/src/config.rs +++ b/substrate/client/cli/src/config.rs @@ -139,8 +139,8 @@ pub trait CliConfiguration: Sized { /// Returns `true` if the node is for development or not /// /// By default this is retrieved from `SharedParams`. - fn is_dev(&self) -> Result { - Ok(self.shared_params().is_dev()) + fn is_dev(&self) -> bool { + self.shared_params().is_dev() } /// Gets the role @@ -455,7 +455,7 @@ pub trait CliConfiguration: Sized { /// By default this is retrieved from `NodeKeyParams` if it is available. Otherwise its /// `NodeKeyConfig::default()`. fn node_key(&self, net_config_dir: &PathBuf) -> Result { - let is_dev = self.is_dev()?; + let is_dev = self.is_dev(); let role = self.role(is_dev)?; self.node_key_params() .map(|x| x.node_key(net_config_dir, role, is_dev)) @@ -489,7 +489,7 @@ pub trait CliConfiguration: Sized { cli: &C, tokio_handle: tokio::runtime::Handle, ) -> Result { - let is_dev = self.is_dev()?; + let is_dev = self.is_dev(); let chain_id = self.chain_id(is_dev)?; let chain_spec = cli.load_spec(&chain_id)?; let base_path = base_path_or_default(self.base_path()?, &C::executable_name()); From 26808c4a35ed4daaa53b9df5206974d7784862b0 Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 14 Oct 2025 23:21:02 +0300 Subject: [PATCH 17/21] Update cumulus/polkadot-omni-node/lib/src/common/spec.rs --- cumulus/polkadot-omni-node/lib/src/common/spec.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cumulus/polkadot-omni-node/lib/src/common/spec.rs b/cumulus/polkadot-omni-node/lib/src/common/spec.rs index 11498f013469d..3e1f69e94c5a7 100644 --- a/cumulus/polkadot-omni-node/lib/src/common/spec.rs +++ b/cumulus/polkadot-omni-node/lib/src/common/spec.rs @@ -305,7 +305,7 @@ pub(crate) trait NodeSpec: BaseNodeSpec { _config: Configuration, _mode: DevSealMode, ) -> sc_service::error::Result { - Err(sc_service::Error::Other("Dev seal not supported for this node type".into())) + Err(sc_service::Error::Other("Dev not supported for this node type".into())) } /// Start a node with the given parachain spec. From c9996c90aa33449151c34dd4fb26122b2977b161 Mon Sep 17 00:00:00 2001 From: "cmd[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 20:58:16 +0000 Subject: [PATCH 18/21] Update from github-actions[bot] running command 'fmt' --- cumulus/polkadot-omni-node/lib/src/nodes/aura.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs index 9e6d796b80216..2a7ef5cf537e2 100644 --- a/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs +++ b/cumulus/polkadot-omni-node/lib/src/nodes/aura.rs @@ -20,8 +20,8 @@ use crate::{ aura::{AuraIdT, AuraRuntimeApi}, rpc::{BuildParachainRpcExtensions, BuildRpcExtensions}, spec::{ - BaseNodeSpec, BuildImportQueue, ClientBlockImport, DynNodeSpec, - InitBlockImport, NodeSpec, StartConsensus, + BaseNodeSpec, BuildImportQueue, ClientBlockImport, DynNodeSpec, InitBlockImport, + NodeSpec, StartConsensus, }, types::{ AccountId, Balance, Hash, Nonce, ParachainBackend, ParachainBlockImport, From 6d32e19fec95c6715bfc34b5f67b21d7f525dd4c Mon Sep 17 00:00:00 2001 From: pgherveou Date: Tue, 21 Oct 2025 10:56:07 +0000 Subject: [PATCH 19/21] Revert "fix is_dev" This reverts commit 7f73cfb04ff478485264c726e049ffef67264fae. --- cumulus/polkadot-omni-node/lib/src/cli.rs | 2 +- substrate/client/cli/src/commands/run_cmd.rs | 2 +- substrate/client/cli/src/config.rs | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cumulus/polkadot-omni-node/lib/src/cli.rs b/cumulus/polkadot-omni-node/lib/src/cli.rs index 6255e19dceb77..0b47f7adeb8b2 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -272,7 +272,7 @@ impl Cli { Some(DevSealMode::InstantSeal) } else if let Some(dev_block_time) = self.dev_block_time { Some(DevSealMode::ManualSeal(dev_block_time)) - } else if self.run.base.is_dev() { + } else if self.run.base.is_dev().unwrap_or(false) { Some(DevSealMode::ManualSeal(DEFAULT_DEV_BLOCK_TIME_MS)) } else { None diff --git a/substrate/client/cli/src/commands/run_cmd.rs b/substrate/client/cli/src/commands/run_cmd.rs index b4de4e2c078de..f79e5b558e37e 100644 --- a/substrate/client/cli/src/commands/run_cmd.rs +++ b/substrate/client/cli/src/commands/run_cmd.rs @@ -291,7 +291,7 @@ impl CliConfiguration for RunCmd { } fn rpc_addr(&self, default_listen_port: u16) -> Result>> { - self.rpc_params.rpc_addr(self.is_dev(), self.validator, default_listen_port) + self.rpc_params.rpc_addr(self.is_dev()?, self.validator, default_listen_port) } fn rpc_methods(&self) -> Result { diff --git a/substrate/client/cli/src/config.rs b/substrate/client/cli/src/config.rs index 8f217b7d7e54e..d456a4072d0e0 100644 --- a/substrate/client/cli/src/config.rs +++ b/substrate/client/cli/src/config.rs @@ -139,8 +139,8 @@ pub trait CliConfiguration: Sized { /// Returns `true` if the node is for development or not /// /// By default this is retrieved from `SharedParams`. - fn is_dev(&self) -> bool { - self.shared_params().is_dev() + fn is_dev(&self) -> Result { + Ok(self.shared_params().is_dev()) } /// Gets the role @@ -455,7 +455,7 @@ pub trait CliConfiguration: Sized { /// By default this is retrieved from `NodeKeyParams` if it is available. Otherwise its /// `NodeKeyConfig::default()`. fn node_key(&self, net_config_dir: &PathBuf) -> Result { - let is_dev = self.is_dev(); + let is_dev = self.is_dev()?; let role = self.role(is_dev)?; self.node_key_params() .map(|x| x.node_key(net_config_dir, role, is_dev)) @@ -489,7 +489,7 @@ pub trait CliConfiguration: Sized { cli: &C, tokio_handle: tokio::runtime::Handle, ) -> Result { - let is_dev = self.is_dev(); + let is_dev = self.is_dev()?; let chain_id = self.chain_id(is_dev)?; let chain_spec = cli.load_spec(&chain_id)?; let base_path = base_path_or_default(self.base_path()?, &C::executable_name()); From 5b5048dcec0380fbc0c656ee22423e94a6b38a4f Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 21 Oct 2025 20:40:23 +0200 Subject: [PATCH 20/21] Update cli.rs Co-authored-by: Iulian Barbu <14218860+iulianbarbu@users.noreply.github.com> --- 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 0b47f7adeb8b2..baa69a4392ac5 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -224,7 +224,7 @@ pub struct Cli { /// Development sealing mode. #[derive(Debug, Clone, Copy)] -pub enum DevSealMode { +pub(crate) enum DevSealMode { /// Produces blocks immediately upon receiving transactions. InstantSeal, /// Produces blocks at fixed time intervals. From 4ee6d4ac3262871ced8f547439009f8c365f08b8 Mon Sep 17 00:00:00 2001 From: PG Herveou Date: Tue, 21 Oct 2025 20:58:14 +0200 Subject: [PATCH 21/21] Update cli.rs Co-authored-by: Iulian Barbu <14218860+iulianbarbu@users.noreply.github.com> --- 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 baa69a4392ac5..4ec678f5739cd 100644 --- a/cumulus/polkadot-omni-node/lib/src/cli.rs +++ b/cumulus/polkadot-omni-node/lib/src/cli.rs @@ -267,7 +267,7 @@ impl Cli { } /// Returns the dev seal mode if the node is in dev mode. - pub fn dev_mode(&self) -> Option { + pub(crate) fn dev_mode(&self) -> Option { if self.instant_seal { Some(DevSealMode::InstantSeal) } else if let Some(dev_block_time) = self.dev_block_time {