From 02c98dd3d1cd5b9077de3ba28ff6f65a70946a54 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Wed, 26 Jul 2023 21:36:05 -0700 Subject: [PATCH 1/9] paste in moonbeams new_dev function plus some light hacking --- parachain-template/node/src/service.rs | 242 +++++++++++++++++++++++++ 1 file changed, 242 insertions(+) diff --git a/parachain-template/node/src/service.rs b/parachain-template/node/src/service.rs index 9ad3c1ad3cc..ef270e76899 100644 --- a/parachain-template/node/src/service.rs +++ b/parachain-template/node/src/service.rs @@ -451,3 +451,245 @@ pub async fn start_parachain_node( ) -> sc_service::error::Result<(TaskManager, Arc)> { start_node_impl(parachain_config, polkadot_config, collator_options, para_id, hwbench).await } + +/// Builds a new development service. This service uses manual seal, and mocks +/// the parachain inherent. +pub async fn new_dev( + mut config: Configuration, + // sealing: moonbeam_cli_opt::Sealing, + // rpc_config: RpcConfig, + hwbench: Option, +) -> Result { + use async_io::Timer; + use futures::Stream; + use sc_consensus_manual_seal::{run_manual_seal, EngineCommand, ManualSealParams}; + use sp_core::H256; + + let sc_service::PartialComponents { + client, + backend, + mut task_manager, + import_queue, + keystore_container, + _select_chain, + transaction_pool, + other: + ( + block_import, + filter_pool, + mut telemetry, + _telemetry_worker_handle, + frontier_backend, + fee_history_cache, + ), + } = new_partial(&mut config)?; + + let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = + sc_service::build_network(sc_service::BuildNetworkParams { + config: &config, + client: client.clone(), + transaction_pool: transaction_pool.clone(), + spawn_handle: task_manager.spawn_handle(), + import_queue, + block_announce_validator_builder: None, + warp_sync_params: None, + })?; + + if config.offchain_worker.enabled { + sc_service::build_offchain_workers( + &config, + task_manager.spawn_handle(), + client.clone(), + network.clone(), + ); + } + + let prometheus_registry = config.prometheus_registry().cloned(); + let mut command_sink = None; + let collator = config.role.is_authority(); + + if collator { + let mut env = sc_basic_authorship::ProposerFactory::with_proof_recording( + task_manager.spawn_handle(), + client.clone(), + transaction_pool.clone(), + prometheus_registry.as_ref(), + telemetry.as_ref().map(|x| x.handle()), + ); + env.set_soft_deadline(SOFT_DEADLINE_PERCENT); + env.enable_ensure_proof_size_limit_after_each_extrinsic(); + + let commands_stream: Box::new(StreamExt::map( + Timer::interval(Duration::from_millis(1000)), + |_| EngineCommand::SealNewBlock { + create_empty: true, + finalize: false, + parent_hash: None, + sender: None, + }, + )); + + let select_chain = sc_consensus::LongestChain::new(backend.clone()); + + let client_set_aside_for_cidp = client.clone(); + + // Create channels for mocked XCM messages. + // let (downward_xcm_sender, downward_xcm_receiver) = flume::bounded::>(100); + // let (hrmp_xcm_sender, hrmp_xcm_receiver) = flume::bounded::<(ParaId, Vec)>(100); + // xcm_senders = Some((downward_xcm_sender, hrmp_xcm_sender)); + + task_manager.spawn_essential_handle().spawn_blocking( + "authorship_task", + Some("block-authoring"), + run_manual_seal(ManualSealParams { + block_import, + env, + client: client.clone(), + pool: transaction_pool.clone(), + commands_stream, + select_chain, + //TODO This needs to be aura to match the runtime + consensus_data_provider: Some(Box::new(NimbusManualSealConsensusDataProvider { + keystore: keystore_container.sync_keystore(), + client: client.clone(), + additional_digests_provider: maybe_provide_vrf_digest, + _phantom: Default::default(), + })), + create_inherent_data_providers: move |block: H256, ()| { + let current_para_block = client_set_aside_for_cidp + .number(block) + .expect("Header lookup should succeed") + .expect("Header passed in as parent should be present in backend."); + + // let downward_xcm_receiver = downward_xcm_receiver.clone(); + // let hrmp_xcm_receiver = hrmp_xcm_receiver.clone(); + + // let client_for_xcm = client_set_aside_for_cidp.clone(); + async move { + let time = sp_timestamp::InherentDataProvider::from_system_time(); + + let mocked_parachain = MockValidationDataInherentDataProvider { + current_para_block, + relay_offset: 1000, + relay_blocks_per_para_block: 2, + para_blocks_per_relay_epoch: 10, + relay_randomness_config: (), + xcm_config: Default::default(), + raw_downward_messages: Default::default(), + raw_horizontal_messages: Default::default(), + }; + + Ok((time, mocked_parachain)) + } + }, + }), + ); + } + + rpc::spawn_essential_tasks( + rpc::SpawnTasksParams { + task_manager: &task_manager, + client: client.clone(), + substrate_backend: backend.clone(), + frontier_backend: frontier_backend.clone(), + filter_pool: filter_pool.clone(), + overrides: overrides.clone(), + fee_history_limit, + fee_history_cache: fee_history_cache.clone(), + }, + sync_service.clone(), + pubsub_notification_sinks.clone(), + ); + + let rpc_builder = { + let client = client.clone(); + let pool = transaction_pool.clone(); + let backend = backend.clone(); + let network = network.clone(); + let sync = sync_service.clone(); + let ethapi_cmd = ethapi_cmd.clone(); + let max_past_logs = rpc_config.max_past_logs; + let overrides = overrides.clone(); + let fee_history_cache = fee_history_cache.clone(); + let block_data_cache = block_data_cache.clone(); + let pubsub_notification_sinks = pubsub_notification_sinks.clone(); + + move |deny_unsafe, subscription_task_executor| { + let deps = rpc::FullDeps { + backend: backend.clone(), + client: client.clone(), + command_sink: command_sink.clone(), + deny_unsafe, + ethapi_cmd: ethapi_cmd.clone(), + filter_pool: filter_pool.clone(), + frontier_backend: frontier_backend.clone(), + graph: pool.pool().clone(), + pool: pool.clone(), + is_authority: collator, + max_past_logs, + fee_history_limit, + fee_history_cache: fee_history_cache.clone(), + network: network.clone(), + sync: sync.clone(), + xcm_senders: xcm_senders.clone(), + overrides: overrides.clone(), + block_data_cache: block_data_cache.clone(), + forced_parent_hashes: None, + }; + + if ethapi_cmd.contains(&EthApiCmd::Debug) || ethapi_cmd.contains(&EthApiCmd::Trace) { + rpc::create_full( + deps, + subscription_task_executor, + Some(crate::rpc::TracingConfig { + tracing_requesters: tracing_requesters.clone(), + trace_filter_max_count: rpc_config.ethapi_trace_max_count, + }), + pubsub_notification_sinks.clone(), + ) + .map_err(Into::into) + } else { + rpc::create_full( + deps, + subscription_task_executor, + None, + pubsub_notification_sinks.clone(), + ) + .map_err(Into::into) + } + } + }; + + let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams { + network, + client, + keystore: keystore_container.sync_keystore(), + task_manager: &mut task_manager, + transaction_pool, + rpc_builder: Box::new(rpc_builder), + backend, + system_rpc_tx, + sync_service: sync_service.clone(), + config, + tx_handler_controller, + telemetry: None, + })?; + + if let Some(hwbench) = hwbench { + sc_sysinfo::print_hwbench(&hwbench); + + if let Some(ref mut telemetry) = telemetry { + let telemetry_handle = telemetry.handle(); + task_manager.spawn_handle().spawn( + "telemetry_hwbench", + None, + sc_sysinfo::initialize_hwbench_telemetry(telemetry_handle, hwbench), + ); + } + } + + log::info!("Development Service Ready"); + + network_starter.start_network(); + Ok(task_manager) +} From bffe965b0ca8d24948f6eea1bb2565d5177e8cf4 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Wed, 26 Jul 2023 21:36:20 -0700 Subject: [PATCH 2/9] parallel path: bring in Kian's minimal node --- parachain-template/minimal/node/Cargo.toml | 42 ++++ parachain-template/minimal/node/build.rs | 6 + .../minimal/node/src/chain_spec.rs | 65 +++++ parachain-template/minimal/node/src/cli.rs | 64 +++++ .../minimal/node/src/command.rs | 114 +++++++++ parachain-template/minimal/node/src/lib.rs | 4 + parachain-template/minimal/node/src/main.rs | 13 + parachain-template/minimal/node/src/rpc.rs | 55 ++++ .../minimal/node/src/service.rs | 234 ++++++++++++++++++ 9 files changed, 597 insertions(+) create mode 100644 parachain-template/minimal/node/Cargo.toml create mode 100644 parachain-template/minimal/node/build.rs create mode 100644 parachain-template/minimal/node/src/chain_spec.rs create mode 100644 parachain-template/minimal/node/src/cli.rs create mode 100644 parachain-template/minimal/node/src/command.rs create mode 100644 parachain-template/minimal/node/src/lib.rs create mode 100644 parachain-template/minimal/node/src/main.rs create mode 100644 parachain-template/minimal/node/src/rpc.rs create mode 100644 parachain-template/minimal/node/src/service.rs diff --git a/parachain-template/minimal/node/Cargo.toml b/parachain-template/minimal/node/Cargo.toml new file mode 100644 index 00000000000..b2185419fa1 --- /dev/null +++ b/parachain-template/minimal/node/Cargo.toml @@ -0,0 +1,42 @@ +[package] +name = "parachain-standalone-node" +version = "0.1.0" +edition = "2021" +license = "Unlicense" +publish = false +build = "build.rs" + +[dependencies] +clap = { version = "4.3.11", features = ["derive"] } +futures = { version = "0.3.21", features = ["thread-pool"] } +futures-timer = "3.0.1" +jsonrpsee = { version = "0.16.2", features = ["server"] } + +sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "master" } + +sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } +sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } + + +substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "master" } + +runtime = { package = "parachain-template-runtime", path = "../runtime" } + +[build-dependencies] +substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" } + +[features] +default = [] diff --git a/parachain-template/minimal/node/build.rs b/parachain-template/minimal/node/build.rs new file mode 100644 index 00000000000..a5b173537e8 --- /dev/null +++ b/parachain-template/minimal/node/build.rs @@ -0,0 +1,6 @@ +use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed}; + +fn main() { + generate_cargo_keys(); + rerun_if_git_head_changed(); +} diff --git a/parachain-template/minimal/node/src/chain_spec.rs b/parachain-template/minimal/node/src/chain_spec.rs new file mode 100644 index 00000000000..90dac1dd2e4 --- /dev/null +++ b/parachain-template/minimal/node/src/chain_spec.rs @@ -0,0 +1,65 @@ +use runtime::{BalancesConfig, RuntimeGenesisConfig, SudoConfig, SystemConfig, WASM_BINARY}; +use sc_service::{ChainType, Properties}; +use sp_keyring::AccountKeyring; + +/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type. +pub type ChainSpec = sc_service::GenericChainSpec; + +fn props() -> Properties { + let mut properties = Properties::new(); + properties.insert("tokenDecimals".to_string(), 0.into()); + properties.insert("tokenSymbol".to_string(), "TEST".into()); + properties +} + +pub fn development_config() -> Result { + let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; + Ok(ChainSpec::from_genesis( + "Development", + "dev", + ChainType::Development, + move || testnet_genesis(wasm_binary), + vec![], + None, + None, + None, + Some(props()), + None, + )) +} + +pub fn local_testnet_config() -> Result { + let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; + + Ok(ChainSpec::from_genesis( + "Local Testnet", + "local_testnet", + ChainType::Local, + move || testnet_genesis(wasm_binary), + vec![], + None, + None, + None, + Some(props()), + None, + )) +} + +/// Configure initial storage state for FRAME modules. +fn testnet_genesis(wasm_binary: &[u8]) -> RuntimeGenesisConfig { + use frame::traits::Get; + use runtime::interface::{Balance, MinimumBalance}; + let endowment = >::get().max(1) * 1000; + let balances = AccountKeyring::iter() + .map(|a| (a.to_account_id(), endowment)) + .collect::>(); + RuntimeGenesisConfig { + system: SystemConfig { + // Add Wasm runtime to storage. + code: wasm_binary.to_vec(), + }, + balances: BalancesConfig { balances }, + sudo: SudoConfig { key: Some(AccountKeyring::Alice.to_account_id()) }, + ..Default::default() + } +} diff --git a/parachain-template/minimal/node/src/cli.rs b/parachain-template/minimal/node/src/cli.rs new file mode 100644 index 00000000000..36985a48a8a --- /dev/null +++ b/parachain-template/minimal/node/src/cli.rs @@ -0,0 +1,64 @@ +use sc_cli::RunCmd; + +#[derive(Debug, Clone)] +pub enum Consensus { + ManualSeal(u64), + InstantSeal, +} + +impl std::str::FromStr for Consensus { + type Err = String; + + fn from_str(s: &str) -> Result { + Ok(if s == "instant-seal" { + Consensus::InstantSeal + } else if let Some(block_time) = s.strip_prefix("manual-seal-") { + Consensus::ManualSeal(block_time.parse().map_err(|_| "invalid block time")?) + } else { + return Err("incorrect consensus identifier".into()) + }) + } +} + +#[derive(Debug, clap::Parser)] +pub struct Cli { + #[command(subcommand)] + pub subcommand: Option, + + #[clap(long, default_value = "manual-seal-3000")] + pub consensus: Consensus, + + #[clap(flatten)] + pub run: RunCmd, +} + +#[derive(Debug, clap::Subcommand)] +pub enum Subcommand { + /// Key management cli utilities + #[command(subcommand)] + Key(sc_cli::KeySubcommand), + + /// Build a chain specification. + BuildSpec(sc_cli::BuildSpecCmd), + + /// Validate blocks. + CheckBlock(sc_cli::CheckBlockCmd), + + /// Export blocks. + ExportBlocks(sc_cli::ExportBlocksCmd), + + /// Export the state of a given block into a chain spec. + ExportState(sc_cli::ExportStateCmd), + + /// Import blocks. + ImportBlocks(sc_cli::ImportBlocksCmd), + + /// Remove the whole chain. + PurgeChain(sc_cli::PurgeChainCmd), + + /// Revert the chain to a previous state. + Revert(sc_cli::RevertCmd), + + /// Db meta columns information. + ChainInfo(sc_cli::ChainInfoCmd), +} diff --git a/parachain-template/minimal/node/src/command.rs b/parachain-template/minimal/node/src/command.rs new file mode 100644 index 00000000000..2718170ac02 --- /dev/null +++ b/parachain-template/minimal/node/src/command.rs @@ -0,0 +1,114 @@ +use crate::{ + chain_spec, + cli::{Cli, Subcommand}, + service, +}; +use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli}; +use sc_service::PartialComponents; + +#[cfg(feature = "try-runtime")] +use try_runtime_cli::block_building_info::timestamp_with_aura_info; + +impl SubstrateCli for Cli { + fn impl_name() -> String { + "Substrate Node".into() + } + + fn impl_version() -> String { + env!("SUBSTRATE_CLI_IMPL_VERSION").into() + } + + fn description() -> String { + env!("CARGO_PKG_DESCRIPTION").into() + } + + fn author() -> String { + env!("CARGO_PKG_AUTHORS").into() + } + + fn support_url() -> String { + "support.anonymous.an".into() + } + + fn copyright_start_year() -> i32 { + 2017 + } + + fn load_spec(&self, id: &str) -> Result, String> { + Ok(match id { + "dev" => Box::new(chain_spec::development_config()?), + "" | "local" => Box::new(chain_spec::local_testnet_config()?), + path => + Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?), + }) + } + + fn native_runtime_version(_: &Box) -> &'static RuntimeVersion { + &runtime::VERSION + } +} + +/// Parse and run command line arguments +pub fn run() -> sc_cli::Result<()> { + let cli = Cli::from_args(); + + match &cli.subcommand { + Some(Subcommand::Key(cmd)) => cmd.run(&cli), + Some(Subcommand::BuildSpec(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) + }, + Some(Subcommand::CheckBlock(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + let PartialComponents { client, task_manager, import_queue, .. } = + service::new_partial(&config)?; + Ok((cmd.run(client, import_queue), task_manager)) + }) + }, + Some(Subcommand::ExportBlocks(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + let PartialComponents { client, task_manager, .. } = service::new_partial(&config)?; + Ok((cmd.run(client, config.database), task_manager)) + }) + }, + Some(Subcommand::ExportState(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + let PartialComponents { client, task_manager, .. } = service::new_partial(&config)?; + Ok((cmd.run(client, config.chain_spec), task_manager)) + }) + }, + Some(Subcommand::ImportBlocks(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + let PartialComponents { client, task_manager, import_queue, .. } = + service::new_partial(&config)?; + Ok((cmd.run(client, import_queue), task_manager)) + }) + }, + Some(Subcommand::PurgeChain(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.sync_run(|config| cmd.run(config.database)) + }, + Some(Subcommand::Revert(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.async_run(|config| { + let PartialComponents { client, task_manager, backend, .. } = + service::new_partial(&config)?; + Ok((cmd.run(client, backend, None), task_manager)) + }) + }, + Some(Subcommand::ChainInfo(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.sync_run(|config| cmd.run::(&config)) + }, + None => { + let runner = cli.create_runner(&cli.run)?; + runner.run_node_until_exit(|config| async move { + service::new_full(config, cli.consensus).map_err(sc_cli::Error::Service) + }) + }, + } +} diff --git a/parachain-template/minimal/node/src/lib.rs b/parachain-template/minimal/node/src/lib.rs new file mode 100644 index 00000000000..f13719f81d1 --- /dev/null +++ b/parachain-template/minimal/node/src/lib.rs @@ -0,0 +1,4 @@ +pub mod chain_spec; +pub(crate) mod cli; +pub mod rpc; +pub mod service; diff --git a/parachain-template/minimal/node/src/main.rs b/parachain-template/minimal/node/src/main.rs new file mode 100644 index 00000000000..4449d28b9fa --- /dev/null +++ b/parachain-template/minimal/node/src/main.rs @@ -0,0 +1,13 @@ +//! Substrate Node Template CLI library. +#![warn(missing_docs)] + +mod chain_spec; +#[macro_use] +mod service; +mod cli; +mod command; +mod rpc; + +fn main() -> sc_cli::Result<()> { + command::run() +} diff --git a/parachain-template/minimal/node/src/rpc.rs b/parachain-template/minimal/node/src/rpc.rs new file mode 100644 index 00000000000..38130124e8d --- /dev/null +++ b/parachain-template/minimal/node/src/rpc.rs @@ -0,0 +1,55 @@ +//! A collection of node-specific RPC methods. +//! Substrate provides the `sc-rpc` crate, which defines the core RPC layer +//! used by Substrate nodes. This file extends those RPC definitions with +//! capabilities that are specific to this project's runtime configuration. + +#![warn(missing_docs)] + +use jsonrpsee::RpcModule; +use runtime::interface::{AccountId, Index, OpaqueBlock}; +use sc_transaction_pool_api::TransactionPool; +use sp_block_builder::BlockBuilder; +use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; +use std::sync::Arc; + +pub use sc_rpc_api::DenyUnsafe; + +/// Full client dependencies. +pub struct FullDeps { + /// The client instance to use. + pub client: Arc, + /// Transaction pool instance. + pub pool: Arc

, + /// Whether to deny unsafe calls + pub deny_unsafe: DenyUnsafe, +} + +/// Instantiate all full RPC extensions. +pub fn create_full( + deps: FullDeps, +) -> Result, Box> +where + C: sp_api::ProvideRuntimeApi< + // TODO: bloody hell.. + frame::runtime::runtime_types_generic::Block< + frame::runtime::runtime_types_generic::Header, + frame::runtime::runtime_types_generic::OpaqueExtrinsic, + >, + // OpaqueBlock, + >, + C: HeaderBackend + HeaderMetadata + 'static, + C: Send + Sync + 'static, + P: TransactionPool + 'static, + C::Api: BlockBuilder, + C::Api: substrate_frame_rpc_system::AccountNonceApi, +{ + use substrate_frame_rpc_system::{System, SystemApiServer}; + + let mut module = RpcModule::new(()); + let FullDeps { client, pool, deny_unsafe } = deps; + + module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?; + // NOTE: we have intentionally ignored adding tx-pool's custom RPC here. + + Ok(module) +} diff --git a/parachain-template/minimal/node/src/service.rs b/parachain-template/minimal/node/src/service.rs new file mode 100644 index 00000000000..80aa15d9d3f --- /dev/null +++ b/parachain-template/minimal/node/src/service.rs @@ -0,0 +1,234 @@ +use runtime::{self, interface::OpaqueBlock as Block, RuntimeApi}; +pub use sc_executor::NativeElseWasmExecutor; +use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; +use sc_telemetry::{Telemetry, TelemetryWorker}; +use std::sync::Arc; + +use crate::cli::Consensus; + +// Our native executor instance. +pub struct ExecutorDispatch; + +impl sc_executor::NativeExecutionDispatch for ExecutorDispatch { + /// Only enable the benchmarking host functions when we actually want to benchmark. + #[cfg(feature = "runtime-benchmarks")] + type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; + /// Otherwise we only use the default Substrate host functions. + #[cfg(not(feature = "runtime-benchmarks"))] + type ExtendHostFunctions = (); + + fn dispatch(method: &str, data: &[u8]) -> Option> { + runtime::api::dispatch(method, data) + } + + fn native_version() -> sc_executor::NativeVersion { + runtime::native_version() + } +} + +pub(crate) type FullClient = + sc_service::TFullClient>; +type FullBackend = sc_service::TFullBackend; +type FullSelectChain = sc_consensus::LongestChain; + +pub fn new_partial( + config: &Configuration, +) -> Result< + sc_service::PartialComponents< + FullClient, + FullBackend, + FullSelectChain, + sc_consensus::DefaultImportQueue, + sc_transaction_pool::FullPool, + Option, + >, + ServiceError, +> { + let telemetry = config + .telemetry_endpoints + .clone() + .filter(|x| !x.is_empty()) + .map(|endpoints| -> Result<_, sc_telemetry::Error> { + let worker = TelemetryWorker::new(16)?; + let telemetry = worker.handle().new_telemetry(endpoints); + Ok((worker, telemetry)) + }) + .transpose()?; + + let executor = sc_service::new_native_or_wasm_executor(&config); + + let (client, backend, keystore_container, task_manager) = + sc_service::new_full_parts::( + config, + telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), + executor, + )?; + let client = Arc::new(client); + + let telemetry = telemetry.map(|(worker, telemetry)| { + task_manager.spawn_handle().spawn("telemetry", None, worker.run()); + telemetry + }); + + let select_chain = sc_consensus::LongestChain::new(backend.clone()); + + let transaction_pool = sc_transaction_pool::BasicPool::new_full( + config.transaction_pool.clone(), + config.role.is_authority().into(), + config.prometheus_registry(), + task_manager.spawn_essential_handle(), + client.clone(), + ); + + let import_queue = sc_consensus_manual_seal::import_queue( + Box::new(client.clone()), + &task_manager.spawn_essential_handle(), + config.prometheus_registry(), + ); + + Ok(sc_service::PartialComponents { + client, + backend, + task_manager, + import_queue, + keystore_container, + select_chain, + transaction_pool, + other: (telemetry), + }) +} + +/// Builds a new service for a full client. +pub fn new_full(config: Configuration, consensus: Consensus) -> Result { + let sc_service::PartialComponents { + client, + backend, + mut task_manager, + import_queue, + keystore_container, + select_chain, + transaction_pool, + other: mut telemetry, + } = new_partial(&config)?; + + let net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); + + let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = + sc_service::build_network(sc_service::BuildNetworkParams { + config: &config, + client: client.clone(), + transaction_pool: transaction_pool.clone(), + spawn_handle: task_manager.spawn_handle(), + import_queue, + net_config, + block_announce_validator_builder: None, + warp_sync_params: None, + })?; + + if config.offchain_worker.enabled { + sc_service::build_offchain_workers( + &config, + task_manager.spawn_handle(), + client.clone(), + network.clone(), + ); + } + + let rpc_extensions_builder = { + let client = client.clone(); + let pool = transaction_pool.clone(); + + Box::new(move |deny_unsafe, _| { + let deps = + crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), deny_unsafe }; + crate::rpc::create_full(deps).map_err(Into::into) + }) + }; + + let prometheus_registry = config.prometheus_registry().cloned(); + + let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams { + network, + client: client.clone(), + keystore: keystore_container.keystore(), + task_manager: &mut task_manager, + transaction_pool: transaction_pool.clone(), + rpc_builder: rpc_extensions_builder, + backend, + system_rpc_tx, + tx_handler_controller, + sync_service, + config, + telemetry: telemetry.as_mut(), + })?; + + let proposer = sc_basic_authorship::ProposerFactory::new( + task_manager.spawn_handle(), + client.clone(), + transaction_pool.clone(), + prometheus_registry.as_ref(), + telemetry.as_ref().map(|x| x.handle()), + ); + + match consensus { + Consensus::InstantSeal => { + let params = sc_consensus_manual_seal::InstantSealParams { + block_import: client.clone(), + env: proposer, + client, + pool: transaction_pool, + select_chain, + consensus_data_provider: None, + create_inherent_data_providers: move |_, ()| async move { + Ok(sp_timestamp::InherentDataProvider::from_system_time()) + }, + }; + + let authorship_future = sc_consensus_manual_seal::run_instant_seal(params); + + task_manager.spawn_essential_handle().spawn_blocking( + "instant-seal", + None, + authorship_future, + ); + }, + Consensus::ManualSeal(block_time) => { + let (mut sink, commands_stream) = futures::channel::mpsc::channel(1024); + task_manager.spawn_handle().spawn("block_authoring", None, async move { + loop { + futures_timer::Delay::new(std::time::Duration::from_millis(block_time)).await; + sink.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, + pool: transaction_pool, + select_chain, + commands_stream: Box::pin(commands_stream), + consensus_data_provider: None, + create_inherent_data_providers: move |_, ()| async move { + Ok(sp_timestamp::InherentDataProvider::from_system_time()) + }, + }; + let authorship_future = sc_consensus_manual_seal::run_manual_seal(params); + + task_manager.spawn_essential_handle().spawn_blocking( + "manual-seal", + None, + authorship_future, + ); + }, + } + + network_starter.start_network(); + Ok(task_manager) +} From 1cf110faaaf60cf13a4cea17657bb205f0642772 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Wed, 26 Jul 2023 22:54:44 -0700 Subject: [PATCH 3/9] new dev function actually compiles --- Cargo.lock | 463 +++++++++++++------------ parachain-template/node/Cargo.toml | 2 + parachain-template/node/src/service.rs | 144 +++----- 3 files changed, 294 insertions(+), 315 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd856d2cff3..04b56ea6783 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -640,35 +640,36 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf46fee83e5ccffc220104713af3292ff9bc7c64c7de289f66dae8e38d826833" dependencies = [ - "concurrent-queue 2.1.0", + "concurrent-queue", "event-listener", "futures-core", ] [[package]] name = "async-io" -version = "1.6.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a811e6a479f2439f0c04038796b5cfb3d2ad56c230e0f2d3f7b04d68cfee607b" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "concurrent-queue 1.2.2", + "async-lock", + "autocfg", + "cfg-if", + "concurrent-queue", "futures-lite", - "libc", "log", - "once_cell", "parking", "polling", + "rustix 0.37.19", "slab", "socket2 0.4.9", "waker-fn", - "winapi", ] [[package]] name = "async-lock" -version = "2.4.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" +checksum = "fa24f727524730b077666307f2734b4a1a1c57acb79193127dcc8914d5242dd7" dependencies = [ "event-listener", ] @@ -782,7 +783,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "hash-db", "log", @@ -1539,12 +1540,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "cache-padded" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" - [[package]] name = "camino" version = "1.1.2" @@ -1954,15 +1949,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2382f75942f4b3be3690fe4f86365e9c853c1587d6ee58212cebf6e2a9ccd101" -[[package]] -name = "concurrent-queue" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" -dependencies = [ - "cache-padded", -] - [[package]] name = "concurrent-queue" version = "2.1.0" @@ -3911,7 +3897,7 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "fork-tree" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", ] @@ -3934,7 +3920,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "frame-support-procedural", @@ -3959,7 +3945,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "Inflector", "array-bytes", @@ -4007,7 +3993,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -4018,7 +4004,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -4035,7 +4021,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "frame-system", @@ -4064,7 +4050,7 @@ dependencies = [ [[package]] name = "frame-remote-externalities" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-recursion", "futures", @@ -4085,7 +4071,7 @@ dependencies = [ [[package]] name = "frame-support" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "aquamarine", "bitflags 1.3.2", @@ -4122,7 +4108,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "Inflector", "cfg-expr", @@ -4140,7 +4126,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate", @@ -4152,7 +4138,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "proc-macro2", "quote", @@ -4162,7 +4148,7 @@ dependencies = [ [[package]] name = "frame-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "cfg-if", "frame-support", @@ -4181,7 +4167,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4196,7 +4182,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "sp-api", @@ -4205,7 +4191,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "parity-scale-codec", @@ -6306,7 +6292,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "futures", "log", @@ -6325,7 +6311,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "anyhow", "jsonrpsee", @@ -6829,7 +6815,7 @@ dependencies = [ [[package]] name = "pallet-alliance" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "frame-benchmarking", @@ -6850,7 +6836,7 @@ dependencies = [ [[package]] name = "pallet-asset-conversion" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6868,7 +6854,7 @@ dependencies = [ [[package]] name = "pallet-asset-conversion-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "frame-system", @@ -6883,7 +6869,7 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6901,7 +6887,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6916,7 +6902,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "frame-system", @@ -6932,7 +6918,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "frame-system", @@ -6948,7 +6934,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "frame-system", @@ -6962,7 +6948,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -6986,7 +6972,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7006,7 +6992,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7021,7 +7007,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "frame-system", @@ -7040,7 +7026,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "binary-merkle-tree", @@ -7064,7 +7050,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7170,7 +7156,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7214,7 +7200,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7231,7 +7217,7 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "bitflags 1.3.2", "environmental", @@ -7260,7 +7246,7 @@ dependencies = [ [[package]] name = "pallet-contracts-primitives" version = "24.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -7273,7 +7259,7 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "proc-macro2", "quote", @@ -7283,7 +7269,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7300,7 +7286,7 @@ dependencies = [ [[package]] name = "pallet-core-fellowship" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7318,7 +7304,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7336,7 +7322,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7359,7 +7345,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7372,7 +7358,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7391,7 +7377,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "docify", "frame-benchmarking", @@ -7410,7 +7396,7 @@ dependencies = [ [[package]] name = "pallet-glutton" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "blake2", "frame-benchmarking", @@ -7428,7 +7414,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7451,7 +7437,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7467,7 +7453,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7487,7 +7473,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7504,7 +7490,7 @@ dependencies = [ [[package]] name = "pallet-insecure-randomness-collective-flip" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "frame-system", @@ -7518,7 +7504,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7535,7 +7521,7 @@ dependencies = [ [[package]] name = "pallet-message-queue" version = "7.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7554,7 +7540,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7571,7 +7557,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7587,7 +7573,7 @@ dependencies = [ [[package]] name = "pallet-nft-fractionalization" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7604,7 +7590,7 @@ dependencies = [ [[package]] name = "pallet-nfts" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7622,7 +7608,7 @@ dependencies = [ [[package]] name = "pallet-nfts-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "pallet-nfts", @@ -7633,7 +7619,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7649,7 +7635,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "frame-system", @@ -7666,7 +7652,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "1.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7686,7 +7672,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "1.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -7697,7 +7683,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "frame-system", @@ -7714,7 +7700,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7753,7 +7739,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7770,7 +7756,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7785,7 +7771,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7803,7 +7789,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7818,7 +7804,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7837,7 +7823,7 @@ dependencies = [ [[package]] name = "pallet-salary" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7855,7 +7841,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7872,7 +7858,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "frame-system", @@ -7893,7 +7879,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7909,7 +7895,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7928,7 +7914,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7951,7 +7937,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -7962,7 +7948,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "log", "sp-arithmetic", @@ -7971,7 +7957,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "sp-api", @@ -7980,7 +7966,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7997,7 +7983,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8012,7 +7998,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8030,7 +8016,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8049,7 +8035,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-support", "frame-system", @@ -8065,7 +8051,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -8081,7 +8067,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8093,7 +8079,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8110,7 +8096,7 @@ dependencies = [ [[package]] name = "pallet-uniques" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8125,7 +8111,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8141,7 +8127,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8156,7 +8142,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8225,6 +8211,7 @@ dependencies = [ name = "parachain-template-node" version = "0.1.0" dependencies = [ + "async-io", "clap", "color-print", "cumulus-client-cli", @@ -8249,6 +8236,7 @@ dependencies = [ "sc-cli", "sc-client-api", "sc-consensus", + "sc-consensus-manual-seal", "sc-executor", "sc-network", "sc-network-sync", @@ -11216,7 +11204,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "log", "sp-core", @@ -11227,7 +11215,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "futures", @@ -11255,7 +11243,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "futures", "futures-timer", @@ -11278,7 +11266,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "sc-client-api", @@ -11293,7 +11281,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "memmap2", "sc-chain-spec-derive", @@ -11312,7 +11300,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -11323,7 +11311,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "chrono", @@ -11362,7 +11350,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "fnv", "futures", @@ -11388,7 +11376,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "hash-db", "kvdb", @@ -11414,7 +11402,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "futures", @@ -11439,7 +11427,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "futures", @@ -11468,7 +11456,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "fork-tree", @@ -11504,7 +11492,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "futures", "jsonrpsee", @@ -11526,7 +11514,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "async-channel", @@ -11560,7 +11548,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "futures", "jsonrpsee", @@ -11579,7 +11567,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "fork-tree", "parity-scale-codec", @@ -11592,7 +11580,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "ahash 0.8.2", "array-bytes", @@ -11633,7 +11621,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "finality-grandpa", "futures", @@ -11650,10 +11638,45 @@ dependencies = [ "thiserror", ] +[[package]] +name = "sc-consensus-manual-seal" +version = "0.10.0-dev" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" +dependencies = [ + "assert_matches", + "async-trait", + "futures", + "futures-timer", + "jsonrpsee", + "log", + "parity-scale-codec", + "sc-client-api", + "sc-consensus", + "sc-consensus-aura", + "sc-consensus-babe", + "sc-consensus-epochs", + "sc-transaction-pool", + "sc-transaction-pool-api", + "serde", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-consensus-slots", + "sp-core", + "sp-inherents", + "sp-keystore", + "sp-runtime", + "sp-timestamp", + "substrate-prometheus-endpoint", + "thiserror", +] + [[package]] name = "sc-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "futures", @@ -11676,7 +11699,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -11698,7 +11721,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", @@ -11710,7 +11733,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "anyhow", "cfg-if", @@ -11727,7 +11750,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "ansi_term", "futures", @@ -11743,7 +11766,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "parking_lot 0.12.1", @@ -11757,7 +11780,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "async-channel", @@ -11800,7 +11823,7 @@ dependencies = [ [[package]] name = "sc-network-bitswap" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-channel", "cid", @@ -11820,7 +11843,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -11837,7 +11860,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "ahash 0.8.2", "futures", @@ -11856,7 +11879,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "async-channel", @@ -11877,7 +11900,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "async-channel", @@ -11911,7 +11934,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "futures", @@ -11929,7 +11952,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "bytes", @@ -11963,7 +11986,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -11972,7 +11995,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "futures", "jsonrpsee", @@ -12003,7 +12026,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12022,7 +12045,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "http", "jsonrpsee", @@ -12037,7 +12060,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "futures", @@ -12063,7 +12086,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "directories", @@ -12127,7 +12150,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "log", "parity-scale-codec", @@ -12138,7 +12161,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "clap", "fs4", @@ -12152,7 +12175,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12171,7 +12194,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "6.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "futures", "libc", @@ -12190,7 +12213,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "chrono", "futures", @@ -12209,7 +12232,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "ansi_term", "atty", @@ -12238,7 +12261,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -12249,7 +12272,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "futures", @@ -12275,7 +12298,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "futures", @@ -12291,7 +12314,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-channel", "futures", @@ -12835,7 +12858,7 @@ dependencies = [ [[package]] name = "sp-api" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "hash-db", "log", @@ -12856,7 +12879,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "Inflector", "blake2", @@ -12870,7 +12893,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "23.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "scale-info", @@ -12883,7 +12906,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "16.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "integer-sqrt", "num-traits", @@ -12897,7 +12920,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "scale-info", @@ -12910,7 +12933,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "sp-api", "sp-inherents", @@ -12921,7 +12944,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "futures", "log", @@ -12939,7 +12962,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "futures", @@ -12954,7 +12977,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "parity-scale-codec", @@ -12971,7 +12994,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "parity-scale-codec", @@ -12990,7 +13013,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "lazy_static", "parity-scale-codec", @@ -13009,7 +13032,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "finality-grandpa", "log", @@ -13027,7 +13050,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "scale-info", @@ -13039,7 +13062,7 @@ dependencies = [ [[package]] name = "sp-core" version = "21.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "bitflags 1.3.2", @@ -13084,7 +13107,7 @@ dependencies = [ [[package]] name = "sp-core-hashing" version = "9.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "blake2b_simd", "byteorder", @@ -13097,7 +13120,7 @@ dependencies = [ [[package]] name = "sp-core-hashing-proc-macro" version = "9.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "quote", "sp-core-hashing", @@ -13107,7 +13130,7 @@ dependencies = [ [[package]] name = "sp-database" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "kvdb", "parking_lot 0.12.1", @@ -13116,7 +13139,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "proc-macro2", "quote", @@ -13126,7 +13149,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.19.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "environmental", "parity-scale-codec", @@ -13137,7 +13160,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "serde_json", "sp-api", @@ -13148,7 +13171,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -13162,7 +13185,7 @@ dependencies = [ [[package]] name = "sp-io" version = "23.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "bytes", "ed25519", @@ -13187,7 +13210,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "24.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "lazy_static", "sp-core", @@ -13198,7 +13221,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.27.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", @@ -13210,7 +13233,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "4.1.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "thiserror", "zstd 0.12.3+zstd.1.5.2", @@ -13219,7 +13242,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.1.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -13230,7 +13253,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "ckb-merkle-mountain-range", "log", @@ -13248,7 +13271,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "scale-info", @@ -13262,7 +13285,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "sp-api", "sp-core", @@ -13272,7 +13295,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "backtrace", "lazy_static", @@ -13282,7 +13305,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "6.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "rustc-hash", "serde", @@ -13292,7 +13315,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "24.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "either", "hash256-std-hasher", @@ -13314,7 +13337,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "17.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -13332,7 +13355,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "Inflector", "proc-macro-crate", @@ -13344,7 +13367,7 @@ dependencies = [ [[package]] name = "sp-session" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "scale-info", @@ -13359,7 +13382,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -13373,7 +13396,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.28.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "hash-db", "log", @@ -13394,7 +13417,7 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "aes-gcm 0.10.2", "curve25519-dalek 3.2.0", @@ -13418,12 +13441,12 @@ dependencies = [ [[package]] name = "sp-std" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" [[package]] name = "sp-storage" version = "13.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13436,7 +13459,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "parity-scale-codec", @@ -13449,7 +13472,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "10.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "sp-std", @@ -13461,7 +13484,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "sp-api", "sp-runtime", @@ -13470,7 +13493,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "parity-scale-codec", @@ -13485,7 +13508,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "22.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "ahash 0.8.2", "hash-db", @@ -13508,7 +13531,7 @@ dependencies = [ [[package]] name = "sp-version" version = "22.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13525,7 +13548,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "8.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -13536,7 +13559,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "14.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -13549,7 +13572,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "20.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "parity-scale-codec", "scale-info", @@ -13731,12 +13754,12 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "3.0.0" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" [[package]] name = "substrate-frame-rpc-system" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "frame-system-rpc-runtime-api", "futures", @@ -13755,7 +13778,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "hyper", "log", @@ -13767,7 +13790,7 @@ dependencies = [ [[package]] name = "substrate-rpc-client" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "jsonrpsee", @@ -13780,7 +13803,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -13797,7 +13820,7 @@ dependencies = [ [[package]] name = "substrate-test-client" version = "2.0.1" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "array-bytes", "async-trait", @@ -13823,7 +13846,7 @@ dependencies = [ [[package]] name = "substrate-test-utils" version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "futures", "substrate-test-utils-derive", @@ -13833,7 +13856,7 @@ dependencies = [ [[package]] name = "substrate-test-utils-derive" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -13844,7 +13867,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "5.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "ansi_term", "build-helper", @@ -14480,7 +14503,7 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "try-runtime-cli" version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=master#9780579c234f8de633294679bce4821f3783db6e" +source = "git+https://github.com/paritytech/substrate?branch=master#cb450b626ac8e8848db76933e114e57e7cce3e8d" dependencies = [ "async-trait", "clap", diff --git a/parachain-template/node/Cargo.toml b/parachain-template/node/Cargo.toml index ebd0da4001e..4edbf6d6d60 100644 --- a/parachain-template/node/Cargo.toml +++ b/parachain-template/node/Cargo.toml @@ -16,6 +16,7 @@ codec = { package = "parity-scale-codec", version = "3.0.0" } serde = { version = "1.0.175", features = ["derive"] } jsonrpsee = { version = "0.16.2", features = ["server"] } futures = "0.3.28" +async-io = "1.13.0" # Local parachain-template-runtime = { path = "../runtime" } @@ -44,6 +45,7 @@ sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "master" } +sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" } sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" } diff --git a/parachain-template/node/src/service.rs b/parachain-template/node/src/service.rs index ef270e76899..a124a279e4d 100644 --- a/parachain-template/node/src/service.rs +++ b/parachain-template/node/src/service.rs @@ -2,7 +2,9 @@ // std use std::{sync::Arc, time::Duration}; - +use sc_client_api::HeaderBackend; +use futures::FutureExt; +use cumulus_primitives_parachain_inherent::MockValidationDataInherentDataProvider; use cumulus_client_cli::CollatorOptions; // Local Runtime Types use parachain_template_runtime::{opaque::Block, RuntimeApi}; @@ -28,11 +30,12 @@ use sc_executor::{ }; use sc_network::NetworkBlock; use sc_network_sync::SyncingService; -use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; +use sc_service::{error::Error as ServiceError, Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_keystore::KeystorePtr; use substrate_prometheus_endpoint::Registry; +use sc_consensus_manual_seal::consensus::aura::AuraConsensusDataProvider; /// Native executor type. pub struct ParachainNativeExecutor; @@ -454,14 +457,13 @@ pub async fn start_parachain_node( /// Builds a new development service. This service uses manual seal, and mocks /// the parachain inherent. -pub async fn new_dev( +pub async fn new_dev( mut config: Configuration, // sealing: moonbeam_cli_opt::Sealing, // rpc_config: RpcConfig, hwbench: Option, ) -> Result { use async_io::Timer; - use futures::Stream; use sc_consensus_manual_seal::{run_manual_seal, EngineCommand, ManualSealParams}; use sp_core::H256; @@ -471,22 +473,22 @@ pub async fn new_dev( mut task_manager, import_queue, keystore_container, - _select_chain, + select_chain: _, transaction_pool, other: ( block_import, - filter_pool, mut telemetry, _telemetry_worker_handle, - frontier_backend, - fee_history_cache, ), } = new_partial(&mut config)?; + let net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); + let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, + net_config, client: client.clone(), transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), @@ -496,16 +498,27 @@ pub async fn new_dev( })?; if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), + task_manager.spawn_handle().spawn( + "offchain-workers-runner", + "offchain-worker", + sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { + runtime_api_provider: client.clone(), + is_validator: config.role.is_authority(), + keystore: Some(keystore_container.keystore()), + offchain_db: backend.offchain_storage(), + transaction_pool: Some(OffchainTransactionPoolFactory::new( + transaction_pool.clone(), + )), + network_provider: network.clone(), + enable_http_requests: true, + custom_extensions: |_| vec![], + }) + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); } let prometheus_registry = config.prometheus_registry().cloned(); - let mut command_sink = None; let collator = config.role.is_authority(); if collator { @@ -516,10 +529,8 @@ pub async fn new_dev( prometheus_registry.as_ref(), telemetry.as_ref().map(|x| x.handle()), ); - env.set_soft_deadline(SOFT_DEADLINE_PERCENT); - env.enable_ensure_proof_size_limit_after_each_extrinsic(); - let commands_stream: Box::new(StreamExt::map( + let commands_stream = Box::new(futures::StreamExt::map( Timer::interval(Duration::from_millis(1000)), |_| EngineCommand::SealNewBlock { create_empty: true, @@ -532,6 +543,7 @@ pub async fn new_dev( let select_chain = sc_consensus::LongestChain::new(backend.clone()); let client_set_aside_for_cidp = client.clone(); + let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?; // Create channels for mocked XCM messages. // let (downward_xcm_sender, downward_xcm_receiver) = flume::bounded::>(100); @@ -548,13 +560,7 @@ pub async fn new_dev( pool: transaction_pool.clone(), commands_stream, select_chain, - //TODO This needs to be aura to match the runtime - consensus_data_provider: Some(Box::new(NimbusManualSealConsensusDataProvider { - keystore: keystore_container.sync_keystore(), - client: client.clone(), - additional_digests_provider: maybe_provide_vrf_digest, - _phantom: Default::default(), - })), + consensus_data_provider: Some(Box::new(AuraConsensusDataProvider::new(client.clone()))), create_inherent_data_providers: move |block: H256, ()| { let current_para_block = client_set_aside_for_cidp .number(block) @@ -566,7 +572,14 @@ pub async fn new_dev( // let client_for_xcm = client_set_aside_for_cidp.clone(); async move { - let time = sp_timestamp::InherentDataProvider::from_system_time(); + + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + + let slot = + sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( + *timestamp, + slot_duration, + ); let mocked_parachain = MockValidationDataInherentDataProvider { current_para_block, @@ -579,94 +592,35 @@ pub async fn new_dev( raw_horizontal_messages: Default::default(), }; - Ok((time, mocked_parachain)) + Ok((slot, timestamp, mocked_parachain)) } }, }), ); } - rpc::spawn_essential_tasks( - rpc::SpawnTasksParams { - task_manager: &task_manager, - client: client.clone(), - substrate_backend: backend.clone(), - frontier_backend: frontier_backend.clone(), - filter_pool: filter_pool.clone(), - overrides: overrides.clone(), - fee_history_limit, - fee_history_cache: fee_history_cache.clone(), - }, - sync_service.clone(), - pubsub_notification_sinks.clone(), - ); - let rpc_builder = { let client = client.clone(); - let pool = transaction_pool.clone(); - let backend = backend.clone(); - let network = network.clone(); - let sync = sync_service.clone(); - let ethapi_cmd = ethapi_cmd.clone(); - let max_past_logs = rpc_config.max_past_logs; - let overrides = overrides.clone(); - let fee_history_cache = fee_history_cache.clone(); - let block_data_cache = block_data_cache.clone(); - let pubsub_notification_sinks = pubsub_notification_sinks.clone(); - - move |deny_unsafe, subscription_task_executor| { - let deps = rpc::FullDeps { - backend: backend.clone(), + let transaction_pool = transaction_pool.clone(); + + Box::new(move |deny_unsafe, _| { + let deps = crate::rpc::FullDeps { client: client.clone(), - command_sink: command_sink.clone(), + pool: transaction_pool.clone(), deny_unsafe, - ethapi_cmd: ethapi_cmd.clone(), - filter_pool: filter_pool.clone(), - frontier_backend: frontier_backend.clone(), - graph: pool.pool().clone(), - pool: pool.clone(), - is_authority: collator, - max_past_logs, - fee_history_limit, - fee_history_cache: fee_history_cache.clone(), - network: network.clone(), - sync: sync.clone(), - xcm_senders: xcm_senders.clone(), - overrides: overrides.clone(), - block_data_cache: block_data_cache.clone(), - forced_parent_hashes: None, }; - if ethapi_cmd.contains(&EthApiCmd::Debug) || ethapi_cmd.contains(&EthApiCmd::Trace) { - rpc::create_full( - deps, - subscription_task_executor, - Some(crate::rpc::TracingConfig { - tracing_requesters: tracing_requesters.clone(), - trace_filter_max_count: rpc_config.ethapi_trace_max_count, - }), - pubsub_notification_sinks.clone(), - ) - .map_err(Into::into) - } else { - rpc::create_full( - deps, - subscription_task_executor, - None, - pubsub_notification_sinks.clone(), - ) - .map_err(Into::into) - } - } + crate::rpc::create_full(deps).map_err(Into::into) + }) }; - let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams { + sc_service::spawn_tasks(sc_service::SpawnTasksParams { network, client, - keystore: keystore_container.sync_keystore(), + keystore: keystore_container.keystore(), task_manager: &mut task_manager, transaction_pool, - rpc_builder: Box::new(rpc_builder), + rpc_builder, backend, system_rpc_tx, sync_service: sync_service.clone(), From c841091b05517c0c987d20c744028a7e3d56f9ae Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Wed, 26 Jul 2023 23:08:45 -0700 Subject: [PATCH 4/9] add subcommand to run the dev service --- parachain-template/node/src/cli.rs | 7 +++++++ parachain-template/node/src/command.rs | 6 ++++++ parachain-template/node/src/service.rs | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/parachain-template/node/src/cli.rs b/parachain-template/node/src/cli.rs index b72579c86b9..33d7ad10227 100644 --- a/parachain-template/node/src/cli.rs +++ b/parachain-template/node/src/cli.rs @@ -3,6 +3,13 @@ use std::path::PathBuf; /// Sub-commands supported by the collator. #[derive(Debug, clap::Subcommand)] pub enum Subcommand { + /// Temporary simple way of enabling dev service + /// We'll need to put some thought about how to actually enable to dev service + /// along with its various subcommands. + /// + /// It may be most appropriate to have a separate binary entirely for the dev service. + DevService(sc_cli::RunCmd), + /// Build a chain specification. BuildSpec(sc_cli::BuildSpecCmd), diff --git a/parachain-template/node/src/command.rs b/parachain-template/node/src/command.rs index 46c57aa2c67..12bdb7dfa1b 100644 --- a/parachain-template/node/src/command.rs +++ b/parachain-template/node/src/command.rs @@ -242,6 +242,12 @@ pub fn run() -> Result<()> { Some(Subcommand::TryRuntime) => Err("Try-runtime was not enabled when building the node. \ You can enable it with `--features try-runtime`." .into()), + Some(Subcommand::DevService(cmd)) => { + let runner = cli.create_runner(cmd)?; + runner.run_node_until_exit(|config| async move { + crate::service::new_dev(config, None).map_err(sc_cli::Error::Service) + }) + } None => { let runner = cli.create_runner(&cli.run.normalize())?; let collator_options = cli.run.collator_options(); diff --git a/parachain-template/node/src/service.rs b/parachain-template/node/src/service.rs index a124a279e4d..0a6b48a277f 100644 --- a/parachain-template/node/src/service.rs +++ b/parachain-template/node/src/service.rs @@ -457,7 +457,7 @@ pub async fn start_parachain_node( /// Builds a new development service. This service uses manual seal, and mocks /// the parachain inherent. -pub async fn new_dev( +pub fn new_dev( mut config: Configuration, // sealing: moonbeam_cli_opt::Sealing, // rpc_config: RpcConfig, From 85e955e90fae8dbe05667de3a476ef39890f0628 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Wed, 26 Jul 2023 23:38:47 -0700 Subject: [PATCH 5/9] remove unnecessary mut --- parachain-template/node/src/service.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parachain-template/node/src/service.rs b/parachain-template/node/src/service.rs index 0a6b48a277f..234406281b0 100644 --- a/parachain-template/node/src/service.rs +++ b/parachain-template/node/src/service.rs @@ -522,7 +522,7 @@ pub fn new_dev( let collator = config.role.is_authority(); if collator { - let mut env = sc_basic_authorship::ProposerFactory::with_proof_recording( + let env = sc_basic_authorship::ProposerFactory::with_proof_recording( task_manager.spawn_handle(), client.clone(), transaction_pool.clone(), From 34a19efb9f4a92014f8484d3a0564170470996f3 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Wed, 26 Jul 2023 23:49:25 -0700 Subject: [PATCH 6/9] change client side slot duration to 12_000 to match runtime --- parachain-template/node/src/service.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/parachain-template/node/src/service.rs b/parachain-template/node/src/service.rs index 234406281b0..f2aa478f0fa 100644 --- a/parachain-template/node/src/service.rs +++ b/parachain-template/node/src/service.rs @@ -531,7 +531,7 @@ pub fn new_dev( ); let commands_stream = Box::new(futures::StreamExt::map( - Timer::interval(Duration::from_millis(1000)), + Timer::interval(Duration::from_millis(12_000)), |_| EngineCommand::SealNewBlock { create_empty: true, finalize: false, From dd3bd99546f02059e3f3cf10562661a4bb7533d4 Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Wed, 26 Jul 2023 23:52:29 -0700 Subject: [PATCH 7/9] cleanup commented code --- parachain-template/node/src/service.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/parachain-template/node/src/service.rs b/parachain-template/node/src/service.rs index f2aa478f0fa..e5d5f009307 100644 --- a/parachain-template/node/src/service.rs +++ b/parachain-template/node/src/service.rs @@ -459,8 +459,6 @@ pub async fn start_parachain_node( /// the parachain inherent. pub fn new_dev( mut config: Configuration, - // sealing: moonbeam_cli_opt::Sealing, - // rpc_config: RpcConfig, hwbench: Option, ) -> Result { use async_io::Timer; From c880db07e009b90e646d0609d2982d1d7e24c5ce Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Thu, 27 Jul 2023 00:07:02 -0700 Subject: [PATCH 8/9] partially fix import queue --- parachain-template/node/src/service.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/parachain-template/node/src/service.rs b/parachain-template/node/src/service.rs index e5d5f009307..e5887c78801 100644 --- a/parachain-template/node/src/service.rs +++ b/parachain-template/node/src/service.rs @@ -475,12 +475,22 @@ pub fn new_dev( transaction_pool, other: ( - block_import, + _block_import, mut telemetry, _telemetry_worker_handle, ), } = new_partial(&mut config)?; + // We don't use the block import provided from new_partial because + // it is a parachain block import, and it will mark new blocks as + // not best (because parachains wait for the relay chain to do that) + let block_import = client.clone(); + + //TODO currently we are still using the parachain block import in the import queue + // which means that blocks authored by other nodes will still be handled incorrectly. + // But at least it should work for a single node already, and this will allow me to test + // the hypothesis that the parachain block import is the problem. + let net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = From 2a710ce9677095cb493476d55297d63a7b97a7dc Mon Sep 17 00:00:00 2001 From: Joshy Orndorff Date: Thu, 27 Jul 2023 00:07:08 -0700 Subject: [PATCH 9/9] Revert "parallel path: bring in Kian's minimal node" This reverts commit bffe965b0ca8d24948f6eea1bb2565d5177e8cf4. --- parachain-template/minimal/node/Cargo.toml | 42 ---- parachain-template/minimal/node/build.rs | 6 - .../minimal/node/src/chain_spec.rs | 65 ----- parachain-template/minimal/node/src/cli.rs | 64 ----- .../minimal/node/src/command.rs | 114 --------- parachain-template/minimal/node/src/lib.rs | 4 - parachain-template/minimal/node/src/main.rs | 13 - parachain-template/minimal/node/src/rpc.rs | 55 ---- .../minimal/node/src/service.rs | 234 ------------------ 9 files changed, 597 deletions(-) delete mode 100644 parachain-template/minimal/node/Cargo.toml delete mode 100644 parachain-template/minimal/node/build.rs delete mode 100644 parachain-template/minimal/node/src/chain_spec.rs delete mode 100644 parachain-template/minimal/node/src/cli.rs delete mode 100644 parachain-template/minimal/node/src/command.rs delete mode 100644 parachain-template/minimal/node/src/lib.rs delete mode 100644 parachain-template/minimal/node/src/main.rs delete mode 100644 parachain-template/minimal/node/src/rpc.rs delete mode 100644 parachain-template/minimal/node/src/service.rs diff --git a/parachain-template/minimal/node/Cargo.toml b/parachain-template/minimal/node/Cargo.toml deleted file mode 100644 index b2185419fa1..00000000000 --- a/parachain-template/minimal/node/Cargo.toml +++ /dev/null @@ -1,42 +0,0 @@ -[package] -name = "parachain-standalone-node" -version = "0.1.0" -edition = "2021" -license = "Unlicense" -publish = false -build = "build.rs" - -[dependencies] -clap = { version = "4.3.11", features = ["derive"] } -futures = { version = "0.3.21", features = ["thread-pool"] } -futures-timer = "3.0.1" -jsonrpsee = { version = "0.16.2", features = ["server"] } - -sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-consensus-manual-seal = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "master" } - -sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" } -sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" } - - -substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "master" } - -runtime = { package = "parachain-template-runtime", path = "../runtime" } - -[build-dependencies] -substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" } - -[features] -default = [] diff --git a/parachain-template/minimal/node/build.rs b/parachain-template/minimal/node/build.rs deleted file mode 100644 index a5b173537e8..00000000000 --- a/parachain-template/minimal/node/build.rs +++ /dev/null @@ -1,6 +0,0 @@ -use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed}; - -fn main() { - generate_cargo_keys(); - rerun_if_git_head_changed(); -} diff --git a/parachain-template/minimal/node/src/chain_spec.rs b/parachain-template/minimal/node/src/chain_spec.rs deleted file mode 100644 index 90dac1dd2e4..00000000000 --- a/parachain-template/minimal/node/src/chain_spec.rs +++ /dev/null @@ -1,65 +0,0 @@ -use runtime::{BalancesConfig, RuntimeGenesisConfig, SudoConfig, SystemConfig, WASM_BINARY}; -use sc_service::{ChainType, Properties}; -use sp_keyring::AccountKeyring; - -/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type. -pub type ChainSpec = sc_service::GenericChainSpec; - -fn props() -> Properties { - let mut properties = Properties::new(); - properties.insert("tokenDecimals".to_string(), 0.into()); - properties.insert("tokenSymbol".to_string(), "TEST".into()); - properties -} - -pub fn development_config() -> Result { - let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; - Ok(ChainSpec::from_genesis( - "Development", - "dev", - ChainType::Development, - move || testnet_genesis(wasm_binary), - vec![], - None, - None, - None, - Some(props()), - None, - )) -} - -pub fn local_testnet_config() -> Result { - let wasm_binary = WASM_BINARY.ok_or_else(|| "Development wasm not available".to_string())?; - - Ok(ChainSpec::from_genesis( - "Local Testnet", - "local_testnet", - ChainType::Local, - move || testnet_genesis(wasm_binary), - vec![], - None, - None, - None, - Some(props()), - None, - )) -} - -/// Configure initial storage state for FRAME modules. -fn testnet_genesis(wasm_binary: &[u8]) -> RuntimeGenesisConfig { - use frame::traits::Get; - use runtime::interface::{Balance, MinimumBalance}; - let endowment = >::get().max(1) * 1000; - let balances = AccountKeyring::iter() - .map(|a| (a.to_account_id(), endowment)) - .collect::>(); - RuntimeGenesisConfig { - system: SystemConfig { - // Add Wasm runtime to storage. - code: wasm_binary.to_vec(), - }, - balances: BalancesConfig { balances }, - sudo: SudoConfig { key: Some(AccountKeyring::Alice.to_account_id()) }, - ..Default::default() - } -} diff --git a/parachain-template/minimal/node/src/cli.rs b/parachain-template/minimal/node/src/cli.rs deleted file mode 100644 index 36985a48a8a..00000000000 --- a/parachain-template/minimal/node/src/cli.rs +++ /dev/null @@ -1,64 +0,0 @@ -use sc_cli::RunCmd; - -#[derive(Debug, Clone)] -pub enum Consensus { - ManualSeal(u64), - InstantSeal, -} - -impl std::str::FromStr for Consensus { - type Err = String; - - fn from_str(s: &str) -> Result { - Ok(if s == "instant-seal" { - Consensus::InstantSeal - } else if let Some(block_time) = s.strip_prefix("manual-seal-") { - Consensus::ManualSeal(block_time.parse().map_err(|_| "invalid block time")?) - } else { - return Err("incorrect consensus identifier".into()) - }) - } -} - -#[derive(Debug, clap::Parser)] -pub struct Cli { - #[command(subcommand)] - pub subcommand: Option, - - #[clap(long, default_value = "manual-seal-3000")] - pub consensus: Consensus, - - #[clap(flatten)] - pub run: RunCmd, -} - -#[derive(Debug, clap::Subcommand)] -pub enum Subcommand { - /// Key management cli utilities - #[command(subcommand)] - Key(sc_cli::KeySubcommand), - - /// Build a chain specification. - BuildSpec(sc_cli::BuildSpecCmd), - - /// Validate blocks. - CheckBlock(sc_cli::CheckBlockCmd), - - /// Export blocks. - ExportBlocks(sc_cli::ExportBlocksCmd), - - /// Export the state of a given block into a chain spec. - ExportState(sc_cli::ExportStateCmd), - - /// Import blocks. - ImportBlocks(sc_cli::ImportBlocksCmd), - - /// Remove the whole chain. - PurgeChain(sc_cli::PurgeChainCmd), - - /// Revert the chain to a previous state. - Revert(sc_cli::RevertCmd), - - /// Db meta columns information. - ChainInfo(sc_cli::ChainInfoCmd), -} diff --git a/parachain-template/minimal/node/src/command.rs b/parachain-template/minimal/node/src/command.rs deleted file mode 100644 index 2718170ac02..00000000000 --- a/parachain-template/minimal/node/src/command.rs +++ /dev/null @@ -1,114 +0,0 @@ -use crate::{ - chain_spec, - cli::{Cli, Subcommand}, - service, -}; -use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli}; -use sc_service::PartialComponents; - -#[cfg(feature = "try-runtime")] -use try_runtime_cli::block_building_info::timestamp_with_aura_info; - -impl SubstrateCli for Cli { - fn impl_name() -> String { - "Substrate Node".into() - } - - fn impl_version() -> String { - env!("SUBSTRATE_CLI_IMPL_VERSION").into() - } - - fn description() -> String { - env!("CARGO_PKG_DESCRIPTION").into() - } - - fn author() -> String { - env!("CARGO_PKG_AUTHORS").into() - } - - fn support_url() -> String { - "support.anonymous.an".into() - } - - fn copyright_start_year() -> i32 { - 2017 - } - - fn load_spec(&self, id: &str) -> Result, String> { - Ok(match id { - "dev" => Box::new(chain_spec::development_config()?), - "" | "local" => Box::new(chain_spec::local_testnet_config()?), - path => - Box::new(chain_spec::ChainSpec::from_json_file(std::path::PathBuf::from(path))?), - }) - } - - fn native_runtime_version(_: &Box) -> &'static RuntimeVersion { - &runtime::VERSION - } -} - -/// Parse and run command line arguments -pub fn run() -> sc_cli::Result<()> { - let cli = Cli::from_args(); - - match &cli.subcommand { - Some(Subcommand::Key(cmd)) => cmd.run(&cli), - Some(Subcommand::BuildSpec(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.sync_run(|config| cmd.run(config.chain_spec, config.network)) - }, - Some(Subcommand::CheckBlock(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.async_run(|config| { - let PartialComponents { client, task_manager, import_queue, .. } = - service::new_partial(&config)?; - Ok((cmd.run(client, import_queue), task_manager)) - }) - }, - Some(Subcommand::ExportBlocks(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.async_run(|config| { - let PartialComponents { client, task_manager, .. } = service::new_partial(&config)?; - Ok((cmd.run(client, config.database), task_manager)) - }) - }, - Some(Subcommand::ExportState(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.async_run(|config| { - let PartialComponents { client, task_manager, .. } = service::new_partial(&config)?; - Ok((cmd.run(client, config.chain_spec), task_manager)) - }) - }, - Some(Subcommand::ImportBlocks(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.async_run(|config| { - let PartialComponents { client, task_manager, import_queue, .. } = - service::new_partial(&config)?; - Ok((cmd.run(client, import_queue), task_manager)) - }) - }, - Some(Subcommand::PurgeChain(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.sync_run(|config| cmd.run(config.database)) - }, - Some(Subcommand::Revert(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.async_run(|config| { - let PartialComponents { client, task_manager, backend, .. } = - service::new_partial(&config)?; - Ok((cmd.run(client, backend, None), task_manager)) - }) - }, - Some(Subcommand::ChainInfo(cmd)) => { - let runner = cli.create_runner(cmd)?; - runner.sync_run(|config| cmd.run::(&config)) - }, - None => { - let runner = cli.create_runner(&cli.run)?; - runner.run_node_until_exit(|config| async move { - service::new_full(config, cli.consensus).map_err(sc_cli::Error::Service) - }) - }, - } -} diff --git a/parachain-template/minimal/node/src/lib.rs b/parachain-template/minimal/node/src/lib.rs deleted file mode 100644 index f13719f81d1..00000000000 --- a/parachain-template/minimal/node/src/lib.rs +++ /dev/null @@ -1,4 +0,0 @@ -pub mod chain_spec; -pub(crate) mod cli; -pub mod rpc; -pub mod service; diff --git a/parachain-template/minimal/node/src/main.rs b/parachain-template/minimal/node/src/main.rs deleted file mode 100644 index 4449d28b9fa..00000000000 --- a/parachain-template/minimal/node/src/main.rs +++ /dev/null @@ -1,13 +0,0 @@ -//! Substrate Node Template CLI library. -#![warn(missing_docs)] - -mod chain_spec; -#[macro_use] -mod service; -mod cli; -mod command; -mod rpc; - -fn main() -> sc_cli::Result<()> { - command::run() -} diff --git a/parachain-template/minimal/node/src/rpc.rs b/parachain-template/minimal/node/src/rpc.rs deleted file mode 100644 index 38130124e8d..00000000000 --- a/parachain-template/minimal/node/src/rpc.rs +++ /dev/null @@ -1,55 +0,0 @@ -//! A collection of node-specific RPC methods. -//! Substrate provides the `sc-rpc` crate, which defines the core RPC layer -//! used by Substrate nodes. This file extends those RPC definitions with -//! capabilities that are specific to this project's runtime configuration. - -#![warn(missing_docs)] - -use jsonrpsee::RpcModule; -use runtime::interface::{AccountId, Index, OpaqueBlock}; -use sc_transaction_pool_api::TransactionPool; -use sp_block_builder::BlockBuilder; -use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; -use std::sync::Arc; - -pub use sc_rpc_api::DenyUnsafe; - -/// Full client dependencies. -pub struct FullDeps { - /// The client instance to use. - pub client: Arc, - /// Transaction pool instance. - pub pool: Arc

, - /// Whether to deny unsafe calls - pub deny_unsafe: DenyUnsafe, -} - -/// Instantiate all full RPC extensions. -pub fn create_full( - deps: FullDeps, -) -> Result, Box> -where - C: sp_api::ProvideRuntimeApi< - // TODO: bloody hell.. - frame::runtime::runtime_types_generic::Block< - frame::runtime::runtime_types_generic::Header, - frame::runtime::runtime_types_generic::OpaqueExtrinsic, - >, - // OpaqueBlock, - >, - C: HeaderBackend + HeaderMetadata + 'static, - C: Send + Sync + 'static, - P: TransactionPool + 'static, - C::Api: BlockBuilder, - C::Api: substrate_frame_rpc_system::AccountNonceApi, -{ - use substrate_frame_rpc_system::{System, SystemApiServer}; - - let mut module = RpcModule::new(()); - let FullDeps { client, pool, deny_unsafe } = deps; - - module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?; - // NOTE: we have intentionally ignored adding tx-pool's custom RPC here. - - Ok(module) -} diff --git a/parachain-template/minimal/node/src/service.rs b/parachain-template/minimal/node/src/service.rs deleted file mode 100644 index 80aa15d9d3f..00000000000 --- a/parachain-template/minimal/node/src/service.rs +++ /dev/null @@ -1,234 +0,0 @@ -use runtime::{self, interface::OpaqueBlock as Block, RuntimeApi}; -pub use sc_executor::NativeElseWasmExecutor; -use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; -use sc_telemetry::{Telemetry, TelemetryWorker}; -use std::sync::Arc; - -use crate::cli::Consensus; - -// Our native executor instance. -pub struct ExecutorDispatch; - -impl sc_executor::NativeExecutionDispatch for ExecutorDispatch { - /// Only enable the benchmarking host functions when we actually want to benchmark. - #[cfg(feature = "runtime-benchmarks")] - type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions; - /// Otherwise we only use the default Substrate host functions. - #[cfg(not(feature = "runtime-benchmarks"))] - type ExtendHostFunctions = (); - - fn dispatch(method: &str, data: &[u8]) -> Option> { - runtime::api::dispatch(method, data) - } - - fn native_version() -> sc_executor::NativeVersion { - runtime::native_version() - } -} - -pub(crate) type FullClient = - sc_service::TFullClient>; -type FullBackend = sc_service::TFullBackend; -type FullSelectChain = sc_consensus::LongestChain; - -pub fn new_partial( - config: &Configuration, -) -> Result< - sc_service::PartialComponents< - FullClient, - FullBackend, - FullSelectChain, - sc_consensus::DefaultImportQueue, - sc_transaction_pool::FullPool, - Option, - >, - ServiceError, -> { - let telemetry = config - .telemetry_endpoints - .clone() - .filter(|x| !x.is_empty()) - .map(|endpoints| -> Result<_, sc_telemetry::Error> { - let worker = TelemetryWorker::new(16)?; - let telemetry = worker.handle().new_telemetry(endpoints); - Ok((worker, telemetry)) - }) - .transpose()?; - - let executor = sc_service::new_native_or_wasm_executor(&config); - - let (client, backend, keystore_container, task_manager) = - sc_service::new_full_parts::( - config, - telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), - executor, - )?; - let client = Arc::new(client); - - let telemetry = telemetry.map(|(worker, telemetry)| { - task_manager.spawn_handle().spawn("telemetry", None, worker.run()); - telemetry - }); - - let select_chain = sc_consensus::LongestChain::new(backend.clone()); - - let transaction_pool = sc_transaction_pool::BasicPool::new_full( - config.transaction_pool.clone(), - config.role.is_authority().into(), - config.prometheus_registry(), - task_manager.spawn_essential_handle(), - client.clone(), - ); - - let import_queue = sc_consensus_manual_seal::import_queue( - Box::new(client.clone()), - &task_manager.spawn_essential_handle(), - config.prometheus_registry(), - ); - - Ok(sc_service::PartialComponents { - client, - backend, - task_manager, - import_queue, - keystore_container, - select_chain, - transaction_pool, - other: (telemetry), - }) -} - -/// Builds a new service for a full client. -pub fn new_full(config: Configuration, consensus: Consensus) -> Result { - let sc_service::PartialComponents { - client, - backend, - mut task_manager, - import_queue, - keystore_container, - select_chain, - transaction_pool, - other: mut telemetry, - } = new_partial(&config)?; - - let net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); - - let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) = - sc_service::build_network(sc_service::BuildNetworkParams { - config: &config, - client: client.clone(), - transaction_pool: transaction_pool.clone(), - spawn_handle: task_manager.spawn_handle(), - import_queue, - net_config, - block_announce_validator_builder: None, - warp_sync_params: None, - })?; - - if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), - ); - } - - let rpc_extensions_builder = { - let client = client.clone(); - let pool = transaction_pool.clone(); - - Box::new(move |deny_unsafe, _| { - let deps = - crate::rpc::FullDeps { client: client.clone(), pool: pool.clone(), deny_unsafe }; - crate::rpc::create_full(deps).map_err(Into::into) - }) - }; - - let prometheus_registry = config.prometheus_registry().cloned(); - - let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams { - network, - client: client.clone(), - keystore: keystore_container.keystore(), - task_manager: &mut task_manager, - transaction_pool: transaction_pool.clone(), - rpc_builder: rpc_extensions_builder, - backend, - system_rpc_tx, - tx_handler_controller, - sync_service, - config, - telemetry: telemetry.as_mut(), - })?; - - let proposer = sc_basic_authorship::ProposerFactory::new( - task_manager.spawn_handle(), - client.clone(), - transaction_pool.clone(), - prometheus_registry.as_ref(), - telemetry.as_ref().map(|x| x.handle()), - ); - - match consensus { - Consensus::InstantSeal => { - let params = sc_consensus_manual_seal::InstantSealParams { - block_import: client.clone(), - env: proposer, - client, - pool: transaction_pool, - select_chain, - consensus_data_provider: None, - create_inherent_data_providers: move |_, ()| async move { - Ok(sp_timestamp::InherentDataProvider::from_system_time()) - }, - }; - - let authorship_future = sc_consensus_manual_seal::run_instant_seal(params); - - task_manager.spawn_essential_handle().spawn_blocking( - "instant-seal", - None, - authorship_future, - ); - }, - Consensus::ManualSeal(block_time) => { - let (mut sink, commands_stream) = futures::channel::mpsc::channel(1024); - task_manager.spawn_handle().spawn("block_authoring", None, async move { - loop { - futures_timer::Delay::new(std::time::Duration::from_millis(block_time)).await; - sink.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, - pool: transaction_pool, - select_chain, - commands_stream: Box::pin(commands_stream), - consensus_data_provider: None, - create_inherent_data_providers: move |_, ()| async move { - Ok(sp_timestamp::InherentDataProvider::from_system_time()) - }, - }; - let authorship_future = sc_consensus_manual_seal::run_manual_seal(params); - - task_manager.spawn_essential_handle().spawn_blocking( - "manual-seal", - None, - authorship_future, - ); - }, - } - - network_starter.start_network(); - Ok(task_manager) -}