From 225dc9b4e885d004b052bb82974f854c77984635 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Mon, 28 Feb 2022 21:35:57 +0100 Subject: [PATCH 1/3] polkadot-collator: Switch to wasm only This switches the polkadot-collator to run everything in wasm only mode. While we should not that yet with the relay chain, because it can happen that we run out of memory (very unlikely). On the relay chain that would be bad, because we only have at max 2 sessions to bring everything back, for Parachains that isn't such a problem as they would only stall and we could roll out a release that fixes it. Besides that, Parachain validation on the relay chain happens in Wasm already all the time and there is the memory usage even higher then on block import. --- polkadot-parachains/src/command.rs | 61 ++++--- polkadot-parachains/src/service.rs | 251 ++++++++++++----------------- 2 files changed, 132 insertions(+), 180 deletions(-) diff --git a/polkadot-parachains/src/command.rs b/polkadot-parachains/src/command.rs index caa2531dbc3..7404170130d 100644 --- a/polkadot-parachains/src/command.rs +++ b/polkadot-parachains/src/command.rs @@ -18,8 +18,7 @@ use crate::{ chain_spec, cli::{Cli, RelayChainCli, Subcommand}, service::{ - new_partial, Block, CanvasKusamaRuntimeExecutor, RococoParachainRuntimeExecutor, - SeedlingRuntimeExecutor, ShellRuntimeExecutor, StatemineRuntimeExecutor, + new_partial, Block, ShellRuntimeExecutor, StatemineRuntimeExecutor, StatemintRuntimeExecutor, WestmintRuntimeExecutor, }, }; @@ -274,34 +273,34 @@ macro_rules! construct_async_run { let runner = $cli.create_runner($cmd)?; if runner.config().chain_spec.is_westmint() { runner.async_run(|$config| { - let $components = new_partial::( + let $components = new_partial::( &$config, - crate::service::statemint_build_import_queue::<_, _, AuraId>, + crate::service::statemint_build_import_queue::<_, AuraId>, )?; let task_manager = $components.task_manager; { $( $code )* }.map(|v| (v, task_manager)) }) } else if runner.config().chain_spec.is_statemine() { runner.async_run(|$config| { - let $components = new_partial::( + let $components = new_partial::( &$config, - crate::service::statemint_build_import_queue::<_, _, AuraId>, + crate::service::statemint_build_import_queue::<_, AuraId>, )?; let task_manager = $components.task_manager; { $( $code )* }.map(|v| (v, task_manager)) }) } else if runner.config().chain_spec.is_statemint() { runner.async_run(|$config| { - let $components = new_partial::( + let $components = new_partial::( &$config, - crate::service::statemint_build_import_queue::<_, _, StatemintAuraId>, + crate::service::statemint_build_import_queue::<_, StatemintAuraId>, )?; let task_manager = $components.task_manager; { $( $code )* }.map(|v| (v, task_manager)) }) } else if runner.config().chain_spec.is_shell() { runner.async_run(|$config| { - let $components = new_partial::( + let $components = new_partial::( &$config, crate::service::shell_build_import_queue, )?; @@ -310,7 +309,7 @@ macro_rules! construct_async_run { }) } else if runner.config().chain_spec.is_seedling() { runner.async_run(|$config| { - let $components = new_partial::( + let $components = new_partial::( &$config, crate::service::shell_build_import_queue, )?; @@ -319,7 +318,7 @@ macro_rules! construct_async_run { }) } else if runner.config().chain_spec.is_canvas_kusama() { runner.async_run(|$config| { - let $components = new_partial::( + let $components = new_partial::( &$config, crate::service::canvas_kusama_build_import_queue, )?; @@ -330,7 +329,6 @@ macro_rules! construct_async_run { runner.async_run(|$config| { let $components = new_partial::< rococo_parachain_runtime::RuntimeApi, - RococoParachainRuntimeExecutor, _ >( &$config, @@ -532,43 +530,44 @@ pub fn run() -> Result<()> { if config.chain_spec.is_statemint() { crate::service::start_statemint_node::< statemint_runtime::RuntimeApi, - StatemintRuntimeExecutor, StatemintAuraId, >(config, polkadot_config, id) .await .map(|r| r.0) .map_err(Into::into) } else if config.chain_spec.is_statemine() { - crate::service::start_statemint_node::< - statemine_runtime::RuntimeApi, - StatemineRuntimeExecutor, - AuraId, - >(config, polkadot_config, id) + crate::service::start_statemint_node::( + config, + polkadot_config, + id, + ) .await .map(|r| r.0) .map_err(Into::into) } else if config.chain_spec.is_westmint() { - crate::service::start_statemint_node::< - westmint_runtime::RuntimeApi, - WestmintRuntimeExecutor, - AuraId, - >(config, polkadot_config, id) + crate::service::start_statemint_node::( + config, + polkadot_config, + id, + ) .await .map(|r| r.0) .map_err(Into::into) } else if config.chain_spec.is_shell() { - crate::service::start_shell_node::< - shell_runtime::RuntimeApi, - ShellRuntimeExecutor, - >(config, polkadot_config, id) + crate::service::start_shell_node::( + config, + polkadot_config, + id, + ) .await .map(|r| r.0) .map_err(Into::into) } else if config.chain_spec.is_seedling() { - crate::service::start_shell_node::< - seedling_runtime::RuntimeApi, - SeedlingRuntimeExecutor, - >(config, polkadot_config, id) + crate::service::start_shell_node::( + config, + polkadot_config, + id, + ) .await .map(|r| r.0) .map_err(Into::into) diff --git a/polkadot-parachains/src/service.rs b/polkadot-parachains/src/service.rs index 2fe31635a67..7ebb1f74631 100644 --- a/polkadot-parachains/src/service.rs +++ b/polkadot-parachains/src/service.rs @@ -29,19 +29,17 @@ use cumulus_primitives_core::{ }; use cumulus_relay_chain_interface::RelayChainInterface; use cumulus_relay_chain_local::build_relay_chain_interface; -use polkadot_service::NativeExecutionDispatch; use crate::rpc; pub use parachains_common::{AccountId, Balance, Block, BlockNumber, Hash, Header, Index as Nonce}; use cumulus_client_consensus_relay_chain::Verifier as RelayChainVerifier; use futures::lock::Mutex; -use sc_client_api::ExecutorProvider; use sc_consensus::{ import_queue::{BasicQueue, Verifier as VerifierT}, BlockImportParams, }; -use sc_executor::NativeElseWasmExecutor; +use sc_executor::WasmExecutor; use sc_network::NetworkService; use sc_service::{Configuration, PartialComponents, Role, TFullBackend, TFullClient, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; @@ -58,6 +56,13 @@ use sp_runtime::{ use std::{marker::PhantomData, sync::Arc, time::Duration}; use substrate_prometheus_endpoint::Registry; +#[cfg(not(feature = "runtime-benchmarks"))] +type HostFunctions = sp_io::SubstrateHostFunctions; + +#[cfg(feature = "runtime-benchmarks")] +type HostFunctions = + (sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions); + /// Native executor instance. pub struct RococoParachainRuntimeExecutor; @@ -167,28 +172,28 @@ impl sc_executor::NativeExecutionDispatch for CanvasKusamaRuntimeExecutor { /// /// Use this macro if you don't actually need the full service, but just the builder in order to /// be able to perform chain operations. -pub fn new_partial( +pub fn new_partial( config: &Configuration, build_import_queue: BIQ, ) -> Result< PartialComponents< - TFullClient>, + TFullClient>, TFullBackend, (), sc_consensus::DefaultImportQueue< Block, - TFullClient>, + TFullClient>, >, sc_transaction_pool::FullPool< Block, - TFullClient>, + TFullClient>, >, (Option, Option), >, sc_service::Error, > where - RuntimeApi: ConstructRuntimeApi>> + RuntimeApi: ConstructRuntimeApi>> + Send + Sync + 'static, @@ -201,16 +206,15 @@ where > + sp_offchain::OffchainWorkerApi + sp_block_builder::BlockBuilder, sc_client_api::StateBackendFor, Block>: sp_api::StateBackend, - Executor: NativeExecutionDispatch + 'static, BIQ: FnOnce( - Arc>>, + Arc>>, &Configuration, Option, &TaskManager, ) -> Result< sc_consensus::DefaultImportQueue< Block, - TFullClient>, + TFullClient>, >, sc_service::Error, >, @@ -226,10 +230,11 @@ where }) .transpose()?; - let executor = sc_executor::NativeElseWasmExecutor::::new( + let executor = sc_executor::WasmExecutor::::new( config.wasm_method, config.default_heap_pages, config.max_runtime_instances, + None, config.runtime_cache_size, ); @@ -281,7 +286,7 @@ where /// /// This is the actual implementation that is abstract over the executor and the runtime api for shell nodes. #[sc_tracing::logging::prefix_logs_with("Parachain")] -async fn start_shell_node_impl( +async fn start_shell_node_impl( parachain_config: Configuration, polkadot_config: Configuration, id: ParaId, @@ -290,10 +295,10 @@ async fn start_shell_node_impl( build_consensus: BIC, ) -> sc_service::error::Result<( TaskManager, - Arc>>, + Arc>>, )> where - RuntimeApi: ConstructRuntimeApi>> + RuntimeApi: ConstructRuntimeApi>> + Send + Sync + 'static, @@ -307,26 +312,25 @@ where + sp_block_builder::BlockBuilder + cumulus_primitives_core::CollectCollationInfo, sc_client_api::StateBackendFor, Block>: sp_api::StateBackend, - Executor: sc_executor::NativeExecutionDispatch + 'static, RB: Fn( - Arc>>, + Arc>>, ) -> Result, sc_service::Error> + Send + 'static, BIQ: FnOnce( - Arc>>, + Arc>>, &Configuration, Option, &TaskManager, ) -> Result< sc_consensus::DefaultImportQueue< Block, - TFullClient>, + TFullClient>, >, sc_service::Error, >, BIC: FnOnce( - Arc>>, + Arc>>, Option<&Registry>, Option, &TaskManager, @@ -334,7 +338,7 @@ where Arc< sc_transaction_pool::FullPool< Block, - TFullClient>, + TFullClient>, >, >, Arc>, @@ -348,7 +352,7 @@ where let parachain_config = prepare_node_config(parachain_config); - let params = new_partial::(¶chain_config, build_import_queue)?; + let params = new_partial::(¶chain_config, build_import_queue)?; let (mut telemetry, telemetry_worker_handle) = params.other; let client = params.client.clone(); @@ -459,7 +463,7 @@ where /// /// This is the actual implementation that is abstract over the executor and the runtime api. #[sc_tracing::logging::prefix_logs_with("Parachain")] -async fn start_node_impl( +async fn start_node_impl( parachain_config: Configuration, polkadot_config: Configuration, id: ParaId, @@ -468,10 +472,10 @@ async fn start_node_impl( build_consensus: BIC, ) -> sc_service::error::Result<( TaskManager, - Arc>>, + Arc>>, )> where - RuntimeApi: ConstructRuntimeApi>> + RuntimeApi: ConstructRuntimeApi>> + Send + Sync + 'static, @@ -487,26 +491,25 @@ where + pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi + frame_rpc_system::AccountNonceApi, sc_client_api::StateBackendFor, Block>: sp_api::StateBackend, - Executor: sc_executor::NativeExecutionDispatch + 'static, RB: Fn( - Arc>, + Arc>>, ) -> Result, sc_service::Error> + Send + 'static, BIQ: FnOnce( - Arc>>, + Arc>>, &Configuration, Option, &TaskManager, ) -> Result< sc_consensus::DefaultImportQueue< Block, - TFullClient>, + TFullClient>, >, sc_service::Error, > + 'static, BIC: FnOnce( - Arc>>, + Arc>>, Option<&Registry>, Option, &TaskManager, @@ -514,7 +517,7 @@ where Arc< sc_transaction_pool::FullPool< Block, - TFullClient>, + TFullClient>, >, >, Arc>, @@ -528,7 +531,7 @@ where let parachain_config = prepare_node_config(parachain_config); - let params = new_partial::(¶chain_config, build_import_queue)?; + let params = new_partial::(¶chain_config, build_import_queue)?; let (mut telemetry, telemetry_worker_handle) = params.other; let client = params.client.clone(); @@ -649,11 +652,7 @@ where /// Build the import queue for the rococo parachain runtime. pub fn rococo_parachain_build_import_queue( client: Arc< - TFullClient< - Block, - rococo_parachain_runtime::RuntimeApi, - NativeElseWasmExecutor, - >, + TFullClient>, >, config: &Configuration, telemetry: Option, @@ -661,11 +660,7 @@ pub fn rococo_parachain_build_import_queue( ) -> Result< sc_consensus::DefaultImportQueue< Block, - TFullClient< - Block, - rococo_parachain_runtime::RuntimeApi, - NativeElseWasmExecutor, - >, + TFullClient>, >, sc_service::Error, > { @@ -694,7 +689,7 @@ pub fn rococo_parachain_build_import_queue( Ok((timestamp, slot)) }, registry: config.prometheus_registry().clone(), - can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), + can_author_with: sp_consensus::AlwaysCanAuthor, spawner: &task_manager.spawn_essential_handle(), telemetry, }) @@ -708,15 +703,9 @@ pub async fn start_rococo_parachain_node( id: ParaId, ) -> sc_service::error::Result<( TaskManager, - Arc< - TFullClient< - Block, - rococo_parachain_runtime::RuntimeApi, - NativeElseWasmExecutor, - >, - >, + Arc>>, )> { - start_node_impl::( + start_node_impl::( parachain_config, polkadot_config, id, @@ -741,22 +730,14 @@ pub async fn start_rococo_parachain_node( telemetry.clone(), ); + Ok(AuraConsensus::build::( + BuildAuraConsensusParams { + proposer_factory, + create_inherent_data_providers: move |_, (relay_parent, validation_data)| { + let relay_chain_interface = relay_chain_interface.clone(); - Ok(AuraConsensus::build::< - sp_consensus_aura::sr25519::AuthorityPair, - _, - _, - _, - _, - _, - _, - >(BuildAuraConsensusParams { - proposer_factory, - create_inherent_data_providers: move |_, (relay_parent, validation_data)| { - let relay_chain_interface = relay_chain_interface.clone(); - - async move { - let parachain_inherent = + async move { + let parachain_inherent = cumulus_primitives_parachain_inherent::ParachainInherentData::create_at( relay_parent, &relay_chain_interface, @@ -764,56 +745,57 @@ pub async fn start_rococo_parachain_node( id, ).await; - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - let slot = + let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( *timestamp, slot_duration, ); - let parachain_inherent = parachain_inherent.ok_or_else(|| { - Box::::from( - "Failed to create parachain inherent", - ) - })?; + let parachain_inherent = parachain_inherent.ok_or_else(|| { + Box::::from( + "Failed to create parachain inherent", + ) + })?; - Ok((timestamp, slot, parachain_inherent)) - } + Ok((timestamp, slot, parachain_inherent)) + } + }, + block_import: client.clone(), + para_client: client.clone(), + backoff_authoring_blocks: Option::<()>::None, + sync_oracle, + keystore, + force_authoring, + slot_duration, + // We got around 500ms for proposing + block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32), + // And a maximum of 750ms if slots are skipped + max_block_proposal_slot_portion: Some(SlotProportion::new(1f32 / 16f32)), + telemetry, }, - block_import: client.clone(), - para_client: client.clone(), - backoff_authoring_blocks: Option::<()>::None, - sync_oracle, - keystore, - force_authoring, - slot_duration, - // We got around 500ms for proposing - block_proposal_slot_portion: SlotProportion::new(1f32 / 24f32), - // And a maximum of 750ms if slots are skipped - max_block_proposal_slot_portion: Some(SlotProportion::new(1f32 / 16f32)), - telemetry, - })) + )) }, ) .await } /// Build the import queue for the shell runtime. -pub fn shell_build_import_queue( - client: Arc>>, +pub fn shell_build_import_queue( + client: Arc>>, config: &Configuration, _: Option, task_manager: &TaskManager, ) -> Result< sc_consensus::DefaultImportQueue< Block, - TFullClient>, + TFullClient>, >, sc_service::Error, > where - RuntimeApi: ConstructRuntimeApi>> + RuntimeApi: ConstructRuntimeApi>> + Send + Sync + 'static, @@ -826,7 +808,6 @@ where > + sp_offchain::OffchainWorkerApi + sp_block_builder::BlockBuilder, sc_client_api::StateBackendFor, Block>: sp_api::StateBackend, - Executor: sc_executor::NativeExecutionDispatch + 'static, { cumulus_client_consensus_relay_chain::import_queue( client.clone(), @@ -839,16 +820,16 @@ where } /// Start a polkadot-shell parachain node. -pub async fn start_shell_node( +pub async fn start_shell_node( parachain_config: Configuration, polkadot_config: Configuration, id: ParaId, ) -> sc_service::error::Result<( TaskManager, - Arc>>, + Arc>>, )> where - RuntimeApi: ConstructRuntimeApi>> + RuntimeApi: ConstructRuntimeApi>> + Send + Sync + 'static, @@ -862,9 +843,8 @@ where + sp_block_builder::BlockBuilder + cumulus_primitives_core::CollectCollationInfo, sc_client_api::StateBackendFor, Block>: sp_api::StateBackend, - Executor: sc_executor::NativeExecutionDispatch + 'static, { - start_shell_node_impl::( + start_shell_node_impl::( parachain_config, polkadot_config, id, @@ -1026,20 +1006,20 @@ where } /// Build the import queue for the statemint/statemine/westmine runtime. -pub fn statemint_build_import_queue( - client: Arc>>, +pub fn statemint_build_import_queue( + client: Arc>>, config: &Configuration, telemetry_handle: Option, task_manager: &TaskManager, ) -> Result< sc_consensus::DefaultImportQueue< Block, - TFullClient>, + TFullClient>, >, sc_service::Error, > where - RuntimeApi: ConstructRuntimeApi>> + RuntimeApi: ConstructRuntimeApi>> + Send + Sync + 'static, @@ -1053,7 +1033,6 @@ where + sp_block_builder::BlockBuilder + sp_consensus_aura::AuraApi::Pair as Pair>::Public>, sc_client_api::StateBackendFor, Block>: sp_api::StateBackend, - Executor: sc_executor::NativeExecutionDispatch + 'static, <::Pair as Pair>::Signature: TryFrom> + std::hash::Hash + sp_runtime::traits::Member + Codec, { @@ -1077,9 +1056,7 @@ where Ok((timestamp, slot)) }, - can_author_with: sp_consensus::CanAuthorWithNativeVersion::new( - client2.executor().clone(), - ), + can_author_with: sp_consensus::AlwaysCanAuthor, telemetry: telemetry_handle, }, ), @@ -1109,16 +1086,16 @@ where } /// Start a statemint/statemine/westmint parachain node. -pub async fn start_statemint_node( +pub async fn start_statemint_node( parachain_config: Configuration, polkadot_config: Configuration, id: ParaId, ) -> sc_service::error::Result<( TaskManager, - Arc>>, + Arc>>, )> where - RuntimeApi: ConstructRuntimeApi>> + RuntimeApi: ConstructRuntimeApi>> + Send + Sync + 'static, @@ -1135,16 +1112,15 @@ where + pallet_transaction_payment_rpc::TransactionPaymentRuntimeApi + frame_rpc_system::AccountNonceApi, sc_client_api::StateBackendFor, Block>: sp_api::StateBackend, - Executor: sc_executor::NativeExecutionDispatch + 'static, <::Pair as Pair>::Signature: TryFrom> + std::hash::Hash + sp_runtime::traits::Member + Codec, { - start_node_impl::( + start_node_impl::( parachain_config, polkadot_config, id, |_| Ok(Default::default()), - statemint_build_import_queue::<_, _, AuraId>, + statemint_build_import_queue::<_, AuraId>, |client, prometheus_registry, telemetry, @@ -1274,7 +1250,7 @@ where } #[sc_tracing::logging::prefix_logs_with("Parachain")] -async fn start_canvas_kusama_node_impl( +async fn start_canvas_kusama_node_impl( parachain_config: Configuration, polkadot_config: Configuration, id: ParaId, @@ -1283,10 +1259,10 @@ async fn start_canvas_kusama_node_impl( build_consensus: BIC, ) -> sc_service::error::Result<( TaskManager, - Arc>>, + Arc>>, )> where - RuntimeApi: ConstructRuntimeApi>> + RuntimeApi: ConstructRuntimeApi>> + Send + Sync + 'static, @@ -1303,26 +1279,25 @@ where + frame_rpc_system::AccountNonceApi + pallet_contracts_rpc::ContractsRuntimeApi, sc_client_api::StateBackendFor, Block>: sp_api::StateBackend, - Executor: sc_executor::NativeExecutionDispatch + 'static, RB: Fn( - Arc>, + Arc>>, ) -> Result, sc_service::Error> + Send + 'static, BIQ: FnOnce( - Arc>>, + Arc>>, &Configuration, Option, &TaskManager, ) -> Result< sc_consensus::DefaultImportQueue< Block, - TFullClient>, + TFullClient>, >, sc_service::Error, > + 'static, BIC: FnOnce( - Arc>>, + Arc>>, Option<&Registry>, Option, &TaskManager, @@ -1330,7 +1305,7 @@ where Arc< sc_transaction_pool::FullPool< Block, - TFullClient>, + TFullClient>, >, >, Arc>, @@ -1344,7 +1319,7 @@ where let parachain_config = prepare_node_config(parachain_config); - let params = new_partial::(¶chain_config, build_import_queue)?; + let params = new_partial::(¶chain_config, build_import_queue)?; let (mut telemetry, telemetry_worker_handle) = params.other; let client = params.client.clone(); @@ -1464,24 +1439,14 @@ where #[allow(clippy::type_complexity)] pub fn canvas_kusama_build_import_queue( - client: Arc< - TFullClient< - Block, - canvas_kusama_runtime::RuntimeApi, - NativeElseWasmExecutor, - >, - >, + client: Arc>>, config: &Configuration, telemetry: Option, task_manager: &TaskManager, ) -> Result< sc_consensus::DefaultImportQueue< Block, - TFullClient< - Block, - canvas_kusama_runtime::RuntimeApi, - NativeElseWasmExecutor, - >, + TFullClient>, >, sc_service::Error, > { @@ -1510,7 +1475,7 @@ pub fn canvas_kusama_build_import_queue( Ok((timestamp, slot)) }, registry: config.prometheus_registry(), - can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), + can_author_with: sp_consensus::AlwaysCanAuthor, spawner: &task_manager.spawn_essential_handle(), telemetry, }) @@ -1524,21 +1489,9 @@ pub async fn start_canvas_kusama_node( id: ParaId, ) -> sc_service::error::Result<( TaskManager, - Arc< - TFullClient< - Block, - canvas_kusama_runtime::RuntimeApi, - NativeElseWasmExecutor, - >, - >, + Arc>>, )> { - start_canvas_kusama_node_impl::< - canvas_kusama_runtime::RuntimeApi, - CanvasKusamaRuntimeExecutor, - _, - _, - _, - >( + start_canvas_kusama_node_impl::( parachain_config, polkadot_config, id, From 99d30c29342d6e6642eb769501265c364078b84a Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Wed, 2 Mar 2022 10:47:43 +0000 Subject: [PATCH 2/3] cargo fmt --- polkadot-parachains/src/command.rs | 38 +++++++++++++++++++----------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/polkadot-parachains/src/command.rs b/polkadot-parachains/src/command.rs index 7d33ea6699f..0265839706c 100644 --- a/polkadot-parachains/src/command.rs +++ b/polkadot-parachains/src/command.rs @@ -537,32 +537,42 @@ pub fn run() -> Result<()> { .map(|r| r.0) .map_err(Into::into) } else if config.chain_spec.is_statemine() { - crate::service::start_statemint_node::< - statemine_runtime::RuntimeApi, - AuraId, - >(config, polkadot_config, collator_options, id) + crate::service::start_statemint_node::( + config, + polkadot_config, + collator_options, + id, + ) .await .map(|r| r.0) .map_err(Into::into) } else if config.chain_spec.is_westmint() { - crate::service::start_statemint_node::< - westmint_runtime::RuntimeApi, - AuraId, - >(config, polkadot_config, collator_options, id) + crate::service::start_statemint_node::( + config, + polkadot_config, + collator_options, + id, + ) .await .map(|r| r.0) .map_err(Into::into) } else if config.chain_spec.is_shell() { - crate::service::start_shell_node::< - shell_runtime::RuntimeApi, - >(config, polkadot_config, collator_options, id) + crate::service::start_shell_node::( + config, + polkadot_config, + collator_options, + id, + ) .await .map(|r| r.0) .map_err(Into::into) } else if config.chain_spec.is_seedling() { - crate::service::start_shell_node::< - seedling_runtime::RuntimeApi, - >(config, polkadot_config, collator_options, id) + crate::service::start_shell_node::( + config, + polkadot_config, + collator_options, + id, + ) .await .map(|r| r.0) .map_err(Into::into) From 809cc014f1985c406e14f9f9b37e15473ee54d23 Mon Sep 17 00:00:00 2001 From: Giles Cope Date: Wed, 2 Mar 2022 10:55:11 +0000 Subject: [PATCH 3/3] remove unused var --- polkadot-parachains/src/service.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polkadot-parachains/src/service.rs b/polkadot-parachains/src/service.rs index 8e16b0d5e26..ea890fd33fe 100644 --- a/polkadot-parachains/src/service.rs +++ b/polkadot-parachains/src/service.rs @@ -31,7 +31,7 @@ use cumulus_primitives_core::{ use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain; use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult}; use cumulus_relay_chain_rpc_interface::RelayChainRPCInterface; -use polkadot_service::{CollatorPair, NativeExecutionDispatch}; +use polkadot_service::CollatorPair; use sp_core::Pair; use crate::rpc;