diff --git a/bridges/bin/node/node/Cargo.toml b/bridges/bin/node/node/Cargo.toml index ab7db6f9d0..df2d53052f 100644 --- a/bridges/bin/node/node/Cargo.toml +++ b/bridges/bin/node/node/Cargo.toml @@ -25,110 +25,110 @@ default-features = false features = ["std"] [dependencies.sc-cli] -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sc-rpc] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sp-core] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sc-executor] -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sc-service] -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sp-inherents] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sc-transaction-pool] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sp-transaction-pool] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sc-network] -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sc-consensus-aura] -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sp-consensus-aura] -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sp-consensus] -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sc-finality-grandpa] package = "sc-finality-grandpa" -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.grandpa-primitives] package = "sp-finality-grandpa" -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sc-consensus] -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sc-client-api] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sp-runtime] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sc-basic-authorship] -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.substrate-frame-rpc-system] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.frame-benchmarking] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.frame-benchmarking-cli] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [build-dependencies] @@ -136,13 +136,13 @@ vergen = "3.1.0" [build-dependencies.build-script-utils] package = "substrate-build-script-utils" -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [build-dependencies.frame-benchmarking-cli] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [features] diff --git a/bridges/bin/node/node/src/command.rs b/bridges/bin/node/node/src/command.rs index 8a50ab1ad4..9951e9af47 100644 --- a/bridges/bin/node/node/src/command.rs +++ b/bridges/bin/node/node/src/command.rs @@ -32,10 +32,10 @@ use crate::cli::{Cli, Subcommand}; use crate::service; -use crate::service::new_full_params; +use crate::service::new_partial; use bridge_node_runtime::Block; use sc_cli::{ChainSpec, Role, RuntimeVersion, SubstrateCli}; -use sc_service::ServiceParams; +use sc_service::PartialComponents; impl SubstrateCli for Cli { fn impl_name() -> String { @@ -103,16 +103,13 @@ pub fn run() -> sc_cli::Result<()> { Some(Subcommand::Base(subcommand)) => { let runner = cli.create_runner(subcommand)?; runner.run_subcommand(subcommand, |config| { - let ( - ServiceParams { - client, - backend, - task_manager, - import_queue, - .. - }, - .., - ) = new_full_params(config)?; + let PartialComponents { + client, + backend, + task_manager, + import_queue, + .. + } = new_partial(&config)?; Ok((client, backend, import_queue, task_manager)) }) } diff --git a/bridges/bin/node/node/src/service.rs b/bridges/bin/node/node/src/service.rs index 4607c51b50..e1a1919b97 100644 --- a/bridges/bin/node/node/src/service.rs +++ b/bridges/bin/node/node/src/service.rs @@ -16,14 +16,24 @@ //! Service and ServiceFactory implementation. Specialized wrapper over substrate service. +// ===================================================================================== +// ===================================================================================== +// ===================================================================================== +// UPDATE GUIDE: +// 1) replace everything with node-template/src/service.rs contents (found in main Substrate repo); +// 2) the only thing to keep from old code, is `rpc_extensions_builder` - we use our own custom RPCs; +// 3) fix compilation errors; +// 4) test :) +// ===================================================================================== +// ===================================================================================== +// ===================================================================================== + use bridge_node_runtime::{self, opaque::Block, RuntimeApi}; use sc_client_api::{ExecutorProvider, RemoteBackend}; use sc_executor::native_executor_instance; pub use sc_executor::NativeExecutor; -use sc_finality_grandpa::{ - FinalityProofProvider as GrandpaFinalityProofProvider, SharedVoterState, StorageAndProofProvider, -}; -use sc_service::{error::Error as ServiceError, Configuration, ServiceComponents, TaskManager}; +use sc_finality_grandpa::{FinalityProofProvider as GrandpaFinalityProofProvider, SharedVoterState}; +use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; use sp_inherents::InherentDataProviders; use std::sync::Arc; @@ -42,23 +52,20 @@ type FullBackend = sc_service::TFullBackend; type FullSelectChain = sc_consensus::LongestChain; #[allow(clippy::type_complexity)] -pub fn new_full_params( - config: Configuration, +pub fn new_partial( + config: &Configuration, ) -> Result< - ( - sc_service::ServiceParams< - Block, - FullClient, - sc_consensus_aura::AuraImportQueue, - sc_transaction_pool::FullPool, - jsonrpc_core::IoHandler, - FullBackend, - >, + sc_service::PartialComponents< + FullClient, + FullBackend, FullSelectChain, - sp_inherents::InherentDataProviders, - sc_finality_grandpa::GrandpaBlockImport, - sc_finality_grandpa::LinkHalf, - ), + sp_consensus::DefaultImportQueue, + sc_transaction_pool::FullPool, + ( + sc_finality_grandpa::GrandpaBlockImport, + sc_finality_grandpa::LinkHalf, + ), + >, ServiceError, > { let inherent_data_providers = sp_inherents::InherentDataProviders::new(); @@ -68,10 +75,8 @@ pub fn new_full_params( let select_chain = sc_consensus::LongestChain::new(backend.clone()); - let pool_api = sc_transaction_pool::FullChainApi::new(client.clone(), config.prometheus_registry()); let transaction_pool = sc_transaction_pool::BasicPool::new_full( config.transaction_pool.clone(), - std::sync::Arc::new(pool_api), config.prometheus_registry(), task_manager.spawn_handle(), client.clone(), @@ -83,7 +88,7 @@ pub fn new_full_params( let aura_block_import = sc_consensus_aura::AuraBlockImport::<_, _, _, AuraPair>::new(grandpa_block_import.clone(), client.clone()); - let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _>( + let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>( sc_consensus_aura::slot_duration(&*client)?, aura_block_import, Some(Box::new(grandpa_block_import.clone())), @@ -92,8 +97,68 @@ pub fn new_full_params( inherent_data_providers.clone(), &task_manager.spawn_handle(), config.prometheus_registry(), + sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone()), )?; + Ok(sc_service::PartialComponents { + client, + backend, + task_manager, + import_queue, + keystore, + select_chain, + transaction_pool, + inherent_data_providers, + other: (grandpa_block_import, grandpa_link), + }) +} + +/// Builds a new service for a full client. +pub fn new_full(config: Configuration) -> Result { + let sc_service::PartialComponents { + client, + backend, + mut task_manager, + import_queue, + keystore, + select_chain, + transaction_pool, + inherent_data_providers, + other: (block_import, grandpa_link), + } = new_partial(&config)?; + + let finality_proof_provider = GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone()); + + let (network, network_status_sinks, system_rpc_tx, network_starter) = + 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, + on_demand: None, + block_announce_validator_builder: None, + finality_proof_request_builder: None, + finality_proof_provider: Some(finality_proof_provider), + })?; + + if config.offchain_worker.enabled { + sc_service::build_offchain_workers( + &config, + backend.clone(), + task_manager.spawn_handle(), + client.clone(), + network.clone(), + ); + } + + let role = config.role.clone(); + let force_authoring = config.force_authoring; + let name = config.network.node_name.clone(); + let enable_grandpa = !config.disable_grandpa; + let prometheus_registry = config.prometheus_registry().cloned(); + let telemetry_connection_sinks = sc_service::TelemetryConnectionSinks::default(); + let rpc_extensions_builder = { use sc_rpc::DenyUnsafe; use substrate_frame_rpc_system::{FullSystem, SystemApi}; @@ -101,7 +166,7 @@ pub fn new_full_params( let client = client.clone(); let pool = transaction_pool.clone(); - Box::new(move |_| { + Box::new(move |_, _| { let mut io = jsonrpc_core::IoHandler::default(); io.extend_with(SystemApi::to_delegate(FullSystem::new( client.clone(), @@ -113,65 +178,21 @@ pub fn new_full_params( }) }; - let provider = client.clone() as Arc>; - let finality_proof_provider = Arc::new(GrandpaFinalityProofProvider::new(backend.clone(), provider)); - - let params = sc_service::ServiceParams { - backend, - client, - import_queue, - keystore, - task_manager, - transaction_pool, - config, - block_announce_validator_builder: None, - finality_proof_request_builder: None, - finality_proof_provider: Some(finality_proof_provider), + sc_service::spawn_tasks(sc_service::SpawnTasksParams { + network: network.clone(), + client: client.clone(), + keystore: keystore.clone(), + task_manager: &mut task_manager, + transaction_pool: transaction_pool.clone(), + telemetry_connection_sinks: telemetry_connection_sinks.clone(), + rpc_extensions_builder, on_demand: None, remote_blockchain: None, - rpc_extensions_builder, - }; - - Ok(( - params, - select_chain, - inherent_data_providers, - grandpa_block_import, - grandpa_link, - )) -} - -/// Builds a new service for a full client. -pub fn new_full(config: Configuration) -> Result { - let (params, select_chain, inherent_data_providers, block_import, grandpa_link) = new_full_params(config)?; - - let (role, force_authoring, name, enable_grandpa, prometheus_registry, client, transaction_pool, keystore) = { - let sc_service::ServiceParams { - config, - client, - transaction_pool, - keystore, - .. - } = ¶ms; - - ( - config.role.clone(), - config.force_authoring, - config.network.node_name.clone(), - !config.disable_grandpa, - config.prometheus_registry().cloned(), - client.clone(), - transaction_pool.clone(), - keystore.clone(), - ) - }; - - let ServiceComponents { - task_manager, - network, - telemetry_on_connect_sinks, - .. - } = sc_service::build(params)?; + backend, + network_status_sinks, + system_rpc_tx, + config, + })?; if role.is_authority() { let proposer = @@ -227,7 +248,7 @@ pub fn new_full(config: Configuration) -> Result { link: grandpa_link, network, inherent_data_providers, - telemetry_on_connect: Some(telemetry_on_connect_sinks.on_connect_stream()), + telemetry_on_connect: Some(telemetry_connection_sinks.on_connect_stream()), voting_rule: sc_finality_grandpa::VotingRulesBuilder::default().build(), prometheus_registry, shared_voter_state: SharedVoterState::empty(), @@ -242,24 +263,22 @@ pub fn new_full(config: Configuration) -> Result { sc_finality_grandpa::setup_disabled_grandpa(client, &inherent_data_providers, network)?; } + network_starter.start_network(); Ok(task_manager) } /// Builds a new service for a light client. pub fn new_light(config: Configuration) -> Result { - let (client, backend, keystore, task_manager, on_demand) = + let (client, backend, keystore, mut task_manager, on_demand) = sc_service::new_light_parts::(&config)?; - let transaction_pool_api = Arc::new(sc_transaction_pool::LightChainApi::new( + let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light( + config.transaction_pool.clone(), + config.prometheus_registry(), + task_manager.spawn_handle(), client.clone(), on_demand.clone(), )); - let transaction_pool = sc_transaction_pool::BasicPool::new_light( - config.transaction_pool.clone(), - transaction_pool_api, - config.prometheus_registry(), - task_manager.spawn_handle(), - ); let grandpa_block_import = sc_finality_grandpa::light_block_import( client.clone(), @@ -270,7 +289,7 @@ pub fn new_light(config: Configuration) -> Result { let finality_proof_import = grandpa_block_import.clone(); let finality_proof_request_builder = finality_proof_import.create_finality_proof_request_builder(); - let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _>( + let import_queue = sc_consensus_aura::import_queue::<_, _, _, AuraPair, _, _>( sc_consensus_aura::slot_duration(&*client)?, grandpa_block_import, None, @@ -279,27 +298,51 @@ pub fn new_light(config: Configuration) -> Result { InherentDataProviders::new(), &task_manager.spawn_handle(), config.prometheus_registry(), + sp_consensus::NeverCanAuthor, )?; - let finality_proof_provider = Arc::new(GrandpaFinalityProofProvider::new( - backend.clone(), - client.clone() as Arc<_>, - )); + let finality_proof_provider = GrandpaFinalityProofProvider::new_for_service(backend.clone(), client.clone()); - sc_service::build(sc_service::ServiceParams { - block_announce_validator_builder: None, - finality_proof_request_builder: Some(finality_proof_request_builder), - finality_proof_provider: Some(finality_proof_provider), - on_demand: Some(on_demand), + let (network, network_status_sinks, system_rpc_tx, network_starter) = + 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, + on_demand: Some(on_demand.clone()), + block_announce_validator_builder: None, + finality_proof_request_builder: Some(finality_proof_request_builder), + finality_proof_provider: Some(finality_proof_provider), + })?; + + if config.offchain_worker.enabled { + sc_service::build_offchain_workers( + &config, + backend.clone(), + task_manager.spawn_handle(), + client.clone(), + network.clone(), + ); + } + + sc_service::spawn_tasks(sc_service::SpawnTasksParams { remote_blockchain: Some(backend.remote_blockchain()), - rpc_extensions_builder: Box::new(|_| ()), - transaction_pool: Arc::new(transaction_pool), + transaction_pool, + task_manager: &mut task_manager, + on_demand: Some(on_demand), + rpc_extensions_builder: Box::new(|_, _| ()), + telemetry_connection_sinks: sc_service::TelemetryConnectionSinks::default(), config, client, - import_queue, keystore, backend, - task_manager, - }) - .map(|ServiceComponents { task_manager, .. }| task_manager) + network, + network_status_sinks, + system_rpc_tx, + })?; + + network_starter.start_network(); + + Ok(task_manager) } diff --git a/bridges/bin/node/runtime/Cargo.toml b/bridges/bin/node/runtime/Cargo.toml index bedb7a9a0c..62a8e6baee 100644 --- a/bridges/bin/node/runtime/Cargo.toml +++ b/bridges/bin/node/runtime/Cargo.toml @@ -29,14 +29,14 @@ features = ["derive"] # Substrate Dependencies [dependencies.pallet-aura] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.pallet-balances] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" @@ -51,148 +51,148 @@ default-features = false path = "../../../modules/currency-exchange" [dependencies.frame-support] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.pallet-grandpa] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.pallet-randomness-collective-flip] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.pallet-sudo] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.pallet-session] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.frame-system] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.frame-system-rpc-runtime-api] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.pallet-timestamp] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.pallet-transaction-payment] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.frame-executive] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" # Substrate Primitives [dependencies.sp-api] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-block-builder] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-consensus-aura] -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-core] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-inherents] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-io] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-offchain] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-runtime] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-session] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-staking] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-std] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-transaction-pool] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-version] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.frame-benchmarking] optional = true -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" @@ -226,7 +226,7 @@ path = "../../../primitives/ethereum-poa" [build-dependencies.wasm-builder-runner] version = "1.0.5" -tag = 'v2.0.0-rc5' +tag = 'v2.0.0-rc6' package = "substrate-wasm-builder-runner" git = "https://github.com/paritytech/substrate/" diff --git a/bridges/bin/node/runtime/src/exchange.rs b/bridges/bin/node/runtime/src/exchange.rs index 7296fc41e1..1e68ce83f7 100644 --- a/bridges/bin/node/runtime/src/exchange.rs +++ b/bridges/bin/node/runtime/src/exchange.rs @@ -128,7 +128,7 @@ impl MaybeLockFundsTransaction for EthTransaction { /// Prepares everything required to bench claim of funds locked by given transaction. #[cfg(feature = "runtime-benchmarks")] -pub(crate) fn prepare_environment_for_claim, I: pallet_bridge_eth_poa::Instance>( +pub(crate) fn prepare_environment_for_claim, I: frame_support::traits::Instance>( transactions: &[(RawTransaction, RawTransactionReceipt)], ) -> bp_eth_poa::H256 { use bp_eth_poa::compute_merkle_root; diff --git a/bridges/bin/node/runtime/src/lib.rs b/bridges/bin/node/runtime/src/lib.rs index 2ea3112891..7fedc3e354 100644 --- a/bridges/bin/node/runtime/src/lib.rs +++ b/bridges/bin/node/runtime/src/lib.rs @@ -687,22 +687,23 @@ impl_runtime_apis! { highest_range_values: Vec, steps: Vec, repeat: u32, + extra: bool, ) -> Result, sp_runtime::RuntimeString> { - use frame_benchmarking::{Benchmarking, BenchmarkBatch, add_benchmark}; + use frame_benchmarking::{Benchmarking, BenchmarkBatch, TrackedStorageKey, add_benchmark}; let mut batches = Vec::::new(); - let whitelist: Vec> = vec![ + let whitelist: Vec = vec![ // Block Number - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec(), + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef702a5c1b19ab7a04f536c519aca4983ac").to_vec().into(), // Execution Phase - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec(), + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7ff553b5a9862a516939d82b3d3d8661a").to_vec().into(), // Event Count - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec(), + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef70a98fdbe9ce6c55837576c60c7af3850").to_vec().into(), // System Events - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec(), + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef780d41e5e16056765bc8461851072c9d7").to_vec().into(), // Caller 0 Account - hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da946c154ffd9992e395af90b5b13cc6f295c77033fce8a9045824a6690bbf99c6db269502f0a8d1d2a008542d5690a0749").to_vec(), + hex_literal::hex!("26aa394eea5630e07c48ae0c9558cef7b99d880ec681799c0cf30e8886371da946c154ffd9992e395af90b5b13cc6f295c77033fce8a9045824a6690bbf99c6db269502f0a8d1d2a008542d5690a0749").to_vec().into(), ]; - let params = (&pallet, &benchmark, &lowest_range_values, &highest_range_values, &steps, repeat, &whitelist); + let params = (&pallet, &benchmark, &lowest_range_values, &highest_range_values, &steps, repeat, &whitelist, extra); use pallet_bridge_currency_exchange::benchmarking::{ Module as BridgeCurrencyExchangeBench, diff --git a/bridges/modules/currency-exchange/Cargo.toml b/bridges/modules/currency-exchange/Cargo.toml index 4b0f0fd068..09bb1c25cb 100644 --- a/bridges/modules/currency-exchange/Cargo.toml +++ b/bridges/modules/currency-exchange/Cargo.toml @@ -9,49 +9,49 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] bp-currency-exchange = { path = "../../primitives/currency-exchange", default-features = false } bp-header-chain = { path = "../../primitives/header-chain", default-features = false } -codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false } +codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false } serde = { version = "1.0", optional = true } # Substrate Based Dependencies [dependencies.frame-support] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.frame-system] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-std] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-runtime] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.frame-benchmarking] optional = true -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dev-dependencies.sp-core] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate/" [dev-dependencies.sp-io] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate/" [features] diff --git a/bridges/modules/ethereum-contract/builtin/Cargo.toml b/bridges/modules/ethereum-contract/builtin/Cargo.toml index 97b497f5ee..ac7b7b80b7 100644 --- a/bridges/modules/ethereum-contract/builtin/Cargo.toml +++ b/bridges/modules/ethereum-contract/builtin/Cargo.toml @@ -10,7 +10,7 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" # General dependencies -codec = { package = "parity-scale-codec", version = "1.3.1" } +codec = { package = "parity-scale-codec", version = "1.3.4" } ethereum-types = "0.9.2" finality-grandpa = "0.12.3" hex = "0.4" @@ -21,29 +21,29 @@ log = "0.4.11" bridge-node-runtime = { path = "../../../bin/node/runtime" } [dependencies.sp-blockchain] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate/" [dependencies.sp-finality-grandpa] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate/" [dependencies.sp-runtime] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate/" [dependencies.sc-finality-grandpa] -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate/" [dev-dependencies] hex = "0.4" [dev-dependencies.sp-core] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate/" diff --git a/bridges/modules/ethereum/Cargo.toml b/bridges/modules/ethereum/Cargo.toml index bde8f95456..affabfe797 100644 --- a/bridges/modules/ethereum/Cargo.toml +++ b/bridges/modules/ethereum/Cargo.toml @@ -8,45 +8,45 @@ license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] bp-eth-poa = { path = "../../primitives/ethereum-poa", default-features = false } -codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false } +codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false } hex-literal = "0.3" serde = { version = "1.0", optional = true } # Substrate Based Dependencies [dependencies.frame-support] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.frame-system] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-std] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-io] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-runtime] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.frame-benchmarking] optional = true -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" diff --git a/bridges/modules/substrate/Cargo.toml b/bridges/modules/substrate/Cargo.toml index 0abae27618..d5ffb159d2 100644 --- a/bridges/modules/substrate/Cargo.toml +++ b/bridges/modules/substrate/Cargo.toml @@ -13,14 +13,14 @@ hash-db = { version = "0.15.2", default-features = false } # Substrate Based Dependencies [dependencies.sp-runtime] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" [dependencies.sp-trie] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate/" diff --git a/bridges/primitives/currency-exchange/Cargo.toml b/bridges/primitives/currency-exchange/Cargo.toml index ff2c98c118..a958f83c43 100644 --- a/bridges/primitives/currency-exchange/Cargo.toml +++ b/bridges/primitives/currency-exchange/Cargo.toml @@ -7,25 +7,25 @@ edition = "2018" license = "GPL-3.0-or-later WITH Classpath-exception-2.0" [dependencies] -codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false } +codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false } # Substrate Based Dependencies [dependencies.sp-api] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate.git" [dependencies.sp-std] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate.git" [dependencies.frame-support] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate.git" diff --git a/bridges/primitives/ethereum-poa/Cargo.toml b/bridges/primitives/ethereum-poa/Cargo.toml index 9beb08892e..95b6fa2132 100644 --- a/bridges/primitives/ethereum-poa/Cargo.toml +++ b/bridges/primitives/ethereum-poa/Cargo.toml @@ -15,7 +15,7 @@ primitive-types = { version = "0.7", default-features = false, features = ["code fixed-hash = { version = "0.5", default-features = false } impl-rlp = { version = "0.2", default-features = false } impl-serde = { version = "0.2.3", optional = true } -codec = { package = "parity-scale-codec", version = "1.3.1", default-features = false } +codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false } rlp = { version = "0.4", default-features = false } hash-db = { version = "0.15.2", default-features = false } triehash = { version = "0.8.2", default-features = false } @@ -23,26 +23,26 @@ plain_hasher = { version = "0.2.2", default-features = false } # Substrate Based Dependencies [dependencies.sp-api] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate.git" [dependencies.sp-std] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate.git" [dependencies.sp-runtime] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate.git" [dependencies.sp-io] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' default-features = false git = "https://github.com/paritytech/substrate.git" diff --git a/bridges/relays/ethereum/Cargo.toml b/bridges/relays/ethereum/Cargo.toml index 856c10788b..e06e31b45c 100644 --- a/bridges/relays/ethereum/Cargo.toml +++ b/bridges/relays/ethereum/Cargo.toml @@ -14,7 +14,7 @@ backoff = "0.2" bp-currency-exchange = { path = "../../primitives/currency-exchange" } bp-eth-poa = { path = "../../primitives/ethereum-poa" } clap = { version = "2.33.3", features = ["yaml"] } -codec = { package = "parity-scale-codec", version = "1.3.1" } +codec = { package = "parity-scale-codec", version = "1.3.4" } env_logger = "0.7.0" ethabi = "12.0" ethabi-contract = "11.0" @@ -43,38 +43,38 @@ features = ["http"] # Substrate Based Dependencies [dependencies.frame-system] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate/" [dependencies.pallet-transaction-payment] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.node-primitives] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sp-core] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sp-keyring] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.sp-runtime] -version = "2.0.0-rc5" -tag = 'v2.0.0-rc5' +version = "2.0.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.substrate-prometheus-endpoint] -version = "0.8.0-rc5" -tag = 'v2.0.0-rc5' +version = "0.8.0-rc6" +tag = 'v2.0.0-rc6' git = "https://github.com/paritytech/substrate.git" [dependencies.bridge-node-runtime]