From fdcf43d2a3e3dfa8195edadd7e91b83481e853a0 Mon Sep 17 00:00:00 2001 From: Theodore Bugnet Date: Tue, 11 Oct 2022 16:21:48 +0100 Subject: [PATCH] chore: update to polkadot 0.9.29 Includes refactor to opaque weights (weights v1.5) --- Cargo.lock | 116 ++++++------------ Cargo.toml | 1 + crates/democracy/src/tests.rs | 2 +- parachain/runtime/runtime-tests/Cargo.toml | 5 +- .../relaychain/kusama_cross_chain_transfer.rs | 13 +- .../src/relaychain/kusama_test_net.rs | 6 +- .../polkadot_cross_chain_transfer.rs | 25 ++-- .../src/relaychain/polkadot_test_net.rs | 8 +- parachain/src/command.rs | 10 +- parachain/src/service.rs | 18 ++- standalone/runtime/tests/test_issue.rs | 1 - standalone/runtime/tests/test_multisig.rs | 14 +-- 12 files changed, 84 insertions(+), 135 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 97706d2bbe..18efaec2b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7127,8 +7127,8 @@ dependencies = [ "vault-registry", "xcm", "xcm-builder", - "xcm-emulator", "xcm-executor", + "xcm-simulator", ] [[package]] @@ -7668,7 +7668,7 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "sc-network", - "sc-network-common 0.10.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29)", + "sc-network-common", "sp-consensus", "thiserror", "tracing-gum", @@ -8480,7 +8480,7 @@ dependencies = [ "sc-finality-grandpa", "sc-keystore", "sc-network", - "sc-network-common 0.10.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29)", + "sc-network-common", "sc-offchain", "sc-service", "sc-sync-state-rpc", @@ -9590,7 +9590,7 @@ dependencies = [ "prost-build", "rand 0.7.3", "sc-client-api", - "sc-network-common 0.10.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", + "sc-network-common", "sp-api", "sp-authority-discovery", "sp-blockchain", @@ -9649,7 +9649,7 @@ dependencies = [ "memmap2", "parity-scale-codec", "sc-chain-spec-derive", - "sc-network-common 0.10.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", + "sc-network-common", "sc-telemetry", "serde", "serde_json", @@ -10051,7 +10051,7 @@ dependencies = [ "sc-consensus", "sc-keystore", "sc-network", - "sc-network-common 0.10.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", + "sc-network-common", "sc-network-gossip", "sc-telemetry", "sc-utils", @@ -10101,7 +10101,7 @@ dependencies = [ "log", "parity-util-mem", "sc-client-api", - "sc-network-common 0.10.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", + "sc-network-common", "sc-transaction-pool-api", "sp-blockchain", "sp-runtime", @@ -10153,8 +10153,8 @@ dependencies = [ "sc-block-builder", "sc-client-api", "sc-consensus", - "sc-network-common 0.10.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", - "sc-peerset 4.0.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", + "sc-network-common", + "sc-peerset", "sc-utils", "serde", "serde_json", @@ -10184,30 +10184,7 @@ dependencies = [ "parity-scale-codec", "prost-build", "sc-consensus", - "sc-peerset 4.0.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", - "serde", - "smallvec", - "sp-blockchain", - "sp-consensus", - "sp-finality-grandpa", - "sp-runtime", - "thiserror", -] - -[[package]] -name = "sc-network-common" -version = "0.10.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" -dependencies = [ - "async-trait", - "bitflags", - "bytes", - "futures", - "libp2p", - "parity-scale-codec", - "prost-build", - "sc-consensus", - "sc-peerset 4.0.0-dev (git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29)", + "sc-peerset", "serde", "smallvec", "sp-blockchain", @@ -10228,8 +10205,8 @@ dependencies = [ "libp2p", "log", "lru 0.7.8", - "sc-network-common 0.10.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", - "sc-peerset 4.0.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", + "sc-network-common", + "sc-peerset", "sp-runtime", "substrate-prometheus-endpoint", "tracing", @@ -10248,8 +10225,8 @@ dependencies = [ "prost", "prost-build", "sc-client-api", - "sc-network-common 0.10.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", - "sc-peerset 4.0.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", + "sc-network-common", + "sc-peerset", "sp-blockchain", "sp-core", "sp-runtime", @@ -10272,8 +10249,8 @@ dependencies = [ "prost-build", "sc-client-api", "sc-consensus", - "sc-network-common 0.10.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", - "sc-peerset 4.0.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", + "sc-network-common", + "sc-peerset", "smallvec", "sp-arithmetic", "sp-blockchain", @@ -10303,8 +10280,8 @@ dependencies = [ "parking_lot 0.12.1", "rand 0.7.3", "sc-client-api", - "sc-network-common 0.10.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", - "sc-peerset 4.0.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", + "sc-network-common", + "sc-peerset", "sc-utils", "sp-api", "sp-core", @@ -10327,19 +10304,6 @@ dependencies = [ "wasm-timer", ] -[[package]] -name = "sc-peerset" -version = "4.0.0-dev" -source = "git+https://github.com/paritytech/substrate?branch=polkadot-v0.9.29#cc370aa61e15c18d23a2f686b812fd576a630afe" -dependencies = [ - "futures", - "libp2p", - "log", - "sc-utils", - "serde_json", - "wasm-timer", -] - [[package]] name = "sc-proposer-metrics" version = "0.10.0-dev" @@ -10442,7 +10406,7 @@ dependencies = [ "sc-informant", "sc-keystore", "sc-network", - "sc-network-common 0.10.0-dev (git+https://github.com/paritytech//substrate?branch=polkadot-v0.9.29)", + "sc-network-common", "sc-network-light", "sc-network-sync", "sc-offchain", @@ -13665,31 +13629,6 @@ dependencies = [ "xcm-executor", ] -[[package]] -name = "xcm-emulator" -version = "0.1.0" -source = "git+https://github.com/shaunxw/xcm-simulator?rev=ab5cd6c5fabe6ddda52ed6803ee1bf54c258fefe#ab5cd6c5fabe6ddda52ed6803ee1bf54c258fefe" -dependencies = [ - "cumulus-pallet-dmp-queue", - "cumulus-pallet-parachain-system", - "cumulus-pallet-xcmp-queue", - "cumulus-primitives-core", - "cumulus-primitives-parachain-inherent", - "cumulus-test-relay-sproof-builder", - "frame-support", - "frame-system", - "parachain-info", - "parity-scale-codec", - "paste", - "polkadot-primitives", - "polkadot-runtime-parachains", - "quote", - "sp-io", - "sp-std", - "xcm", - "xcm-executor", -] - [[package]] name = "xcm-executor" version = "0.9.29" @@ -13719,6 +13658,23 @@ dependencies = [ "syn", ] +[[package]] +name = "xcm-simulator" +version = "0.9.29" +source = "git+https://github.com/paritytech/polkadot?branch=release-v0.9.29#94078b44fb6c9767bf60ffcaaa3be40681be5a76" +dependencies = [ + "frame-support", + "parity-scale-codec", + "paste", + "polkadot-core-primitives", + "polkadot-parachain", + "polkadot-runtime-parachains", + "sp-io", + "sp-std", + "xcm", + "xcm-executor", +] + [[package]] name = "yamux" version = "0.10.2" diff --git a/Cargo.toml b/Cargo.toml index 00dccb1ff9..2d3b42b79f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -98,6 +98,7 @@ sc-informant = { git = "https://github.com/paritytech//substrate", branch = "pol sc-keystore = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.29" } sc-network = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.29" } sc-network-gossip = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.29" } +sc-network-common = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.29" } sc-offchain = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.29" } sc-rpc = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.29" } sc-rpc-api = { git = "https://github.com/paritytech//substrate", branch = "polkadot-v0.9.29" } diff --git a/crates/democracy/src/tests.rs b/crates/democracy/src/tests.rs index b7a8bd676f..d38e734881 100644 --- a/crates/democracy/src/tests.rs +++ b/crates/democracy/src/tests.rs @@ -53,7 +53,7 @@ impl Contains for BaseFilter { parameter_types! { pub const BlockHashCount: u64 = 250; pub BlockWeights: frame_system::limits::BlockWeights = - frame_system::limits::BlockWeights::simple_max(1_000_000); + frame_system::limits::BlockWeights::simple_max(Weight::from_ref_time(1_000_000 as u64)); } impl frame_system::Config for Test { type BaseCallFilter = BaseFilter; diff --git a/parachain/runtime/runtime-tests/Cargo.toml b/parachain/runtime/runtime-tests/Cargo.toml index d2930a78d8..c618ef1ef3 100644 --- a/parachain/runtime/runtime-tests/Cargo.toml +++ b/parachain/runtime/runtime-tests/Cargo.toml @@ -77,6 +77,7 @@ polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "r xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } xcm-builder = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } xcm-executor = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } +xcm-simulator = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } pallet-xcm = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.29", default-features = false } # Parachain dependencies @@ -121,8 +122,6 @@ orml-xcm = { git = "https://github.com/open-web3-stack/open-runtime-module-libra orml-xcm-support = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "44fda4432b71f49ee59a650cf4775db895ab97af", default-features = false } orml-unknown-tokens = { git = "https://github.com/open-web3-stack/open-runtime-module-library", rev = "44fda4432b71f49ee59a650cf4775db895ab97af", default-features = false } -xcm-emulator = { git = "https://github.com/shaunxw/xcm-simulator", rev = "ab5cd6c5fabe6ddda52ed6803ee1bf54c258fefe" } - [dev-dependencies] hex = '0.4.2' mocktopus = '0.7.0' @@ -199,7 +198,7 @@ std = [ "interlay-runtime-parachain/std", "testnet-kintsugi-runtime-parachain/std", "testnet-interlay-runtime-parachain/std", - + "btc-relay/std", "currency/std", "security/std", diff --git a/parachain/runtime/runtime-tests/src/relaychain/kusama_cross_chain_transfer.rs b/parachain/runtime/runtime-tests/src/relaychain/kusama_cross_chain_transfer.rs index 29a0dcb4bb..8003ea62f9 100644 --- a/parachain/runtime/runtime-tests/src/relaychain/kusama_cross_chain_transfer.rs +++ b/parachain/runtime/runtime-tests/src/relaychain/kusama_cross_chain_transfer.rs @@ -1,16 +1,19 @@ use crate::relaychain::kusama_test_net::*; use codec::Encode; -use frame_support::{assert_ok, weights::WeightToFee}; +use frame_support::{ + assert_ok, + weights::{Weight as FrameWeight, WeightToFee}, +}; use orml_traits::MultiCurrency; use primitives::{ CurrencyId::{ForeignAsset, Token}, CustomMetadata, }; use sp_runtime::{FixedPointNumber, FixedU128}; -use xcm::latest::prelude::*; +use xcm::latest::{prelude::*, Weight}; use xcm_builder::ParentIsPreset; -use xcm_emulator::{TestExt, XcmExecutor}; use xcm_executor::traits::Convert; +use xcm_simulator::{TestExt, XcmExecutor}; mod fees { use super::*; @@ -18,7 +21,7 @@ mod fees { // N * unit_weight * (weight/10^12) * token_per_second fn weight_calculation(instruction_count: u32, unit_weight: Weight, per_second: u128) -> u128 { let weight = unit_weight.saturating_mul(instruction_count as u64); - let weight_ratio = FixedU128::saturating_from_rational(weight as u128, WEIGHT_PER_SECOND as u128); + let weight_ratio = FixedU128::saturating_from_rational(weight as u128, WEIGHT_PER_SECOND.ref_time() as u128); weight_ratio.saturating_mul_int(per_second) } @@ -229,7 +232,7 @@ fn transfer_to_relay_chain() { }); KusamaNet::execute_with(|| { - let used_weight = 298_368_000; // the actual weight of the sent message + let used_weight = FrameWeight::from_ref_time(298_368_000); // the actual weight of the sent message let fee = ::WeightToFee::weight_to_fee(&used_weight); assert_eq!( diff --git a/parachain/runtime/runtime-tests/src/relaychain/kusama_test_net.rs b/parachain/runtime/runtime-tests/src/relaychain/kusama_test_net.rs index 993814f696..643d0c20cb 100644 --- a/parachain/runtime/runtime-tests/src/relaychain/kusama_test_net.rs +++ b/parachain/runtime/runtime-tests/src/relaychain/kusama_test_net.rs @@ -7,7 +7,7 @@ pub use primitives::{ TokenSymbol::{KINT, KSM}, }; use sp_runtime::traits::AccountIdConversion; -use xcm_emulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; +use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; pub const KINTSUGI_PARA_ID: u32 = 2092; pub const SIBLING_PARA_ID: u32 = 2001; @@ -23,7 +23,6 @@ decl_test_relay_chain! { decl_test_parachain! { pub struct Kintsugi { Runtime = Runtime, - Origin = Origin, XcmpMessageHandler = kintsugi_runtime_parachain::XcmpQueue, DmpMessageHandler = kintsugi_runtime_parachain::DmpQueue, new_ext = para_ext(KINTSUGI_PARA_ID), @@ -33,7 +32,6 @@ decl_test_parachain! { decl_test_parachain! { pub struct Sibling { Runtime = testnet_kintsugi_runtime_parachain::Runtime, - Origin = testnet_kintsugi_runtime_parachain::Origin, XcmpMessageHandler = testnet_kintsugi_runtime_parachain::XcmpQueue, DmpMessageHandler = testnet_kintsugi_runtime_parachain::DmpQueue, new_ext = para_ext(SIBLING_PARA_ID), @@ -66,7 +64,7 @@ fn default_parachains_host_configuration() -> HostConfiguration { max_upward_queue_count: 8, max_upward_queue_size: 1024 * 1024, max_downward_message_size: 1024, - ump_service_total_weight: 4 * 1_000_000_000, + ump_service_total_weight: Weight::from_ref_time(4 * 1_000_000_000 as u64), max_upward_message_size: 50 * 1024, max_upward_message_num_per_candidate: 5, hrmp_sender_deposit: 5_000_000_000_000, diff --git a/parachain/runtime/runtime-tests/src/relaychain/polkadot_cross_chain_transfer.rs b/parachain/runtime/runtime-tests/src/relaychain/polkadot_cross_chain_transfer.rs index 2d7617d1f5..1530efcea1 100644 --- a/parachain/runtime/runtime-tests/src/relaychain/polkadot_cross_chain_transfer.rs +++ b/parachain/runtime/runtime-tests/src/relaychain/polkadot_cross_chain_transfer.rs @@ -1,21 +1,24 @@ use crate::relaychain::polkadot_test_net::*; use codec::Encode; -use frame_support::{assert_ok, weights::WeightToFee}; +use frame_support::{ + assert_ok, + weights::{Weight as FrameWeight, WeightToFee}, +}; use orml_traits::MultiCurrency; use primitives::{ CurrencyId::{ForeignAsset, Token}, CustomMetadata, }; -use xcm::latest::prelude::*; +use xcm::latest::{prelude::*, Weight}; use xcm_builder::ParentIsPreset; -use xcm_emulator::{TestExt, XcmExecutor}; use xcm_executor::traits::{Convert, WeightBounds}; +use xcm_simulator::{TestExt, XcmExecutor}; mod hrmp { use super::*; use polkadot_runtime_parachains::hrmp; - fn construct_xcm(call: hrmp::Call, xcm_fee: u128, transact_weight: u64) -> Xcm<()> { + fn construct_xcm(call: hrmp::Call, xcm_fee: u128, transact_weight: Weight) -> Xcm<()> { Xcm(vec![ WithdrawAsset((Here, xcm_fee).into()), BuyExecution { @@ -71,7 +74,7 @@ mod hrmp { }) } - fn init_open_channel(sender: u32, recipient: u32, xcm_fee: u128, transact_weight: u64) + fn init_open_channel(sender: u32, recipient: u32, xcm_fee: u128, transact_weight: Weight) where T: TestExt, { @@ -94,7 +97,7 @@ mod hrmp { assert!(has_open_channel_requested_event(sender, recipient)); } - fn accept_open_channel(sender: u32, recipient: u32, xcm_fee: u128, transact_weight: u64) + fn accept_open_channel(sender: u32, recipient: u32, xcm_fee: u128, transact_weight: Weight) where T: TestExt, { @@ -221,7 +224,7 @@ fn transfer_to_relay_chain() { )); }); - let used_weight = 4_000_000_000; // The value used in UI - very conservative: actually used at time of writing = 298_368_000 + let used_weight = FrameWeight::from_ref_time(4_000_000_000 as u64); // The value used in UI - very conservative: actually used at time of writing = 298_368_000 Interlay::execute_with(|| { assert_ok!(XTokens::transfer( @@ -238,7 +241,7 @@ fn transfer_to_relay_chain() { ) .into() ), - used_weight + used_weight.ref_time() )); }); @@ -344,7 +347,7 @@ fn transfer_to_sibling_and_back() { Interlay::execute_with(|| { let used_weight = 800_000_000; // empirically determined in test - weight is decreased in AllowTopLevelPaidExecutionFrom let intr_per_second = interlay_runtime_parachain::xcm_config::CanonicalizedIntrPerSecond::get().1; - let xcm_fee = (intr_per_second * used_weight) / WEIGHT_PER_SECOND as u128; + let xcm_fee = (intr_per_second * used_weight) / WEIGHT_PER_SECOND.ref_time() as u128; assert_eq!( Tokens::free_balance(Token(INTR), &AccountId::from(ALICE)), @@ -382,7 +385,7 @@ fn xcm_transfer_execution_barrier_trader_works() { let weight_limit_too_low = 500_000_000; let unit_instruction_weight = 200_000_000; let minimum_fee = (interlay_runtime_parachain::xcm_config::DotPerSecond::get().1 * expect_weight_limit as u128) - / WEIGHT_PER_SECOND as u128; + / WEIGHT_PER_SECOND.ref_time() as u128; // relay-chain use normal account to send xcm, destination parachain can't pass Barrier check let message = construct_xcm(100, Unlimited); @@ -513,7 +516,7 @@ fn subscribe_version_notify_works() { fn weigh_xcm(mut message: Xcm, fee_per_second: u128) -> u128 { let trapped_xcm_message_weight = ::Weigher::weight( &mut message).unwrap(); - (fee_per_second * trapped_xcm_message_weight as u128) / WEIGHT_PER_SECOND as u128 + (fee_per_second * trapped_xcm_message_weight as u128) / WEIGHT_PER_SECOND.ref_time() as u128 } #[test] fn trap_assets_works() { diff --git a/parachain/runtime/runtime-tests/src/relaychain/polkadot_test_net.rs b/parachain/runtime/runtime-tests/src/relaychain/polkadot_test_net.rs index fe9887932e..7629fccb23 100644 --- a/parachain/runtime/runtime-tests/src/relaychain/polkadot_test_net.rs +++ b/parachain/runtime/runtime-tests/src/relaychain/polkadot_test_net.rs @@ -7,7 +7,7 @@ pub use primitives::{ TokenSymbol::{DOT, INTR}, }; use sp_runtime::traits::AccountIdConversion; -use xcm_emulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; +use xcm_simulator::{decl_test_network, decl_test_parachain, decl_test_relay_chain}; pub const INTERLAY_PARA_ID: u32 = 2032; pub const SIBLING_PARA_ID: u32 = 2001; @@ -23,7 +23,6 @@ decl_test_relay_chain! { decl_test_parachain! { pub struct Interlay { Runtime = Runtime, - Origin = Origin, XcmpMessageHandler = interlay_runtime_parachain::XcmpQueue, DmpMessageHandler = interlay_runtime_parachain::DmpQueue, new_ext = para_ext(INTERLAY_PARA_ID), @@ -33,7 +32,6 @@ decl_test_parachain! { decl_test_parachain! { pub struct Sibling { Runtime = testnet_interlay_runtime_parachain::Runtime, - Origin = testnet_interlay_runtime_parachain::Origin, XcmpMessageHandler = testnet_interlay_runtime_parachain::XcmpQueue, DmpMessageHandler = testnet_interlay_runtime_parachain::DmpQueue, new_ext = para_ext(SIBLING_PARA_ID), @@ -64,7 +62,7 @@ fn default_parachains_host_configuration() -> HostConfiguration { validation_upgrade_cooldown: 14_400, validation_upgrade_delay: 600, max_downward_message_size: 51_200, - ump_service_total_weight: 100_000_000_000, + ump_service_total_weight: Weight::from_ref_time(100_000_000_000 as u64), hrmp_max_parachain_outbound_channels: 10, hrmp_max_parathread_outbound_channels: 0, hrmp_sender_deposit: 100_000_000_000, @@ -92,7 +90,7 @@ fn default_parachains_host_configuration() -> HostConfiguration { zeroth_delay_tranche_width: 0, needed_approvals: 30, relay_vrf_modulo_samples: 40, - ump_max_individual_weight: 20_000_000_000, + ump_max_individual_weight: Weight::from_ref_time(20_000_000_000 as u64), pvf_checking_enabled: false, pvf_voting_ttl: 2, minimum_validation_upgrade_delay: 20, diff --git a/parachain/src/command.rs b/parachain/src/command.rs index f8b40c0155..0d8a3c7eef 100644 --- a/parachain/src/command.rs +++ b/parachain/src/command.rs @@ -561,7 +561,7 @@ impl CliConfiguration for RelayChainCli { fn base_path(&self) -> Result> { Ok(self .shared_params() - .base_path() + .base_path()? .or_else(|| self.base_path.clone().map(Into::into))) } @@ -612,12 +612,8 @@ impl CliConfiguration for RelayChainCli { self.base.base.role(is_dev) } - fn transaction_pool(&self) -> Result { - self.base.base.transaction_pool() - } - - fn state_cache_child_ratio(&self) -> Result> { - self.base.base.state_cache_child_ratio() + fn transaction_pool(&self, is_dev: bool) -> Result { + self.base.base.transaction_pool(is_dev) } fn rpc_methods(&self) -> Result { diff --git a/parachain/src/service.rs b/parachain/src/service.rs index 4bede9aef6..e057f86177 100644 --- a/parachain/src/service.rs +++ b/parachain/src/service.rs @@ -9,7 +9,7 @@ use cumulus_primitives_core::ParaId; use cumulus_primitives_parachain_inherent::{MockValidationDataInherentDataProvider, MockXcmConfig}; use cumulus_relay_chain_inprocess_interface::build_inprocess_relay_chain; use cumulus_relay_chain_interface::{RelayChainError, RelayChainInterface, RelayChainResult}; -use cumulus_relay_chain_rpc_interface::RelayChainRPCInterface; +use cumulus_relay_chain_rpc_interface::{create_client_and_start_worker, RelayChainRpcInterface}; use polkadot_service::CollatorPair; use futures::StreamExt; @@ -18,8 +18,8 @@ use primitives::*; use sc_client_api::{ExecutorProvider, HeaderBackend}; use sc_consensus::LongestChain; use sc_executor::NativeElseWasmExecutor; -use sc_network::NetworkService; -use sc_service::{Configuration, PartialComponents, Role, RpcHandlers, TFullBackend, TFullClient, TaskManager}; +use sc_network::{NetworkBlock, NetworkService}; +use sc_service::{Configuration, PartialComponents, RpcHandlers, TFullBackend, TFullClient, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; use sp_api::ConstructRuntimeApi; use sp_consensus_aura::sr25519::{AuthorityId as AuraId, AuthorityPair as AuraPair}; @@ -281,10 +281,10 @@ async fn build_relay_chain_interface( collator_options: CollatorOptions, ) -> RelayChainResult<(Arc<(dyn RelayChainInterface + 'static)>, Option)> { match collator_options.relay_chain_rpc_url { - Some(relay_chain_url) => Ok(( - Arc::new(RelayChainRPCInterface::new(relay_chain_url).await?) as Arc<_>, - None, - )), + Some(relay_chain_url) => { + let client = create_client_and_start_worker(relay_chain_url, task_manager).await?; + Ok((Arc::new(RelayChainRpcInterface::new(client)) as Arc<_>, None)) + } None => build_inprocess_relay_chain( polkadot_config, parachain_config, @@ -325,10 +325,6 @@ where bool, ) -> Result>, sc_service::Error>, { - if matches!(parachain_config.role, Role::Light) { - return Err("Light client not supported!".into()); - } - let parachain_config = prepare_node_config(parachain_config); let params = new_partial(¶chain_config, false)?; diff --git a/standalone/runtime/tests/test_issue.rs b/standalone/runtime/tests/test_issue.rs index 8d7ea72039..1de6eb3d5d 100644 --- a/standalone/runtime/tests/test_issue.rs +++ b/standalone/runtime/tests/test_issue.rs @@ -1,7 +1,6 @@ mod mock; use currency::Amount; -use frame_support::assert_err; use mock::{assert_eq, issue_testing_utils::*, *}; fn test_with(execute: impl Fn(VaultId) -> R) { diff --git a/standalone/runtime/tests/test_multisig.rs b/standalone/runtime/tests/test_multisig.rs index 27aee60589..87474dc410 100644 --- a/standalone/runtime/tests/test_multisig.rs +++ b/standalone/runtime/tests/test_multisig.rs @@ -1,6 +1,6 @@ mod mock; -use frame_support::traits::WrapperKeepOpaque; +use frame_support::{traits::WrapperKeepOpaque, weights::Weight}; use mock::{assert_eq, *}; use orml_tokens::AccountData; use orml_vesting::VestingSchedule; @@ -49,7 +49,7 @@ fn integration_test_transfer_from_multisig_to_vested() { maybe_timepoint: None, call: WrapperKeepOpaque::from_encoded(call.clone()), store_call: true, - max_weight: 1000000000000, + max_weight: Weight::from_ref_time(1000000000000 as u64), }) .dispatch(origin_of(account_of(ALICE)))); @@ -73,7 +73,7 @@ fn integration_test_transfer_from_multisig_to_vested() { other_signatories: vec![account_of(ALICE)], maybe_timepoint: Some(timepoint), call_hash: sp_core::blake2_256(&call), - max_weight: 1000000000000, + max_weight: Weight::from_ref_time(1000000000000 as u64), }) .dispatch(origin_of(account_of(BOB)))); // step 4a: check that the call is now executed @@ -118,7 +118,7 @@ fn integration_test_transfer_from_multisig_to_unvested() { maybe_timepoint: None, call: WrapperKeepOpaque::from_encoded(call.clone()), store_call: true, - max_weight: 1000000000000, + max_weight: Weight::from_ref_time(1000000000000 as u64), }) .dispatch(origin_of(account_of(ALICE)))); @@ -127,7 +127,7 @@ fn integration_test_transfer_from_multisig_to_unvested() { other_signatories: vec![account_of(ALICE)], maybe_timepoint: Some(MultisigPallet::timepoint()), call_hash: sp_core::blake2_256(&call), - max_weight: 1000000000000, + max_weight: Weight::from_ref_time(1000000000000 as u64), }) .dispatch(origin_of(account_of(BOB)))); @@ -273,7 +273,7 @@ fn integration_test_batched_multisig_vesting() { maybe_timepoint: None, call: WrapperKeepOpaque::from_encoded(batch.clone()), store_call: true, - max_weight: 1000000000000, + max_weight: Weight::from_ref_time(1000000000000 as u64), }) .dispatch(origin_of(account_of(ALICE)))); @@ -282,7 +282,7 @@ fn integration_test_batched_multisig_vesting() { other_signatories: vec![account_of(ALICE)], maybe_timepoint: Some(MultisigPallet::timepoint()), call_hash: sp_core::blake2_256(&batch), - max_weight: 1000000000000, + max_weight: Weight::from_ref_time(1000000000000 as u64), }) .dispatch(origin_of(account_of(BOB))));