From 7b30098a12d2b45635a65d4142c5aca78226f5a4 Mon Sep 17 00:00:00 2001 From: Antonio Dropulic Date: Tue, 30 Nov 2021 14:43:43 +0100 Subject: [PATCH] update dependencies (#1229) --- bridges/bin/millau/node/src/chain_spec.rs | 1 - bridges/bin/millau/node/src/command.rs | 10 +- bridges/bin/millau/node/src/service.rs | 186 +++--------------- bridges/bin/millau/runtime/src/lib.rs | 3 - .../rialto-parachain/node/src/chain_spec.rs | 1 - bridges/bin/rialto-parachain/node/src/cli.rs | 3 + .../bin/rialto-parachain/node/src/command.rs | 6 +- .../bin/rialto-parachain/node/src/service.rs | 5 +- bridges/bin/rialto/node/Cargo.toml | 1 - bridges/bin/rialto/node/src/chain_spec.rs | 1 - bridges/bin/rialto/node/src/command.rs | 2 +- bridges/bin/rialto/node/src/overseer.rs | 5 +- bridges/bin/rialto/node/src/service.rs | 13 +- bridges/bin/rialto/runtime/src/lib.rs | 10 +- bridges/bin/rialto/runtime/src/parachains.rs | 4 +- bridges/modules/grandpa/src/lib.rs | 16 +- bridges/modules/grandpa/src/mock.rs | 1 - .../bin-substrate/src/cli/swap_tokens.rs | 3 +- 18 files changed, 60 insertions(+), 211 deletions(-) diff --git a/bridges/bin/millau/node/src/chain_spec.rs b/bridges/bin/millau/node/src/chain_spec.rs index c32291fb3858..05496bb64f63 100644 --- a/bridges/bin/millau/node/src/chain_spec.rs +++ b/bridges/bin/millau/node/src/chain_spec.rs @@ -186,7 +186,6 @@ fn testnet_genesis( GenesisConfig { system: SystemConfig { code: WASM_BINARY.expect("Millau development WASM not available").to_vec(), - changes_trie_config: Default::default(), }, balances: BalancesConfig { balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 50)).collect(), diff --git a/bridges/bin/millau/node/src/command.rs b/bridges/bin/millau/node/src/command.rs index 4285ecaced51..4dbf9575dfec 100644 --- a/bridges/bin/millau/node/src/command.rs +++ b/bridges/bin/millau/node/src/command.rs @@ -20,7 +20,7 @@ use crate::{ service::new_partial, }; use millau_runtime::{Block, RuntimeApi}; -use sc_cli::{ChainSpec, Role, RuntimeVersion, SubstrateCli}; +use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli}; use sc_service::PartialComponents; impl SubstrateCli for Cli { @@ -72,7 +72,7 @@ impl SubstrateCli for Cli { pub fn run() -> sc_cli::Result<()> { let cli = Cli::from_args(); // make sure to set correct crypto version. - sp_core::crypto::set_default_ss58_version(sp_core::crypto::Ss58AddressFormat::Custom( + sp_core::crypto::set_default_ss58_version(sp_core::crypto::Ss58AddressFormat::custom( millau_runtime::SS58Prefix::get() as u16, )); @@ -146,11 +146,7 @@ pub fn run() -> sc_cli::Result<()> { None => { let runner = cli.create_runner(&cli.run)?; runner.run_node_until_exit(|config| async move { - match config.role { - Role::Light => service::new_light(config), - _ => service::new_full(config), - } - .map_err(sc_cli::Error::Service) + service::new_full(config).map_err(sc_cli::Error::Service) }) }, } diff --git a/bridges/bin/millau/node/src/service.rs b/bridges/bin/millau/node/src/service.rs index b8d42f9c7ed3..4085982494b8 100644 --- a/bridges/bin/millau/node/src/service.rs +++ b/bridges/bin/millau/node/src/service.rs @@ -29,10 +29,10 @@ // ===================================================================================== use millau_runtime::{self, opaque::Block, RuntimeApi}; -use sc_client_api::{ExecutorProvider, RemoteBackend}; +use sc_client_api::ExecutorProvider; use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams}; pub use sc_executor::NativeElseWasmExecutor; - +use sc_finality_grandpa::SharedVoterState; use sc_keystore::LocalKeystore; use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; use sc_telemetry::{Telemetry, TelemetryWorker}; @@ -40,13 +40,16 @@ use sp_consensus::SlotData; use sp_consensus_aura::sr25519::AuthorityPair as AuraPair; use std::{sync::Arc, time::Duration}; -type Executor = NativeElseWasmExecutor; - // 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> { millau_runtime::api::dispatch(method, data) @@ -62,7 +65,6 @@ type FullClient = type FullBackend = sc_service::TFullBackend; type FullSelectChain = sc_consensus::LongestChain; -#[allow(clippy::type_complexity)] pub fn new_partial( config: &Configuration, ) -> Result< @@ -86,7 +88,7 @@ pub fn new_partial( ServiceError, > { if config.keystore_remote.is_some() { - return Err(ServiceError::Other("Remote Keystores are not supported.".to_string())) + return Err(ServiceError::Other(format!("Remote Keystores are not supported."))) } let telemetry = config @@ -107,15 +109,15 @@ pub fn new_partial( ); let (client, backend, keystore_container, task_manager) = - sc_service::new_full_parts::( - config, + 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", worker.run()); + task_manager.spawn_handle().spawn("telemetry", None, worker.run()); telemetry }); @@ -175,7 +177,7 @@ pub fn new_partial( }) } -fn remote_keystore(_url: &str) -> Result, &'static str> { +fn remote_keystore(_url: &String) -> Result, &'static str> { // FIXME: here would the concrete keystore be built, // must return a concrete type (NOT `LocalKeystore`) that // implements `CryptoStore` and `SyncCryptoStore` @@ -210,7 +212,7 @@ pub fn new_full(mut config: Configuration) -> Result let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new( backend.clone(), grandpa_link.shared_authority_set().clone(), - vec![], + Vec::default(), )); let (network, system_rpc_tx, network_starter) = @@ -220,7 +222,6 @@ pub fn new_full(mut config: Configuration) -> Result transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), import_queue, - on_demand: None, block_announce_validator_builder: None, warp_sync: Some(warp_sync), })?; @@ -240,7 +241,7 @@ pub fn new_full(mut config: Configuration) -> Result let name = config.network.node_name.clone(); let enable_grandpa = !config.disable_grandpa; let prometheus_registry = config.prometheus_registry().cloned(); - let shared_voter_state = sc_finality_grandpa::SharedVoterState::empty(); + let shared_voter_state = SharedVoterState::empty(); let rpc_extensions_builder = { use sc_finality_grandpa::FinalityProofProvider as GrandpaFinalityProofProvider; @@ -291,8 +292,6 @@ pub fn new_full(mut config: Configuration) -> Result task_manager: &mut task_manager, transaction_pool: transaction_pool.clone(), rpc_extensions_builder, - on_demand: None, - remote_blockchain: None, backend, system_rpc_tx, config, @@ -317,17 +316,18 @@ pub fn new_full(mut config: Configuration) -> Result let aura = sc_consensus_aura::start_aura::( StartAuraParams { slot_duration, - client, + client: client.clone(), select_chain, block_import, proposer_factory, create_inherent_data_providers: move |_, ()| async move { let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_duration( - *timestamp, - raw_slot_duration, - ); + let slot = + sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_duration( + *timestamp, + raw_slot_duration, + ); Ok((timestamp, slot)) }, @@ -345,7 +345,9 @@ pub fn new_full(mut config: Configuration) -> Result // the AURA authoring task is considered essential, i.e. if it // fails we take down the service with it. - task_manager.spawn_essential_handle().spawn_blocking("aura", aura); + task_manager + .spawn_essential_handle() + .spawn_blocking("aura", Some("block-authoring"), aura); } // if the node isn't actively participating in consensus then it doesn't @@ -385,6 +387,7 @@ pub fn new_full(mut config: Configuration) -> Result // if it fails we take down the service with it. task_manager.spawn_essential_handle().spawn_blocking( "grandpa-voter", + None, sc_finality_grandpa::run_grandpa_voter(grandpa_config)?, ); } @@ -392,144 +395,3 @@ pub fn new_full(mut config: Configuration) -> Result network_starter.start_network(); Ok(task_manager) } - -/// Builds a new service for a light client. -pub fn new_light(mut config: Configuration) -> Result { - 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 = NativeElseWasmExecutor::::new( - config.wasm_method, - config.default_heap_pages, - config.max_runtime_instances, - ); - - let (client, backend, keystore_container, mut task_manager, on_demand) = - sc_service::new_light_parts::( - &config, - telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), - executor, - )?; - - let mut telemetry = telemetry.map(|(worker, telemetry)| { - task_manager.spawn_handle().spawn("telemetry", worker.run()); - telemetry - }); - - config.network.extra_sets.push(sc_finality_grandpa::grandpa_peers_set_config()); - - let select_chain = sc_consensus::LongestChain::new(backend.clone()); - - let transaction_pool = Arc::new(sc_transaction_pool::BasicPool::new_light( - config.transaction_pool.clone(), - config.prometheus_registry(), - task_manager.spawn_essential_handle(), - client.clone(), - on_demand.clone(), - )); - - let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( - client.clone(), - &(client.clone() as Arc<_>), - select_chain, - telemetry.as_ref().map(|x| x.handle()), - )?; - - let slot_duration = sc_consensus_aura::slot_duration(&*client)?.slot_duration(); - - let import_queue = - sc_consensus_aura::import_queue::(ImportQueueParams { - block_import: grandpa_block_import.clone(), - justification_import: Some(Box::new(grandpa_block_import)), - client: client.clone(), - create_inherent_data_providers: move |_, ()| async move { - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - - let slot = - sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_duration( - *timestamp, - slot_duration, - ); - - Ok((timestamp, slot)) - }, - spawner: &task_manager.spawn_essential_handle(), - can_author_with: sp_consensus::NeverCanAuthor, - registry: config.prometheus_registry(), - check_for_equivocation: Default::default(), - telemetry: telemetry.as_ref().map(|x| x.handle()), - })?; - - let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new( - backend.clone(), - grandpa_link.shared_authority_set().clone(), - vec![], - )); - - let (network, 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, - warp_sync: Some(warp_sync), - })?; - - if config.offchain_worker.enabled { - sc_service::build_offchain_workers( - &config, - task_manager.spawn_handle(), - client.clone(), - network.clone(), - ); - } - - let enable_grandpa = !config.disable_grandpa; - if enable_grandpa { - let name = config.network.node_name.clone(); - - let config = sc_finality_grandpa::Config { - gossip_duration: std::time::Duration::from_millis(333), - justification_period: 512, - name: Some(name), - observer_enabled: false, - keystore: None, - local_role: config.role.clone(), - telemetry: telemetry.as_ref().map(|x| x.handle()), - }; - - task_manager.spawn_handle().spawn_blocking( - "grandpa-observer", - sc_finality_grandpa::run_grandpa_observer(config, grandpa_link, network.clone())?, - ); - } - - sc_service::spawn_tasks(sc_service::SpawnTasksParams { - remote_blockchain: Some(backend.remote_blockchain()), - transaction_pool, - task_manager: &mut task_manager, - on_demand: Some(on_demand), - rpc_extensions_builder: Box::new(|_, _| Ok(())), - config, - client, - keystore: keystore_container.sync_keystore(), - backend, - network, - system_rpc_tx, - telemetry: telemetry.as_mut(), - })?; - - network_starter.start_network(); - Ok(task_manager) -} diff --git a/bridges/bin/millau/runtime/src/lib.rs b/bridges/bin/millau/runtime/src/lib.rs index 4e486c267010..b713211b1e48 100644 --- a/bridges/bin/millau/runtime/src/lib.rs +++ b/bridges/bin/millau/runtime/src/lib.rs @@ -100,9 +100,6 @@ pub type Hash = bp_millau::Hash; /// Hashing algorithm used by the chain. pub type Hashing = bp_millau::Hasher; -/// Digest item type. -pub type DigestItem = generic::DigestItem; - /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know /// the specifics of the runtime. They can then be made to be agnostic over specific formats /// of data like extrinsics, allowing for them to continue syncing the network through upgrades diff --git a/bridges/bin/rialto-parachain/node/src/chain_spec.rs b/bridges/bin/rialto-parachain/node/src/chain_spec.rs index f93887a21e47..52012423fb71 100644 --- a/bridges/bin/rialto-parachain/node/src/chain_spec.rs +++ b/bridges/bin/rialto-parachain/node/src/chain_spec.rs @@ -151,7 +151,6 @@ fn testnet_genesis( code: rialto_parachain_runtime::WASM_BINARY .expect("WASM binary was not build, please build it!") .to_vec(), - changes_trie_config: Default::default(), }, balances: rialto_parachain_runtime::BalancesConfig { balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), diff --git a/bridges/bin/rialto-parachain/node/src/cli.rs b/bridges/bin/rialto-parachain/node/src/cli.rs index bc2238e2fd44..78c05f90c880 100644 --- a/bridges/bin/rialto-parachain/node/src/cli.rs +++ b/bridges/bin/rialto-parachain/node/src/cli.rs @@ -103,6 +103,9 @@ pub struct Cli { #[structopt(subcommand)] pub subcommand: Option, + #[structopt(long)] + pub parachain_id: Option, + #[structopt(flatten)] pub run: cumulus_client_cli::RunCmd, diff --git a/bridges/bin/rialto-parachain/node/src/command.rs b/bridges/bin/rialto-parachain/node/src/command.rs index eb9aba2c104b..e4f52cc026a7 100644 --- a/bridges/bin/rialto-parachain/node/src/command.rs +++ b/bridges/bin/rialto-parachain/node/src/command.rs @@ -77,7 +77,7 @@ impl SubstrateCli for Cli { } fn load_spec(&self, id: &str) -> std::result::Result, String> { - load_spec(id, self.run.parachain_id.unwrap_or(2000).into()) + load_spec(id, self.parachain_id.unwrap_or(2000).into()) } fn native_runtime_version(_: &Box) -> &'static RuntimeVersion { @@ -153,7 +153,7 @@ macro_rules! construct_async_run { /// Parse command line arguments into service configuration. pub fn run() -> Result<()> { let cli = Cli::from_args(); - sp_core::crypto::set_default_ss58_version(sp_core::crypto::Ss58AddressFormat::Custom( + sp_core::crypto::set_default_ss58_version(sp_core::crypto::Ss58AddressFormat::custom( rialto_parachain_runtime::SS58Prefix::get() as u16, )); @@ -273,7 +273,7 @@ pub fn run() -> Result<()> { [RelayChainCli::executable_name()].iter().chain(cli.relaychain_args.iter()), ); - let id = ParaId::from(cli.run.parachain_id.or(para_id).expect("Missing ParaId")); + let id = ParaId::from(cli.parachain_id.or(para_id).expect("Missing ParaId")); let parachain_account = AccountIdConversion::::into_account(&id); diff --git a/bridges/bin/rialto-parachain/node/src/service.rs b/bridges/bin/rialto-parachain/node/src/service.rs index 65a8e7bb65c5..bd3afca30744 100644 --- a/bridges/bin/rialto-parachain/node/src/service.rs +++ b/bridges/bin/rialto-parachain/node/src/service.rs @@ -147,7 +147,7 @@ where let telemetry_worker_handle = telemetry.as_ref().map(|(worker, _)| worker.handle()); let telemetry = telemetry.map(|(worker, telemetry)| { - task_manager.spawn_handle().spawn("telemetry", worker.run()); + task_manager.spawn_handle().spawn("telemetry", None, worker.run()); telemetry }); @@ -283,7 +283,6 @@ where transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), import_queue: import_queue.clone(), - on_demand: None, block_announce_validator_builder: Some(Box::new(|_| block_announce_validator)), warp_sync: None, })?; @@ -292,8 +291,6 @@ where let rpc_extensions_builder = Box::new(move |_, _| Ok(rpc_ext_builder(rpc_client.clone()))); sc_service::spawn_tasks(sc_service::SpawnTasksParams { - on_demand: None, - remote_blockchain: None, rpc_extensions_builder, client: client.clone(), transaction_pool: transaction_pool.clone(), diff --git a/bridges/bin/rialto/node/Cargo.toml b/bridges/bin/rialto/node/Cargo.toml index 75be9bcd9fb7..fd76fbf9a617 100644 --- a/bridges/bin/rialto/node/Cargo.toml +++ b/bridges/bin/rialto/node/Cargo.toml @@ -88,7 +88,6 @@ polkadot-node-core-bitfield-signing = { git = "https://github.com/paritytech/pol polkadot-node-core-candidate-validation = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-node-core-chain-api = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-node-core-chain-selection = { git = "https://github.com/paritytech/polkadot", branch = "master" } -polkadot-node-core-dispute-participation = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-node-core-parachains-inherent = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-node-core-provisioner = { git = "https://github.com/paritytech/polkadot", branch = "master" } polkadot-node-core-pvf = { git = "https://github.com/paritytech/polkadot", branch = "master" } diff --git a/bridges/bin/rialto/node/src/chain_spec.rs b/bridges/bin/rialto/node/src/chain_spec.rs index 49f77c9bc6a8..cadacad72da9 100644 --- a/bridges/bin/rialto/node/src/chain_spec.rs +++ b/bridges/bin/rialto/node/src/chain_spec.rs @@ -207,7 +207,6 @@ fn testnet_genesis( GenesisConfig { system: SystemConfig { code: WASM_BINARY.expect("Rialto development WASM not available").to_vec(), - changes_trie_config: Default::default(), }, balances: BalancesConfig { balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 50)).collect(), diff --git a/bridges/bin/rialto/node/src/command.rs b/bridges/bin/rialto/node/src/command.rs index 6f841a9d67f1..7be615a57760 100644 --- a/bridges/bin/rialto/node/src/command.rs +++ b/bridges/bin/rialto/node/src/command.rs @@ -70,7 +70,7 @@ impl SubstrateCli for Cli { /// Parse and run command line arguments pub fn run() -> sc_cli::Result<()> { let cli = Cli::from_args(); - sp_core::crypto::set_default_ss58_version(sp_core::crypto::Ss58AddressFormat::Custom( + sp_core::crypto::set_default_ss58_version(sp_core::crypto::Ss58AddressFormat::custom( rialto_runtime::SS58Prefix::get() as u16, )); diff --git a/bridges/bin/rialto/node/src/overseer.rs b/bridges/bin/rialto/node/src/overseer.rs index 17f7edce2a31..9a7025e77c9b 100644 --- a/bridges/bin/rialto/node/src/overseer.rs +++ b/bridges/bin/rialto/node/src/overseer.rs @@ -63,8 +63,7 @@ pub use polkadot_node_core_candidate_validation::CandidateValidationSubsystem; pub use polkadot_node_core_chain_api::ChainApiSubsystem; pub use polkadot_node_core_chain_selection::ChainSelectionSubsystem; pub use polkadot_node_core_dispute_coordinator::DisputeCoordinatorSubsystem; -pub use polkadot_node_core_dispute_participation::DisputeParticipationSubsystem; -pub use polkadot_node_core_provisioner::ProvisioningSubsystem as ProvisionerSubsystem; +pub use polkadot_node_core_provisioner::ProvisionerSubsystem; pub use polkadot_node_core_runtime_api::RuntimeApiSubsystem; pub use polkadot_statement_distribution::StatementDistribution as StatementDistributionSubsystem; @@ -160,7 +159,6 @@ pub fn prepared_overseer_builder( ApprovalVotingSubsystem, GossipSupportSubsystem, DisputeCoordinatorSubsystem, - DisputeParticipationSubsystem, DisputeDistributionSubsystem, ChainSelectionSubsystem, >, @@ -249,7 +247,6 @@ where keystore.clone(), Metrics::register(registry)?, )) - .dispute_participation(DisputeParticipationSubsystem::new()) .dispute_distribution(DisputeDistributionSubsystem::new( keystore, dispute_req_receiver, diff --git a/bridges/bin/rialto/node/src/service.rs b/bridges/bin/rialto/node/src/service.rs index e2e811eaa67f..fb774d86cca9 100644 --- a/bridges/bin/rialto/node/src/service.rs +++ b/bridges/bin/rialto/node/src/service.rs @@ -226,7 +226,7 @@ where let client = Arc::new(client); let telemetry = telemetry.map(|(worker, telemetry)| { - task_manager.spawn_handle().spawn("telemetry", worker.run()); + task_manager.spawn_handle().spawn("telemetry", None, worker.run()); telemetry }); @@ -474,7 +474,6 @@ where transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), import_queue, - on_demand: None, block_announce_validator_builder: None, warp_sync: Some(warp_sync), })?; @@ -533,8 +532,6 @@ where rpc_extensions_builder: Box::new(rpc_extensions_builder), transaction_pool: transaction_pool.clone(), task_manager: &mut task_manager, - on_demand: None, - remote_blockchain: None, system_rpc_tx, telemetry: telemetry.as_mut(), })?; @@ -574,7 +571,9 @@ where prometheus_registry.clone(), ); - task_manager.spawn_handle().spawn("authority-discovery-worker", worker.run()); + task_manager + .spawn_handle() + .spawn("authority-discovery-worker", None, worker.run()); Some(service) } else { None @@ -619,6 +618,7 @@ where let handle = handle.clone(); task_manager.spawn_essential_handle().spawn_blocking( "overseer", + None, Box::pin(async move { use futures::{pin_mut, select, FutureExt}; @@ -705,7 +705,7 @@ where }; let babe = sc_consensus_babe::start_babe(babe_config)?; - task_manager.spawn_essential_handle().spawn_blocking("babe", babe); + task_manager.spawn_essential_handle().spawn_blocking("babe", None, babe); } // if the node isn't actively participating in consensus then it doesn't @@ -751,6 +751,7 @@ where task_manager.spawn_essential_handle().spawn_blocking( "grandpa-voter", + None, sc_finality_grandpa::run_grandpa_voter(grandpa_config)?, ); } diff --git a/bridges/bin/rialto/runtime/src/lib.rs b/bridges/bin/rialto/runtime/src/lib.rs index aae9aa21c2fa..5e7e47490d58 100644 --- a/bridges/bin/rialto/runtime/src/lib.rs +++ b/bridges/bin/rialto/runtime/src/lib.rs @@ -101,9 +101,6 @@ pub type Hash = bp_rialto::Hash; /// Hashing algorithm used by the chain. pub type Hashing = bp_rialto::Hasher; -/// Digest item type. -pub type DigestItem = generic::DigestItem; - /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know /// the specifics of the runtime. They can then be made to be agnostic over specific formats /// of data like extrinsics, allowing for them to continue syncing the network through upgrades @@ -675,6 +672,13 @@ impl_runtime_apis! { polkadot_runtime_parachains::runtime_api_impl::v1::persisted_validation_data::(para_id, assumption) } + fn assumed_validation_data( + para_id: polkadot_primitives::v1::Id, + expected_persisted_validation_data_hash: Hash, + ) -> Option<(polkadot_primitives::v1::PersistedValidationData, polkadot_primitives::v1::ValidationCodeHash)> { + polkadot_runtime_parachains::runtime_api_impl::v1::assumed_validation_data::(para_id, expected_persisted_validation_data_hash) + } + fn check_validation_outputs( para_id: polkadot_primitives::v1::Id, outputs: polkadot_primitives::v1::CandidateCommitments, diff --git a/bridges/bin/rialto/runtime/src/parachains.rs b/bridges/bin/rialto/runtime/src/parachains.rs index 9a2f85460153..332a3387ac69 100644 --- a/bridges/bin/rialto/runtime/src/parachains.rs +++ b/bridges/bin/rialto/runtime/src/parachains.rs @@ -71,7 +71,9 @@ impl parachains_paras::Config for Runtime { type WeightInfo = parachains_paras::TestWeightInfo; } -impl parachains_paras_inherent::Config for Runtime {} +impl parachains_paras_inherent::Config for Runtime { + type WeightInfo = parachains_paras_inherent::TestWeightInfo; +} impl parachains_scheduler::Config for Runtime {} diff --git a/bridges/modules/grandpa/src/lib.rs b/bridges/modules/grandpa/src/lib.rs index 4e57a45292d3..cbc85da30259 100644 --- a/bridges/modules/grandpa/src/lib.rs +++ b/bridges/modules/grandpa/src/lib.rs @@ -620,9 +620,7 @@ pub fn initialize_for_benchmarks, I: 'static>(header: BridgedHeader #[cfg(test)] mod tests { use super::*; - use crate::mock::{ - run_test, test_header, Origin, TestHash, TestHeader, TestNumber, TestRuntime, - }; + use crate::mock::{run_test, test_header, Origin, TestHeader, TestNumber, TestRuntime}; use bp_test_utils::{ authority_list, make_default_justification, make_justification_for_header, JustificationGeneratorParams, ALICE, BOB, @@ -672,19 +670,17 @@ mod tests { let _ = Pallet::::on_initialize(current_number); } - fn change_log(delay: u64) -> Digest { + fn change_log(delay: u64) -> Digest { let consensus_log = ConsensusLog::::ScheduledChange(sp_finality_grandpa::ScheduledChange { next_authorities: vec![(ALICE.into(), 1), (BOB.into(), 1)], delay, }); - Digest:: { - logs: vec![DigestItem::Consensus(GRANDPA_ENGINE_ID, consensus_log.encode())], - } + Digest { logs: vec![DigestItem::Consensus(GRANDPA_ENGINE_ID, consensus_log.encode())] } } - fn forced_change_log(delay: u64) -> Digest { + fn forced_change_log(delay: u64) -> Digest { let consensus_log = ConsensusLog::::ForcedChange( delay, sp_finality_grandpa::ScheduledChange { @@ -693,9 +689,7 @@ mod tests { }, ); - Digest:: { - logs: vec![DigestItem::Consensus(GRANDPA_ENGINE_ID, consensus_log.encode())], - } + Digest { logs: vec![DigestItem::Consensus(GRANDPA_ENGINE_ID, consensus_log.encode())] } } #[test] diff --git a/bridges/modules/grandpa/src/mock.rs b/bridges/modules/grandpa/src/mock.rs index 183a56779156..f8b5e269323f 100644 --- a/bridges/modules/grandpa/src/mock.rs +++ b/bridges/modules/grandpa/src/mock.rs @@ -29,7 +29,6 @@ use sp_runtime::{ pub type AccountId = u64; pub type TestHeader = crate::BridgedHeader; pub type TestNumber = crate::BridgedBlockNumber; -pub type TestHash = crate::BridgedBlockHash; type Block = frame_system::mocking::MockBlock; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; diff --git a/bridges/relays/bin-substrate/src/cli/swap_tokens.rs b/bridges/relays/bin-substrate/src/cli/swap_tokens.rs index aa3996aa4136..dbe46f469070 100644 --- a/bridges/relays/bin-substrate/src/cli/swap_tokens.rs +++ b/bridges/relays/bin-substrate/src/cli/swap_tokens.rs @@ -401,7 +401,8 @@ impl SwapTokens { .await?; if token_swap_state != None { return Err(anyhow::format_err!( - "Confirmed token swap state has been changed to {:?} unexpectedly" + "Confirmed token swap state has been changed to {:?} unexpectedly", + token_swap_state )) } } else {